pgsql: Track sort direction in SortGroupClause

From: Peter Eisentraut <peter(at)eisentraut(dot)org>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Track sort direction in SortGroupClause
Date: 2024-10-14 14:16:37
Message-ID: E1t0LsE-000ngB-3B@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Track sort direction in SortGroupClause

Functions make_pathkey_from_sortop() and transformWindowDefinitions(),
which receive a SortGroupClause, were determining the sort order
(ascending vs. descending) by comparing that structure's operator
strategy to BTLessStrategyNumber, but could just as easily have gotten
it from the SortGroupClause object, if it had such a field, so add
one. This reduces the number of places that hardcode the assumption
that the strategy refers specifically to a btree strategy, rather than
some other index AM's operators.

Author: Mark Dilger <mark(dot)dilger(at)enterprisedb(dot)com>
Discussion: https://www.postgresql.org/message-id/flat/E72EAA49-354D-4C2E-8EB9-255197F55330(at)enterprisedb(dot)com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/0d2aa4d4937bb0500823edfc7d620f4e5fa45b9c

Modified Files
--------------
src/backend/optimizer/path/pathkeys.c | 4 +++-
src/backend/optimizer/plan/createplan.c | 1 +
src/backend/optimizer/plan/planagg.c | 10 ++++++----
src/backend/parser/analyze.c | 1 +
src/backend/parser/parse_clause.c | 5 ++++-
src/backend/utils/cache/lsyscache.c | 2 +-
src/include/catalog/catversion.h | 2 +-
src/include/nodes/parsenodes.h | 1 +
8 files changed, 18 insertions(+), 8 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Masahiko Sawada 2024-10-14 16:50:54 pgsql: Use construct_array_builtin for FLOAT8OID instead of construct_a
Previous Message Peter Eisentraut 2024-10-14 09:25:19 pgsql: Run pgperltidy on newly-added test code