gooderp18绿色标准版
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

78 lines
2.1KB

  1. /*--------------------------------------------------------------------------
  2. * gin.h
  3. * Public header file for Generalized Inverted Index access method.
  4. *
  5. * Copyright (c) 2006-2019, PostgreSQL Global Development Group
  6. *
  7. * src/include/access/gin.h
  8. *--------------------------------------------------------------------------
  9. */
  10. #ifndef GIN_H
  11. #define GIN_H
  12. #include "access/xlogreader.h"
  13. #include "lib/stringinfo.h"
  14. #include "storage/block.h"
  15. #include "utils/relcache.h"
  16. /*
  17. * amproc indexes for inverted indexes.
  18. */
  19. #define GIN_COMPARE_PROC 1
  20. #define GIN_EXTRACTVALUE_PROC 2
  21. #define GIN_EXTRACTQUERY_PROC 3
  22. #define GIN_CONSISTENT_PROC 4
  23. #define GIN_COMPARE_PARTIAL_PROC 5
  24. #define GIN_TRICONSISTENT_PROC 6
  25. #define GINNProcs 6
  26. /*
  27. * searchMode settings for extractQueryFn.
  28. */
  29. #define GIN_SEARCH_MODE_DEFAULT 0
  30. #define GIN_SEARCH_MODE_INCLUDE_EMPTY 1
  31. #define GIN_SEARCH_MODE_ALL 2
  32. #define GIN_SEARCH_MODE_EVERYTHING 3 /* for internal use only */
  33. /*
  34. * GinStatsData represents stats data for planner use
  35. */
  36. typedef struct GinStatsData
  37. {
  38. BlockNumber nPendingPages;
  39. BlockNumber nTotalPages;
  40. BlockNumber nEntryPages;
  41. BlockNumber nDataPages;
  42. int64 nEntries;
  43. int32 ginVersion;
  44. } GinStatsData;
  45. /*
  46. * A ternary value used by tri-consistent functions.
  47. *
  48. * This must be of the same size as a bool because some code will cast a
  49. * pointer to a bool to a pointer to a GinTernaryValue.
  50. */
  51. typedef char GinTernaryValue;
  52. #define GIN_FALSE 0 /* item is not present / does not match */
  53. #define GIN_TRUE 1 /* item is present / matches */
  54. #define GIN_MAYBE 2 /* don't know if item is present / don't know
  55. * if matches */
  56. #define DatumGetGinTernaryValue(X) ((GinTernaryValue)(X))
  57. #define GinTernaryValueGetDatum(X) ((Datum)(X))
  58. #define PG_RETURN_GIN_TERNARY_VALUE(x) return GinTernaryValueGetDatum(x)
  59. /* GUC parameters */
  60. extern PGDLLIMPORT int GinFuzzySearchLimit;
  61. extern int gin_pending_list_limit;
  62. /* ginutil.c */
  63. extern void ginGetStats(Relation index, GinStatsData *stats);
  64. extern void ginUpdateStats(Relation index, const GinStatsData *stats,
  65. bool is_build);
  66. #endif /* GIN_H */
上海开阖软件有限公司 沪ICP备12045867号-1