Re: Constraint Exclusion on all tables

From: Tatsuo Ishii <t-ishii(at)sra(dot)co(dot)jp>
To: simon(at)2ndquadrant(dot)com
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Constraint Exclusion on all tables
Date: 2005-07-24 08:57:17
Message-ID: 20050724.175717.104031390.t-ishii@sra.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

It seems current CE implementation ignores UPDATE, DELETE quries. Is
this an intended limitation?
--
Tatsuo Ishii

> So far, the CE patch covers only inherited child tables and is only
> effective when enable_constraint_exclusion is true.
>
> There have been various requests for this to work with UNION ALL views
> and also with normal queries.
>
> Since we have a GUC that can turn this behaviour off, and is off by
> default, I think it is probably acceptable to have CE apply to ALL table
> accesses, not just inherited ones. That is considerably neater in
> implementation than trying to kludge it for UNION ALL cases.
>
> [In the future when we have plan invalidation: I would suggest that we
> keep enable_constraint_exclusion as a GUC. When set to true, this would
> apply for all tables. Inherited tables would always be considered for
> exclusion, whatever the setting of the GUC.]
>
> An idea for discussion is to hide the exclusion within
> set_plain_rel_pathlist, so that CE applies to all tables. If a table is
> excluded, we generate only the single "exclusion plan". I think we
> should introduce a new Node type of "No Scan", making it very clear in
> any Explain that we have excluded a table. The alternative is a Result
> node with an SeqScan below it... but the Result doesn't explain *why* it
> exists at that point. I've already used that form of coding and it works
> well enough.
>
> Inheritance queries would continue to act as they do now, where an
> excluded table is *not* shown; this is to allow for sensible size
> EXPLAINs when we have 100s of child tables.
>
> Comments?
>
> Best Regards, Simon Riggs
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
> message can get through to the mailing list cleanly
>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2005-07-24 09:54:27 Re: Constraint Exclusion on all tables
Previous Message Tom Lane 2005-07-24 02:38:59 Re: [HACKERS] Patch to fix plpython on OS X