Non-text EXPLAIN output for partial aggregation - Mailing list pgsql-hackers

From Tom Lane
Subject Non-text EXPLAIN output for partial aggregation
Date
Msg-id 16002.1466972724@sss.pgh.pa.us
Whole thread Raw
Responses Re: Non-text EXPLAIN output for partial aggregation  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
I noticed that the EXPLAIN code is set up so that in non-text output
modes, you get output like this for partial-aggregate plans:
      "Node Type": "Aggregate",                  +      "Strategy": "Plain",                       +      "Operation":
"Finalize",                  +
 
...              "Node Type": "Aggregate",          +              "Strategy": "Plain",               +
"Operation":"Partial",            +
 

That is, the "Operation" field type has been commandeered to indicate
partial-aggregation cases.  This seems like a pretty bad idea to me,
for two reasons:

1.  In other plan node types, "Operation" refers to SQL-visible semantics,
in fact always Select/Insert/Update/Delete.  Re-using it for an
implementation detail doesn't seem very consistent.

2.  As coded, the field is not printed at all for a non-partial aggregate
node.  This is just wrong.  A given node type should have a fixed set of
attributes.

I think we should use some other field name, maybe "Step" or
"PartialMode", and have "Simple" or "Plain" as the default field
contents.  It's also arguable that this field should distinguish all the
values of the AggSplit enum we just invented, though I'm not sure how
important it is to report serialization options.  I'm not wedded to any
particular ideas here, other than that omitting the field in the simple
case is bad.

Comments, naming ideas?
        regards, tom lane



pgsql-hackers by date:

Previous
From: David Rowley
Date:
Subject: Re: Rethinking representation of partial-aggregate steps
Next
From: Tom Lane
Date:
Subject: Re: Rethinking representation of partial-aggregate steps