aboutsummaryrefslogtreecommitdiff
path: root/src/backend/commands/explain.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/commands/explain.c')
-rw-r--r--src/backend/commands/explain.c46
1 files changed, 29 insertions, 17 deletions
diff --git a/src/backend/commands/explain.c b/src/backend/commands/explain.c
index 9827c39e09d..25d8ca075d4 100644
--- a/src/backend/commands/explain.c
+++ b/src/backend/commands/explain.c
@@ -909,24 +909,36 @@ ExplainNode(PlanState *planstate, List *ancestors,
break;
case T_Agg:
sname = "Aggregate";
- switch (((Agg *) plan)->aggstrategy)
{
- case AGG_PLAIN:
- pname = "Aggregate";
- strategy = "Plain";
- break;
- case AGG_SORTED:
- pname = "GroupAggregate";
- strategy = "Sorted";
- break;
- case AGG_HASHED:
- pname = "HashAggregate";
- strategy = "Hashed";
- break;
- default:
- pname = "Aggregate ???";
- strategy = "???";
- break;
+ Agg *agg = (Agg *) plan;
+
+ if (agg->finalizeAggs == false)
+ operation = "Partial";
+ else if (agg->combineStates == true)
+ operation = "Finalize";
+
+ switch (agg->aggstrategy)
+ {
+ case AGG_PLAIN:
+ pname = "Aggregate";
+ strategy = "Plain";
+ break;
+ case AGG_SORTED:
+ pname = "GroupAggregate";
+ strategy = "Sorted";
+ break;
+ case AGG_HASHED:
+ pname = "HashAggregate";
+ strategy = "Hashed";
+ break;
+ default:
+ pname = "Aggregate ???";
+ strategy = "???";
+ break;
+ }
+
+ if (operation != NULL)
+ pname = psprintf("%s %s", operation, pname);
}
break;
case T_WindowAgg: