"McGehee, Robert" <Robert.McGehee@geodecapital.com> writes:
> I have recently upgraded to PostgreSQL 9.2.0 and one of my queries is now giving incorrectly sorted results due, I
believe,to the new index-only scan in 9.2.0. The below table is a table of currency FX rates by date.
Hmm, no it's not about index-only scans (your query isn't even using
one). I think this got broken in my commit
9e8da0f75731aaa7605cf4656c21ea09e84d2eb1, which turned =ANY into a
native index qualification type for btree. I thought that the output
could still be considered sorted by the index's sort order, but this
example proves that that's not so. Need to think a bit more carefully
about that --- maybe we can only assume sorted output when the =ANY qual
is for the first index column. Or maybe we can't assume it at all.
regards, tom lane