Re: slow IN() clause for many cases

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: slow IN() clause for many cases
Дата
Msg-id 8468.1129481009@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: slow IN() clause for many cases  (Greg Stark <gsstark@mit.edu>)
Список 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 по дате отправления:

Предыдущее
От: Thomas Hallgren
Дата:
Сообщение: Re: Advice needed concerning Win32 signals
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Question about Ctrl-C and less