brin.h 948 B

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