Re: generic plans and "initial" pruning

Поиск
Список
Период
Сортировка
От Amit Langote
Тема Re: generic plans and "initial" pruning
Дата
Msg-id CA+HiwqFW-iWC=VawYDs31fwSii4HNW26ug-7JWu6_r-BAKRuug@mail.gmail.com
обсуждение исходный текст
Ответ на Re: generic plans and "initial" pruning  (Simon Riggs <simon.riggs@enterprisedb.com>)
Ответы Re: generic plans and "initial" pruning  (Simon Riggs <simon.riggs@enterprisedb.com>)
Re: generic plans and "initial" pruning  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-hackers
Hi Simon,

On Tue, Jan 18, 2022 at 4:44 PM Simon Riggs
<simon.riggs@enterprisedb.com> wrote:
> On Tue, 11 Jan 2022 at 16:22, Robert Haas <robertmhaas@gmail.com> wrote:
> > This is just a relatively simple example and I think there are
> > probably a bunch of others. There are a lot of kinds of DDL that could
> > be performed on a partition that gets pruned away: DROP INDEX is just
> > one example.
>
> I haven't followed this in any detail, but this patch and its goal of
> reducing the O(N) drag effect on partition execution time is very
> important. Locking a long list of objects that then get pruned is very
> wasteful, as the results show.
>
> Ideally, we want an O(1) algorithm for single partition access and DDL
> is rare. So perhaps that is the starting point for a safe design -
> invent a single lock or cache that allows us to check if the partition
> hierarchy has changed in any way, and if so, replan, if not, skip
> locks.

Rearchitecting partition locking to be O(1) seems like a project of
non-trivial complexity as Robert mentioned in a related email thread
couple of years ago:

https://www.postgresql.org/message-id/CA%2BTgmoYbtm1uuDne3rRp_uNA2RFiBwXX1ngj3RSLxOfc3oS7cQ%40mail.gmail.com

Pursuing that kind of a project would perhaps have been more
worthwhile if the locking issue had affected more than just this
particular case, that is, the case of running prepared statements over
partitioned tables using generic plans.  Addressing this by
rearchitecting run-time pruning (and plancache to some degree) seemed
like it might lead to this getting fixed in a bounded timeframe.  I
admit that the concerns that Robert has raised about the patch make me
want to reconsider that position, though maybe it's too soon to
conclude.

-- 
Amit Langote
EDB: http://www.enterprisedb.com



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

Предыдущее
От: Julien Rouhaud
Дата:
Сообщение: Re: Is there any documentation on how to correctly create extensions in HA(primary-standby) setup?
Следующее
От: Alexander Pyhalov
Дата:
Сообщение: Re: Push down time-related SQLValue functions to foreign server