Re: slow IN() clause for many cases

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Greg Stark <gsstark(at)mit(dot)edu>
Cc: andrew(at)supernews(dot)com, pgsql-hackers(at)postgresql(dot)org
Subject: Re: slow IN() clause for many cases
Date: 2005-10-16 16:43:29
Message-ID: 8468.1129481009@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Greg Stark <gsstark(at)mit(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Hallgren 2005-10-16 16:56:12 Re: Advice needed concerning Win32 signals
Previous Message Martijn van Oosterhout 2005-10-16 16:33:29 Re: slow IN() clause for many cases