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 1pHtT8-0003oz-1x for pgsql-general@arkaria.postgresql.org; Tue, 17 Jan 2023 21:26:10 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pHtT6-0004Up-OC for pgsql-general@arkaria.postgresql.org; Tue, 17 Jan 2023 21:26:08 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pHtT6-0004Ue-Da for pgsql-general@lists.postgresql.org; Tue, 17 Jan 2023 21:26:08 +0000 Received: from momjian.us ([72.94.173.45]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pHtT2-0000tK-AJ for pgsql-general@lists.postgresql.org; Tue, 17 Jan 2023 21:26:07 +0000 Received: from bruce by momjian.us with local (Exim 4.94.2) (envelope-from ) id 1pHtT0-00B98K-8v; Tue, 17 Jan 2023 16:26:02 -0500 Date: Tue, 17 Jan 2023 16:26:02 -0500 From: Bruce Momjian To: Alicja Kucharczyk Cc: Ron , pgsql-general@lists.postgresql.org Subject: Re: Use case for enabling log_duration other than benchmarking Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, Jan 10, 2023 at 04:57:11PM +0100, Alicja Kucharczyk wrote: > thank you Ron. > My question is a bit more practical - Does anyone really find it useful?  > What value brings the info that 20% of my query are under 1ms and 10% over 1 > minute - If just checked once and then turned off - I can understand to have > more visibility into the overall characteristics. But let say someone have it > enabled on a production system all the time - what could be the reason for > that? I think the big value is that enabling log_statement and log_duration prints the statement text when it _starts, while enabling only log_min_duration_statement prints the statement and duration when it _ends_. -- Bruce Momjian https://momjian.us EDB https://enterprisedb.com Embrace your flaws. They make you human, rather than perfect, which you will never be.