Re: Unexpected sequence scan

От: Kevin Grittner
Тема: Re: Unexpected sequence scan
Дата: ,
(см: обсуждение, исходный текст)
Ответ на: Unexpected sequence scan  (Dan Fairs)
Список: pgsql-performance

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

Unexpected sequence scan  (Dan Fairs, )
 Re: Unexpected sequence scan  ("Kevin Grittner", )
 Re: Unexpected sequence scan  (Tom Lane, )
  Re: Unexpected sequence scan  (Dan Fairs, )

Dan Fairs <> wrote:

> I have a query which is running slowly, and the query plan shows
> an unexpected sequence scan where I'd have expected the planner to
> use an index.

Looking at the actual row counts compared to run time, it appears
that the active portion of your data set is heavily cached.  In such
an environment, I would add these lines to postgresql.conf, to
better model costs:

seq_page_cost = 0.1
random_page_cost = 0.1  # or maybe slightly higher
cpu_tuple_cost = 0.03


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

От: Richard Jones
Сообщение: Re: Partitioned/inherited tables with check constraints causing slower query plans
От: Martin Grotzke
Сообщение: Re: Several optimization options (config/hardware)