pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: Disallow SRFs when considering sorts below Gather Merge 2+ messages / 1 participants [nested] [flat]
* pgsql: Disallow SRFs when considering sorts below Gather Merge @ 2020-12-21 18:36 Tomas Vondra <tomas.vondra@postgresql.org> 0 siblings, 0 replies; 2+ messages in thread From: Tomas Vondra @ 2020-12-21 18:36 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Disallow SRFs when considering sorts below Gather Merge While we do allow SRFs in ORDER BY, scan/join processing should not consider such cases - such sorts should only happen via final Sort atop a ProjectSet. So make sure we don't try adding such sorts below Gather Merge, just like we do for expressions that are volatile and/or not parallel safe. Backpatch to PostgreSQL 13, where this code was introduced as part of the Incremental Sort patch. Author: James Coleman Reviewed-by: Tomas Vondra Backpatch-through: 13 Discussion: https://postgr.es/m/CAAaqYe8cK3g5CfLC4w7bs=hC0mSksZC=H5M8LSchj5e5OxpTAg@mail.gmail.com Discussion: https://postgr.es/m/295524.1606246314%40sss.pgh.pa.us Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/fac1b470a9f7e846534620b78ea4cf122ed432b2 Modified Files -------------- src/backend/optimizer/path/equivclass.c | 7 +++++++ src/backend/optimizer/util/tlist.c | 5 ----- src/include/optimizer/optimizer.h | 5 +++++ src/test/regress/expected/incremental_sort.out | 12 ++++++++++++ src/test/regress/sql/incremental_sort.sql | 2 ++ 5 files changed, 26 insertions(+), 5 deletions(-) ^ permalink raw reply [nested|flat] 2+ messages in thread
* pgsql: Disallow SRFs when considering sorts below Gather Merge @ 2020-12-21 18:36 Tomas Vondra <tomas.vondra@postgresql.org> 0 siblings, 0 replies; 2+ messages in thread From: Tomas Vondra @ 2020-12-21 18:36 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org Disallow SRFs when considering sorts below Gather Merge While we do allow SRFs in ORDER BY, scan/join processing should not consider such cases - such sorts should only happen via final Sort atop a ProjectSet. So make sure we don't try adding such sorts below Gather Merge, just like we do for expressions that are volatile and/or not parallel safe. Backpatch to PostgreSQL 13, where this code was introduced as part of the Incremental Sort patch. Author: James Coleman Reviewed-by: Tomas Vondra Backpatch-through: 13 Discussion: https://postgr.es/m/CAAaqYe8cK3g5CfLC4w7bs=hC0mSksZC=H5M8LSchj5e5OxpTAg@mail.gmail.com Discussion: https://postgr.es/m/295524.1606246314%40sss.pgh.pa.us Branch ------ REL_13_STABLE Details ------- https://git.postgresql.org/pg/commitdiff/d0167631e8b7388b78203c6798621f98beed93d5 Modified Files -------------- src/backend/optimizer/path/equivclass.c | 7 +++++++ src/backend/optimizer/util/tlist.c | 5 ----- src/include/optimizer/optimizer.h | 5 +++++ src/test/regress/expected/incremental_sort.out | 12 ++++++++++++ src/test/regress/sql/incremental_sort.sql | 2 ++ 5 files changed, 26 insertions(+), 5 deletions(-) ^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2020-12-21 18:36 UTC | newest] Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2020-12-21 18:36 pgsql: Disallow SRFs when considering sorts below Gather Merge Tomas Vondra <tomas.vondra@postgresql.org> 2020-12-21 18:36 pgsql: Disallow SRFs when considering sorts below Gather Merge 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