Re: Why date index is not used

Поиск
Список
Период
Сортировка
От Jim C. Nasby
Тема Re: Why date index is not used
Дата
Msg-id 20060608215745.GE45331@pervasive.com
обсуждение исходный текст
Ответ на Re: Why date index is not used  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Why date index is not used
Список pgsql-performance
On Thu, Jun 08, 2006 at 03:20:55PM -0400, Tom Lane wrote:
> "Andrus" <eetasoft@online.ee> writes:
> > Why Postgres 8.1 does not use makse_kuupaev_idx index in the following query
> > ?
>
> Because it doesn't help --- the system still has to do the sort.
> You'd need a two-column index on both of the ORDER BY columns to avoid
> sorting.

And even then you better have a pretty high correlation on the first
column, otherwise you'll still get a seqscan.
--
Jim C. Nasby, Sr. Engineering Consultant      jnasby@pervasive.com
Pervasive Software      http://pervasive.com    work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf       cell: 512-569-9461

В списке pgsql-performance по дате отправления:

Предыдущее
От: "Dave Dutcher"
Дата:
Сообщение: Re: Why date index is not used
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Why date index is not used