diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2022-07-19 12:29:37 -0400 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2022-07-19 12:29:37 -0400 |
commit | d6a3aeb9a37bdbb5aa8ed03a9f95e2b1a1b44ba7 (patch) | |
tree | 3a10100442b306e8c206bf6378015bd0a61c1a59 /src/include/nodes | |
parent | e2f6c307c02924e6ee1667890b56280ab1960d2e (diff) | |
download | postgresql-d6a3aeb9a37bdbb5aa8ed03a9f95e2b1a1b44ba7.tar.gz postgresql-d6a3aeb9a37bdbb5aa8ed03a9f95e2b1a1b44ba7.zip |
Convert planner's AggInfo and AggTransInfo structs to proper Nodes.
This is mostly just to get outfuncs.c support for them, so that
the agginfos and aggtransinfos lists can be dumped when dumping
the contents of PlannerInfo.
While here, improve some related comments; notably, clean up
obsolete comments left over from when preprocess_minmax_aggregates
had to make its own scan of the query tree.
Discussion: https://postgr.es/m/742479.1658160504@sss.pgh.pa.us
Diffstat (limited to 'src/include/nodes')
-rw-r--r-- | src/include/nodes/pathnodes.h | 42 |
1 files changed, 26 insertions, 16 deletions
diff --git a/src/include/nodes/pathnodes.h b/src/include/nodes/pathnodes.h index 69ba254372d..e650af5ff29 100644 --- a/src/include/nodes/pathnodes.h +++ b/src/include/nodes/pathnodes.h @@ -442,15 +442,15 @@ struct PlannerInfo * Information about aggregates. Filled by preprocess_aggrefs(). */ /* AggInfo structs */ - List *agginfos pg_node_attr(read_write_ignore); + List *agginfos; /* AggTransInfo structs */ - List *aggtransinfos pg_node_attr(read_write_ignore); - /* number w/ DISTINCT/ORDER BY/WITHIN GROUP */ - int numOrderedAggs pg_node_attr(read_write_ignore); + List *aggtransinfos; + /* number of aggs with DISTINCT/ORDER BY/WITHIN GROUP */ + int numOrderedAggs; /* does any agg not support partial mode? */ - bool hasNonPartialAggs pg_node_attr(read_write_ignore); + bool hasNonPartialAggs; /* is any partial agg non-serializable? */ - bool hasNonSerialAggs pg_node_attr(read_write_ignore); + bool hasNonSerialAggs; /* * These fields are used only when hasRecursion is true: @@ -3121,6 +3121,10 @@ typedef struct JoinCostWorkspace */ typedef struct AggInfo { + pg_node_attr(no_copy_equal, no_read) + + NodeTag type; + /* * Link to an Aggref expr this state value is for. * @@ -3129,6 +3133,7 @@ typedef struct AggInfo */ Aggref *representative_aggref; + /* Transition state number for this aggregate */ int transno; /* @@ -3137,9 +3142,8 @@ typedef struct AggInfo */ bool shareable; - /* Oid of the final function or InvalidOid */ + /* Oid of the final function, or InvalidOid if none */ Oid finalfn_oid; - } AggInfo; /* @@ -3151,34 +3155,40 @@ typedef struct AggInfo */ typedef struct AggTransInfo { + pg_node_attr(no_copy_equal, no_read) + + NodeTag type; + + /* Inputs for this transition state */ List *args; Expr *aggfilter; /* Oid of the state transition function */ Oid transfn_oid; - /* Oid of the serialization function or InvalidOid */ + /* Oid of the serialization function, or InvalidOid if none */ Oid serialfn_oid; - /* Oid of the deserialization function or InvalidOid */ + /* Oid of the deserialization function, or InvalidOid if none */ Oid deserialfn_oid; - /* Oid of the combine function or InvalidOid */ + /* Oid of the combine function, or InvalidOid if none */ Oid combinefn_oid; /* Oid of state value's datatype */ Oid aggtranstype; + + /* Additional data about transtype */ int32 aggtranstypmod; int transtypeLen; bool transtypeByVal; + + /* Space-consumption estimate */ int32 aggtransspace; - /* - * initial value from pg_aggregate entry - */ - Datum initValue; + /* Initial value from pg_aggregate entry */ + Datum initValue pg_node_attr(read_write_ignore); bool initValueIsNull; - } AggTransInfo; #endif /* PATHNODES_H */ |