mirror of https://github.com/citusdata/citus.git
Use finishedPreScan to check if sub plans are already executed
parent
369d636b22
commit
fb33900669
|
@ -190,7 +190,7 @@ typedef struct SerializeDestReceiver
|
||||||
|
|
||||||
/* Explain functions for distributed queries */
|
/* Explain functions for distributed queries */
|
||||||
static void ExplainSubPlans(DistributedPlan *distributedPlan, ExplainState *es,
|
static void ExplainSubPlans(DistributedPlan *distributedPlan, ExplainState *es,
|
||||||
bool queryExecuted);
|
bool subPlansExecuted);
|
||||||
static void ExplainJob(CitusScanState *scanState, Job *job, ExplainState *es,
|
static void ExplainJob(CitusScanState *scanState, Job *job, ExplainState *es,
|
||||||
ParamListInfo params);
|
ParamListInfo params);
|
||||||
static void ExplainMapMergeJob(MapMergeJob *mapMergeJob, ExplainState *es);
|
static void ExplainMapMergeJob(MapMergeJob *mapMergeJob, ExplainState *es);
|
||||||
|
@ -297,7 +297,7 @@ CitusExplainScan(CustomScanState *node, List *ancestors, struct ExplainState *es
|
||||||
|
|
||||||
if (distributedPlan->subPlanList != NIL)
|
if (distributedPlan->subPlanList != NIL)
|
||||||
{
|
{
|
||||||
ExplainSubPlans(distributedPlan, es, scanState->finishedRemoteScan);
|
ExplainSubPlans(distributedPlan, es, scanState->finishedPreScan);
|
||||||
}
|
}
|
||||||
|
|
||||||
ExplainJob(scanState, distributedPlan->workerJob, es, params);
|
ExplainJob(scanState, distributedPlan->workerJob, es, params);
|
||||||
|
@ -435,7 +435,7 @@ NonPushableMergeCommandExplainScan(CustomScanState *node, List *ancestors,
|
||||||
* planning time and set it to 0.
|
* planning time and set it to 0.
|
||||||
*/
|
*/
|
||||||
static void
|
static void
|
||||||
ExplainSubPlans(DistributedPlan *distributedPlan, ExplainState *es, bool queryExecuted)
|
ExplainSubPlans(DistributedPlan *distributedPlan, ExplainState *es, bool subPlansExecuted)
|
||||||
{
|
{
|
||||||
ListCell *subPlanCell = NULL;
|
ListCell *subPlanCell = NULL;
|
||||||
uint64 planId = distributedPlan->planId;
|
uint64 planId = distributedPlan->planId;
|
||||||
|
@ -445,7 +445,7 @@ ExplainSubPlans(DistributedPlan *distributedPlan, ExplainState *es, bool queryEx
|
||||||
|
|
||||||
ExplainOpenGroup("Subplans", "Subplans", false, es);
|
ExplainOpenGroup("Subplans", "Subplans", false, es);
|
||||||
|
|
||||||
if (queryExecuted)
|
if (subPlansExecuted)
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* Subplans are already executed recursively when
|
* Subplans are already executed recursively when
|
||||||
|
@ -570,7 +570,7 @@ ExplainSubPlans(DistributedPlan *distributedPlan, ExplainState *es, bool queryEx
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Restore the settings */
|
/* Restore the settings */
|
||||||
if (queryExecuted)
|
if (subPlansExecuted)
|
||||||
{
|
{
|
||||||
es->analyze = analyzeEnabled;
|
es->analyze = analyzeEnabled;
|
||||||
es->timing = timingEnabled;
|
es->timing = timingEnabled;
|
||||||
|
@ -602,6 +602,7 @@ static bool
|
||||||
ShowReceivedTupleData(CitusScanState *scanState, ExplainState *es)
|
ShowReceivedTupleData(CitusScanState *scanState, ExplainState *es)
|
||||||
{
|
{
|
||||||
TupleDesc tupDesc = ScanStateGetTupleDescriptor(scanState);
|
TupleDesc tupDesc = ScanStateGetTupleDescriptor(scanState);
|
||||||
|
|
||||||
return es->analyze && tupDesc != NULL && tupDesc->natts > 0;
|
return es->analyze && tupDesc != NULL && tupDesc->natts > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue