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 1oJcXU-0007jb-M7 for pgsql-bugs@arkaria.postgresql.org; Thu, 04 Aug 2022 15:13:32 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oJcXT-0001DQ-EC for pgsql-bugs@arkaria.postgresql.org; Thu, 04 Aug 2022 15:13:31 +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 1oJcXT-0001DF-5x for pgsql-bugs@lists.postgresql.org; Thu, 04 Aug 2022 15:13:31 +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 1oJcXN-0001Th-1R for pgsql-bugs@lists.postgresql.org; Thu, 04 Aug 2022 15:13:30 +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 274FDMSt3503396; Thu, 4 Aug 2022 11:13:22 -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> <3002973.1659538573@sss.pgh.pa.us> <3297011.1659578134@sss.pgh.pa.us> Comments: In-reply-to Richard Guo message dated "Thu, 04 Aug 2022 11:16:42 +0800" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3503394.1659626002.1@sss.pgh.pa.us> Date: Thu, 04 Aug 2022 11:13:22 -0400 Message-ID: <3503395.1659626002@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Richard Guo writes: > Yeah, I tested in bc76f5ac4. Attached is a regression test I composed. > I tested it locally and it can catch this bug before 1aa8dad41 and give > the expected answer after 1aa8dad41. Nice! I found we could simplify it even further: we don't seem to need the generate_subscripts() to provoke the error in this query. And it fails in v13-v14, too. Pushed. regards, tom lane