pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andres Freund <andres@2ndquadrant.com>
To: Alvaro Herrera <alvherre@2ndquadrant.com>
Cc: terje@elde.net
Cc: pgsql-bugs@postgresql.org
Subject: Re: BUG #8410: out of binary heap slots
Date: Fri, 30 Aug 2013 23:27:07 +0200
Message-ID: <20130830212707.GC8932@awork2.anarazel.de> (raw)
In-Reply-To: <20130830211532.GA5931@eldon.alvh.no-ip.org>
References: <E1VFVaN-000679-Mj@wrigleys.postgresql.org>
	<20130830210015.GA8932@awork2.anarazel.de>
	<20130830210525.GB8932@awork2.anarazel.de>
	<20130830211532.GA5931@eldon.alvh.no-ip.org>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

On 2013-08-30 17:15:32 -0400, Alvaro Herrera wrote:
> Andres Freund wrote:
> 
> > 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.
> 
> Um.  Are we missing a binaryheap_clear() method?

In the patch I am patch-to-be it's binaryheap_reset(), but yes ;). Are
you already patching it, or do you want me to finish it? I have a not so
nice testcase and I can confirm that this is the issue and that a
binaryheap_reset() fixes it:

SELECT (SELECT g.i FROM ((SELECT random()::int ORDER BY 1 OFFSET 0) UNION ALL (SELECT random()::int ORDER BY 1 OFFSET 0)) f(i) ORDER BY f.i LIMIT 1) FROM generate_series(1, 10) g(i);

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



view thread (20+ messages)  latest in thread

Message-ID: <20130830212707.GC8932@awork2.anarazel.de>
Permalink:  ../20130830212707.GC8932@awork2.anarazel.de/
Also on:    postgresql.org/message-id/20130830212707.GC8932@awork2.anarazel.de

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: andres@2ndquadrant.com, alvherre@2ndquadrant.com, terje@elde.net
  Subject: Re: BUG #8410: out of binary heap slots
  In-Reply-To: <20130830212707.GC8932@awork2.anarazel.de>
  References: <E1VFVaN-000679-Mj@wrigleys.postgresql.org> <20130830210015.GA8932@awork2.anarazel.de> <20130830210525.GB8932@awork2.anarazel.de> <20130830211532.GA5931@eldon.alvh.no-ip.org> <20130830212707.GC8932@awork2.anarazel.de>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox