Re: Default setting for enable_hashagg_disk
Stephen Frost <sfrost@snowman.net>
From: Stephen Frost <sfrost@snowman.net>
To: Justin Pryzby <pryzby@telsasoft.com>
Cc: Peter Geoghegan <pg@bowt.ie>, 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>, David Rowley <dgrowleyml@gmail.com>, Melanie Plageman <melanieplageman@gmail.com>, Tomas Vondra <tomas.vondra@2ndquadrant.com>, pgsql-hackers@postgresql.org
Date: 2020-07-10T13:43:51Z
Lists: pgsql-hackers, pgsql-docs
Greetings, * Justin Pryzby (pryzby@telsasoft.com) wrote: > On Thu, Jul 09, 2020 at 06:58:40PM -0400, Stephen Frost wrote: > > * Peter Geoghegan (pg@bowt.ie) wrote: > > > On Thu, Jul 9, 2020 at 7:03 AM Stephen Frost <sfrost@snowman.net> wrote: > > > It makes more sense than simply ignoring what our users will see as a > > > simple regression. (Though I still lean towards fixing the problem by > > > introducing hash_mem, which at least tries to fix the problem head > > > on.) > > > > The presumption that this will always end up resulting in a regression > > really doesn't seem sensible to me. > > Nobody said "always" - we're concerned about a fraction of workloads which > regress, badly affecting only only a small fraction of users. And those workloads would be addressed by increasing work_mem, no? Why are we inventing something new here for something that'll only impact a small fraction of users in a small fraction of cases and where there's already a perfectly workable way to address the issue? > Maybe pretend that Jeff implemented something called CashAgg, which does > everything HashAgg does but implemented from scratch. Users would be able to > tune it or disable it, and we could talk about removing HashAgg for the next 3 > years. But instead we decide to remove HashAgg right now since it's redundant. > That's a bad way to transition from an old behavior to a new one. It's scary > because it imposes a burden, rather than offering a new option without also > taking away the old one. We already have enable_hashagg. Users are free to disable it. This makes it also respect work_mem- allowing users to tune that value to adjust how much memory HashAgg actually uses. > > > That's not the only justification. The other justification is that > > > it's generally reasonable to prefer giving hash aggregate more memory. > > > > Sure, and it's generally reasonably to prefer giving Sorts more memory > > too... as long as you've got it available. > > I believe he meant: > "it's generally reasonable to prefer giving hash aggregate more memory THAN OTHER NODES" If we were developing a wholistic view of memory usage, with an overall cap on how much memory is allowed to be used for a query, then that would be an interesting thing to consider and discuss. That's not what any of this is. Thanks, Stephen
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