mirror of
https://github.com/postgres/postgres.git
synced 2025-12-21 05:21:08 +03:00
Generalize hash and ordering support in amapi
Stop comparing access method OID values against HASH_AM_OID and BTREE_AM_OID, and instead check the IndexAmRoutine for an index to see if it advertises its ability to perform the necessary ordering, hashing, or cross-type comparing functionality. A field amcanorder already existed, this uses it more widely. Fields amcanhash and amcancrosscompare are added for the other purposes. Author: Mark Dilger <mark.dilger@enterprisedb.com> Discussion: https://www.postgresql.org/message-id/flat/E72EAA49-354D-4C2E-8EB9-255197F55330@enterprisedb.com
This commit is contained in:
@@ -256,6 +256,8 @@ brinhandler(PG_FUNCTION_ARGS)
|
||||
amroutine->amoptsprocnum = BRIN_PROCNUM_OPTIONS;
|
||||
amroutine->amcanorder = false;
|
||||
amroutine->amcanorderbyop = false;
|
||||
amroutine->amcanhash = false;
|
||||
amroutine->amcancrosscompare = false;
|
||||
amroutine->amcanbackward = false;
|
||||
amroutine->amcanunique = false;
|
||||
amroutine->amcanmulticol = true;
|
||||
|
||||
@@ -43,6 +43,8 @@ ginhandler(PG_FUNCTION_ARGS)
|
||||
amroutine->amoptsprocnum = GIN_OPTIONS_PROC;
|
||||
amroutine->amcanorder = false;
|
||||
amroutine->amcanorderbyop = false;
|
||||
amroutine->amcanhash = false;
|
||||
amroutine->amcancrosscompare = false;
|
||||
amroutine->amcanbackward = false;
|
||||
amroutine->amcanunique = false;
|
||||
amroutine->amcanmulticol = true;
|
||||
|
||||
@@ -65,6 +65,8 @@ gisthandler(PG_FUNCTION_ARGS)
|
||||
amroutine->amoptsprocnum = GIST_OPTIONS_PROC;
|
||||
amroutine->amcanorder = false;
|
||||
amroutine->amcanorderbyop = true;
|
||||
amroutine->amcanhash = false;
|
||||
amroutine->amcancrosscompare = false;
|
||||
amroutine->amcanbackward = false;
|
||||
amroutine->amcanunique = false;
|
||||
amroutine->amcanmulticol = true;
|
||||
|
||||
@@ -64,6 +64,8 @@ hashhandler(PG_FUNCTION_ARGS)
|
||||
amroutine->amoptsprocnum = HASHOPTIONS_PROC;
|
||||
amroutine->amcanorder = false;
|
||||
amroutine->amcanorderbyop = false;
|
||||
amroutine->amcanhash = true;
|
||||
amroutine->amcancrosscompare = false;
|
||||
amroutine->amcanbackward = true;
|
||||
amroutine->amcanunique = false;
|
||||
amroutine->amcanmulticol = false;
|
||||
|
||||
@@ -107,6 +107,8 @@ bthandler(PG_FUNCTION_ARGS)
|
||||
amroutine->amoptsprocnum = BTOPTIONS_PROC;
|
||||
amroutine->amcanorder = true;
|
||||
amroutine->amcanorderbyop = false;
|
||||
amroutine->amcanhash = false;
|
||||
amroutine->amcancrosscompare = true;
|
||||
amroutine->amcanbackward = true;
|
||||
amroutine->amcanunique = true;
|
||||
amroutine->amcanmulticol = true;
|
||||
|
||||
@@ -50,6 +50,8 @@ spghandler(PG_FUNCTION_ARGS)
|
||||
amroutine->amoptsprocnum = SPGIST_OPTIONS_PROC;
|
||||
amroutine->amcanorder = false;
|
||||
amroutine->amcanorderbyop = true;
|
||||
amroutine->amcanhash = false;
|
||||
amroutine->amcancrosscompare = false;
|
||||
amroutine->amcanbackward = false;
|
||||
amroutine->amcanunique = false;
|
||||
amroutine->amcanmulticol = false;
|
||||
|
||||
Reference in New Issue
Block a user