pgsql: Consider unsorted paths in generate_useful_gather_paths - Mailing list pgsql-committers

From Tomas Vondra
Subject pgsql: Consider unsorted paths in generate_useful_gather_paths
Date
Msg-id E1krOzL-00053L-N3@gemulon.postgresql.org
Whole thread Raw
List pgsql-committers
Consider unsorted paths in generate_useful_gather_paths

generate_useful_gather_paths used to skip unsorted paths (without any
pathkeys), but that is unnecessary - the later code actually can handle
such paths just fine by adding a Sort node. This is clearly a thinko,
preventing construction of useful plans.

Backpatch to 13, where Incremental Sort was introduced.

Author: James Coleman
Reviewed-by: Tomas Vondra
Backpatch-through: 13
Discussion: https://postgr.es/m/CAAaqYe8cK3g5CfLC4w7bs=hC0mSksZC=H5M8LSchj5e5OxpTAg@mail.gmail.com

Branch
------
REL_13_STABLE

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

Modified Files
--------------
src/backend/optimizer/path/allpaths.c          | 11 ++---------
src/test/regress/expected/incremental_sort.out | 13 +++++++++++++
src/test/regress/sql/incremental_sort.sql      |  4 ++++
3 files changed, 19 insertions(+), 9 deletions(-)


pgsql-committers by date:

Previous
From: Alexander Korotkov
Date:
Subject: Re: pgsql: Multirange datatypes
Next
From: Tomas Vondra
Date:
Subject: pgsql: Consider unsorted paths in generate_useful_gather_paths