Model
What partial aggregation saves
The average number of rows per group per partition. Below 1, expect almost nothing.
- Rows
- rows to aggregate
- Partitions
- partitions (executors)
- Groups
- distinct groups
How it behaves
One input on the horizontal axis, the others held fixed.
Data table
| N / (P·G) | Reduction from partial aggregation |
|---|---|
| 0.01 | 1.01× |
| 0.012 | 1.01× |
| 0.013 | 1.01× |
| 0.015 | 1.01× |
| 0.018 | 1.01× |
| 0.021 | 1.01× |
| 0.024 | 1.01× |
| 0.027 | 1.01× |
| 0.032 | 1.02× |
| 0.037 | 1.02× |
| 0.042 | 1.02× |
| 0.049 | 1.02× |
| 0.056 | 1.03× |
| 0.065 | 1.03× |
| 0.075 | 1.04× |
| 0.087 | 1.04× |
| 0.1 | 1.05× |
| 0.115 | 1.06× |
| 0.133 | 1.07× |
| 0.154 | 1.08× |
| 0.178 | 1.09× |
| 0.205 | 1.11× |
| 0.237 | 1.12× |
| 0.274 | 1.14× |
| 0.316 | 1.17× |
| 0.365 | 1.19× |
| 0.422 | 1.23× |
| 0.487 | 1.26× |
| 0.562 | 1.31× |
| 0.649 | 1.36× |
| 0.75 | 1.42× |
| 0.866 | 1.49× |
| 1 | 1.58× |
| 1.15 | 1.69× |
| 1.33 | 1.81× |
| 1.54 | 1.96× |
| 1.78 | 2.14× |
| 2.05 | 2.36× |
| 2.37 | 2.62× |
| 2.74 | 2.93× |
| 3.16 | 3.3× |
| 3.65 | 3.75× |
| 4.22 | 4.28× |
| 4.87 | 4.91× |
| 5.62 | 5.64× |
| 6.49 | 6.5× |
| 7.5 | 7.5× |
| 8.66 | 8.66× |
| 10 | 10× |
| 11.5 | 11.5× |
| 13.3 | 13.3× |
| 15.4 | 15.4× |
| 17.8 | 17.8× |
| 20.5 | 20.5× |
| 23.7 | 23.7× |
| 27.4 | 27.4× |
| 31.6 | 31.6× |
| 36.5 | 36.5× |
| 42.2 | 42.2× |
| 48.7 | 48.7× |
| 56.2 | 56.2× |
| 64.9 | 64.9× |
| 75 | 75× |
| 86.6 | 86.6× |
| 100 | 100× |
| 115 | 115× |
| 133 | 133× |
| 154 | 154× |
| 178 | 178× |
| 205 | 205× |
| 237 | 237× |
| 274 | 274× |
| 316 | 316× |
| 365 | 365× |
| 422 | 422× |
| 487 | 487× |
| 562 | 562× |
| 649 | 649× |
| 750 | 750× |
| 866 | 866× |
| 1,000 | 1,000× |
Worked examples, recomputed
Every number the mechanisms quote for this relationship is recomputed from it, so none of them disagrees with it.
- 10¹⁰ rows, 200 partitions, 1,000 groups → 50,000×
- 10 million rows over 40 million customers → ≈ 8.85 million groups
- real reduction ≈ 1.13×
Where it appears
Each mechanism states it in its own names. The general symbol each name stands for is shown with it.
- Query Processing
Why can one question be answered by plans whose costs differ by a factor of ten thousand, and what does each operator force the engine to do?