25 .
name =
"pg_overexplain",
41 const char *relationship,
42 const char *plan_name,
47 const char *queryString,
135 const char *relationship,
const char *plan_name,
142 (*prev_explain_per_node_hook) (planstate, ancestors, relationship,
199 case T_IndexOnlyScan:
200 case T_BitmapHeapScan:
205 case T_TableFuncScan:
208 case T_NamedTuplestoreScan:
209 case T_WorkTableScan:
255 const char *queryString,
262 (*prev_explain_per_plan_hook) (plannedstmt, into, es, queryString,
287 char *commandType = NULL;
303 commandType =
"unknown";
306 commandType =
"select";
309 commandType =
"update";
312 commandType =
"insert";
315 commandType =
"delete";
318 commandType =
"merge";
321 commandType =
"utility";
324 commandType =
"nothing";
361 else if (plannedstmt->
stmt_len == 0)
426 kind =
"namedtuplestore";
448 rte->
inh ?
", inherited" :
"",
449 rte->inFromCl ?
", in-from-clause" :
"");
461 if (rte->alias != NULL)
473 const char *qualname;
493 switch (rte->relkind)
495 case RELKIND_RELATION:
496 relkind =
"relation";
501 case RELKIND_SEQUENCE:
502 relkind =
"sequence";
504 case RELKIND_TOASTVALUE:
505 relkind =
"toastvalue";
510 case RELKIND_MATVIEW:
513 case RELKIND_COMPOSITE_TYPE:
514 relkind =
"composite_type";
516 case RELKIND_FOREIGN_TABLE:
517 relkind =
"foreign_table";
519 case RELKIND_PARTITIONED_TABLE:
520 relkind =
"parititioned_table";
522 case RELKIND_PARTITIONED_INDEX:
523 relkind =
"parititioned_index";
529 relkind =
psprintf(
"%c", rte->relkind);
538 if (rte->rellockmode != 0)
541 rte->rellockmode), es);
549 if (rte->perminfoindex != 0)
551 rte->perminfoindex, es);
592 jointype =
"Right Semi";
595 jointype =
"Right Anti";
608 rte->joinmergedcols, es);
int bms_next_member(const Bitmapset *a, int prevbit)
bool defGetBoolean(DefElem *def)
explain_per_node_hook_type explain_per_node_hook
explain_per_plan_hook_type explain_per_plan_hook
void(* explain_per_plan_hook_type)(PlannedStmt *plannedstmt, IntoClause *into, struct ExplainState *es, const char *queryString, ParamListInfo params, QueryEnvironment *queryEnv)
void(* explain_per_node_hook_type)(PlanState *planstate, List *ancestors, const char *relationship, const char *plan_name, struct ExplainState *es)
int GetExplainExtensionId(const char *extension_name)
void * GetExplainExtensionState(ExplainState *es, int extension_id)
void SetExplainExtensionState(ExplainState *es, int extension_id, void *opaque)
void RegisterExtensionExplainOption(const char *option_name, ExplainOptionHandler handler)
Assert(PointerIsAligned(start, uint64))
const char * GetLockmodeName(LOCKMETHODID lockmethodid, LOCKMODE mode)
#define DEFAULT_LOCKMETHOD
char * get_rel_name(Oid relid)
Oid get_rel_namespace(Oid relid)
char * get_namespace_name_or_temp(Oid nspid)
void pfree(void *pointer)
void * palloc0(Size size)
#define IsA(nodeptr, _type_)
#define rt_fetch(rangetable_index, rangetable)
static int list_length(const List *l)
#define foreach_xid(var, lst)
#define foreach_node(type, var, lst)
#define foreach_oid(var, lst)
#define foreach_int(var, lst)
static void overexplain_per_plan_hook(PlannedStmt *plannedstmt, IntoClause *into, ExplainState *es, const char *queryString, ParamListInfo params, QueryEnvironment *queryEnv)
static void overexplain_bitmapset(const char *qlabel, Bitmapset *bms, ExplainState *es)
static void overexplain_range_table(PlannedStmt *plannedstmt, ExplainState *es)
static explain_per_plan_hook_type prev_explain_per_plan_hook
static explain_per_node_hook_type prev_explain_per_node_hook
static overexplain_options * overexplain_ensure_options(ExplainState *es)
static void overexplain_per_node_hook(PlanState *planstate, List *ancestors, const char *relationship, const char *plan_name, ExplainState *es)
PG_MODULE_MAGIC_EXT(.name="pg_overexplain",.version=PG_VERSION)
static void overexplain_debug_handler(ExplainState *es, DefElem *opt, ParseState *pstate)
static void overexplain_intlist(const char *qlabel, List *intlist, ExplainState *es)
static void overexplain_alias(const char *qlabel, Alias *alias, ExplainState *es)
static int es_extension_id
static void overexplain_debug(PlannedStmt *plannedstmt, ExplainState *es)
static void overexplain_range_table_handler(ExplainState *es, DefElem *opt, ParseState *pstate)
char * psprintf(const char *fmt,...)
const char * quote_identifier(const char *ident)
void appendStringInfo(StringInfo str, const char *fmt,...)
void appendStringInfoChar(StringInfo str, char ch)
void initStringInfo(StringInfo str)
Bitmapset * rewindPlanIDs
Bitmapset * unprunableRelids