Re: Automatic optimization of IN clauses via INNER JOIN

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Automatic optimization of IN clauses via INNER JOIN
Дата
Msg-id 14755.1261182762@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Automatic optimization of IN clauses via INNER JOIN  (Robert Haas <robertmhaas@gmail.com>)
Ответы Re: Automatic optimization of IN clauses via INNER JOIN  (Robert Haas <robertmhaas@gmail.com>)
Список pgsql-performance
Robert Haas <robertmhaas@gmail.com> writes:
> If at least one column in the subselect is strict, you can rewrite it
> that way yourself, but the optimizer won't do it. I wish it did, but I
> don't wish it badly enough to have written the code myself, and
> apparently neither does anyone else.

I was thinking about this earlier today.  It's a bit of a PITA because
we need the information very early in the planner, before it's done much
analysis.  So for example we might find ourselves duplicating the work
that will happen later to determine which tables are nullable by outer
joins.  I think this would be all right as long as we ensure that it's
only done when there's a chance for a win (ie, no extra cycles if
there's not actually a NOT IN present).  It could still be an
unpleasantly large amount of new code though.

Wouldn't we need to enforce that *all* columns of the subselect are
non-null, rather than *any*?

            regards, tom lane

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

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: Issues with \copy from file
Следующее
От: Robert Haas
Дата:
Сообщение: Re: Automatic optimization of IN clauses via INNER JOIN