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 1u0DcZ-00Ece8-CR for pgsql-hackers@arkaria.postgresql.org; Thu, 03 Apr 2025 06:00:11 +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 1u0DcY-003ZAu-1A for pgsql-hackers@arkaria.postgresql.org; Thu, 03 Apr 2025 06:00:10 +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 1u0DbY-003VJn-O9 for pgsql-hackers@lists.postgresql.org; Thu, 03 Apr 2025 05:59:08 +0000 Received: from oss.nttdata.com ([49.212.34.109]) by magus.postgresql.org with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1u0DbW-0036VN-0l for pgsql-hackers@lists.postgresql.org; Thu, 03 Apr 2025 05:59:08 +0000 Received: from oss.nttdata.com (localhost [127.0.0.1]) by oss.nttdata.com (Postfix) with ESMTPA id 87F0C612A9; Thu, 3 Apr 2025 14:59:02 +0900 (JST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at oss.nttdata.com MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Thu, 03 Apr 2025 14:59:02 +0900 From: torikoshia To: Sami Imseih Cc: Robert Haas , pgsql-hackers@lists.postgresql.org, destrex271@gmail.com Subject: Re: RFC: Logging plan of the running query In-Reply-To: References: <2aedcb5e8120bfdee994775e660f8718@oss.nttdata.com> <174144854199.294105.9417032645816235284.pgcf@coridan.postgresql.org> <784224198089cbe3cc3825332f195475@oss.nttdata.com> User-Agent: Roundcube Webmail/1.4.11 Message-ID: X-Sender: torikoshia@oss.nttdata.com List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2025-04-03 01:22, Sami Imseih wrote: >> > FWIW, I have been thinking about auto_explain for another task, >> > remote plans for fdw [0], and perhaps there are now other good >> > reasons, some that you mention, that can be simplified if "auto_explain" >> > becomes a core feature. This could be a proposal taken up in 19. >> >> For what we're talking about here, I don't think we would need to go >> that far -- maybe put a few functions in core but no real need to move >> the whole module into core. However, I don't rule out that there are >> other reasons to do as you suggest. > > This is the first core feature that will allow users to log explain > plans for > a live workload. EXPLAIN is not really good for this purpose. So this > proposal is a step in the correct direction. I think the appetite for > more > plan logging/visibility options will likely increase, and > auto_explainlike > features in core will be desired IMO. We will see. > > As far as this patch goes, I took a look and I have some comments: Thanks for your comments! > 2/ > It should be noted that the plan will not print to the log until > the plan begins executing the next plan node? depending on the > operation, that could take some time ( i.e.long seq scan of a table, > etc.) > Does this behavior need to be called out in docs? Seems reasonable, but long seq scan of a table would not cause the case since ExecProcNode() is called at least the number of the rows in a table, as far as I remember. Of course there can be the case where long time can elapse before executing ExecProcNode(), so I agree with adding the doc about this. I'm going to improve including other than this comment in the next patch. -- Regards, -- Atsushi Torikoshi Seconded from NTT DATA GROUP CORPORATION to SRA OSS K.K.