Re: [GENERAL] Very slow queries w/ NOT IN preparation (seems like a bug, test case) - Mailing list pgsql-hackers

From Tom Lane
Subject Re: [GENERAL] Very slow queries w/ NOT IN preparation (seems like a bug, test case)
Date
Msg-id 18538.1226513800@sss.pgh.pa.us
Whole thread Raw
In response to Re: [GENERAL] Very slow queries w/ NOT IN preparation (seems like a bug, test case)  ("Brendan Jurd" <direvus@gmail.com>)
Responses Re: [GENERAL] Very slow queries w/ NOT IN preparation (seems like a bug, test case)
List pgsql-hackers
"Brendan Jurd" <direvus@gmail.com> writes:
> I guess my question is, what's the real benefit of going to all this
> trouble trying to prove that clauses are false?

Not having to scan gigabytes of data in an excluded partition, for
instance.

Now the docs do say
Currently, constraint_exclusion is disabled by default becausethe constraint checks are relatively expensive, and in
manycircumstanceswill yield no savings. It is recommended to turnthis on only if you are actually using partitioned
tablesdesignedto take advantage of the feature. 
 

so we could argue that it's the OP's own fault if he turns this option
on for queries where long planning time isn't worth the trouble.
        regards, tom lane


pgsql-hackers by date:

Previous
From: "Brendan Jurd"
Date:
Subject: Re: [GENERAL] Very slow queries w/ NOT IN preparation (seems like a bug, test case)
Next
From: Heikki Linnakangas
Date:
Subject: Re: [GENERAL] Very slow queries w/ NOT IN preparation (seems like a bug, test case)