1/*-------------------------------------------------------------------------
4 * Public header file for SP-GiST access method.
7 * Portions Copyright (c) 1996-2025, PostgreSQL Global Development Group
8 * Portions Copyright (c) 1994, Regents of the University of California
10 * src/include/access/spgist.h
12 *-------------------------------------------------------------------------
22/* SPGiST opclass support function numbers */
23 #define SPGIST_CONFIG_PROC 1
24 #define SPGIST_CHOOSE_PROC 2
25 #define SPGIST_PICKSPLIT_PROC 3
26 #define SPGIST_INNER_CONSISTENT_PROC 4
27 #define SPGIST_LEAF_CONSISTENT_PROC 5
28 #define SPGIST_COMPRESS_PROC 6
29 #define SPGIST_OPTIONS_PROC 7
30 #define SPGISTNRequiredProc 5
34 * Argument structs for spg_config method
51 * Argument structs for spg_choose method
57 int level;
/* current level (counting from zero) */
59 /* Data from current inner tuple */
63 int nNodes;
/* number of nodes in the inner tuple */
79 struct /* results for spgMatchNode */
81 int nodeN;
/* descend to this node (index from 0) */
82 int levelAdd;
/* increment level by this much */
85 struct /* results for spgAddNode */
88 int nodeN;
/* where to insert it (index from 0) */
90 struct /* results for spgSplitTuple */
92 /* Info to form new upper-level inner tuple with one child tuple */
100 /* Info to form new lower-level inner tuple with all old nodes */
108 * Argument structs for spg_picksplit method
114 int level;
/* current level (counting from zero) */
119 bool hasPrefix;
/* new inner tuple should have a prefix? */
122 int nNodes;
/* number of nodes for new inner tuple */
130 * Argument structs for spg_inner_consistent method
137 int nkeys;
/* length of scankeys array */
143 int level;
/* current level (counting from zero) */
146 /* Data from current inner tuple */
150 int nNodes;
/* number of nodes in the inner tuple */
156 int nNodes;
/* number of child nodes to be visited */
158 int *
levelAdds;
/* increment level by this much for each */
165 * Argument structs for spg_leaf_consistent method
172 int nkeys;
/* length of scankeys array */
177 int level;
/* current level (counting from zero) */
186 bool recheck;
/* set true if operator must be rechecked */
209 ScanKey orderbys,
int norderbys);
218 void *callback_state);
static bool validate(Port *port, const char *auth)
static Datum values[MAXATTR]
bool(* IndexBulkDeleteCallback)(ItemPointer itemptr, void *state)
static const struct fns functions
IndexScanDesc spgbeginscan(Relation rel, int keysz, int orderbysz)
struct spgInnerConsistentOut spgInnerConsistentOut
struct spgPickSplitIn spgPickSplitIn
bool spgcanreturn(Relation index, int attno)
struct spgConfigOut spgConfigOut
bool spggettuple(IndexScanDesc scan, ScanDirection dir)
struct spgLeafConsistentIn spgLeafConsistentIn
void spgendscan(IndexScanDesc scan)
IndexBulkDeleteResult * spgbulkdelete(IndexVacuumInfo *info, IndexBulkDeleteResult *stats, IndexBulkDeleteCallback callback, void *callback_state)
bool spgvalidate(Oid opclassoid)
struct spgChooseOut spgChooseOut
void spgbuildempty(Relation index)
bool spginsert(Relation index, Datum *values, bool *isnull, ItemPointer ht_ctid, Relation heapRel, IndexUniqueCheck checkUnique, bool indexUnchanged, struct IndexInfo *indexInfo)
IndexBulkDeleteResult * spgvacuumcleanup(IndexVacuumInfo *info, IndexBulkDeleteResult *stats)
bytea * spgoptions(Datum reloptions, bool validate)
struct spgPickSplitOut spgPickSplitOut
struct spgInnerConsistentIn spgInnerConsistentIn
void spgadjustmembers(Oid opfamilyoid, Oid opclassoid, List *operators, List *functions)
void spgrescan(IndexScanDesc scan, ScanKey scankey, int nscankeys, ScanKey orderbys, int norderbys)
struct spgConfigIn spgConfigIn
int64 spggetbitmap(IndexScanDesc scan, TIDBitmap *tbm)
struct spgChooseIn spgChooseIn
struct spgLeafConsistentOut spgLeafConsistentOut
IndexBuildResult * spgbuild(Relation heap, Relation index, struct IndexInfo *indexInfo)
spgChooseResultType resultType
struct spgChooseOut::@53::@54 matchNode
struct spgChooseOut::@53::@56 splitTuple
union spgChooseOut::@53 result
struct spgChooseOut::@53::@55 addNode
MemoryContext traversalMemoryContext
Datum * reconstructedValues
static void callback(struct sockaddr *addr, struct sockaddr *mask, void *unused)