comment about cardinality estimates for 2-phase distributed aggregates
authorTomas Vondra <[email protected]>
Sat, 14 Jan 2017 18:56:35 +0000 (19:56 +0100)
committerTomas Vondra <[email protected]>
Sat, 14 Jan 2017 18:56:35 +0000 (19:56 +0100)
src/backend/optimizer/plan/planner.c

index f279e08e7dbcc0f56b0081ef62498f086465d5ee..06b172c4db8481a2ab5a563ba6e9e8b843485cfe 100644 (file)
@@ -4132,6 +4132,12 @@ create_grouping_paths(PlannerInfo *root,
         * instead of the partial ones. Underestimates often have more severe
         * consequences (e.g. OOM with HashAggregate) than overestimates, so this
         * seems like a more defensive approach.
+        *
+        * XXX After thinking a bit more about the estimation, it may depend on
+        * pushdown - if the aggregate is fully pushed down (as above, we can
+        * probably use dNumGroups/numberOfNodes as a cardinality estimate, as
+        * we know the per-node groupings won't overlap. But here we need to be
+        * more careful.
         */
        if (! try_parallel_aggregation)
        {