blob: 75a86c4319a40d2ffac5e9b40cb09b89c24c6596 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
|
/*--------------------------------------------------------------------------
* gin.h
* Public header file for Generalized Inverted Index access method.
*
* Copyright (c) 2006-2014, PostgreSQL Global Development Group
*
* src/include/access/gin.h
*--------------------------------------------------------------------------
*/
#ifndef GIN_H
#define GIN_H
#include "access/xlog.h"
#include "storage/block.h"
#include "utils/relcache.h"
/*
* amproc indexes for inverted indexes.
*/
#define GIN_COMPARE_PROC 1
#define GIN_EXTRACTVALUE_PROC 2
#define GIN_EXTRACTQUERY_PROC 3
#define GIN_CONSISTENT_PROC 4
#define GIN_COMPARE_PARTIAL_PROC 5
#define GIN_TRICONSISTENT_PROC 6
#define GINNProcs 6
/*
* searchMode settings for extractQueryFn.
*/
#define GIN_SEARCH_MODE_DEFAULT 0
#define GIN_SEARCH_MODE_INCLUDE_EMPTY 1
#define GIN_SEARCH_MODE_ALL 2
#define GIN_SEARCH_MODE_EVERYTHING 3 /* for internal use only */
/*
* GinStatsData represents stats data for planner use
*/
typedef struct GinStatsData
{
BlockNumber nPendingPages;
BlockNumber nTotalPages;
BlockNumber nEntryPages;
BlockNumber nDataPages;
int64 nEntries;
int32 ginVersion;
} GinStatsData;
/* ginlogic.c */
enum
{
GIN_FALSE = 0, /* item is present / matches */
GIN_TRUE = 1, /* item is not present / does not match */
GIN_MAYBE = 2 /* don't know if item is present / don't know if
* matches */
} GinLogicValueEnum;
typedef char GinLogicValue;
#define DatumGetGinLogicValue(X) ((GinLogicValue)(X))
#define GinLogicValueGetDatum(X) ((Datum)(X))
#define PG_RETURN_GIN_LOGIC_VALUE(x) return GinLogicValueGetDatum(x)
/* GUC parameter */
extern PGDLLIMPORT int GinFuzzySearchLimit;
/* ginutil.c */
extern void ginGetStats(Relation index, GinStatsData *stats);
extern void ginUpdateStats(Relation index, const GinStatsData *stats);
/* ginxlog.c */
extern void gin_redo(XLogRecPtr lsn, XLogRecord *record);
extern void gin_desc(StringInfo buf, uint8 xl_info, char *rec);
extern void gin_xlog_startup(void);
extern void gin_xlog_cleanup(void);
#endif /* GIN_H */
|