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-2024, 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 "storage/shm_toc.h"
15 #include "utils/relcache.h"
16 
17 
18 /*
19  * Storage type for BRIN's reloptions
20  */
21 typedef struct BrinOptions
22 {
23  int32 vl_len_; /* varlena header (do not touch directly!) */
27 
28 
29 /*
30  * BrinStatsData represents stats data for planner use
31  */
32 typedef struct BrinStatsData
33 {
37 
38 
39 #define BRIN_DEFAULT_PAGES_PER_RANGE 128
40 #define BrinGetPagesPerRange(relation) \
41  (AssertMacro(relation->rd_rel->relkind == RELKIND_INDEX && \
42  relation->rd_rel->relam == BRIN_AM_OID), \
43  (relation)->rd_options ? \
44  ((BrinOptions *) (relation)->rd_options)->pagesPerRange : \
45  BRIN_DEFAULT_PAGES_PER_RANGE)
46 #define BrinGetAutoSummarize(relation) \
47  (AssertMacro(relation->rd_rel->relkind == RELKIND_INDEX && \
48  relation->rd_rel->relam == BRIN_AM_OID), \
49  (relation)->rd_options ? \
50  ((BrinOptions *) (relation)->rd_options)->autosummarize : \
51  false)
52 
53 
54 extern void brinGetStats(Relation index, BrinStatsData *stats);
55 
56 extern void _brin_parallel_build_main(dsm_segment *seg, shm_toc *toc);
57 
58 #endif /* BRIN_H */
uint32 BlockNumber
Definition: block.h:31
struct BrinOptions BrinOptions
struct BrinStatsData BrinStatsData
void brinGetStats(Relation index, BrinStatsData *stats)
Definition: brin.c:1640
void _brin_parallel_build_main(dsm_segment *seg, shm_toc *toc)
Definition: brin.c:2855
signed int int32
Definition: c.h:497
bool autosummarize
Definition: brin.h:25
BlockNumber pagesPerRange
Definition: brin.h:24
int32 vl_len_
Definition: brin.h:23
BlockNumber revmapNumPages
Definition: brin.h:35
BlockNumber pagesPerRange
Definition: brin.h:34
Definition: type.h:95