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.94.2) (envelope-from ) id 1sXOvT-003ncA-HD for pgsql-hackers@arkaria.postgresql.org; Fri, 26 Jul 2024 17:40:19 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1sXOvR-00FZ7S-PQ for pgsql-hackers@arkaria.postgresql.org; Fri, 26 Jul 2024 17:40:17 +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.94.2) (envelope-from ) id 1sXOvR-00FZ7K-Fv for pgsql-hackers@lists.postgresql.org; Fri, 26 Jul 2024 17:40:17 +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.94.2) (envelope-from ) id 1sXOvO-001cEc-UX for pgsql-hackers@postgresql.org; Fri, 26 Jul 2024 17:40:16 +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 46QHeCPv1747081; Fri, 26 Jul 2024 13:40:12 -0400 From: Tom Lane To: Robert Haas cc: Anthonin Bonnefoy , PostgreSQL Hackers Subject: Re: Add ALL_CANDIDATES option to EXPLAIN In-reply-to: References: Comments: In-reply-to Robert Haas message dated "Fri, 26 Jul 2024 13:16:43 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1747079.1722015612.1@sss.pgh.pa.us> Date: Fri, 26 Jul 2024 13:40:12 -0400 Message-ID: <1747080.1722015612@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Robert Haas writes: > I've thought about trying to figure out some way of identifying and > printing out plans that are "interestingly different" from the chosen > plan, with the costs they would have had, but I haven't been able to > come up with a good algorithm. I wonder how far you'd get by just printing the surviving paths (that is, something like Anthonin's patch, but without lobotomizing add_path). The survivors would have to dominate the cheapest-total path along one of the other metrics add_path considers, which seems like a rough approximation of "interestingly different". regards, tom lane