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 1voJSi-0018VW-1G for pgsql-hackers@arkaria.postgresql.org; Fri, 06 Feb 2026 10:53:20 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1voJSh-003Hn3-1s for pgsql-hackers@arkaria.postgresql.org; Fri, 06 Feb 2026 10:53:19 +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.96) (envelope-from ) id 1voJRn-003ECd-1Q for pgsql-hackers@lists.postgresql.org; Fri, 06 Feb 2026 10:52:23 +0000 Received: from goedel.df7cb.de ([49.13.90.212]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1voJRk-00000000pMa-409i for pgsql-hackers@lists.postgresql.org; Fri, 06 Feb 2026 10:52:22 +0000 Received: from msg.df7cb.de (unknown [IPv6:2a02:908:1472:9340:f0ad:fc6e:9c86:f1dc]) by goedel.df7cb.de (Postfix) with ESMTPSA id 0481010F73; Fri, 06 Feb 2026 10:52:18 +0000 (UTC) Date: Fri, 6 Feb 2026 11:52:18 +0100 From: Christoph Berg To: Pavlo Golub Cc: Sami Imseih , Bertrand Drouvot , "pgsql-hackers@lists.postgresql.org" Subject: Re: [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: Pavlo Golub > > I still wonder if "stats_last_updated" is a good name here. What about > > "last_execution_start", since that is exactly what this timestamp is. > > Yeah, sounds better really. Thanks I still believe that storing execution start time is the wrong thing to do as it will miss all long-running statements. Consider this timeline: 09:55 get all stats changed since 09:50 -> doesn't see the statement because it hasn't started yet 09:57 start long-running statement 10:00 get all stats changed since 09:55 -> doesn't see the statement because it's still running 10:02 long-running statement terminates, storing 09:57 as timestamp 10:05 get all stats changed since 10:00 -> doesn't see the statement because it's too old Christoph