postgresql/src
David Rowley 7e0ade0ffe Allow Gather Merge in more cases for parallel DISTINCT
Here we adjust the partial path generation for parallel DISTINCT queries
to add Sort nodes on top of any unsorted partial distinct paths.

This increases the likelihood of the planner pushing a Sort below a Gather
Merge which enables the final phase of the parallel distinct to be
implemented using a Unique node in more cases.

Sorting the partial distinct paths is particularly useful when the
DISTINCT query has an ORDER BY and LIMIT clause as this can allow cheaper
plans by having the workers Hash Aggregate then Sort before feeding the
results into the Gather Merge.  The non-parallel portion of the plan then
becomes very cheap as it leaves only Unique and Limit to do in the leader
process.

Author: Richard Guo
Reviewed-by: David Rowley
Discussion: https://postgr.es/m/CAMbWs48u9VoVOouJsys1qOaC9WVGVmBa+wT1dx8KvxF5GPzezA@mail.gmail.com
2024-02-03 00:20:18 +13:00
..
backend Allow Gather Merge in more cases for parallel DISTINCT 2024-02-03 00:20:18 +13:00
bin Avoid package qualification of $windows_os 2024-02-01 15:19:56 -05:00
common Move is_valid_ascii() to ascii.h. 2024-01-29 12:08:57 -06:00
fe_utils Update copyright for 2024 2024-01-03 20:49:05 -05:00
include Give SMgrRelation pointers a well-defined lifetime. 2024-01-31 12:31:02 +02:00
interfaces Exclude Threadsanitizer instrumentation in exit check 2024-01-31 22:54:45 +01:00
makefiles Add backend support for injection points 2024-01-22 10:15:50 +09:00
pl Fix plpgsql to allow new-style SQL CREATE FUNCTION as a SQL command. 2024-01-18 16:11:16 -05:00
port Update copyright for 2024 2024-01-03 20:49:05 -05:00
template
test Allow Gather Merge in more cases for parallel DISTINCT 2024-02-03 00:20:18 +13:00
timezone Update time zone data files to tzdata release 2024a. 2024-02-01 15:57:53 -05:00
tools Fix various issues with ALTER TEXT SEARCH CONFIGURATION 2024-01-31 13:15:21 +09:00
tutorial Update copyright for 2024 2024-01-03 20:49:05 -05:00
.gitignore
DEVELOPERS
Makefile
Makefile.global.in Remove make function vpathsearch 2024-01-29 07:24:59 +01:00
Makefile.shlib Support shared libraries on Android (using make) 2024-01-23 20:37:49 +01:00
meson.build Update copyright for 2024 2024-01-03 20:49:05 -05:00
nls-global.mk