Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1juGT8-0002Sk-GF for pgsql-hackers@arkaria.postgresql.org; Sat, 11 Jul 2020 14:27:10 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1juGT7-0003IC-9u for pgsql-hackers@arkaria.postgresql.org; Sat, 11 Jul 2020 14:27:09 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1juGT7-0003I5-2b for pgsql-hackers@lists.postgresql.org; Sat, 11 Jul 2020 14:27:09 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1juGT5-0004Kb-4j for pgsql-hackers@postgresql.org; Sat, 11 Jul 2020 14:27:08 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 06BER2Ah2210836; Sat, 11 Jul 2020 10:27:02 -0400 From: Tom Lane To: David Rowley cc: Peter Geoghegan , "David G. Johnston" , Stephen Frost , Jeff Davis , Alvaro Herrera , Andres Freund , Bruce Momjian , Robert Haas , Justin Pryzby , Melanie Plageman , Tomas Vondra , "pgsql-hackers@postgresql.org" Subject: Re: Default setting for enable_hashagg_disk In-reply-to: References: <20200708140037.GI3125@tamriel.snowman.net> <99b047386525b87df1e611335c2e57a6cdef346b.camel@j-davis.com> <20200709140330.GO3125@tamriel.snowman.net> <20200709225840.GE12375@tamriel.snowman.net> <20200710000842.GF12375@tamriel.snowman.net> <20200710141714.GI12375@tamriel.snowman.net> <20200710215012.GN12375@tamriel.snowman.net> <2165606.1594418399@sss.pgh.pa.us> Comments: In-reply-to David Rowley message dated "Sat, 11 Jul 2020 17:00:22 +1200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2210834.1594477622.1@sss.pgh.pa.us> Date: Sat, 11 Jul 2020 10:27:02 -0400 Message-ID: <2210835.1594477622@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk David Rowley writes: > hmm yeah. It's unfortunate, but I'm not sure how I'd have implemented > it differently. The problem is made worse by the fact that we'll only > release the memory for the hash table during ExecEndHashJoin(). If the > planner had some ability to provide the executor with knowledge that > the node would never be rescanned, then the executor could release the > memory for the hash table after the join is complete. EXEC_FLAG_REWIND seems to fit the bill already? regards, tom lane