Re: BUG #15592: Memory overuse with subquery containing unnest() and set operations (11.x regression)
Andres Freund <andres@anarazel.de>
From: Andres Freund <andres@anarazel.de>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-bugs@lists.postgresql.org, amdmi3@amdmi3.ru, Andrew Gierth <andrew@tao11.riddles.org.uk>, Jakub Janeček <jakub.janecek@comgate.cz>
Date: 2019-02-09T15:00:28Z
Lists: pgsql-bugs
Hi, On 2019-02-09 09:34:41 -0500, Tom Lane wrote: > Andres Freund <andres@anarazel.de> writes: > >> ... Given that, I think it's ok > >> to not explicitly shutdown the expr context. > > Uh, what? Well, you explicitly removed the surrounding reasoning. What's the issue you see here? The generated expression cannot contain anything that uses shutdown callbacks (it can only contain *_FETCHSOME, *_VAR, *_NOT_DISTINCT, *_QUAL expression steps). No user defined expressions have access to the ExprContext. I'd written about this a few weeks ago, nobody responded with a better suggestion. > > Dmitry, the fix will be included in the next minor release, which is > > scheduled for next week. > > This doesn't really seem like the kind of patch to push on a release > weekend. At this point you can't even be confident of getting a readout > from every active buildfarm member. Yea, I'd hoped to push this earlier, but unfortune family issues + related travel + work travel prevented me from getting to this earlier. The memory leak is significant, the patch hasn't materially changed in the two weeks since it has been posted, and there's nothing operating system / architecture related, which I think makes this acceptable. Greetings, Andres Freund
Commits
-
Plug leak in BuildTupleHashTable by creating ExprContext in correct context.
- 9cf37a527cf8 11.2 landed
- 5567d12ce030 12.0 landed
-
simplehash: Add support for resetting a hashtable's contents.
- 350b0a40375e 11.2 landed
- 3b632a58e798 12.0 landed