Re: index scan on =, but not < ?

Поиск
Список
Период
Сортировка
От David Brown
Тема Re: index scan on =, but not < ?
Дата
Msg-id 422F93CE.10400@bigpond.net.au
обсуждение исходный текст
Ответ на Re: index scan on =, but not < ?  ("Jim C. Nasby" <decibel@decibel.org>)
Ответы Re: index scan on =, but not < ?  (Manfred Koizar <mkoi-pg@aon.at>)
Список pgsql-performance
Jim C. Nasby wrote:

>Ahh, I was thinking of a high correlation factor on the index. I still
>question 5% though... that seems awefully low.
>
>
Not really. It all depends on how many records you're packing into each
page. 1% may well be the threshold for small records.

Tom mentioned this in the last couple of months. He was citing a uniform
distribution as an example and I thought that sounded a little
pessimistic, but when I did the (possibly faulty) math with a random
distribution, I discovered he wasn't far off.

It's not this simple, but if you can fit 50 randomly organized records
into each page and you want to retrieve 2% of the rows, it's likely
you'll have to fetch every page - believe it or not.

What concerns me is that this all depends on the correlation factor, and
I suspect that the planner is not giving enough weight to this.
Actually, I'm wondering if it's even looking at the statistic, but I
haven't created a test to check. It might explain quite a few complaints
about the planner not utilizing indexes.

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

Предыдущее
От: David Brown
Дата:
Сообщение: Re: index scan on =, but not < ?
Следующее
От: Jim Johannsen
Дата:
Сообщение: Re: Help trying to tune query that executes 40x slower