Re: Default setting for enable_hashagg_disk
Stephen Frost <sfrost@snowman.net>
From: Stephen Frost <sfrost@snowman.net>
To: Jeff Davis <pgsql@j-davis.com>
Cc: Justin Pryzby <pryzby@telsasoft.com>, Peter Geoghegan <pg@bowt.ie>, 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-10T14:34:15Z
Lists: pgsql-hackers, pgsql-docs
Greetings, * Jeff Davis (pgsql@j-davis.com) wrote: > In principle, Stephen is right: the v12 behavior is a bug, lots of > people are unhappy about it, it causes real problems, and it would not > be acceptable if proposed today. Otherwise I wouldn't have spent the > time to fix it. > > Similarly, potential regressions are not the "fault" of my feature -- > they are the fault of the limitations of work_mem, the limitations of > the planner, the wrong expectations from customers, or just > happenstance. Exactly. > But at a certain point, I have to weigh the potential anger of > customers hitting regressions versus the potential anger of hackers > seeing a couple extra GUCs. I have to say that I am more worried about > the former. We work, quite intentionally, to avoid having a billion knobs that people have to understand and to tune. Yes, we could create a bunch of new GUCs to change all kinds of behavior, and we could add hints while we're at it, but there's been quite understandable and good pressure against doing so because much of the point of this database system is that it should be figuring out the best plan on its own and within the constraints that users have configured. > If there is some more serious consequence of adding a GUC that I missed > in this thread, please let me know. Otherwise, I intend to commit a new > GUC shortly that will enable users to bypass work_mem for HashAgg, just > as in v12. I don't think this thread has properly considered that every new GUC, every additional knob that we create, increases the complexity of the system for users to have to deal with and, in some sense, creates a failure of ours to be able to just figure out what the right answer is. For such a small set of users, who somehow have a problem with a Sort taking up more memory but are fine with HashAgg doing so, I don't think the requirement is met that this is a large enough issue to warrant a new GUC. Users who are actually hit by this in a negative way have an option- increase work_mem to reflect what was actually happening already. I seriously doubt that we'd get tons of users complaining about that answer or asking us to have something separate from that, and we'd avoid adding some new GUC that has to be explained to every new user to the system and complicate the documentation that explains how work_mem works. 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