Re: not in(subselect) in 8.4

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: not in(subselect) in 8.4
Дата
Msg-id 4043.1235274101@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: not in(subselect) in 8.4  (Scott Carey <scott@richrelevance.com>)
Ответы Re: not in(subselect) in 8.4
Re: not in(subselect) in 8.4
Список pgsql-performance
Scott Carey <scott@richrelevance.com> writes:
> Are there any optimizations planned for the case where columns are
> defined as NOT NULL?

We might get around to recognizing that case as an antijoin sometime.
It's nontrivial though, because you have to check for an intermediate
outer join causing the column to be possibly nullable after all.

> It turns out to be a rare use case for someone to write a subselect
> for a NOT IN  or IN clause that will have NULL values.

Judging from the steady flow of "why doesn't my NOT IN query work"
newbie questions, I don't think it's so rare as all that.

There's surely some population of people who know enough or could be
trained to be careful about using NOT NULL columns, but they could also
be trained to use NOT EXISTS, and dodge the whole bullet from the start.

            regards, tom lane

В списке pgsql-performance по дате отправления:

Предыдущее
От: "Jonah H. Harris"
Дата:
Сообщение: Re: Benchmark comparing PostgreSQL, MySQL and Oracle
Следующее
От: Robert Haas
Дата:
Сообщение: Re: not in(subselect) in 8.4