Re: Should we add GUCs to allow partition pruning to be disabled? - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: Should we add GUCs to allow partition pruning to be disabled?
Date
Msg-id 20180502132858.35ui3u624k4cmzm5@alvherre.pgsql
Whole thread Raw
In response to Re: Should we add GUCs to allow partition pruning to be disabled?  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: Should we add GUCs to allow partition pruning to be disabled?
List pgsql-hackers
Robert Haas wrote:
> On Tue, Apr 24, 2018 at 5:59 PM, Alvaro Herrera <alvherre@alvh.no-ip.org> wrote:
> > Constraint
> > exclusion was pretty easy to get wrong, hence the need for a separate
> > section, and I suppose the new partition pruning may be prey to the same
> > problems, so it seems worth to document them specially.  But not sure
> > about the others, if they are mostly debugging tools.
> 
> Weighing in here late, but I have a hard time understanding why we
> want a GUC to control partition pruning at all. With constraint
> exclusion, the issue is whether you want to spend planner cycles to
> try to deduce things using CHECK constraints when, quite possibly,
> your CHECK constraints are unrelated to table inheritance and thus
> won't help.  But seems extremely unlikely that the same thing would
> happen with partition pruning.  Unlike your CHECK constraints, your
> partition bounds are, by definition, potentially useful for pruning.

I admit I am more concerned about the possibility of bugs than I am
about providing a performance-related tool.  If partition prune can do
its thing with only a 1.1% of overhead, that's a great result.  While
I'm sure that some real-world partitioning scenarios exist that have a
higher overhead than that, that's not what I am worried about the most.

In a couple of releases, once we know for sure that all this new code is
absolutely stable and that there are no bugs (keeping in mind that PG12
will boast additional pruning for MergeAppend as well as for UPDATE/
DELETE queries,) we can remove the GUC -- hoping that no user will bark
at us about they having to keep it disabled by default.  

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


pgsql-hackers by date:

Previous
From: Ashutosh Bapat
Date:
Subject: Re: Remove mention in docs that foreign keys on partitioned tablesare not supported
Next
From: "David G. Johnston"
Date:
Subject: Re: Should we add GUCs to allow partition pruning to be disabled?