Re: Slow Planning Times

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Slow Planning Times
Дата
Msg-id 3221252.1649300260@sss.pgh.pa.us
обсуждение исходный текст
Ответы Re: Slow Planning Times  (Saurabh Sehgal <saurabh.r.s@gmail.com>)
Список pgsql-performance
"David G. Johnston" <david.g.johnston@gmail.com> writes:
> On Wed, Apr 6, 2022 at 5:27 PM Saurabh Sehgal <saurabh.r.s@gmail.com> wrote:
>> I have the following query:
>> I don't think it is super complex. But when I run explain analyze on this
>> I get the following:
>> Planning Time: 578.068 ms
>> Execution Time: 0.113 ms

> The fundamental issue here is that you have basically 12 conditions across
> 5 tables that need to be evaluated to determine which one of the 1,680
> possible join orders is the most efficient.

A 5-way join doesn't seem particularly outrageous.  But I'm wondering
if these are all plain tables or if some of them are actually complex
views.  Another possibility is that the statistics target has been
cranked to the moon and the planner is spending all its time sifting
through huge statistics arrays.

It'd be interesting to see the actual schemas for the tables,
as well as EXPLAIN's output for this query.  I'm wondering
exactly which PG version this is, too.

            regards, tom lane



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

Предыдущее
От: Saurabh Sehgal
Дата:
Сообщение: Re: Slow Planning Times
Следующее
От: Saurabh Sehgal
Дата:
Сообщение: Re: Slow Planning Times