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)
Список: pgsql-performance

Скрыть дерево обсуждения

planner costs in "warm cache" tests  (Jesper Krogh, )
 Re: planner costs in "warm cache" tests  (Tom Lane, )
  Re: planner costs in "warm cache" tests  (Jesper Krogh, )
   Re: planner costs in "warm cache" tests  (Tom Lane, )
    Re: planner costs in "warm cache" tests  (Scott Carey, )
     Re: planner costs in "warm cache" tests  (Tom Lane, )
    Re: planner costs in "warm cache" tests  (Robert Haas, )

Scott Carey <> 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 по дате сообщения:

От: Alvaro Herrera
Дата:
Сообщение: Re: Optimize date query for large child tables: GiST or GIN?
От: Mark Kirkwood
Дата:
Сообщение: File system choice for Red Hat systems