Re: Improving NOT IN - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Improving NOT IN
Date
Msg-id 13113.1170198371@sss.pgh.pa.us
Whole thread Raw
In response to Re: Improving NOT IN  ("Simon Riggs" <simon@2ndquadrant.com>)
Responses Re: Improving NOT IN
List pgsql-hackers
"Simon Riggs" <simon@2ndquadrant.com> writes:
> On Tue, 2007-01-30 at 17:34 -0500, Tom Lane wrote:
>> Since that is unlikely to be the case, I can't see that this is worth
>> implementing...

> Integers are typically used as keys...

Yeah, in the form of sequences, so you have a hole for every failed
insert.  If the key isn't coming from a sequence then there's still
not any very good reason to suppose it's exactly contiguous.  People
do delete entries.

> What would be wrong with checking for a NOT NULL constraint? Thats how
> other planners cope with it. Or are you thinking about lack of plan
> invalidation?

Yup, without that, depending on constraints for plan correctness is
pretty risky.

Basically what I see here is a whole lot of work and new executor
infrastructure for something that will be a win in a very narrow
use-case and a significant loss the rest of the time.  I think there
are more productive ways to spend our development effort.
        regards, tom lane


pgsql-hackers by date:

Previous
From: "Simon Riggs"
Date:
Subject: Re: Improving NOT IN
Next
From: "Simon Riggs"
Date:
Subject: Re: Improving NOT IN