From 0c1af2c35c7b456bd2fc76bbc9df5aa9c7911bde Mon Sep 17 00:00:00 2001 From: Alexander Korotkov Date: Thu, 6 Jun 2024 13:43:24 +0300 Subject: Rename PathKeyInfo to GroupByOrdering 0452b461bc made optimizer explore alternative orderings of group-by pathkeys. The PathKeyInfo data structure was used to store the particular ordering of group-by pathkeys and corresponding clauses. It turns out that PathKeyInfo is not the best name for that purpose. This commit renames this data structure to GroupByOrdering, and revises its comment. Discussion: https://postgr.es/m/db0fc3a4-966c-4cec-a136-94024d39212d%40postgrespro.ru Reported-by: Tom Lane Author: Andrei Lepikhov Reviewed-by: Alexander Korotkov, Pavel Borisov --- src/include/nodes/pathnodes.h | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) (limited to 'src/include/nodes/pathnodes.h') diff --git a/src/include/nodes/pathnodes.h b/src/include/nodes/pathnodes.h index 14ef296ab72..78489398294 100644 --- a/src/include/nodes/pathnodes.h +++ b/src/include/nodes/pathnodes.h @@ -1468,14 +1468,21 @@ typedef struct PathKey } PathKey; /* - * Combines the information about pathkeys and the associated clauses. + * Contains an order of group-by clauses and the corresponding list of + * pathkeys. + * + * The elements of 'clauses' list should have the same order as the head of + * 'pathkeys' list. The tleSortGroupRef of the clause should be equal to + * ec_sortref of the pathkey equivalence class. If there are redundant + * clauses with the same tleSortGroupRef, they must be grouped together. */ -typedef struct PathKeyInfo +typedef struct GroupByOrdering { NodeTag type; + List *pathkeys; List *clauses; -} PathKeyInfo; +} GroupByOrdering; /* * VolatileFunctionStatus -- allows nodes to cache their -- cgit v1.2.3