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 1voKpp-001b5n-0x for pgsql-hackers@arkaria.postgresql.org; Fri, 06 Feb 2026 12:21:17 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1voKpo-003bON-0n for pgsql-hackers@arkaria.postgresql.org; Fri, 06 Feb 2026 12:21:16 +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 1voKpn-003bOF-35 for pgsql-hackers@lists.postgresql.org; Fri, 06 Feb 2026 12:21:15 +0000 Received: from goedel.df7cb.de ([2a01:4f8:c013:1d4::1]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1voKpl-00000000pzi-30zJ for pgsql-hackers@lists.postgresql.org; Fri, 06 Feb 2026 12:21:14 +0000 Received: from msg.df7cb.de (unknown [IPv6:2a02:908:1472:9340:f0ad:fc6e:9c86:f1dc]) by goedel.df7cb.de (Postfix) with ESMTPSA id 1E2DE10F73; Fri, 06 Feb 2026 12:21:10 +0000 (UTC) Date: Fri, 6 Feb 2026 13:21:09 +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 > If we do > > WHERE last_execution_start + max_exec_time * INTERVAL '1 ms' > NOW() - > polling_interval Is this extra complexity worth one saved GetCurrentTimestamp()? src/backend/access/transam/xact.c is calling GetCurrentTimestamp a lot already, so I don't really buy the argument it should be avoided at all cost in pg_stat_statements. Just storing the statement end time would make this use case much nicer. Christoph