aboutsummaryrefslogtreecommitdiff
path: root/src/include/executor/nodeAgg.h
diff options
context:
space:
mode:
authorJeff Davis <jdavis@postgresql.org>2020-07-28 23:15:47 -0700
committerJeff Davis <jdavis@postgresql.org>2020-07-28 23:16:28 -0700
commit9878b643f37b1e4167f64a9941244bfabed60623 (patch)
treef211bc0c45f888f8fea8d3827a2e2ae6be4fa0ea /src/include/executor/nodeAgg.h
parentf2130e77da51f35d37fd15a343bc1c4a4527e0fd (diff)
downloadpostgresql-9878b643f37b1e4167f64a9941244bfabed60623.tar.gz
postgresql-9878b643f37b1e4167f64a9941244bfabed60623.zip
HashAgg: use better cardinality estimate for recursive spilling.
Use HyperLogLog to estimate the group cardinality in a spilled partition. This estimate is used to choose the number of partitions if we recurse. The previous behavior was to use the number of tuples in a spilled partition as the estimate for the number of groups, which lead to overpartitioning. That could cause the number of batches to be much higher than expected (with each batch being very small), which made it harder to interpret EXPLAIN ANALYZE results. Reviewed-by: Peter Geoghegan Discussion: https://postgr.es/m/a856635f9284bc36f7a77d02f47bbb6aaf7b59b3.camel@j-davis.com Backpatch-through: 13
Diffstat (limited to 'src/include/executor/nodeAgg.h')
-rw-r--r--src/include/executor/nodeAgg.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/include/executor/nodeAgg.h b/src/include/executor/nodeAgg.h
index bb0805abe09..b9551695384 100644
--- a/src/include/executor/nodeAgg.h
+++ b/src/include/executor/nodeAgg.h
@@ -320,7 +320,7 @@ extern void ExecReScanAgg(AggState *node);
extern Size hash_agg_entry_size(int numTrans, Size tupleWidth,
Size transitionSpace);
-extern void hash_agg_set_limits(double hashentrysize, uint64 input_groups,
+extern void hash_agg_set_limits(double hashentrysize, double input_groups,
int used_bits, Size *mem_limit,
uint64 *ngroups_limit, int *num_partitions);