Re: [PERFORM] 7.4 vs 7.3 ( hash join issue )

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: [PERFORM] 7.4 vs 7.3 ( hash join issue )
Дата
Msg-id 17291.1095879635@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: [PERFORM] 7.4 vs 7.3 ( hash join issue )  (Greg Stark <gsstark@mit.edu>)
Список pgsql-patches
Greg Stark <gsstark@mit.edu> writes:
>> It would also be interesting to prefetch one row from the outer table and fall
>> out immediately (without building the hash table) if the outer table is
>> empty.  This seems to require some contortion of the code though :-(

> Why is it any more complicated than just moving the hash build down lower?

Having to inject the consideration into ExecHashJoinOuterGetTuple seems
messy to me.

On reflection I'm not sure it would be a win anyway, for a couple of reasons.
(1) Assuming that the planner has gotten things right and put the larger
relation on the outside, the case of an empty outer relation and a
nonempty inner one should rarely arise.
(2) Doing this would lose some of the benefit from the optimization to
detect an empty inner relation.  If the outer subplan is a slow-start
one (such as another hashjoin), it would lose a lot of the benefit :-(

            regards, tom lane

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

Предыдущее
От: Greg Stark
Дата:
Сообщение: Re: [PERFORM] 7.4 vs 7.3 ( hash join issue )
Следующее
От: Alvaro Herrera
Дата:
Сообщение: ALTER TABLE .. OWNER TO and sequences