mirror of
https://github.com/postgres/postgres.git
synced 2025-06-14 18:42:34 +03:00
Revert "Include information on buffer usage during planning phase, in EXPLAIN output."
This reverts commit ed7a509571
.
Per buildfarm member prion.
This commit is contained in:
@ -372,11 +372,7 @@ ExplainOneQuery(Query *query, int cursorOptions,
|
|||||||
PlannedStmt *plan;
|
PlannedStmt *plan;
|
||||||
instr_time planstart,
|
instr_time planstart,
|
||||||
planduration;
|
planduration;
|
||||||
BufferUsage bufusage_start,
|
|
||||||
bufusage;
|
|
||||||
|
|
||||||
if (es->buffers)
|
|
||||||
bufusage_start = pgBufferUsage;
|
|
||||||
INSTR_TIME_SET_CURRENT(planstart);
|
INSTR_TIME_SET_CURRENT(planstart);
|
||||||
|
|
||||||
/* plan the query */
|
/* plan the query */
|
||||||
@ -385,16 +381,9 @@ ExplainOneQuery(Query *query, int cursorOptions,
|
|||||||
INSTR_TIME_SET_CURRENT(planduration);
|
INSTR_TIME_SET_CURRENT(planduration);
|
||||||
INSTR_TIME_SUBTRACT(planduration, planstart);
|
INSTR_TIME_SUBTRACT(planduration, planstart);
|
||||||
|
|
||||||
/* calc differences of buffer counters. */
|
|
||||||
if (es->buffers)
|
|
||||||
{
|
|
||||||
memset(&bufusage, 0, sizeof(BufferUsage));
|
|
||||||
BufferUsageAccumDiff(&bufusage, &pgBufferUsage, &bufusage_start);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* run it (if needed) and produce output */
|
/* run it (if needed) and produce output */
|
||||||
ExplainOnePlan(plan, into, es, queryString, params, queryEnv,
|
ExplainOnePlan(plan, into, es, queryString, params, queryEnv,
|
||||||
&planduration, (es->buffers ? &bufusage : NULL));
|
&planduration);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -487,8 +476,7 @@ ExplainOneUtility(Node *utilityStmt, IntoClause *into, ExplainState *es,
|
|||||||
void
|
void
|
||||||
ExplainOnePlan(PlannedStmt *plannedstmt, IntoClause *into, ExplainState *es,
|
ExplainOnePlan(PlannedStmt *plannedstmt, IntoClause *into, ExplainState *es,
|
||||||
const char *queryString, ParamListInfo params,
|
const char *queryString, ParamListInfo params,
|
||||||
QueryEnvironment *queryEnv, const instr_time *planduration,
|
QueryEnvironment *queryEnv, const instr_time *planduration)
|
||||||
const BufferUsage *bufusage)
|
|
||||||
{
|
{
|
||||||
DestReceiver *dest;
|
DestReceiver *dest;
|
||||||
QueryDesc *queryDesc;
|
QueryDesc *queryDesc;
|
||||||
@ -572,9 +560,6 @@ ExplainOnePlan(PlannedStmt *plannedstmt, IntoClause *into, ExplainState *es,
|
|||||||
/* Create textual dump of plan tree */
|
/* Create textual dump of plan tree */
|
||||||
ExplainPrintPlan(es, queryDesc);
|
ExplainPrintPlan(es, queryDesc);
|
||||||
|
|
||||||
if (es->summary && (planduration || bufusage))
|
|
||||||
ExplainOpenGroup("Planning", "Planning", true, es);
|
|
||||||
|
|
||||||
if (es->summary && planduration)
|
if (es->summary && planduration)
|
||||||
{
|
{
|
||||||
double plantime = INSTR_TIME_GET_DOUBLE(*planduration);
|
double plantime = INSTR_TIME_GET_DOUBLE(*planduration);
|
||||||
@ -582,19 +567,6 @@ ExplainOnePlan(PlannedStmt *plannedstmt, IntoClause *into, ExplainState *es,
|
|||||||
ExplainPropertyFloat("Planning Time", "ms", 1000.0 * plantime, 3, es);
|
ExplainPropertyFloat("Planning Time", "ms", 1000.0 * plantime, 3, es);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Show buffer usage */
|
|
||||||
if (es->summary && bufusage)
|
|
||||||
{
|
|
||||||
if (es->format == EXPLAIN_FORMAT_TEXT)
|
|
||||||
es->indent++;
|
|
||||||
show_buffer_usage(es, bufusage);
|
|
||||||
if (es->format == EXPLAIN_FORMAT_TEXT)
|
|
||||||
es->indent--;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (es->summary && (planduration || bufusage))
|
|
||||||
ExplainCloseGroup("Planning", "Planning", true, es);
|
|
||||||
|
|
||||||
/* Print info about runtime of triggers */
|
/* Print info about runtime of triggers */
|
||||||
if (es->analyze)
|
if (es->analyze)
|
||||||
ExplainPrintTriggers(es, queryDesc);
|
ExplainPrintTriggers(es, queryDesc);
|
||||||
|
@ -616,11 +616,7 @@ ExplainExecuteQuery(ExecuteStmt *execstmt, IntoClause *into, ExplainState *es,
|
|||||||
EState *estate = NULL;
|
EState *estate = NULL;
|
||||||
instr_time planstart;
|
instr_time planstart;
|
||||||
instr_time planduration;
|
instr_time planduration;
|
||||||
BufferUsage bufusage_start,
|
|
||||||
bufusage;
|
|
||||||
|
|
||||||
if (es->buffers)
|
|
||||||
bufusage_start = pgBufferUsage;
|
|
||||||
INSTR_TIME_SET_CURRENT(planstart);
|
INSTR_TIME_SET_CURRENT(planstart);
|
||||||
|
|
||||||
/* Look it up in the hash table */
|
/* Look it up in the hash table */
|
||||||
@ -658,13 +654,6 @@ ExplainExecuteQuery(ExecuteStmt *execstmt, IntoClause *into, ExplainState *es,
|
|||||||
INSTR_TIME_SET_CURRENT(planduration);
|
INSTR_TIME_SET_CURRENT(planduration);
|
||||||
INSTR_TIME_SUBTRACT(planduration, planstart);
|
INSTR_TIME_SUBTRACT(planduration, planstart);
|
||||||
|
|
||||||
/* calc differences of buffer counters. */
|
|
||||||
if (es->buffers)
|
|
||||||
{
|
|
||||||
memset(&bufusage, 0, sizeof(BufferUsage));
|
|
||||||
BufferUsageAccumDiff(&bufusage, &pgBufferUsage, &bufusage_start);
|
|
||||||
}
|
|
||||||
|
|
||||||
plan_list = cplan->stmt_list;
|
plan_list = cplan->stmt_list;
|
||||||
|
|
||||||
/* Explain each query */
|
/* Explain each query */
|
||||||
@ -674,7 +663,7 @@ ExplainExecuteQuery(ExecuteStmt *execstmt, IntoClause *into, ExplainState *es,
|
|||||||
|
|
||||||
if (pstmt->commandType != CMD_UTILITY)
|
if (pstmt->commandType != CMD_UTILITY)
|
||||||
ExplainOnePlan(pstmt, into, es, query_string, paramLI, queryEnv,
|
ExplainOnePlan(pstmt, into, es, query_string, paramLI, queryEnv,
|
||||||
&planduration, (es->buffers ? &bufusage : NULL));
|
&planduration);
|
||||||
else
|
else
|
||||||
ExplainOneUtility(pstmt->utilityStmt, into, es, query_string,
|
ExplainOneUtility(pstmt->utilityStmt, into, es, query_string,
|
||||||
paramLI, queryEnv);
|
paramLI, queryEnv);
|
||||||
|
@ -89,8 +89,7 @@ extern void ExplainOneUtility(Node *utilityStmt, IntoClause *into,
|
|||||||
extern void ExplainOnePlan(PlannedStmt *plannedstmt, IntoClause *into,
|
extern void ExplainOnePlan(PlannedStmt *plannedstmt, IntoClause *into,
|
||||||
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);
|
|
||||||
|
|
||||||
extern void ExplainPrintPlan(ExplainState *es, QueryDesc *queryDesc);
|
extern void ExplainPrintPlan(ExplainState *es, QueryDesc *queryDesc);
|
||||||
extern void ExplainPrintTriggers(ExplainState *es, QueryDesc *queryDesc);
|
extern void ExplainPrintTriggers(ExplainState *es, QueryDesc *queryDesc);
|
||||||
|
@ -105,19 +105,7 @@ select explain_filter('explain (analyze, buffers, format json) select * from int
|
|||||||
"Temp Read Blocks": N, +
|
"Temp Read Blocks": N, +
|
||||||
"Temp Written Blocks": N +
|
"Temp Written Blocks": N +
|
||||||
}, +
|
}, +
|
||||||
"Planning": { +
|
"Planning Time": N.N, +
|
||||||
"Planning Time": N.N, +
|
|
||||||
"Shared Hit Blocks": N, +
|
|
||||||
"Shared Read Blocks": N, +
|
|
||||||
"Shared Dirtied Blocks": N, +
|
|
||||||
"Shared Written Blocks": N, +
|
|
||||||
"Local Hit Blocks": N, +
|
|
||||||
"Local Read Blocks": N, +
|
|
||||||
"Local Dirtied Blocks": N, +
|
|
||||||
"Local Written Blocks": N, +
|
|
||||||
"Temp Read Blocks": N, +
|
|
||||||
"Temp Written Blocks": N +
|
|
||||||
}, +
|
|
||||||
"Triggers": [ +
|
"Triggers": [ +
|
||||||
], +
|
], +
|
||||||
"Execution Time": N.N +
|
"Execution Time": N.N +
|
||||||
@ -154,19 +142,7 @@ select explain_filter('explain (analyze, buffers, format xml) select * from int8
|
|||||||
<Temp-Read-Blocks>N</Temp-Read-Blocks> +
|
<Temp-Read-Blocks>N</Temp-Read-Blocks> +
|
||||||
<Temp-Written-Blocks>N</Temp-Written-Blocks> +
|
<Temp-Written-Blocks>N</Temp-Written-Blocks> +
|
||||||
</Plan> +
|
</Plan> +
|
||||||
<Planning> +
|
<Planning-Time>N.N</Planning-Time> +
|
||||||
<Planning-Time>N.N</Planning-Time> +
|
|
||||||
<Shared-Hit-Blocks>N</Shared-Hit-Blocks> +
|
|
||||||
<Shared-Read-Blocks>N</Shared-Read-Blocks> +
|
|
||||||
<Shared-Dirtied-Blocks>N</Shared-Dirtied-Blocks>+
|
|
||||||
<Shared-Written-Blocks>N</Shared-Written-Blocks>+
|
|
||||||
<Local-Hit-Blocks>N</Local-Hit-Blocks> +
|
|
||||||
<Local-Read-Blocks>N</Local-Read-Blocks> +
|
|
||||||
<Local-Dirtied-Blocks>N</Local-Dirtied-Blocks> +
|
|
||||||
<Local-Written-Blocks>N</Local-Written-Blocks> +
|
|
||||||
<Temp-Read-Blocks>N</Temp-Read-Blocks> +
|
|
||||||
<Temp-Written-Blocks>N</Temp-Written-Blocks> +
|
|
||||||
</Planning> +
|
|
||||||
<Triggers> +
|
<Triggers> +
|
||||||
</Triggers> +
|
</Triggers> +
|
||||||
<Execution-Time>N.N</Execution-Time> +
|
<Execution-Time>N.N</Execution-Time> +
|
||||||
@ -200,18 +176,7 @@ select explain_filter('explain (analyze, buffers, format yaml) select * from int
|
|||||||
Local Written Blocks: N +
|
Local Written Blocks: N +
|
||||||
Temp Read Blocks: N +
|
Temp Read Blocks: N +
|
||||||
Temp Written Blocks: N +
|
Temp Written Blocks: N +
|
||||||
Planning: +
|
Planning Time: N.N +
|
||||||
Planning Time: N.N +
|
|
||||||
Shared Hit Blocks: N +
|
|
||||||
Shared Read Blocks: N +
|
|
||||||
Shared Dirtied Blocks: N +
|
|
||||||
Shared Written Blocks: N +
|
|
||||||
Local Hit Blocks: N +
|
|
||||||
Local Read Blocks: N +
|
|
||||||
Local Dirtied Blocks: N +
|
|
||||||
Local Written Blocks: N +
|
|
||||||
Temp Read Blocks: N +
|
|
||||||
Temp Written Blocks: N +
|
|
||||||
Triggers: +
|
Triggers: +
|
||||||
Execution Time: N.N
|
Execution Time: N.N
|
||||||
(1 row)
|
(1 row)
|
||||||
@ -401,21 +366,9 @@ select jsonb_pretty(
|
|||||||
"Shared Dirtied Blocks": 0, +
|
"Shared Dirtied Blocks": 0, +
|
||||||
"Shared Written Blocks": 0 +
|
"Shared Written Blocks": 0 +
|
||||||
}, +
|
}, +
|
||||||
"Planning": { +
|
|
||||||
"Planning Time": 0.0, +
|
|
||||||
"Local Hit Blocks": 0, +
|
|
||||||
"Temp Read Blocks": 0, +
|
|
||||||
"Local Read Blocks": 0, +
|
|
||||||
"Shared Hit Blocks": 0, +
|
|
||||||
"Shared Read Blocks": 0, +
|
|
||||||
"Temp Written Blocks": 0, +
|
|
||||||
"Local Dirtied Blocks": 0, +
|
|
||||||
"Local Written Blocks": 0, +
|
|
||||||
"Shared Dirtied Blocks": 0, +
|
|
||||||
"Shared Written Blocks": 0 +
|
|
||||||
}, +
|
|
||||||
"Triggers": [ +
|
"Triggers": [ +
|
||||||
], +
|
], +
|
||||||
|
"Planning Time": 0.0, +
|
||||||
"Execution Time": 0.0 +
|
"Execution Time": 0.0 +
|
||||||
} +
|
} +
|
||||||
]
|
]
|
||||||
|
Reference in New Issue
Block a user