Re: Improving NOT IN

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Simon Riggs" <simon(at)2ndquadrant(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Improving NOT IN
Date: 2007-01-30 23:06:11
Message-ID: 13113.1170198371@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

"Simon Riggs" <simon(at)2ndquadrant(dot)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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2007-01-30 23:24:40 Re: Improving NOT IN
Previous Message Simon Riggs 2007-01-30 22:55:29 Re: Improving NOT IN