Re: index-only scans

Поиск
Список
Период
Сортировка
От Greg Stark
Тема Re: index-only scans
Дата
Msg-id CAM-w4HNcFeaarhswyCEXUoQf+Tja+KibssOTbF+Q_ZgBGLA++g@mail.gmail.com
обсуждение исходный текст
Ответ на Re: index-only scans  (Anssi Kääriäinen <anssi.kaariainen@thl.fi>)
Список pgsql-hackers
On Tue, Aug 16, 2011 at 11:24 AM, Anssi Kääriäinen
<anssi.kaariainen@thl.fi> wrote:
> There is the question if one should be allowed to tune the *_page_costs at
> all. If I am not missing something, it is possible to detect the correct
> values programmatically and they do not change if you do not change the
> hardware. Cache hit ratio is the real reason why they are currently so
> important for tuning.

Unfortunately things a tad more complex than this picture. There are
multiple levels of cache involved here. There's the Postgres buffer
cache, the filesystem buffer cache, and then the raid controller or
drives often have cache as well.

Also the difference between seq_page_cost and random_page_cost is
hiding another cache effect. The reason sequential reads are faster is
twofold, there's no seek but also there's an increased chance the
buffer is already in the filesystem cache due to having been
prefetched. Actually it's hardly even probabilistic -- only every nth
page needs to do i/o when doing sequential reads.


--
greg


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

Предыдущее
От: Thom Brown
Дата:
Сообщение: Re: [pgsql-advocacy] Unlogged vs. In-Memory
Следующее
От: Alvaro Herrera
Дата:
Сообщение: Re: Re: [BUGS] BUG #6189: libpq: sslmode=require verifies server certificate if root.crt is present