public inbox for [email protected]
help / color / mirror / Atom feedFrom: Peter Eisentraut <[email protected]>
To: [email protected]
Subject: pgsql: Simplify and generalize PrepareSortSupportFromIndexRel()
Date: Fri, 14 Mar 2025 09:54:41 +0000
Message-ID: <[email protected]> (raw)
Simplify and generalize PrepareSortSupportFromIndexRel()
PrepareSortSupportFromIndexRel() was accepting btree strategy numbers
purely for the purpose of comparing it later against btree strategies
to determine if the sort direction was forward or reverse. Change
that. Instead, pass a bool directly, to indicate the same without an
unfortunate assumption that a strategy number refers specifically to a
btree strategy. (This is similar in spirit to commits 0d2aa4d4937 and
c594f1ad2ba.)
(This could arguably be simplfied further by having the callers fill
in ssup_reverse directly. But this way, it preserves consistency by
having all PrepareSortSupport*() variants be responsible for filling
in ssup_reverse.)
Moreover, remove the hardcoded check against BTREE_AM_OID, and check
against amcanorder instead, which is the actual requirement.
Co-authored-by: Mark Dilger <[email protected]>
Discussion: https://www.postgresql.org/message-id/flat/[email protected]
Branch
------
master
Details
-------
https://git.postgresql.org/pg/commitdiff/a359d3701991d040bf7b66cfa7052546eb923c38
Modified Files
--------------
src/backend/access/nbtree/nbtsort.c | 7 +++----
src/backend/utils/sort/sortsupport.c | 15 ++++++---------
src/backend/utils/sort/tuplesortvariants.c | 14 ++++++--------
src/include/utils/sortsupport.h | 2 +-
4 files changed, 16 insertions(+), 22 deletions(-)
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: [email protected]
Cc: [email protected], [email protected]
Subject: Re: pgsql: Simplify and generalize PrepareSortSupportFromIndexRel()
In-Reply-To: <[email protected]>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox