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

From: "Brendan Jurd" <direvus(at)gmail(dot)com>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
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:34:00
Message-ID: 37ed240d0811121034i6b0ac02cs2a8e6955edb64926@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers

On Thu, Nov 13, 2008 at 5:16 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> "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.

[after RTFMing ...]

The docs also say:

"When this parameter is on, the planner compares query conditions with
table CHECK constraints, and omits scanning tables for which the
conditions contradict the constraints."

I would normally interpret the above to mean that the planner *only*
performs these checks where a table CHECK constraint is relevant. I
dug up the original test case posted by Sergey, and his test table
didn't have any CHECK constraint on it at all (unless you count the
NOT NULL implied by PRIMARY KEY).

Cheers,
BJ

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Sam Mason 2008-11-12 18:36:39 Re: how to "group" several records with same timestamp into one line?
Previous Message Erwin Moller 2008-11-12 18:30:36 Re: missing FROM-clause entry for table

Browse pgsql-hackers by date

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