Re: planner costs in "warm cache" tests

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: planner costs in "warm cache" tests
Дата
Msg-id 2193.1275401018@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: planner costs in "warm cache" tests  (Scott Carey <scott@richrelevance.com>)
Список pgsql-performance
Scott Carey <scott@richrelevance.com> writes:
> It is still best to have random_page_cost to be slightly larger (~50%)
> than sequential_page_cost, because even when entirely in RAM,
> sequential reads are faster than random reads.  Today's CPU's do
> memory prefetching on sequential access.

Do you have any actual evidence of that?  Because I don't believe it.
Neither PG nor any kernel that I've ever heard of makes any effort to
ensure that logically sequential blocks occupy physically sequential
buffers, so even if the CPU tries to do some prefetching, it's not
going to help at all.

Now, if the database isn't entirely cached, then indeed it's a good
idea to keep random_page_cost higher than seq_page_cost.  But that's
because of the actual disk fetches, not anything that happens in RAM.

            regards, tom lane

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

Предыдущее
От: Brad Nicholson
Дата:
Сообщение: Re: Zeus IOPS
Следующее
От: Merlin Moncure
Дата:
Сообщение: Re: PostgreSQL Function Language Performance: C vs PL/PGSQL