Re: generic plans and "initial" pruning - Mailing list pgsql-hackers

From Simon Riggs
Subject Re: generic plans and "initial" pruning
Date
Msg-id CANbhV-H_6BOg6ck7p2qYe3QmjYq3N+p1=rCK_Rz9jH0uwYEvQw@mail.gmail.com
Whole thread Raw
In response to Re: generic plans and "initial" pruning  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: generic plans and "initial" pruning
List pgsql-hackers
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.

Please excuse me if this idea falls short, if so, please just note my
comment about how important this is. Thanks.

-- 
Simon Riggs                http://www.EnterpriseDB.com/



pgsql-hackers by date:

Previous
From: Julien Rouhaud
Date:
Subject: Re: 32TB relation size make mdnblocks overflow
Next
From: Julien Rouhaud
Date:
Subject: Re: Is there any documentation on how to correctly create extensions in HA(primary-standby) setup?