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 1oJFnL-00079a-8G for pgsql-bugs@arkaria.postgresql.org; Wed, 03 Aug 2022 14:56:23 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oJFnK-0004MP-3u for pgsql-bugs@arkaria.postgresql.org; Wed, 03 Aug 2022 14:56:22 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oJFnJ-0004MG-S5 for pgsql-bugs@lists.postgresql.org; Wed, 03 Aug 2022 14:56:21 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oJFnD-0001dP-DN for pgsql-bugs@lists.postgresql.org; Wed, 03 Aug 2022 14:56:20 +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 273EuDMa3002974; Wed, 3 Aug 2022 10:56:13 -0400 From: Tom Lane To: Richard Guo cc: Martijn van Oosterhout , PostgreSQL mailing lists Subject: Re: BUG #17564: Planner bug in combination of generate_series(), unnest() and ORDER BY In-reply-to: References: <17564-c7472c2f90ef2da3@postgresql.org> <2184335.1659392231@sss.pgh.pa.us> Comments: In-reply-to Richard Guo message dated "Tue, 02 Aug 2022 19:28:39 +0800" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3002972.1659538573.1@sss.pgh.pa.us> Date: Wed, 03 Aug 2022 10:56:13 -0400 Message-ID: <3002973.1659538573@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Richard Guo writes: > On Tue, Aug 2, 2022 at 4:50 PM Martijn van Oosterhout > wrote: >> Now it's morning I've thought of a way to reproduce it more easily, see >> the attached script. > Thanks for the report! I can reproduce it on HEAD. FWIW, this reproduces the bug for me in v13 and v14, but not v15 or HEAD. While the method to fix the bug seems clear enough, it doesn't seem like we have a test case that's stable enough to be worth anything as a regression test. Hmmm... regards, tom lane