Re: Potential Join Performance Issue

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Potential Join Performance Issue
Дата
Msg-id 12937.1221011217@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Potential Join Performance Issue  ("Lawrence, Ramon" <ramon.lawrence@ubc.ca>)
Список pgsql-hackers
"Lawrence, Ramon" <ramon.lawrence@ubc.ca> writes:
> Our research group has been using the PostgreSQL code base to test new
> join algorithms.  During testing, we noticed that the planner is not
> pushing down projections to the outer relation in a hash join.  Although
> this makes sense for in-memory (1 batch) joins, for joins larger than
> memory (such as for TPC-H DSS), this causes the system to perform
> significantly more disk I/Os when reading/writing batches of the outer
> relation.

Hm.  The proposed patch seems a bit brute-force, since it loses the
benefit of the physical-tlist optimization even if the relations are
certainly too small to require batching.

> A more complicated modification alternative is to add a state variable
> to allow the planner to know how many batches the hash join expects and
> only push down the projection if it is greater than one.  However,
> pushing the projection on the outer relation is almost always the best
> choice as it eliminates unneeded attributes for operators above the hash
> join in the plan and will be robust in the case of poor estimates.

Nonetheless, I'm inclined to do it that way.  The "robust in the case of
poor estimates" argument doesn't convince me, because the incremental
cost isn't *that* large if we get it wrong; and the other argument is
just bogus because we don't do physical tlists at or above joins anyhow.
        regards, tom lane


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

Предыдущее
От: "Alex Hunsaker"
Дата:
Сообщение: Re: [PATCHES] to_date() validation
Следующее
От: Greg Smith
Дата:
Сообщение: Re: [PATCH] Cleanup of GUC units code