Forum OpenACS Q&A: Response to "vacuum analyse" messing up the row ordering?

Collapse
Posted by Don Baccus on
Jonathon's 100% right.  This is a common mistake made by people used to the sequential processing paradigm of standard procedural languages.

Sets are unordered.  SQL operators work on unordered sets and return unordered sets.  The only way to get an ordered result is to use an "order by" clause on the set returned by your query.  The fact that you were getting what appeared to you to be a correct result was simply luck.

This leads to some interesting implications, i.e. it explains why "order by" is not allowed on subselects ...