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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Brendan Jurd" <direvus(at)gmail(dot)com>
Cc: "Richard Huxton" <dev(at)archonet(dot)com>, "Sergey Konoplev" <gray(dot)ru(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [GENERAL] Very slow queries w/ NOT IN preparation (seems like a bug, test case)
Date: 2008-11-12 18:16:40
Message-ID: 18538.1226513800@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

"Brendan Jurd" <direvus(at)gmail(dot)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 because
the constraint checks are relatively expensive, and in many
circumstances will yield no savings. It is recommended to turn
this on only if you are actually using partitioned tables
designed to 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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Raymond O'Donnell 2008-11-12 18:20:09 Re: missing FROM-clause entry for table
Previous Message Adriana Alfonzo 2008-11-12 18:10:44 Re: Upgrading side by side in Gentoo

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2008-11-12 18:26:22 Re: [GENERAL] Very slow queries w/ NOT IN preparation (seems like a bug, test case)
Previous Message Brendan Jurd 2008-11-12 18:03:41 Re: [GENERAL] Very slow queries w/ NOT IN preparation (seems like a bug, test case)