Re: Query planner refuses to use index

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Query planner refuses to use index
Дата
Msg-id 29291.1122041820@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Query planner refuses to use index  (Kilian Hagemann <hagemann1@egs.uct.ac.za>)
Ответы Re: Query planner refuses to use index  (Kilian Hagemann <hagemann1@egs.uct.ac.za>)
Список pgsql-general
Kilian Hagemann <hagemann1@egs.uct.ac.za> writes:
>> - what version are you running?

> 7.4.8, not sure if I'm ready for 8 yet.

Pre-8.0 tends to underestimate the correlation of a multicolumn index.
(8.0 may too, but not as much.)

> Also, note that set_id is strictly increasing (hence correlation of 1) and
> rec_time is strictly increasing within records with same set_id.

So the reason the indexscan is so good is that the ordering correlation
is perfect.  This isn't the planner's default assumption, and
unfortunately we haven't got statistics available that would allow
correlation of a multicolumn index to be estimated well.

            regards, tom lane

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

Предыдущее
От: Ezequiel Tolnay
Дата:
Сообщение: Re: Dumb question about count()
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: Wishlist?