1 /*
2  * AM-callable functions for BRIN indexes
3  *
4  * Portions Copyright (c) 1996-2016, 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 "fmgr.h"
14 #include "nodes/execnodes.h"
15 #include "utils/relcache.h"
16 
17 
18 /*
19  * prototypes for functions in brin.c (external entry points for BRIN)
20  */
21 extern Datum brinhandler(PG_FUNCTION_ARGS);
22 extern Datum brin_summarize_new_values(PG_FUNCTION_ARGS);
23 
24 /*
25  * Storage type for BRIN's reloptions
26  */
27 typedef struct BrinOptions
28 {
29 	int32		vl_len_;		/* varlena header (do not touch directly!) */
30 	BlockNumber pagesPerRange;
31 } BrinOptions;
32 
33 #define BRIN_DEFAULT_PAGES_PER_RANGE	128
34 #define BrinGetPagesPerRange(relation) \
35 	((relation)->rd_options ? \
36 	 ((BrinOptions *) (relation)->rd_options)->pagesPerRange : \
37 	  BRIN_DEFAULT_PAGES_PER_RANGE)
38 
39 #endif   /* BRIN_H */
40