1/*--------------------------------------------------------------------------
3 * Public header file for Generalized Inverted Index access method.
5 * Copyright (c) 2006-2025, PostgreSQL Global Development Group
7 * src/include/access/gin.h
8 *--------------------------------------------------------------------------
22 * amproc indexes for inverted indexes.
24 #define GIN_COMPARE_PROC 1
25 #define GIN_EXTRACTVALUE_PROC 2
26 #define GIN_EXTRACTQUERY_PROC 3
27 #define GIN_CONSISTENT_PROC 4
28 #define GIN_COMPARE_PARTIAL_PROC 5
29 #define GIN_TRICONSISTENT_PROC 6
30 #define GIN_OPTIONS_PROC 7
34 * searchMode settings for extractQueryFn.
36 #define GIN_SEARCH_MODE_DEFAULT 0
37 #define GIN_SEARCH_MODE_INCLUDE_EMPTY 1
38 #define GIN_SEARCH_MODE_ALL 2
39 #define GIN_SEARCH_MODE_EVERYTHING 3 /* for internal use only */
42 * Constant definition for progress reporting. Phase numbers must match
45/* PROGRESS_CREATEIDX_SUBPHASE_INITIALIZE is 1 (see progress.h) */
46 #define PROGRESS_GIN_PHASE_INDEXBUILD_TABLESCAN 2
47 #define PROGRESS_GIN_PHASE_PERFORMSORT_1 3
48 #define PROGRESS_GIN_PHASE_MERGE_1 4
49 #define PROGRESS_GIN_PHASE_PERFORMSORT_2 5
50 #define PROGRESS_GIN_PHASE_MERGE_2 6
53 * GinStatsData represents stats data for planner use
66 * A ternary value used by tri-consistent functions.
68 * This must be of the same size as a bool because some code will cast a
69 * pointer to a bool to a pointer to a GinTernaryValue.
74 "sizes of GinTernaryValue and bool are not equal");
76 #define GIN_FALSE 0 /* item is not present / does not match */
77 #define GIN_TRUE 1 /* item is present / matches */
78 #define GIN_MAYBE 2 /* don't know if item is present / don't know
93#define PG_RETURN_GIN_TERNARY_VALUE(x) return GinTernaryValueGetDatum(x)
void ginGetStats(Relation index, GinStatsData *stats)
static Datum GinTernaryValueGetDatum(GinTernaryValue X)
static GinTernaryValue DatumGetGinTernaryValue(Datum X)
PGDLLIMPORT int gin_pending_list_limit
void _gin_parallel_build_main(dsm_segment *seg, shm_toc *toc)
StaticAssertDecl(sizeof(GinTernaryValue)==sizeof(bool), "sizes of GinTernaryValue and bool are not equal")
PGDLLIMPORT int GinFuzzySearchLimit
void ginUpdateStats(Relation index, const GinStatsData *stats, bool is_build)
struct GinStatsData GinStatsData
BlockNumber nPendingPages