Zeugswetter Andreas SB <[EMAIL PROTECTED]> writes:
>> If not, does an Order-by force a sort even if an index has the correct
>> order to satisfy the order-by?
> If a btree index is chosen that satisfies the order by, the sort is
> avoided.
And, of course, selection of that index is encouraged, because the
optimizer will realize that any other plan will require an explicit
sort step with extra costs.
Bottom line: say what you mean, don't try to outsmart the system.
If you want your results delivered in order, say ORDER BY.
regards, tom lane
---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]