Re: BUG #17885: slow planning constraint_exclusion

Поиск
Список
Период
Сортировка
От David Rowley
Тема Re: BUG #17885: slow planning constraint_exclusion
Дата
Msg-id CAApHDvphHUroVaGHnCtXF6S39_VkE2uL0X2F9HNyuQkfshhyzg@mail.gmail.com
обсуждение исходный текст
Ответ на BUG #17885: slow planning constraint_exclusion  (PG Bug reporting form <noreply@postgresql.org>)
Ответы Re: BUG #17885: slow planning constraint_exclusion  (David Rowley <dgrowleyml@gmail.com>)
Список pgsql-bugs
On Wed, 5 Apr 2023 at 05:14, PG Bug reporting form
<noreply@postgresql.org> wrote:
> Increasing the number of partitions or size of "not in" list further
> increases planning time. Reproduced on today's HEAD 16dev too. I found time
> is wasted somewhere in relation_excluded_by_constraints.

How did you come to the conclusion that the time is wasted?

> If I disable
> constraint_exclusion completely, then the planning time drops to a few
> milliseconds.

We still run relation_excluded_by_constraints() after partition
pruning only the remaining partitions.  I believe there were some
cases that we still didn't prune that relation_excluded_by_constraints
was able to eliminate. I don' recall the exact details of what those
cases are. I believe the call to relation_excluded_by_constraints()
was kept due to this.

You may want to just switch it off if it's too slow for you.  I don't
think anything you've shown here is worthy of being classed as a bug.

David



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

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: BUG #17886: Error disabling user triggers on a partitioned table
Следующее
От: David Rowley
Дата:
Сообщение: Re: BUG #17885: slow planning constraint_exclusion