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.96) (envelope-from ) id 1vnJFS-004ww0-0K for pgsql-hackers@arkaria.postgresql.org; Tue, 03 Feb 2026 16:27:30 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vnJFR-006BSv-0U for pgsql-hackers@arkaria.postgresql.org; Tue, 03 Feb 2026 16:27:28 +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.96) (envelope-from ) id 1vnJFQ-006BSn-2o for pgsql-hackers@lists.postgresql.org; Tue, 03 Feb 2026 16:27:28 +0000 Received: from goedel.df7cb.de ([2a01:4f8:c013:1d4::1]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1vnJFO-00000000rg3-1Gtj for pgsql-hackers@lists.postgresql.org; Tue, 03 Feb 2026 16:27:28 +0000 Received: from msg.df7cb.de (unknown [IPv6:2a02:908:1472:9340:f0ad:fc6e:9c86:f1dc]) by goedel.df7cb.de (Postfix) with ESMTPSA id 8CF2B4A0; Tue, 03 Feb 2026 16:27:25 +0000 (UTC) Date: Tue, 3 Feb 2026 17:27:24 +0100 From: Christoph Berg To: Sami Imseih Cc: Pavlo Golub , pgsql-hackers@lists.postgresql.org Subject: Re: Re[2]: [PATCH] Add last_executed timestamp to pg_stat_statements Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Re: Sami Imseih > I wonder if we can use GetCurrentStatementStartTimestamp() > instead? The main use case for this column is being able to retrieve the stats that were updated since the last time one was looking. That only works if it's the statement end time, or else long-running statements spanning more than one poll interval would be missed. Perhaps the column should rather be called "stats_last_updated" to match "stats_since", and be moved to the very end? Similarly, nested statements would also have to get that stamp. Oh and, yes, I'm definitely +1 on this feature. Christoph