Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VFWGo-0001vg-Di for pgsql-bugs@arkaria.postgresql.org; Fri, 30 Aug 2013 21:30:18 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1VFWGn-0004Ai-NV for pgsql-bugs@arkaria.postgresql.org; Fri, 30 Aug 2013 21:30:17 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VFWGm-0004Ab-Ov for pgsql-bugs@postgresql.org; Fri, 30 Aug 2013 21:30:16 +0000 Received: from moutng.kundenserver.de ([212.227.126.187]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VFWGj-0004y6-TH for pgsql-bugs@postgresql.org; Fri, 30 Aug 2013 21:30:16 +0000 Received: from anarazel.de (p54AF4A79.dip0.t-ipconnect.de [84.175.74.121]) by mrelayeu.kundenserver.de (node=mreu0) with ESMTP (Nemesis) id 0M21dP-1W8zEt47S7-00tka6; Fri, 30 Aug 2013 23:30:13 +0200 Received: by anarazel.de (Postfix, from userid 1000) id 540B9100A6D; Fri, 30 Aug 2013 23:30:12 +0200 (CEST) Date: Fri, 30 Aug 2013 23:30:12 +0200 From: Andres Freund To: Tom Lane Cc: terje@elde.net, pgsql-bugs@postgresql.org Subject: Re: BUG #8410: out of binary heap slots Message-ID: <20130830213012.GD8932@awork2.anarazel.de> References: <20130830210015.GA8932@awork2.anarazel.de> <20130830210525.GB8932@awork2.anarazel.de> <19714.1377897831@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <19714.1377897831@sss.pgh.pa.us> X-Provags-ID: V02:K0:M/4gNjD/IMeV6i6yjiwpSeeLh9X1ualEQYG1MaTuOQ5 BEhi4wBS75c6UDuWlG/v8yugrHx9/2AimdaT9UQ55dunCZv0s5 XSSoNdMpL2KqTBy9ktnHHoXkI7nVJ/h4CekH+wVo4KFq09EgKD HVK8LW5rWx9BqdtHzWPigMfyIozDaOVRagZUi0B8sSNdw95L7g XeT98/f5s8lF+2E9vYwnAp/KA2GMMiWMUoL47gRyGct1T40yYJ iaoQw3vERQxripuRMqNvl9cTH0wLg7Ia71yeZalZeAHCHtMCMV IYtYj/bZDR0DkCjQpEieUMQ+Gs8cxZLUjqCYxK+7ui9szJ/lru CapreL6lgsN2eYLh3TIr7OLc97jKD+ts+f5GrdCEn X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org On 2013-08-30 17:23:51 -0400, Tom Lane wrote: > Andres Freund writes: > > No need, found the bug. And I think can build a testcase myself. > > > ExecReScanMergeAppend resets ms_initialized, but doesn't clear the > > binaryheap. Thus no new elements fit. > > Sounds like a bug all right, but I'm not convinced it explains Terje's > report. The thing this theory doesn't explain is why would Terje be > having trouble reproducing the failure? Seems like re-running the same > query ought to produce the same failure. The number of rescans can be rather data-dependant, so I'd guess that's the reason. If many of the subplans don't return a tuple, it can take several resets to actually ever reach the heap's limit as we don't add the subplan to the heap in that case. Greetings, Andres Freund -- Andres Freund http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs