pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
pgsql: Fix get_useful_pathkeys_for_relation for volatile expressions
2+ messages / 1 participants
[nested] [flat]

* pgsql: Fix get_useful_pathkeys_for_relation for volatile expressions
@ 2020-11-03 21:32 Tomas Vondra <tomas.vondra@postgresql.org>
  0 siblings, 0 replies; 2+ messages in thread

From: Tomas Vondra @ 2020-11-03 21:32 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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(-)



^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* pgsql: Fix get_useful_pathkeys_for_relation for volatile expressions
@ 2020-11-03 21:33 Tomas Vondra <tomas.vondra@postgresql.org>
  0 siblings, 0 replies; 2+ messages in thread

From: Tomas Vondra @ 2020-11-03 21:33 UTC (permalink / raw)
  To: pgsql-committers@lists.postgresql.org

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
------
REL_13_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/2d26c4ac703447a002a02124c1edd01e70a5d1ee

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(-)



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2020-11-03 21:33 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2020-11-03 21:32 pgsql: Fix get_useful_pathkeys_for_relation for volatile expressions Tomas Vondra <tomas.vondra@postgresql.org>
2020-11-03 21:33 pgsql: Fix get_useful_pathkeys_for_relation for volatile expressions Tomas Vondra <tomas.vondra@postgresql.org>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox