Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1w8QlU-000WZr-1w for pgsql-bugs@arkaria.postgresql.org; Thu, 02 Apr 2026 22:43:52 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w8QlT-008Yb4-0m for pgsql-bugs@arkaria.postgresql.org; Thu, 02 Apr 2026 22:43:51 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1w8QlT-008Yaw-02 for pgsql-bugs@lists.postgresql.org; Thu, 02 Apr 2026 22:43:51 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1w8QlQ-00000000HCR-3RxU for pgsql-bugs@lists.postgresql.org; Thu, 02 Apr 2026 22:43:51 +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 632MhaXk3675339; Thu, 2 Apr 2026 18:43:36 -0400 From: Tom Lane To: Tomas Vondra cc: =?UTF-8?Q?Adrian_M=C3=B6nnich?= , Andres Freund , pgsql-bugs@lists.postgresql.org, Tomas Vondra , Thomas Munro Subject: Re: BUG #19449: Massive performance degradation for complex query on Postgres 16+ (few seconds -> multiple hours) In-reply-to: References: <19449-4fac687c06cc7def@postgresql.org> <43225458.20260402160627@cern.ch> <94712944.20260402164957@cern.ch> <2747373b-d188-43b1-8e49-66f9e23e3c24@vondra.me> Comments: In-reply-to Tomas Vondra message dated "Fri, 03 Apr 2026 00:34:25 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3675337.1775169816.1@sss.pgh.pa.us> Date: Thu, 02 Apr 2026 18:43:36 -0400 Message-ID: <3675338.1775169816@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Tomas Vondra writes: > An interesting question is "What changed in PG16?" causing the query to > fail, when it worked OK on earlier versions. "git bisect" could be informative here. I agree with trying to minimize the query first, though --- else you may waste time going down blind alleys, as a result of planner changes changing the join order without affecting the critical executor behavior. regards, tom lane