gooderp18绿色标准版
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

114 行
4.3KB

  1. /*-------------------------------------------------------------------------
  2. *
  3. * explain.h
  4. * prototypes for explain.c
  5. *
  6. * Portions Copyright (c) 1996-2019, PostgreSQL Global Development Group
  7. * Portions Copyright (c) 1994-5, Regents of the University of California
  8. *
  9. * src/include/commands/explain.h
  10. *
  11. *-------------------------------------------------------------------------
  12. */
  13. #ifndef EXPLAIN_H
  14. #define EXPLAIN_H
  15. #include "executor/executor.h"
  16. #include "lib/stringinfo.h"
  17. #include "parser/parse_node.h"
  18. typedef enum ExplainFormat
  19. {
  20. EXPLAIN_FORMAT_TEXT,
  21. EXPLAIN_FORMAT_XML,
  22. EXPLAIN_FORMAT_JSON,
  23. EXPLAIN_FORMAT_YAML
  24. } ExplainFormat;
  25. typedef struct ExplainState
  26. {
  27. StringInfo str; /* output buffer */
  28. /* options */
  29. bool verbose; /* be verbose */
  30. bool analyze; /* print actual times */
  31. bool costs; /* print estimated costs */
  32. bool buffers; /* print buffer usage */
  33. bool timing; /* print detailed node timing */
  34. bool summary; /* print total planning and execution timing */
  35. bool settings; /* print modified settings */
  36. ExplainFormat format; /* output format */
  37. /* state for output formatting --- not reset for each new plan tree */
  38. int indent; /* current indentation level */
  39. List *grouping_stack; /* format-specific grouping state */
  40. /* state related to the current plan tree (filled by ExplainPrintPlan) */
  41. PlannedStmt *pstmt; /* top of plan */
  42. List *rtable; /* range table */
  43. List *rtable_names; /* alias names for RTEs */
  44. List *deparse_cxt; /* context list for deparsing expressions */
  45. Bitmapset *printed_subplans; /* ids of SubPlans we've printed */
  46. } ExplainState;
  47. /* Hook for plugins to get control in ExplainOneQuery() */
  48. typedef void (*ExplainOneQuery_hook_type) (Query *query,
  49. int cursorOptions,
  50. IntoClause *into,
  51. ExplainState *es,
  52. const char *queryString,
  53. ParamListInfo params,
  54. QueryEnvironment *queryEnv);
  55. extern PGDLLIMPORT ExplainOneQuery_hook_type ExplainOneQuery_hook;
  56. /* Hook for plugins to get control in explain_get_index_name() */
  57. typedef const char *(*explain_get_index_name_hook_type) (Oid indexId);
  58. extern PGDLLIMPORT explain_get_index_name_hook_type explain_get_index_name_hook;
  59. extern void ExplainQuery(ParseState *pstate, ExplainStmt *stmt, const char *queryString,
  60. ParamListInfo params, QueryEnvironment *queryEnv, DestReceiver *dest);
  61. extern ExplainState *NewExplainState(void);
  62. extern TupleDesc ExplainResultDesc(ExplainStmt *stmt);
  63. extern void ExplainOneUtility(Node *utilityStmt, IntoClause *into,
  64. ExplainState *es, const char *queryString,
  65. ParamListInfo params, QueryEnvironment *queryEnv);
  66. extern void ExplainOnePlan(PlannedStmt *plannedstmt, IntoClause *into,
  67. ExplainState *es, const char *queryString,
  68. ParamListInfo params, QueryEnvironment *queryEnv,
  69. const instr_time *planduration);
  70. extern void ExplainPrintPlan(ExplainState *es, QueryDesc *queryDesc);
  71. extern void ExplainPrintTriggers(ExplainState *es, QueryDesc *queryDesc);
  72. extern void ExplainPrintJITSummary(ExplainState *es, QueryDesc *queryDesc);
  73. extern void ExplainPrintJIT(ExplainState *es, int jit_flags,
  74. struct JitInstrumentation *jit_instr, int worker_i);
  75. extern void ExplainQueryText(ExplainState *es, QueryDesc *queryDesc);
  76. extern void ExplainBeginOutput(ExplainState *es);
  77. extern void ExplainEndOutput(ExplainState *es);
  78. extern void ExplainSeparatePlans(ExplainState *es);
  79. extern void ExplainPropertyList(const char *qlabel, List *data,
  80. ExplainState *es);
  81. extern void ExplainPropertyListNested(const char *qlabel, List *data,
  82. ExplainState *es);
  83. extern void ExplainPropertyText(const char *qlabel, const char *value,
  84. ExplainState *es);
  85. extern void ExplainPropertyInteger(const char *qlabel, const char *unit,
  86. int64 value, ExplainState *es);
  87. extern void ExplainPropertyFloat(const char *qlabel, const char *unit,
  88. double value, int ndigits, ExplainState *es);
  89. extern void ExplainPropertyBool(const char *qlabel, bool value,
  90. ExplainState *es);
  91. extern void ExplainOpenGroup(const char *objtype, const char *labelname,
  92. bool labeled, ExplainState *es);
  93. extern void ExplainCloseGroup(const char *objtype, const char *labelname,
  94. bool labeled, ExplainState *es);
  95. #endif /* EXPLAIN_H */
上海开阖软件有限公司 沪ICP备12045867号-1