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 1tpuAF-00E0lL-IO for pgsql-hackers@arkaria.postgresql.org; Wed, 05 Mar 2025 19:12: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 1tpuAD-002ZRe-KX for pgsql-hackers@arkaria.postgresql.org; Wed, 05 Mar 2025 19:12:17 +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 1tpuAD-002ZRW-AQ for pgsql-hackers@lists.postgresql.org; Wed, 05 Mar 2025 19:12:17 +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 1tpuAB-0019zv-1K for pgsql-hackers@postgresql.org; Wed, 05 Mar 2025 19:12: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 525JCD51341358; Wed, 5 Mar 2025 14:12:13 -0500 From: Tom Lane To: Jeff Davis cc: Sami Imseih , dinesh salve , pgsql-hackers@postgresql.org Subject: Re: explain plans for foreign servers In-reply-to: <07147023882ac6c4424df946fd4b82b8e8c211a5.camel@j-davis.com> References: <07147023882ac6c4424df946fd4b82b8e8c211a5.camel@j-davis.com> Comments: In-reply-to Jeff Davis message dated "Wed, 05 Mar 2025 11:00:43 -0800" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <341356.1741201933.1@sss.pgh.pa.us> Date: Wed, 05 Mar 2025 14:12:13 -0500 Message-ID: <341357.1741201933@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Jeff Davis writes: > Ideally, we'd have EXPLAIN ANALYZE return two result sets, kind of like > how a query with a semicolon returns two result sets. That changes the > expected message flow for EXPLAIN ANALYZE, though, so we'd need a new > option so we are sure the client is expecting it (is this a sane > idea?). I'm afraid not. That pretty fundamentally breaks the wire protocol, I think. Also (1) there could be more than two, no, if the query touches more than one foreign table? How would the client know how many to expect? (2) there would be no particularly compelling ordering for the multiple resultsets. > I wonder if Robert's extensible EXPLAIN work[1] could be useful > here? I'm wondering the same. You could certainly imagine cramming all of the foreign EXPLAIN output into some new field attached to the ForeignScan node. Readability and indentation would require some thought, but the other approaches don't have any mechanism for addressing that at all. regards, tom lane