diff options
author | Peter Eisentraut <peter@eisentraut.org> | 2025-02-02 10:26:04 +0100 |
---|---|---|
committer | Peter Eisentraut <peter@eisentraut.org> | 2025-02-02 10:26:04 +0100 |
commit | c09e5a6a01659a66dd84f3e745694999d3414ddd (patch) | |
tree | 85c7b89405656557e73360aa65216baf91f01a5b /doc/src | |
parent | 119fc30dd5bd918819b864107ddc8baac51f4d22 (diff) | |
download | postgresql-c09e5a6a01659a66dd84f3e745694999d3414ddd.tar.gz postgresql-c09e5a6a01659a66dd84f3e745694999d3414ddd.zip |
Convert strategies to and from compare types
For each Index AM, provide a mapping between operator strategies and
the system-wide generic concept of a comparison type. For example,
for btree, BTLessStrategyNumber maps to and from COMPARE_LT. Numerous
places in the planner and executor think directly in terms of btree
strategy numbers (and a few in terms of hash strategy numbers.) These
should be converted over subsequent commits to think in terms of
CompareType instead. (This commit doesn't make any use of this API
yet.)
Author: Mark Dilger <mark.dilger@enterprisedb.com>
Reviewed-by: Peter Eisentraut <peter@eisentraut.org>
Discussion: https://www.postgresql.org/message-id/flat/E72EAA49-354D-4C2E-8EB9-255197F55330@enterprisedb.com
Diffstat (limited to 'doc/src')
-rw-r--r-- | doc/src/sgml/indexam.sgml | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/doc/src/sgml/indexam.sgml b/doc/src/sgml/indexam.sgml index dc7d14b60dd..d17fcbd5cec 100644 --- a/doc/src/sgml/indexam.sgml +++ b/doc/src/sgml/indexam.sgml @@ -164,6 +164,10 @@ typedef struct IndexAmRoutine amestimateparallelscan_function amestimateparallelscan; /* can be NULL */ aminitparallelscan_function aminitparallelscan; /* can be NULL */ amparallelrescan_function amparallelrescan; /* can be NULL */ + + /* interface functions to support planning */ + amtranslate_strategy_function amtranslatestrategy; /* can be NULL */ + amtranslate_cmptype_function amtranslatecmptype; /* can be NULL */ } IndexAmRoutine; </programlisting> </para> @@ -876,6 +880,28 @@ amparallelrescan (IndexScanDesc scan); the beginning. </para> + <para> +<programlisting> +CompareType +amtranslatestrategy (StrategyNumber strategy, Oid opfamily, Oid opcintype); + +StrategyNumber +amtranslatecmptype (CompareType cmptype, Oid opfamily, Oid opcintype); +</programlisting> + These functions, if implemented, will be called by the planer and executor + to convert between fixed <type>CompareType</type> values and the specific + strategy numbers used by the access method. These functions can be + implemented by access methods that implement functionality similar to the + built-in btree or hash access methods, and by implementing these + translations, the system can learn about the semantics of the access + method's operations and can use them in place of btree or hash indexes in + various places. If the functionality of the access method is not similar + to those built-in access methods, these functions do not need to be + implemented. If the functions are not implemented, the access method will + be ignored for certain planner and executor decisions, but is otherwise + fully functional. + </para> + </sect1> <sect1 id="index-scanning"> |