Re: BUG #16846: "retrieved too many tuples in a bounded sort" - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #16846: "retrieved too many tuples in a bounded sort"
Date
Msg-id 3086429.1612109768@sss.pgh.pa.us
Whole thread Raw
In response to BUG #16846: "retrieved too many tuples in a bounded sort"  (PG Bug reporting form <noreply@postgresql.org>)
Responses Re: BUG #16846: "retrieved too many tuples in a bounded sort"  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
PG Bug reporting form <noreply@postgresql.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



pgsql-bugs by date:

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