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 1v4L5D-00DIpL-Co for pgsql-hackers@arkaria.postgresql.org; Thu, 02 Oct 2025 15:19:03 +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 1v4L5B-008DH8-8h for pgsql-hackers@arkaria.postgresql.org; Thu, 02 Oct 2025 15:19:01 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1v4L5A-008DGy-VU for pgsql-hackers@lists.postgresql.org; Thu, 02 Oct 2025 15:19:01 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1v4L58-0013jo-2i for pgsql-hackers@lists.postgresql.org; Thu, 02 Oct 2025 15:19:00 +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 592FIuNQ1064548; Thu, 2 Oct 2025 11:18:56 -0400 From: Tom Lane To: David Rowley cc: PostgreSQL Developers Subject: Re: Teaching planner to short-circuit empty UNION/EXCEPT/INTERSECT inputs In-reply-to: References: <976130.1759375308@sss.pgh.pa.us> Comments: In-reply-to David Rowley message dated "Fri, 03 Oct 2025 01:09:27 +1300" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1064546.1759418336.1@sss.pgh.pa.us> Date: Thu, 02 Oct 2025 11:18:56 -0400 Message-ID: <1064547.1759418336@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk David Rowley writes: > Good idea. Less code and still get to keep the one that did well in > the benchmark. See attached. 0001's change in is_dummy_rel() seems like a complete hack, especially since you didn't bother to change the adjacent comment. Why is that necessary? v2 LGTM otherwise. regards, tom lane