00001 /*-------------------------------------------------------------------------- 00002 * gin.h 00003 * Public header file for Generalized Inverted Index access method. 00004 * 00005 * Copyright (c) 2006-2013, PostgreSQL Global Development Group 00006 * 00007 * src/include/access/gin.h 00008 *-------------------------------------------------------------------------- 00009 */ 00010 #ifndef GIN_H 00011 #define GIN_H 00012 00013 #include "access/xlog.h" 00014 #include "storage/block.h" 00015 #include "utils/relcache.h" 00016 00017 00018 /* 00019 * amproc indexes for inverted indexes. 00020 */ 00021 #define GIN_COMPARE_PROC 1 00022 #define GIN_EXTRACTVALUE_PROC 2 00023 #define GIN_EXTRACTQUERY_PROC 3 00024 #define GIN_CONSISTENT_PROC 4 00025 #define GIN_COMPARE_PARTIAL_PROC 5 00026 #define GINNProcs 5 00027 00028 /* 00029 * searchMode settings for extractQueryFn. 00030 */ 00031 #define GIN_SEARCH_MODE_DEFAULT 0 00032 #define GIN_SEARCH_MODE_INCLUDE_EMPTY 1 00033 #define GIN_SEARCH_MODE_ALL 2 00034 #define GIN_SEARCH_MODE_EVERYTHING 3 /* for internal use only */ 00035 00036 /* 00037 * GinStatsData represents stats data for planner use 00038 */ 00039 typedef struct GinStatsData 00040 { 00041 BlockNumber nPendingPages; 00042 BlockNumber nTotalPages; 00043 BlockNumber nEntryPages; 00044 BlockNumber nDataPages; 00045 int64 nEntries; 00046 int32 ginVersion; 00047 } GinStatsData; 00048 00049 /* GUC parameter */ 00050 extern PGDLLIMPORT int GinFuzzySearchLimit; 00051 00052 /* ginutil.c */ 00053 extern void ginGetStats(Relation index, GinStatsData *stats); 00054 extern void ginUpdateStats(Relation index, const GinStatsData *stats); 00055 00056 /* ginxlog.c */ 00057 extern void gin_redo(XLogRecPtr lsn, XLogRecord *record); 00058 extern void gin_desc(StringInfo buf, uint8 xl_info, char *rec); 00059 extern void gin_xlog_startup(void); 00060 extern void gin_xlog_cleanup(void); 00061 extern bool gin_safe_restartpoint(void); 00062 00063 #endif /* GIN_H */