SQLite Forum

Problem with Sqlite DELETE documentation
Login
(Several points, all relating to

> The order in which rows are deleted is arbitrary and is not influenced by the ORDER BY clause.

and assertions about that.)

(1)
It is probably false that the deletion order "is not influenced" by the order clause. More likely, it is so influenced but "is not controlled by the ORDER BY clause." In other words, the order is not guaranteed.

(2)
The sentence quoted says nothing about the selection process, so I cannot see how it could look like it does.

(3)
Sometimes, deletion order would matter. Consider, for example, a table representing a directed graph with self references enforced by foreign key constraints. (And I have not heard of such constraints being suspended within transactions.)

(4)
Removal of that quoted sentence would cause one fact, not explained elsewhere in the section, to not be explained at all. It addresses (inaccurately) the fact that the deletion order is not guaranteed by use of the ORDER BY clause. The preceding text goes only to what rows belong to the deleted set, possibly affected by an ORDER BY clause. Set membership is independent of member ordering.

(5)
Because it is an expected error for readers to assume that an ORDER BY clause will effect a time ordering (as it does for SELECTs under the stepping regime), the quoted sentence clarifies the fact that no such effect should be relied upon.