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 1voJKi-0015GE-2K for pgsql-hackers@arkaria.postgresql.org; Fri, 06 Feb 2026 10:45:04 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1voJKg-0038c9-1L for pgsql-hackers@arkaria.postgresql.org; Fri, 06 Feb 2026 10:45:02 +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 1voJKg-0038bw-0G for pgsql-hackers@lists.postgresql.org; Fri, 06 Feb 2026 10:45:01 +0000 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1voJKe-00000000pIR-0CQo for pgsql-hackers@lists.postgresql.org; Fri, 06 Feb 2026 10:45:01 +0000 Received: by mail-wr1-x432.google.com with SMTP id ffacd0b85a97d-435903c4040so345319f8f.3 for ; Fri, 06 Feb 2026 02:44:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec.at; s=google; t=1770374698; x=1770979498; darn=lists.postgresql.org; h=content-transfer-encoding:mime-version:user-agent:reply-to :references:in-reply-to:message-id:date:cc:subject:to:from:from:to :cc:subject:date:message-id:reply-to; bh=ydHZzF+yf8r+kIcJOHM1FWgLgJDyyxf4qNIV0hiyuBI=; b=hCjRZdMlYcGIwDWAG610VdCUZ6Jdc0gEyqWs0D1HtiQ36/fh0lXchKj4wvbiGL5//j baads1dZYF0W0wq2DnSJxpAAEjZMZ8B0lHKyMioqQC79UpMgCXTxc/4mU0WrGcyMDAZw WNH7tPmbj9y4C3R+5mowg2jb3pjqNfhd041JVIBeJroadJZSx4eQGzvxXn4/NLIFbY3m mzdD8MDVTZVN80xDEBs6h3Tdil+fZKBhEXoXZcIMQNsEPpEpKeQa7RbqNOVZq60F87HE FoerXmXcbUAJ2YxMUJZXKQT4jU9RTAZvUyj6KNQoIfPtE8fru1DK/a87+vR5XvWNCFUE f2xQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770374698; x=1770979498; h=content-transfer-encoding:mime-version:user-agent:reply-to :references:in-reply-to:message-id:date:cc:subject:to:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ydHZzF+yf8r+kIcJOHM1FWgLgJDyyxf4qNIV0hiyuBI=; b=InAoXSTDK87N5S/M9TlPSOn2yUgaJ7vo7eQy+oe+licGtt/EwpDZ+SEuZ3ccr+LnsY NbTIgFPPWFuA2FB6IsPbJhq4fPygeoKsA05jsYX3l2Qyri67VPiSTAneVO7oaRO9HJyT GUblm5hNTiOO670XMgP4C5G4l1SIm0MRZ7XSrteHXRcVrAQ/e8LBeKulB+0Z0ezDVxXn i9uV9cZwwjjJfBFBmcV7qK8fk8iUqhM7YvZLv3QDmrxw+f3hi3HEAyikNT9AH57W+lZ6 2mocIYB4HAohylOsLweNITgEtpnMu8JMwA8wTion2Y/kcc+UsteTzGVOPlfFpN7Z0TEw c8og== X-Forwarded-Encrypted: i=1; AJvYcCVX8hrE/qvs/yzl8kVbculvUjFS6TBizfI/JUdJMi0DjwBfgt+v7mCE4y2BlyG4P2RW6wVYJDsG9d1d+XuR@lists.postgresql.org X-Gm-Message-State: AOJu0YzfwGFRkpMWi8cMz8csU2al52rAD4+kLZgVBJaDLWoOxuT+A8O+ ZUvyPZ9lmXEgie3jwbAPPB+2XIYq6C+yJE2QWZOpZCsUpd+9QuYkGVialii7lN8zFuA= X-Gm-Gg: AZuq6aIAdihnL89BnErl5DJ5Q00jgT3/CKXDWxJ4bBE9Rr0+ux6UP2j40svl6umhyG5 5muyMZRa/ISC/JIvChUoul+qkuYtj3ioUAxtmFpl0ko/4VFRO/UQSO3PSMaaRmne9gZt9VVcNNK 0zmcgkA/zVvi04W8/hV+ob3PAMSU/ef88N0pNgR+MQnNT4sQeL3d9rhDuaGzSC+f6gB+Wwfh7m0 ZoE7o41kfuydTK9Deh5PCD3MNDRzmVdQDZrFxEeSsjTzF6sHOmSxIUzwxj27pTj3nTFIt72XaPk NhOR2LxrrkCXLBOcYZqECVtC/6ibjKKx70jruEXyVmkns323faArAIVYbFmLBFFobaWDAwKFCdv x3Gce8PKcG60chxcgtKGjRYHZHK5iJFtIcpPcjDo5W6xI1b+e9dQeU/3hxA43q7QoI+Yg+jalzR ArrBJlFl2YNuMXoG4LvkVEesaa7zEdkcf0vZrfb2OvfgYRewxn4Q== X-Received: by 2002:a05:600c:4e0e:b0:47e:e71a:e13a with SMTP id 5b1f17b1804b1-48320221645mr32023505e9.32.1770374698446; Fri, 06 Feb 2026 02:44:58 -0800 (PST) Received: from ?IPv6:::ffff:192.168.0.101? ([62.197.243.85]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-483206b8bbbsm65095485e9.3.2026.02.06.02.44.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Feb 2026 02:44:57 -0800 (PST) From: "Pavlo Golub" To: "Sami Imseih" Subject: Re[4]: [PATCH] Add last_executed timestamp to pg_stat_statements Cc: "Bertrand Drouvot" , "Christoph Berg" , "pgsql-hackers@lists.postgresql.org" Date: Fri, 06 Feb 2026 10:44:58 +0000 Message-Id: In-Reply-To: References: Reply-To: "Pavlo Golub" User-Agent: eM_Client/10.4.4209.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hey >> Thank you to Sami, Christoph, and Bertrand for the thorough review and= valuable >> feedback on v1. I've prepared a v2 patch that addresses all the concern= s raised. > >Thanks for the patch! I have not looked at v2 in detail yet. Did take >a quick peek >at the doc. Some comments: > >> I've renamed the column to `stats_last_updated` as Christoph suggested. = This >> matches the existing "stats_since" column for consistency. Following Ch= ristoph's >> suggestion, I've also moved it to the end of the view. > >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 > > >+ >+ stats_last_updated timestamp with >time zone >+ >+ >+ Time at which the statement statistics were last updated (specifically, >+ the time when the statement most recently started execution). > >Here I think we can just say: > >"The start time of the most recent execution of the statement that complet= ed. " +1 > > >+ This is useful for monitoring tools to identify which statements >+ have been executed since their last poll. > >I am not sure we need this part for the docs. others may disagree. Agree, too much details. > > >+ For nested statements (when pg_stat_statements.track >+ is set to all), this reflects the start time of the >+ parent top-level statement. >+ > >Maybe this is better as it mentioned "toplevel" > >"For nested statements (toplevel =3D false), this reflects the start time >of the top-level statement." I like it. Looks easier to read. > > >what do you think? Thanks, I'll prepare updated patch > > >-- >Sami Imseih >Amazon Web Services (AWS)