Re: index usage in multi-column ORDER BY - Mailing list pgsql-general

From Michael Fuhr
Subject Re: index usage in multi-column ORDER BY
Date
Msg-id 20050709134903.GA36703@winnie.fuhr.org
Whole thread Raw
In response to index usage in multi-column ORDER BY  ("Adam Pritchard" <vesper76@gmail.com>)
List pgsql-general
On Fri, Jul 08, 2005 at 10:06:23AM -0700, Adam Pritchard wrote:
> Why aren't two single-column indexes used in a two-column ORDER BY
> clause?  And is there some way to work around this?
>
> For example:
> CREATE TABLE t ( c1 INT, c2 INT );
> CREATE INDEX c1_idx ON t(c2);
                          ^^^^
> CREATE INDEX c2_idx ON t(c2);

Not that it changes anything, but I assume you meant to create the
first index on c1.  I'll defer an explanation of the sequential
scan behavior to somebody who understands the planner better.

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/

pgsql-general by date:

Previous
From: Michael Fuhr
Date:
Subject: Re: Transaction isolation levels
Next
From: Geert Jansen
Date:
Subject: Re: Transaction isolation levels