Fast path for empty relids in check_outerjoin_delay()

Поиск
Список
Период
Сортировка
От Richard Guo
Тема Fast path for empty relids in check_outerjoin_delay()
Дата
Msg-id CAN_9JTySXvSkisdRiWMxiZa09onKAF4uXwXsLRCtqXAWdRjp7A@mail.gmail.com
обсуждение исходный текст
Ответы Re: Fast path for empty relids in check_outerjoin_delay()  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
Список pgsql-hackers
Hi all,

Function check_outerjoin_delay() is used to detect whether a qual
referencing the given relids must be delayed in application due to the
presence of a lower outer join.

If the given relids are empty, we should be able to return from this
function via the same fast path as for the case that there is no special
joins, without going through all the remaining processing. Empty relids
can be very common in check_outerjoin_delay(). Think about the query
below:

    select * from a left join (b left join c on true) on coalesce(b.i,1) = 1;

The qual 'coalesce(b.i,1) = 1' is detected as maybe_equivalence by
distribute_qual_to_rels(), because it doesn't reference any nonnullable
rels at the upper left join node (so it is is_pushed_down) and it
doesn't reference any nullable rels at the lower left join node as well
(so it is not-outerjoin_delayed). Before we treat it as an equivalence
clause, we will check that each side of the qual satisfies the
not-outerjoin_delayed condition on its own. For the right side, we will
check with empty relids in check_outerjoin_delay().

This small revise is not expected to bring performance improvements, but
can improve the readability of the code that for empty relids, the qual
is always considered as being not-outerjoin_delayed.

Is this code change worthwhile? Any thoughts?

Thanks
-Richard
Вложения

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

Предыдущее
От: Laurenz Albe
Дата:
Сообщение: Re: Remove Deprecated Exclusive Backup Mode
Следующее
От: Pavel Stehule
Дата:
Сообщение: Re: proposal: plpgsql pragma statement