Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gsUGg-00043A-Pi for pgsql-bugs@arkaria.postgresql.org; Sat, 09 Feb 2019 15:10:10 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gsUGf-0003J1-Db for pgsql-bugs@arkaria.postgresql.org; Sat, 09 Feb 2019 15:10:09 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gsUGf-0003DV-7N for pgsql-bugs@lists.postgresql.org; Sat, 09 Feb 2019 15:10:09 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gsUGa-000164-V0 for pgsql-bugs@lists.postgresql.org; Sat, 09 Feb 2019 15:10:06 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id x19F9vD7006148; Sat, 9 Feb 2019 10:09:57 -0500 From: Tom Lane To: Andres Freund cc: pgsql-bugs@lists.postgresql.org, amdmi3@amdmi3.ru, Andrew Gierth , Jakub =?utf-8?Q?Jane=C4=8Dek?= Subject: Re: BUG #15592: Memory overuse with subquery containing unnest() and set operations (11.x regression) In-reply-to: <20190209150028.fmmy3xxobh5rqfru@alap3.anarazel.de> References: <15592-cc5729f9ba02e31c@postgresql.org> <26375.1547483080@sss.pgh.pa.us> <3935CFAF-8FD4-459E-B13F-67DFEE852028@anarazel.de> <27372.1547484627@sss.pgh.pa.us> <27649.1547485075@sss.pgh.pa.us> <20190114180423.ywhdg2iagzvh43we@alap3.anarazel.de> <20190114222838.h6r3fuyxjxkykf6t@alap3.anarazel.de> <20190209094025.a2sf2lw3zvnhtrtq@alap3.anarazel.de> <4491.1549722881@sss.pgh.pa.us> <20190209150028.fmmy3xxobh5rqfru@alap3.anarazel.de> Comments: In-reply-to Andres Freund message dated "Sat, 09 Feb 2019 07:00:28 -0800" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <6146.1549724997.1@sss.pgh.pa.us> Date: Sat, 09 Feb 2019 10:09:57 -0500 Message-ID: <6147.1549724997@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Andres Freund writes: > On 2019-02-09 09:34:41 -0500, Tom Lane wrote: >> Andres Freund 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 Even if that happens to be true today, it certainly looks like a booby trap primed and ready to bite somebody in the future. An ExprContext that fails to provide one of the basic services of an ExprContext --- indeed, the *only* basic service of an ExprContext, since whatever else it does is just a memory context feature --- doesn't sound like a great plan to me. What is it you're actually hoping to do by removing this guarantee? (I apologize for not having been paying attention to this thread, but I do have finite bandwidth.) >> 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. I'm thinking more of the valgrind and clobber_cache_always members, which are pretty slow by definition. regards, tom lane