diff options
| author | Tom Lane | 2016-06-26 19:55:01 +0000 |
|---|---|---|
| committer | Tom Lane | 2016-06-26 19:55:01 +0000 |
| commit | f1993038a4f0ce5fbeb7b562b2acd571bf6b567b (patch) | |
| tree | 93f5ee92beb05cab27515290246a72a1b6648845 /src/include/nodes | |
| parent | 19e972d5580c655423572e3c870e47b5b7c346f6 (diff) | |
Avoid making a separate pass over the query to check for partializability.
It's rather silly to make a separate pass over the tlist + HAVING qual,
and a separate set of visits to the syscache, when get_agg_clause_costs
already has all the required information in hand. This nets out as less
code as well as fewer cycles.
Diffstat (limited to 'src/include/nodes')
| -rw-r--r-- | src/include/nodes/relation.h | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/include/nodes/relation.h b/src/include/nodes/relation.h index b5f96839755..0b5cb9e8682 100644 --- a/src/include/nodes/relation.h +++ b/src/include/nodes/relation.h @@ -50,12 +50,15 @@ typedef struct QualCost * Costing aggregate function execution requires these statistics about * the aggregates to be executed by a given Agg node. Note that the costs * include the execution costs of the aggregates' argument expressions as - * well as the aggregate functions themselves. + * well as the aggregate functions themselves. Also, the fields must be + * defined so that initializing the struct to zeroes with memset is correct. */ typedef struct AggClauseCosts { int numAggs; /* total number of aggregate functions */ int numOrderedAggs; /* number w/ DISTINCT/ORDER BY/WITHIN GROUP */ + bool hasNonPartial; /* does any agg not support partial mode? */ + bool hasNonSerial; /* is any partial agg non-serializable? */ QualCost transCost; /* total per-input-row execution costs */ Cost finalCost; /* total per-aggregated-row costs */ Size transitionSpace; /* space for pass-by-ref transition data */ |
