Re: Should we add GUCs to allow partition pruning to be disabled?

From: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
To: Amit Langote <Langote_Amit_f8(at)lab(dot)ntt(dot)co(dot)jp>
Cc: David Rowley <david(dot)rowley(at)2ndquadrant(dot)com>, Ashutosh Bapat <ashutosh(dot)bapat(at)enterprisedb(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Should we add GUCs to allow partition pruning to be disabled?
Date: 2018-04-23 21:10:24
Message-ID: 20180423211024.ydvo6xuce6jfnmhx@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

I just pushed David patch, with some pretty minor changes. I hope not
to have broken anything.

Amit Langote wrote:

> Your proposed changes to inheritance_planner() look fine to me. In the
> comment added by the patch in relation_excluded_by_constraints():
>
> + /*
> + * When constraint_exclusion is set to 'partition' we only handle
> + * OTHER_MEMBER_RELs, or BASERELs in cases where the result target is an
> + * inheritance parent or a partitioned table.
> + */
>
> Just to clarify this a bit, would it be a good idea to be specific by
> appending " (see inheritance_planner() where this is determined)" or some
> such to this sentence?

I didn't think that was really required.

> BTW, while we're at it, would it also be a good idea to consider the patch
> you had proposed, which I then posted an updated version of, to adjust the
> documentation in ddl.sgml (in the section 5.10. Table Partitioning)
> regarding the relationship between constraint exclusion and declarative
> partitioning?

I looked at this one. That patch has two hunks. I applied a change
where the first hunk is, to replace constraint_exclusion with the new
GUC -- seemed easy enough. However, the second hunk is on "5.10.4.
Partitioning and Constraint Exclusion" which needs major editing. Not
really sure how best to handle that one. For starters, I think it need
to stop mentioning the GUC name in the title; maybe rename it to
"Partition Pruning" or some such, and then in the text explain that
sometimes the enable_partition_pruning param is used in one case and
constraint_exclusion in the other, and approximately what effects they
have. I don't think it's worth going into too much detail on exactly
how they differ, but then I'm not 100% sure of that either.

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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David Rowley 2018-04-23 21:23:57 Re: bms_prev_member won't work correctly if bitmapword is 64-bits
Previous Message Tom Lane 2018-04-23 21:10:20 "could not reattach to shared memory" on buildfarm member dory