Re: Do we still need constraint_exclusion?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: jd(at)commandprompt(dot)com
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Bruce Momjian <bruce(at)momjian(dot)us>, 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:19:15
Message-ID: 4859.1231348755@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

"Joshua D. Drake" <jd(at)commandprompt(dot)com> writes:
> On Wed, 2009-01-07 at 10:59 -0500, Tom Lane wrote:
>> In installations whose average query is significantly heavier-weight
>> than this one, and where constraint exclusion actually improves matters
>> on a routine basis, it makes sense to turn it on by default. I will
>> continue to resist having it on as a factory default, because I continue
>> to believe that it's 99% useless to most people. As for removing the

> I believe are correct in that it is 99% useless to most people. If it
> was turned on by default, it would also not be noticed by 99% of those
> people.

~ 10% slowdown on trivial queries will get noticed.

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, but if it's doable it might satisfy both camps.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2009-01-07 17:26:32 Re: Do we still need constraint_exclusion?
Previous Message Bruce Momjian 2009-01-07 17:14:13 Re: Multiplexing SUGUSR1