Search Postgresql Archives

Re: index usage in multi-column ORDER BY

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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/

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux