Re: slow IN() clause for many cases - Mailing list pgsql-hackers

From Tom Lane
Subject Re: slow IN() clause for many cases
Date
Msg-id 29616.1129390292@sss.pgh.pa.us
Whole thread Raw
In response to Re: slow IN() clause for many cases  (mark@mark.mielke.cc)
List pgsql-hackers
mark@mark.mielke.cc writes:
> But doesn't "x IN (NULL)" already fail to ever match, similar to "x
> = NULL"? (Assuming that compatibility switch isn't enabled)

The case I'm worried about is "x IN (1,2,NULL)".  This *can* match.

Also, it's supposed to return NULL (not FALSE) if it doesn't match.
So simply discarding NULLs before we build the array wouldn't give
the right answer.

Considering that allowing null array entries has been a big wishlist
item for many years, I don't think that anyone will object to fixing
that in 8.2, anyway ...
        regards, tom lane


pgsql-hackers by date:

Previous
From: Martijn van Oosterhout
Date:
Subject: Re: drop if exists
Next
From: Tom Lane
Date:
Subject: Re: drop if exists