Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lqyov-0000YJ-I2 for pgsql-hackers@arkaria.postgresql.org; Wed, 09 Jun 2021 14:04:37 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lqyot-0007oo-LJ for pgsql-hackers@arkaria.postgresql.org; Wed, 09 Jun 2021 14:04:35 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lqyot-0007og-Dj for pgsql-hackers@lists.postgresql.org; Wed, 09 Jun 2021 14:04:35 +0000 Received: from oss.nttdata.com ([49.212.34.109]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lqyok-00042x-Gt for pgsql-hackers@postgresql.org; Wed, 09 Jun 2021 14:04:31 +0000 Received: from hnk.local (p2388012-ipbf1027funabasi.chiba.ocn.ne.jp [118.6.6.12]) by oss.nttdata.com (Postfix) with ESMTPSA id 91B9660251; Wed, 9 Jun 2021 23:04:22 +0900 (JST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.2 at oss.nttdata.com Subject: Re: RFC: Logging plan of the running query To: torikoshia , Dilip Kumar , Pgsql Hackers Cc: Bharath Rupireddy References: <0842b5da697a03869fb50be93817e4e1@oss.nttdata.com> From: Fujii Masao Message-ID: <5ab22d89-a9b9-bcc0-7e91-d4ce7935d050@oss.nttdata.com> Date: Wed, 9 Jun 2021 23:04:22 +0900 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <0842b5da697a03869fb50be93817e4e1@oss.nttdata.com> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2021/06/09 16:44, torikoshia wrote: > Updated the patch. Thanks for updating the patch! auto_explain can log the plan of even nested statement if auto_explain.log_nested_statements is enabled. But ISTM that pg_log_current_plan() cannot log that plan. Is this intentional? I think that it's better to make pg_log_current_plan() log the plan of even nested statement. + es->format = EXPLAIN_FORMAT_TEXT; + es->settings = true; Since pg_log_current_plan() is usually used to investigate and trouble-shoot the long running queries, IMO it's better to enable es->verbose by default and get additional information about the queries. Thought? + * pg_log_current_plan + * Signal a backend process to log plan the of running query. "plan the of" is typo? + * Only superusers are allowed to signal to log plan because any users to + * issue this request at an unbounded rate would cause lots of log messages + * and which can lead to denial of service. "because any users" should be "because allowing any users" like the comment for pg_log_backend_memory_contexts()? + * All the actual work is deferred to ProcessLogExplainInterrupt(), "ProcessLogExplainInterrupt()" should be "ProcessLogCurrentPlanInterrupt()"? Regards, -- Fujii Masao Advanced Computing Technology Center Research and Development Headquarters NTT DATA CORPORATION