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 8468.1129481009@sss.pgh.pa.us
Whole thread Raw
In response to Re: slow IN() clause for many cases  (Greg Stark <gsstark@mit.edu>)
List pgsql-hackers
Greg Stark <gsstark@mit.edu> writes:
> The example above raises another idea though. Would it be possible for the
> optimizer to recognize when a clause is so expansive that it would be faster
> to read the complement than the actual clause as written?

Being able to compute the complement, much less do so with an indexable
clause, is usually difficult in SQL (think about NULLs).  In any case
I think this is the situation where you are happy to fall back to a
seqscan.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Thomas Hallgren
Date:
Subject: Re: Advice needed concerning Win32 signals
Next
From: Tom Lane
Date:
Subject: Re: Question about Ctrl-C and less