Re: BUG #16846: "retrieved too many tuples in a bounded sort"

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: contact(at)yorhel(dot)nl
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org, Tomas Vondra <tomas(dot)vondra(at)enterprisedb(dot)com>
Subject: Re: BUG #16846: "retrieved too many tuples in a bounded sort"
Date: 2021-01-31 16:16:08
Message-ID: 3086429.1612109768@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

PG Bug reporting form <noreply(at)postgresql(dot)org> writes:
> I have a query that fails as follows:

> SELECT id FROM releases WHERE minage = 18 AND released <= 20210131 AND id
> IN(SELECT id FROM releases_lang WHERE lang = 'ja') ORDER BY released DESC,
> id LIMIT 50;
> ERROR: XX000: retrieved too many tuples in a bounded sort
> LOCATION: tuplesort_gettuple_common, tuplesort.c:2103

> Sadly I've not been able to create a minimum working example, but I have
> been able to reproduce this on our public database dumps. I've made an
> excerpt of the database with only the two referenced tables:
> https://s.vndb.org/u/vndb-releases-test-20210131.sql.gz (~5.5MB compressed).

I confirm this is reproducible on HEAD with the referenced test data.
(Load it into a utf8-encoding database, ANALYZE, and boom.)

I presume that the incremental-sort patch is at fault, though I've
not tried to run it to ground since I have no idea how that works.

regards, tom lane

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2021-01-31 16:35:28 Re: BUG #16846: "retrieved too many tuples in a bounded sort"
Previous Message Magnus Hagander 2021-01-31 11:33:55 Re: Use of HAVING (Select/Group By) on a output-name of an aggregate function causes SYNTAX ERROR