pgsql: Fix planning of parameterized appendrel paths with expensive joi

Поиск
Список
Период
Сортировка
От Tom Lane
Тема pgsql: Fix planning of parameterized appendrel paths with expensive joi
Дата
Msg-id E1Uw1Kt-0004w0-Vs@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Fix planning of parameterized appendrel paths with expensive join quals.

The code in set_append_rel_pathlist() for building parameterized paths
for append relations (inheritance and UNION ALL combinations) supposed
that the cheapest regular path for a child relation would still be cheapest
when reparameterized.  Which might not be the case, particularly if the
added join conditions are expensive to compute, as in a recent example from
Jeff Janes.  Fix it to compare child path costs *after* reparameterizing.
We can short-circuit that if the cheapest pre-existing path is already
parameterized correctly, which seems likely to be true often enough to be
worth checking for.

Back-patch to 9.2 where parameterized paths were introduced.

Branch
------
REL9_2_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/1bd25c03487dd2f96035f88c77fc0d89bb438fac

Modified Files
--------------
src/backend/optimizer/path/allpaths.c |  108 ++++++++++++++++++++++++++-------
src/test/regress/expected/union.out   |   34 +++++++++++
src/test/regress/sql/union.sql        |   21 +++++++
3 files changed, 142 insertions(+), 21 deletions(-)


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: pgsql: Fix planning of parameterized appendrel paths with expensive joi
Следующее
От: Heikki Linnakangas
Дата:
Сообщение: pgsql: Improve scalability of WAL insertions.