postgresql/src/include/nodes
Alexander Korotkov 505c008ca3 Restore preprocess_groupclause()
0452b461bc made optimizer explore alternative orderings of group-by pathkeys.
It eliminated preprocess_groupclause(), which was intended to match items
between GROUP BY and ORDER BY.  Instead, get_useful_group_keys_orderings()
function generates orderings of GROUP BY elements at the time of grouping
paths generation.  The get_useful_group_keys_orderings() function takes into
account 3 orderings of GROUP BY pathkeys and clauses: original order as written
in GROUP BY, matching ORDER BY clauses as much as possible, and matching the
input path as much as possible.  Given that even before 0452b461b,
preprocess_groupclause() could change the original order of GROUP BY clauses
we don't need to consider it apart from ordering matching ORDER BY clauses.

This commit restores preprocess_groupclause() to provide an ordering of
GROUP BY elements matching ORDER BY before generation of paths.  The new
version of preprocess_groupclause() takes into account an incremental sort.
The get_useful_group_keys_orderings() function now takes into 2 orderings of
GROUP BY elements: the order generated preprocess_groupclause() and the order
matching the input path as much as possible.

Discussion: https://postgr.es/m/CAPpHfdvyWLMGwvxaf%3D7KAp-z-4mxbSH8ti2f6mNOQv5metZFzg%40mail.gmail.com
Author: Alexander Korotkov
Reviewed-by: Andrei Lepikhov, Pavel Borisov
2024-06-06 13:44:34 +03:00
..
.gitignore Automatically generate node support functions 2022-07-09 08:53:59 +02:00
bitmapset.h Move some bitmap logic out of bitmapset.c 2024-03-06 14:30:16 +07:00
execnodes.h Ensure we allocate NAMEDATALEN bytes for names in Index Only Scans 2024-05-01 13:21:21 +12:00
extensible.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
lockoptions.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
makefuncs.h Add basic JSON_TABLE() functionality 2024-04-04 20:20:15 +09:00
memnodes.h Introduce a bump memory allocator 2024-04-08 00:02:43 +12:00
meson.build Update copyright for 2024 2024-01-03 20:49:05 -05:00
miscnodes.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
multibitmapset.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
nodeFuncs.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
nodes.h Do not output actual value of location fields in node serialization by default 2024-03-22 09:49:12 +01:00
params.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
parsenodes.h Fix another couple of outdated comments for MERGE RETURNING. 2024-06-04 09:29:42 +01:00
pathnodes.h Restore preprocess_groupclause() 2024-06-06 13:44:34 +03:00
pg_list.h Add macros for looping through a List without a ListCell. 2024-01-04 16:09:34 -06:00
plannodes.h Fix a couple of outdated comments now that we have MERGE RETURNING 2024-05-23 15:24:54 +12:00
primnodes.h Fix query pullup issue with WindowClause runCondition 2024-05-05 12:54:46 +12:00
print.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
queryjumble.h revert: Transform OR clauses to ANY expression 2024-04-10 02:28:09 +03:00
readfuncs.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
replnodes.h Allow setting failover property in the replication command. 2024-01-29 09:37:23 +05:30
subscripting.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
supportnodes.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
tidbitmap.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
value.h Update copyright for 2024 2024-01-03 20:49:05 -05:00