Re: Do we still need constraint_exclusion?

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: jd(at)commandprompt(dot)com, Robert Haas <robertmhaas(at)gmail(dot)com>, Greg Smith <gsmith(at)gregsmith(dot)com>, Gregory Stark <stark(at)enterprisedb(dot)com>, Josh Berkus <josh(at)agliodbs(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Do we still need constraint_exclusion?
Date: 2009-01-07 17:58:48
Message-ID: 200901071758.n07Hwm315449@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:
> I wrote:
> > I just thought of a possible compromise though: maybe we could invent an
> > intermediate constraint_exclusion setting that makes the checks only for
> > inheritance-child tables. This would avoid the overhead for simple
> > queries and still get the benefit for most of the cases where it's
> > actually useful. I'm not sure how hard this'd be to shoehorn into the
> > planner, ...
>
> Actually, it looks like it'd be totally trivial to implement: just check
> rel->reloptkind == RELOPT_OTHER_MEMBER_REL to detect whether we're
> looking at an inheritance child. (Actually this would also succeed
> for a UNION ALL member, but that's good because that's the other case
> where constraint exclusion is more likely to be useful.)
>
> So, barring objections, I'll go make this happen. What do we want to
> call the intermediate constraint_exclusion value? The first thing
> that comes to mind is constraint_exclusion = 'child', but perhaps
> someone has a better idea.

Wow, this will be a great leap forward for usability.

--
Bruce Momjian <bruce(at)momjian(dot)us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ If your life is a hard drive, Christ can be your backup. +

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2009-01-07 17:59:17 Re: Do we still need constraint_exclusion?
Previous Message Tom Lane 2009-01-07 17:54:35 Re: Do we still need constraint_exclusion?