From: Tom Lane <tgl@sss.pgh.pa.us>
To: McGehee, Robert <Robert.McGehee@geodecapital.com>
Cc: pgsql-bugs@postgresql.org <pgsql-bugs@postgresql.org>
Subject: Re: Incorrect Sort Using Index Scan
Date: Tue, 18 Sep 2012 01:17:52 -0400
Message-ID: <4924.1347945472@sss.pgh.pa.us> (raw)
In-Reply-To: <17B09E7789D3104E8F5EEB0582A8D66FF24242683B@MSGRTPCCRF2WIN.DMN1.FMR.COM>
References: <17B09E7789D3104E8F5EEB0582A8D66FF24242683B@MSGRTPCCRF2WIN.DMN1.FMR.COM>
"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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-bugs@postgresql.org
Cc: tgl@sss.pgh.pa.us, Robert.McGehee@geodecapital.com
Subject: Re: Incorrect Sort Using Index Scan
In-Reply-To: <4924.1347945472@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox