Re: Help in avoiding a query 'Warm-Up' period/shared buffer cache

От: Qingqing Zhou
Тема: Re: Help in avoiding a query 'Warm-Up' period/shared buffer cache
Дата: ,
Msg-id: dpk922$slo$1@news.hub.org
(см: обсуждение, исходный текст)
Ответ на: Help in avoiding a query 'Warm-Up' period/shared buffer cache  (Mark Liberman)
Ответы: Re: Help in avoiding a query 'Warm-Up' period/shared buffer cache  (Mark Liberman)
Список: pgsql-performance

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

Help in avoiding a query 'Warm-Up' period/shared buffer cache  (Mark Liberman, )
 Re: Help in avoiding a query 'Warm-Up' period/shared buffer cache  ("Qingqing Zhou", )
  Re: Help in avoiding a query 'Warm-Up' period/shared buffer cache  (Mark Liberman, )
   Re: Help in avoiding a query 'Warm-Up' period/shared buffer  (David Lang, )
    Re: Help in avoiding a query 'Warm-Up' period/shared buffer  ("Jim C. Nasby", )
 Re: Help in avoiding a query 'Warm-Up' period/shared buffer cache  ("Qingqing Zhou", )

"Mark Liberman" <> wrote
>
> First run, after a night of inactivity:
>
>                     ->  Bitmap Index Scan on 1min_events_file_id_begin_idx
> (cost=0.00..37.85 rows=3670 width=0) (actual time=313.468..313.468
> rows=11082
> loops=1)
>                           Index Cond: (file_id = 137271)
> Total runtime: 313.643 ms
>
> Second run, after that:
>
>                     ->  Bitmap Index Scan on 1min_events_file_id_begin_idx
> (cost=0.00..37.85 rows=3670 width=0) (actual time=2.106..2.106 rows=11082
> loops=1)
>                           Index Cond: (file_id = 137271)
> Total runtime: 2.276 ms

It is clear that the first query takes longer time because of the IO time of
index 1min_events_file_id_begin_idx (see 313.468 vs. 2.106). I am afraid
currently there is no easy solution for this situation, unless you could
predicate which part of relation/index your query will use, then you can
preload or "warm-up" cache for it.

Regards,
Qingqing





В списке pgsql-performance по дате сообщения:

От: Tom Lane
Дата:
Сообщение: Re: Slow query. Any way to speed up?
От: "Andy"
Дата:
Сообщение: Re: Improving Inner Join Performance