pgsql: Fix get_useful_pathkeys_for_relation for volatile expressions

Поиск
Список
Период
Сортировка
От Tomas Vondra
Тема pgsql: Fix get_useful_pathkeys_for_relation for volatile expressions
Дата
Msg-id E1ka3v7-0006CR-BK@gemulon.postgresql.org
обсуждение исходный текст
Список pgsql-committers
Fix get_useful_pathkeys_for_relation for volatile expressions

When considering Incremental Sort below a Gather Merge, we need to be
a bit more careful when matching pathkeys to EC members. It's not enough
to find a member whose Vars are all in the current relation's target;
volatile expressions in particular need to be contained in the target,
otherwise it's too early to use the pathkey.

Reported-by: Jaime Casanova
Author: James Coleman
Reviewed-by: Tomas Vondra
Backpatch-through: 13, where the incremental sort code was added
Discussion: https://postgr.es/m/CAJGNTeNaxpXgBVcRhJX%2B2vSbq%2BF2kJqGBcvompmpvXb7pq%2BoFA%40mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/ebb7ae839d033d0f279670e249f54646a08b8c48

Modified Files
--------------
src/backend/optimizer/path/allpaths.c          | 13 ++--
src/backend/optimizer/path/equivclass.c        | 70 ++++++++++++++++++
src/include/optimizer/paths.h                  |  1 +
src/test/regress/expected/incremental_sort.out | 98 ++++++++++++++++++++++++++
src/test/regress/sql/incremental_sort.sql      | 31 ++++++++
5 files changed, 207 insertions(+), 6 deletions(-)


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

Предыдущее
От: Tom Lane
Дата:
Сообщение: pgsql: Guard against core dump from uninitialized subplan.
Следующее
От: Tomas Vondra
Дата:
Сообщение: pgsql: Use INT64_FORMAT to print int64 variables in sort debug