mirror of
https://github.com/postgres/postgres.git
synced 2025-10-18 04:29:09 +03:00
Improve ExplainState type handling in header files
Now that we can have repeat typedefs with C11, we don't need to use "struct ExplainState" anymore but can instead make a typedef where necessary. This doesn't change anything but makes it look nicer. (There are more opportunities for similar changes, but this is broken out because there was a separate discussion about it, and it's somewhat bulky on its own.) Reviewed-by: Chao Li <li.evan.chao@gmail.com> Discussion: https://www.postgresql.org/message-id/flat/f36c0a45-98cd-40b2-a7cc-f2bf02b12890%40eisentraut.org#a12fb1a2c1089d6d03010f6268871b00 Discussion: https://www.postgresql.org/message-id/flat/10d32190-f31b-40a5-b177-11db55597355@eisentraut.org
This commit is contained in:
@@ -1320,7 +1320,7 @@ ExplainForeignModify(ModifyTableState *mtstate,
|
|||||||
ResultRelInfo *rinfo,
|
ResultRelInfo *rinfo,
|
||||||
List *fdw_private,
|
List *fdw_private,
|
||||||
int subplan_index,
|
int subplan_index,
|
||||||
struct ExplainState *es);
|
ExplainState *es);
|
||||||
</programlisting>
|
</programlisting>
|
||||||
|
|
||||||
Print additional <command>EXPLAIN</command> output for a foreign table update.
|
Print additional <command>EXPLAIN</command> output for a foreign table update.
|
||||||
|
@@ -16,13 +16,13 @@
|
|||||||
#include "executor/executor.h"
|
#include "executor/executor.h"
|
||||||
#include "parser/parse_node.h"
|
#include "parser/parse_node.h"
|
||||||
|
|
||||||
struct ExplainState; /* defined in explain_state.h */
|
typedef struct ExplainState ExplainState; /* defined in explain_state.h */
|
||||||
|
|
||||||
/* Hook for plugins to get control in ExplainOneQuery() */
|
/* Hook for plugins to get control in ExplainOneQuery() */
|
||||||
typedef void (*ExplainOneQuery_hook_type) (Query *query,
|
typedef void (*ExplainOneQuery_hook_type) (Query *query,
|
||||||
int cursorOptions,
|
int cursorOptions,
|
||||||
IntoClause *into,
|
IntoClause *into,
|
||||||
struct ExplainState *es,
|
ExplainState *es,
|
||||||
const char *queryString,
|
const char *queryString,
|
||||||
ParamListInfo params,
|
ParamListInfo params,
|
||||||
QueryEnvironment *queryEnv);
|
QueryEnvironment *queryEnv);
|
||||||
@@ -31,7 +31,7 @@ extern PGDLLIMPORT ExplainOneQuery_hook_type ExplainOneQuery_hook;
|
|||||||
/* Hook for EXPLAIN plugins to print extra information for each plan */
|
/* Hook for EXPLAIN plugins to print extra information for each plan */
|
||||||
typedef void (*explain_per_plan_hook_type) (PlannedStmt *plannedstmt,
|
typedef void (*explain_per_plan_hook_type) (PlannedStmt *plannedstmt,
|
||||||
IntoClause *into,
|
IntoClause *into,
|
||||||
struct ExplainState *es,
|
ExplainState *es,
|
||||||
const char *queryString,
|
const char *queryString,
|
||||||
ParamListInfo params,
|
ParamListInfo params,
|
||||||
QueryEnvironment *queryEnv);
|
QueryEnvironment *queryEnv);
|
||||||
@@ -42,7 +42,7 @@ typedef void (*explain_per_node_hook_type) (PlanState *planstate,
|
|||||||
List *ancestors,
|
List *ancestors,
|
||||||
const char *relationship,
|
const char *relationship,
|
||||||
const char *plan_name,
|
const char *plan_name,
|
||||||
struct ExplainState *es);
|
ExplainState *es);
|
||||||
extern PGDLLIMPORT explain_per_node_hook_type explain_per_node_hook;
|
extern PGDLLIMPORT explain_per_node_hook_type explain_per_node_hook;
|
||||||
|
|
||||||
/* Hook for plugins to get control in explain_get_index_name() */
|
/* Hook for plugins to get control in explain_get_index_name() */
|
||||||
@@ -53,32 +53,32 @@ extern PGDLLIMPORT explain_get_index_name_hook_type explain_get_index_name_hook;
|
|||||||
extern void ExplainQuery(ParseState *pstate, ExplainStmt *stmt,
|
extern void ExplainQuery(ParseState *pstate, ExplainStmt *stmt,
|
||||||
ParamListInfo params, DestReceiver *dest);
|
ParamListInfo params, DestReceiver *dest);
|
||||||
extern void standard_ExplainOneQuery(Query *query, int cursorOptions,
|
extern void standard_ExplainOneQuery(Query *query, int cursorOptions,
|
||||||
IntoClause *into, struct ExplainState *es,
|
IntoClause *into, ExplainState *es,
|
||||||
const char *queryString, ParamListInfo params,
|
const char *queryString, ParamListInfo params,
|
||||||
QueryEnvironment *queryEnv);
|
QueryEnvironment *queryEnv);
|
||||||
|
|
||||||
extern TupleDesc ExplainResultDesc(ExplainStmt *stmt);
|
extern TupleDesc ExplainResultDesc(ExplainStmt *stmt);
|
||||||
|
|
||||||
extern void ExplainOneUtility(Node *utilityStmt, IntoClause *into,
|
extern void ExplainOneUtility(Node *utilityStmt, IntoClause *into,
|
||||||
struct ExplainState *es, ParseState *pstate,
|
ExplainState *es, ParseState *pstate,
|
||||||
ParamListInfo params);
|
ParamListInfo params);
|
||||||
|
|
||||||
extern void ExplainOnePlan(PlannedStmt *plannedstmt, IntoClause *into,
|
extern void ExplainOnePlan(PlannedStmt *plannedstmt, IntoClause *into,
|
||||||
struct ExplainState *es, const char *queryString,
|
ExplainState *es, const char *queryString,
|
||||||
ParamListInfo params, QueryEnvironment *queryEnv,
|
ParamListInfo params, QueryEnvironment *queryEnv,
|
||||||
const instr_time *planduration,
|
const instr_time *planduration,
|
||||||
const BufferUsage *bufusage,
|
const BufferUsage *bufusage,
|
||||||
const MemoryContextCounters *mem_counters);
|
const MemoryContextCounters *mem_counters);
|
||||||
|
|
||||||
extern void ExplainPrintPlan(struct ExplainState *es, QueryDesc *queryDesc);
|
extern void ExplainPrintPlan(ExplainState *es, QueryDesc *queryDesc);
|
||||||
extern void ExplainPrintTriggers(struct ExplainState *es,
|
extern void ExplainPrintTriggers(ExplainState *es,
|
||||||
QueryDesc *queryDesc);
|
QueryDesc *queryDesc);
|
||||||
|
|
||||||
extern void ExplainPrintJITSummary(struct ExplainState *es,
|
extern void ExplainPrintJITSummary(ExplainState *es,
|
||||||
QueryDesc *queryDesc);
|
QueryDesc *queryDesc);
|
||||||
|
|
||||||
extern void ExplainQueryText(struct ExplainState *es, QueryDesc *queryDesc);
|
extern void ExplainQueryText(ExplainState *es, QueryDesc *queryDesc);
|
||||||
extern void ExplainQueryParameters(struct ExplainState *es,
|
extern void ExplainQueryParameters(ExplainState *es,
|
||||||
ParamListInfo params, int maxlen);
|
ParamListInfo params, int maxlen);
|
||||||
|
|
||||||
#endif /* EXPLAIN_H */
|
#endif /* EXPLAIN_H */
|
||||||
|
@@ -16,7 +16,8 @@
|
|||||||
#include "executor/instrument.h"
|
#include "executor/instrument.h"
|
||||||
#include "tcop/dest.h"
|
#include "tcop/dest.h"
|
||||||
|
|
||||||
struct ExplainState; /* avoid including explain.h here */
|
/* avoid including explain_state.h here */
|
||||||
|
typedef struct ExplainState ExplainState;
|
||||||
|
|
||||||
/* Instrumentation data for EXPLAIN's SERIALIZE option */
|
/* Instrumentation data for EXPLAIN's SERIALIZE option */
|
||||||
typedef struct SerializeMetrics
|
typedef struct SerializeMetrics
|
||||||
@@ -26,7 +27,7 @@ typedef struct SerializeMetrics
|
|||||||
BufferUsage bufferUsage; /* buffers accessed during serialization */
|
BufferUsage bufferUsage; /* buffers accessed during serialization */
|
||||||
} SerializeMetrics;
|
} SerializeMetrics;
|
||||||
|
|
||||||
extern DestReceiver *CreateExplainSerializeDestReceiver(struct ExplainState *es);
|
extern DestReceiver *CreateExplainSerializeDestReceiver(ExplainState *es);
|
||||||
extern SerializeMetrics GetSerializationMetrics(DestReceiver *dest);
|
extern SerializeMetrics GetSerializationMetrics(DestReceiver *dest);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -15,44 +15,45 @@
|
|||||||
|
|
||||||
#include "nodes/pg_list.h"
|
#include "nodes/pg_list.h"
|
||||||
|
|
||||||
struct ExplainState; /* avoid including explain.h here */
|
/* avoid including explain_state.h here */
|
||||||
|
typedef struct ExplainState ExplainState;
|
||||||
|
|
||||||
extern void ExplainPropertyList(const char *qlabel, List *data,
|
extern void ExplainPropertyList(const char *qlabel, List *data,
|
||||||
struct ExplainState *es);
|
ExplainState *es);
|
||||||
extern void ExplainPropertyListNested(const char *qlabel, List *data,
|
extern void ExplainPropertyListNested(const char *qlabel, List *data,
|
||||||
struct ExplainState *es);
|
ExplainState *es);
|
||||||
extern void ExplainPropertyText(const char *qlabel, const char *value,
|
extern void ExplainPropertyText(const char *qlabel, const char *value,
|
||||||
struct ExplainState *es);
|
ExplainState *es);
|
||||||
extern void ExplainPropertyInteger(const char *qlabel, const char *unit,
|
extern void ExplainPropertyInteger(const char *qlabel, const char *unit,
|
||||||
int64 value, struct ExplainState *es);
|
int64 value, ExplainState *es);
|
||||||
extern void ExplainPropertyUInteger(const char *qlabel, const char *unit,
|
extern void ExplainPropertyUInteger(const char *qlabel, const char *unit,
|
||||||
uint64 value, struct ExplainState *es);
|
uint64 value, ExplainState *es);
|
||||||
extern void ExplainPropertyFloat(const char *qlabel, const char *unit,
|
extern void ExplainPropertyFloat(const char *qlabel, const char *unit,
|
||||||
double value, int ndigits,
|
double value, int ndigits,
|
||||||
struct ExplainState *es);
|
ExplainState *es);
|
||||||
extern void ExplainPropertyBool(const char *qlabel, bool value,
|
extern void ExplainPropertyBool(const char *qlabel, bool value,
|
||||||
struct ExplainState *es);
|
ExplainState *es);
|
||||||
|
|
||||||
extern void ExplainOpenGroup(const char *objtype, const char *labelname,
|
extern void ExplainOpenGroup(const char *objtype, const char *labelname,
|
||||||
bool labeled, struct ExplainState *es);
|
bool labeled, ExplainState *es);
|
||||||
extern void ExplainCloseGroup(const char *objtype, const char *labelname,
|
extern void ExplainCloseGroup(const char *objtype, const char *labelname,
|
||||||
bool labeled, struct ExplainState *es);
|
bool labeled, ExplainState *es);
|
||||||
|
|
||||||
extern void ExplainOpenSetAsideGroup(const char *objtype, const char *labelname,
|
extern void ExplainOpenSetAsideGroup(const char *objtype, const char *labelname,
|
||||||
bool labeled, int depth,
|
bool labeled, int depth,
|
||||||
struct ExplainState *es);
|
ExplainState *es);
|
||||||
extern void ExplainSaveGroup(struct ExplainState *es, int depth,
|
extern void ExplainSaveGroup(ExplainState *es, int depth,
|
||||||
int *state_save);
|
int *state_save);
|
||||||
extern void ExplainRestoreGroup(struct ExplainState *es, int depth,
|
extern void ExplainRestoreGroup(ExplainState *es, int depth,
|
||||||
int *state_save);
|
int *state_save);
|
||||||
|
|
||||||
extern void ExplainDummyGroup(const char *objtype, const char *labelname,
|
extern void ExplainDummyGroup(const char *objtype, const char *labelname,
|
||||||
struct ExplainState *es);
|
ExplainState *es);
|
||||||
|
|
||||||
extern void ExplainBeginOutput(struct ExplainState *es);
|
extern void ExplainBeginOutput(ExplainState *es);
|
||||||
extern void ExplainEndOutput(struct ExplainState *es);
|
extern void ExplainEndOutput(ExplainState *es);
|
||||||
extern void ExplainSeparatePlans(struct ExplainState *es);
|
extern void ExplainSeparatePlans(ExplainState *es);
|
||||||
|
|
||||||
extern void ExplainIndentText(struct ExplainState *es);
|
extern void ExplainIndentText(ExplainState *es);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@@ -79,7 +79,7 @@ typedef struct ExplainState
|
|||||||
typedef void (*ExplainOptionHandler) (ExplainState *, DefElem *, ParseState *);
|
typedef void (*ExplainOptionHandler) (ExplainState *, DefElem *, ParseState *);
|
||||||
|
|
||||||
/* Hook to perform additional EXPLAIN options validation */
|
/* Hook to perform additional EXPLAIN options validation */
|
||||||
typedef void (*explain_validate_options_hook_type) (struct ExplainState *es, List *options,
|
typedef void (*explain_validate_options_hook_type) (ExplainState *es, List *options,
|
||||||
ParseState *pstate);
|
ParseState *pstate);
|
||||||
extern PGDLLIMPORT explain_validate_options_hook_type explain_validate_options_hook;
|
extern PGDLLIMPORT explain_validate_options_hook_type explain_validate_options_hook;
|
||||||
|
|
||||||
|
@@ -16,8 +16,8 @@
|
|||||||
#include "nodes/execnodes.h"
|
#include "nodes/execnodes.h"
|
||||||
#include "nodes/pathnodes.h"
|
#include "nodes/pathnodes.h"
|
||||||
|
|
||||||
/* To avoid including explain.h here, reference ExplainState thus: */
|
/* avoid including explain_state.h here */
|
||||||
struct ExplainState;
|
typedef struct ExplainState ExplainState;
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@@ -137,16 +137,16 @@ typedef void (*RefetchForeignRow_function) (EState *estate,
|
|||||||
bool *updated);
|
bool *updated);
|
||||||
|
|
||||||
typedef void (*ExplainForeignScan_function) (ForeignScanState *node,
|
typedef void (*ExplainForeignScan_function) (ForeignScanState *node,
|
||||||
struct ExplainState *es);
|
ExplainState *es);
|
||||||
|
|
||||||
typedef void (*ExplainForeignModify_function) (ModifyTableState *mtstate,
|
typedef void (*ExplainForeignModify_function) (ModifyTableState *mtstate,
|
||||||
ResultRelInfo *rinfo,
|
ResultRelInfo *rinfo,
|
||||||
List *fdw_private,
|
List *fdw_private,
|
||||||
int subplan_index,
|
int subplan_index,
|
||||||
struct ExplainState *es);
|
ExplainState *es);
|
||||||
|
|
||||||
typedef void (*ExplainDirectModify_function) (ForeignScanState *node,
|
typedef void (*ExplainDirectModify_function) (ForeignScanState *node,
|
||||||
struct ExplainState *es);
|
ExplainState *es);
|
||||||
|
|
||||||
typedef int (*AcquireSampleRowsFunc) (Relation relation, int elevel,
|
typedef int (*AcquireSampleRowsFunc) (Relation relation, int elevel,
|
||||||
HeapTuple *rows, int targrows,
|
HeapTuple *rows, int targrows,
|
||||||
|
Reference in New Issue
Block a user