PostgreSQL Source Code  git master
brin.h
Go to the documentation of this file.
1 /*
2  * AM-callable functions for BRIN indexes
3  *
4  * Portions Copyright (c) 1996-2020, PostgreSQL Global Development Group
5  * Portions Copyright (c) 1994, Regents of the University of California
6  *
7  * IDENTIFICATION
8  * src/include/access/brin.h
9  */
10 #ifndef BRIN_H
11 #define BRIN_H
12 
13 #include "nodes/execnodes.h"
14 #include "utils/relcache.h"
15 
16 
17 /*
18  * Storage type for BRIN's reloptions
19  */
20 typedef struct BrinOptions
21 {
22  int32 vl_len_; /* varlena header (do not touch directly!) */
25 } BrinOptions;
26 
27 
28 /*
29  * BrinStatsData represents stats data for planner use
30  */
31 typedef struct BrinStatsData
32 {
36 
37 
38 #define BRIN_DEFAULT_PAGES_PER_RANGE 128
39 #define BrinGetPagesPerRange(relation) \
40  (AssertMacro(relation->rd_rel->relkind == RELKIND_INDEX && \
41  relation->rd_rel->relam == BRIN_AM_OID), \
42  (relation)->rd_options ? \
43  ((BrinOptions *) (relation)->rd_options)->pagesPerRange : \
44  BRIN_DEFAULT_PAGES_PER_RANGE)
45 #define BrinGetAutoSummarize(relation) \
46  (AssertMacro(relation->rd_rel->relkind == RELKIND_INDEX && \
47  relation->rd_rel->relam == BRIN_AM_OID), \
48  (relation)->rd_options ? \
49  ((BrinOptions *) (relation)->rd_options)->autosummarize : \
50  false)
51 
52 
53 extern void brinGetStats(Relation index, BrinStatsData *stats);
54 
55 #endif /* BRIN_H */
struct BrinStatsData BrinStatsData
bool autosummarize
Definition: brin.h:24
uint32 BlockNumber
Definition: block.h:31
BlockNumber pagesPerRange
Definition: brin.h:23
signed int int32
Definition: c.h:362
Definition: type.h:89
int32 vl_len_
Definition: brin.h:22
BlockNumber pagesPerRange
Definition: brin.h:33
struct BrinOptions BrinOptions
void brinGetStats(Relation index, BrinStatsData *stats)
Definition: brin.c:1086
BlockNumber revmapNumPages
Definition: brin.h:34