postgresql/src/include/optimizer
Alexander Korotkov 199012a3d8 Fix asymmetry in setting EquivalenceClass.ec_sortref
0452b461bc made get_eclass_for_sort_expr() always set
EquivalenceClass.ec_sortref if it's not done yet.  This leads to an asymmetric
situation when whoever first looks for the EquivalenceClass sets the
ec_sortref.  It is also counterintuitive that get_eclass_for_sort_expr()
performs modification of data structures.

This commit makes make_pathkeys_for_sortclauses_extended() responsible for
setting EquivalenceClass.ec_sortref.  Now we set the
EquivalenceClass.ec_sortref's needed to explore alternative GROUP BY ordering
specifically during building pathkeys by the list of grouping clauses.

Discussion: https://postgr.es/m/17037754-f187-4138-8285-0e2bfebd0dea%40postgrespro.ru
Reported-by: Tom Lane
Author: Andrei Lepikhov
Reviewed-by: Alexander Korotkov, Pavel Borisov
2024-06-06 13:41:34 +03:00
..
appendinfo.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
clauses.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
cost.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
geqo.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
geqo_copy.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
geqo_gene.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
geqo_misc.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
geqo_mutation.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
geqo_pool.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
geqo_random.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
geqo_recombination.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
geqo_selection.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
inherit.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
joininfo.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
optimizer.h revert: Transform OR clauses to ANY expression 2024-04-10 02:28:09 +03:00
orclauses.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
paramassign.h Add RETURNING support to MERGE. 2024-03-17 13:58:59 +00:00
pathnode.h Fix query pullup issue with WindowClause runCondition 2024-05-05 12:54:46 +12:00
paths.h Fix asymmetry in setting EquivalenceClass.ec_sortref 2024-06-06 13:41:34 +03:00
placeholder.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
plancat.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
planmain.h Revert: Remove useless self-joins 2024-05-06 14:36:36 +03:00
planner.h Re-allow planner to use Merge Append to efficiently implement UNION. 2024-05-21 12:44:51 -04:00
prep.h Re-allow planner to use Merge Append to efficiently implement UNION. 2024-05-21 12:44:51 -04:00
restrictinfo.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
subselect.h Update copyright for 2024 2024-01-03 20:49:05 -05:00
tlist.h Update copyright for 2024 2024-01-03 20:49:05 -05:00