Re: Memory-Bounded Hash Aggregation
Jeff Davis <pgsql@j-davis.com>
On Sat, 2019-12-14 at 18:32 +0100, Tomas Vondra wrote: > So I think we're not costing the batching properly / at all. Thank you for all of the testing! I think the results are good: even for cases where HashAgg is the wrong choice, it's not too bad. You're right that costing is not done, and when it is, I think it will avoid these bad choices most of the time. > A couple more comments: > > 1) IMHO we should rename hashagg_mem_overflow to > enable_hashagg_overflow > or something like that. I think that describes the GUC purpose better > (and it's more consistent with enable_hashagg_spill). The other enable_* GUCs are all planner GUCs, so I named this one differently to stand out as an executor GUC. > 2) show_hashagg_info > > I think there's a missing space after ":" here: > > " Batches: %d Disk Usage:%ldkB", > > and maybe we should use just "Disk:" just like in we do for sort: Done, thank you. > 3) I'm not quite sure what to think about the JIT recompile we do for > EEOP_AGG_INIT_TRANS_SPILLED etc. I'm no llvm/jit expert, but do we do > that for some other existing cases? Andres asked for that explicitly to avoid branches in the non-spilling code path (or at least branches that are likely to be mispredicted). Regards, Jeff Davis
Commits
-
Fix costing for disk-based hash aggregation.
- 7351bfeda33b 13.0 landed
-
Fixes for Disk-based Hash Aggregation.
- 64fe60227909 13.0 landed
-
Disk-based Hash Aggregation.
- 1f39bce02154 13.0 landed
-
Extend ExecBuildAggTrans() to support a NULL pointer check.
- c954d4904650 13.0 landed
-
Save calculated transitionSpace in Agg node.
- c11cb17dc55a 13.0 landed
-
Minor refactor of nodeAgg.c.
- 5b618e1f48ae 13.0 landed
-
Logical Tape Set: lazily allocate read buffer.
- 7fdd919ae755 13.0 landed
-
Introduce TupleHashTableHash() and LookupTupleHashEntryHash().
- 4eaea3db150a 13.0 landed
-
Logical Tape Set: use min heap for freelist.
- c02fdc922301 13.0 landed
-
Fix comments in execGrouping.c
- 30d47723fd15 13.0 landed
-
Avoid integer overflow while sifting-up a heap in tuplesort.c.
- 512f67c8d02c 10.0 cited
-
Make the overflow guards in ExecChooseHashTableSize be more protective.
- 8442317beb8f 9.0.0 cited
-
Improve performance of our private version of qsort. Per recent testing,
- a3f0b3d68f9a 8.2.0 cited