Re: BUG #8410: out of binary heap slots

From: Andres Freund <andres(at)2ndquadrant(dot)com>
To: terje(at)elde(dot)net
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #8410: out of binary heap slots
Date: 2013-08-30 21:44:29
Message-ID: 20130830214429.GE8932@awork2.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On 2013-08-30 23:05:25 +0200, Andres Freund wrote:
> On 2013-08-30 23:00:15 +0200, Andres Freund wrote:
> > Hi,
> >
> >
> > On 2013-08-30 20:46:27 +0000, terje(at)elde(dot)net wrote:
> > > I'm getting "out of binary heap slots", which offcourse spoils the fun of
> > > the query.
> >
> > > Explain analyze gives this plan (again anonymized a bit, but can send proper
> > > off-list):
> >
> > Since I reviewed the patch that introduced that message, I'd be
> > interested in getting that. Ideally in a state where I can reproduce the
> > issue in a new cluster.
>
> 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.

Ok, patch for that attached. Should we add
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);
as a regression test? I slightly on the "no" side...

Greetings,

Andres Freund

--
Andres Freund http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

Attachment Content-Type Size
0001-Reset-the-binary-heap-in-merge-append-rescans.patch text/x-patch 2.5 KB

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Andres Freund 2013-08-30 21:49:14 Re: BUG #8410: out of binary heap slots
Previous Message Terje Elde 2013-08-30 21:31:36 Re: BUG #8410: out of binary heap slots