pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Peter Eisentraut <peter@eisentraut.org>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Track sort direction in SortGroupClause
Date: Mon, 14 Oct 2024 14:16:37 +0000
Message-ID: <E1t0LsE-000ngB-3B@gemulon.postgresql.org> (raw)

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.dilger@enterprisedb.com>
Discussion: https://www.postgresql.org/message-id/flat/E72EAA49-354D-4C2E-8EB9-255197F55330@enterprisedb.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(-)



Message-ID: <E1t0LsE-000ngB-3B@gemulon.postgresql.org>
Permalink:  ../E1t0LsE-000ngB-3B@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1t0LsE-000ngB-3B@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-committers@postgresql.org
  Cc: peter@eisentraut.org, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Track sort direction in SortGroupClause
  In-Reply-To: <E1t0LsE-000ngB-3B@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox