don't allocate HashAgg hash tables when running explain only
Alexey Bashtanov <bashtanov@imap.cc>
From: Alexey Bashtanov <bashtanov@imap.cc>
To: PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2020-11-13T16:10:30Z
Lists: pgsql-hackers
Attachments
- dont-build-agg-hashtable-on-explain-only-v1.diff (text/x-patch) patch v1
Hi, I got somewhat scared when my explain took a few seconds to complete and used a few gigs of RAM. To reproduce try the following: discard temp; create temp table a as select to_timestamp(generate_series(1, 7000)) i; analyze a; set work_mem to '3GB'; explain select distinct a1.i - a2.i from a a1, a a2; I would appreciate if someone could have a look at the patch attached, which makes executor skip initializing hash tables when doing explain only. Best, Alex
Commits
-
Skip allocating hash table in EXPLAIN-only mode.
- ded7db4c1ddd 9.5.25 landed
- 02a2dbe91d37 9.6.21 landed
- 1dbe627fd6bf 10.16 landed
- 57b5d8484c8a 11.11 landed
- 888fa2baeb39 12.6 landed
- 340ae3cfb8f3 13.2 landed
- 2cccb627f10d 14.0 landed