Re: Default setting for enable_hashagg_disk
Tom Lane <tgl@sss.pgh.pa.us>
From: Tom Lane <tgl@sss.pgh.pa.us>
To: "David G. Johnston" <david.g.johnston@gmail.com>
Cc: Peter Geoghegan <pg@bowt.ie>, David Rowley <dgrowleyml@gmail.com>,
Stephen Frost <sfrost@snowman.net>, Jeff Davis <pgsql@j-davis.com>,
Alvaro Herrera <alvherre@2ndquadrant.com>,
Andres Freund <andres@anarazel.de>, Bruce Momjian <bruce@momjian.us>,
Robert Haas <robertmhaas@gmail.com>,
Justin Pryzby <pryzby@telsasoft.com>,
Melanie Plageman <melanieplageman@gmail.com>,
Tomas Vondra <tomas.vondra@2ndquadrant.com>,
"pgsql-hackers@postgresql.org" <pgsql-hackers@postgresql.org>
Date: 2020-07-13T20:20:28Z
Lists: pgsql-hackers, pgsql-docs
"David G. Johnston" <david.g.johnston@gmail.com> writes: > To be clear, by "escape hatch" you mean "add a GUC that instructs the > PostgreSQL executor to ignore hash_mem when deciding whether to spill the > contents of the hash table to disk - IOW to never spill the contents of a > hash table to disk"? If so that seems separate from whether to add a > hash_mem GUC to provide finer grained control - people may well want both. If we define the problem narrowly as "allow people to get back exactly the pre-v13 behavior", then yeah you'd need an escape hatch of that sort. We should not, however, forget that the pre-v13 behavior is pretty darn problematic. It's hard to see why anyone would really want to get back exactly "never spill even if it leads to OOM". The proposals for allowing a higher-than-work_mem, but not infinite, spill boundary seem to me to be a reasonable way to accommodate cases where the old behavior is accidentally preferable to what v13 does right now. Moreover, such a knob seems potentially useful in its own right, at least as a stopgap until we figure out how to generalize or remove work_mem. (Which might be a long time.) I'm not unalterably opposed to providing an escape hatch of the other sort, but right now I think the evidence for needing it isn't there. If we get field complaints that can't be resolved with the "raise the spill threshold by X" approach, we could reconsider. But that approach seems a whole lot less brittle than "raise the spill threshold to infinity", so I think we should start with the former type of fix. regards, tom lane
Commits
-
Add hash_mem_multiplier GUC.
- d6c08e29e7bc 14.0 landed
- 78530c8e7a5a 13.0 landed
-
HashAgg: use better cardinality estimate for recursive spilling.
- 3a232a3183d5 13.0 landed
- 9878b643f37b 14.0 landed
-
Remove hashagg_avoid_disk_plan GUC.
- bcbf9446a298 14.0 landed
- 5a6cc6ffa914 13.0 landed
-
Doc fixup for hashagg_avoid_disk_plan GUC.
- d33f33539d7f 13.0 landed
- 7ce461560159 14.0 landed
-
Rework HashAgg GUCs.
- 13e0fa7ae50c 13.0 landed
- 92c58fd94801 14.0 landed
-
Disk-based Hash Aggregation.
- 1f39bce02154 13.0 cited
-
Implement partition-wise grouping/aggregation.
- e2f1eb0ee30d 11.0 cited
-
Defer creation of partially-grouped relation until it's needed.
- 4f15e5d09de2 11.0 cited