Re: Why don't use index on x when ORDER BY x, y?

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

 



Vlad Arkhipov <arhipov@xxxxxxxxxxxx> writes:
> I wonder why Postgres does not use index in the query below?

Because it's useless: you'd still have to do a sort, and an indexscan
is going to be a slower source of data for the sort than a seqscan.

There's been some experimentation of late with a "partial sort" capability
that could take advantage of partially-ordered input, which might make
this kind of thing interesting after all.  But it's not committed and
might never be: it's far from clear that it'd be a win in many cases.

			regards, tom lane


-- 
Sent via pgsql-performance mailing list (pgsql-performance@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance




[Postgresql General]     [Postgresql PHP]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Yosemite]

  Powered by Linux