Re: Size of IN list affects query plan

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Size of IN list affects query plan
Дата
Msg-id 27470.1383921102@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Size of IN list affects query plan  (Jan Walter <john@commontongue.com>)
Ответы Re: Size of IN list affects query plan  (Jan Walter <john@commontongue.com>)
Список pgsql-performance
Jan Walter <john@commontongue.com> writes:
> I would like to know, how does the size of the IN list affect query planner.

AFAICT, the reason the second plan is slow is the large number of checks
of the IN list.  The planner does account for the cost of that, but it's
drastically underestimating that cost relative to the cost of I/O for the
heap and index accesses.  I suppose that your test case is fully cached in
memory, which helps make the CPU costs more important than I/O costs.
If you think this is representative of your real workload, then you
need to decrease random_page_cost (and maybe seq_page_cost too) to make
the cost estimates correspond better to that reality.

            regards, tom lane


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

Предыдущее
От: bricklen
Дата:
Сообщение: Re: Size of IN list affects query plan
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Performance bug in prepared statement binding in 9.2?