Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l6FOY-0007U5-Tk for pgsql-bugs@arkaria.postgresql.org; Sun, 31 Jan 2021 16:16:14 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1l6FOX-00066P-RH for pgsql-bugs@arkaria.postgresql.org; Sun, 31 Jan 2021 16:16:13 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l6FOX-00066I-L2 for pgsql-bugs@lists.postgresql.org; Sun, 31 Jan 2021 16:16:13 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l6FOV-00031I-Uq for pgsql-bugs@lists.postgresql.org; Sun, 31 Jan 2021 16:16:13 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 10VGG8Yv3086431; Sun, 31 Jan 2021 11:16:08 -0500 From: Tom Lane To: contact@yorhel.nl cc: pgsql-bugs@lists.postgresql.org, Tomas Vondra Subject: Re: BUG #16846: "retrieved too many tuples in a bounded sort" In-reply-to: <16846-ae49f51ac379a4cb@postgresql.org> References: <16846-ae49f51ac379a4cb@postgresql.org> Comments: In-reply-to PG Bug reporting form message dated "Sun, 31 Jan 2021 09:09:49 +0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3086428.1612109768.1@sss.pgh.pa.us> Date: Sun, 31 Jan 2021 11:16:08 -0500 Message-ID: <3086429.1612109768@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk PG Bug reporting form 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