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 1vo6pX-00FXpn-0a for pgsql-hackers@arkaria.postgresql.org; Thu, 05 Feb 2026 21:24:03 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1vo6pW-0012Zu-0g for pgsql-hackers@arkaria.postgresql.org; Thu, 05 Feb 2026 21:24:02 +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 1vo6pV-0012Zk-2v for pgsql-hackers@lists.postgresql.org; Thu, 05 Feb 2026 21:24:01 +0000 Received: from mail-ej1-x633.google.com ([2a00:1450:4864:20::633]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1vo6pT-00000001Fer-1KQf for pgsql-hackers@lists.postgresql.org; Thu, 05 Feb 2026 21:24:01 +0000 Received: by mail-ej1-x633.google.com with SMTP id a640c23a62f3a-b886fc047d5so245507366b.3 for ; Thu, 05 Feb 2026 13:23:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1770326638; cv=none; d=google.com; s=arc-20240605; b=bDLDHiGMWjEfnJvkb+2JGvjweyyAkL7qoT0HQJG6Hm5A4p/rTuzWWZmgRGZVwqMiU9 Jx8Tsbzh5oXVT390ssRjeCN8l8fSI97gaZAy6wwQWg4GxkTqY7Wvh9WcvcRnKnenkmkr ynyq0jpk5b3xxuZRpROlGmKXUgxhj4xl9HzQ9L2klUCgUCMfnPTJA8jes7jAvA+eRpbL wD7jBqfm47kUqwXJSn0ImimUoIcLDYkyG8yh5H6BxSgoyqVnWzqTV7leoDp2+Nh4gWg7 S+V7N6WOluZMVoUDicpn0Sx82BgXf9DwAp5GOx2h8PFF6F7DJQeWpZ0GCSE4qk//HtxF dK5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:dkim-signature; bh=muIY+jWySqaugpOP86g4eEH+isB3WTPqncC+voBD4Ag=; fh=VckkzlXfhDOat7CADFBQxSl68jdbCvTed8MEGvq5hM0=; b=B9YAl2H45has5UqAdcr7BcxMp0iuByY6BsKlZfFyT01+yUc/fgAWrz+EgCQN4BDJJx sPgPqMxzUSW9Zql3twQiS3zNXv1hKKc2H9RxiYgLsbe/vi1IU7PXHQnnoRIQkU3L6Y4/ +9LcG3lApzlacCiDEUKjg4SIAT+PxqveZaA9jrKivaMLJsPYv3vzB67U5vFP8/t8Ok1E WKLjfkYDD/IQVwLSjV23N7K7tdfetzM3tQWFSjJJqkWWk8/iYRJQBC7k97YkcAXTxlMD A/0WPvuMhBZ2LaicMpuRRIQcqE4pJHwRtucFi9tR8909D5pFf1QcrsnSWFuZYA0DO/PQ R6rQ==; darn=lists.postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1770326638; x=1770931438; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=muIY+jWySqaugpOP86g4eEH+isB3WTPqncC+voBD4Ag=; b=WK9oIk8bOSl3oQjfzYG6zZVrekWESCPBqEzUOjZjC1fUz4PZdA1IcCPnsXV/mbKKq9 pA/eLDrNl4IfXHwdmbVQvPEf8LVrLkxRyohoc+xdepTDaN5VDt55zbHR0MpTQ8TvqR0C 1ALFJBBe21YzUK/ddpNfzmympGctcM/8BQRQNjdw+LVilaPSjE6DeMZ3y9J+xSh/lJ9H MZ0dUFF3bhkyykudodngy0yQv40YFxgh0wKq1H8PiAAp+FCE3B3Swfo5B1MHlgySxMzu ayT7o/OLUu8TcJcLQJGTRC2gQA+OHYYFq0Xs/RaAVT195OewFXBFgjWDSIug7pdLBX1M Va2g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770326638; x=1770931438; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=muIY+jWySqaugpOP86g4eEH+isB3WTPqncC+voBD4Ag=; b=RrHKp1AaEe1ByQZ2y3jJKjExLZWeDU01CBQqkRd+oiV/2uAtghmYepH9RfYX5UGeMO jWsyLr23vVFACIOFMLsajC8S4pTLs4mezu9+vELlrAHFZxkP4TRLk6HfOnl8ReQrdcl+ ajzCUiCZDkMKxWGfeo2xpHBSlN8BgrMMfdzq0pAKsllMmhpnJG8+kTYC/nfwqrnkgJDx MziQM3sGsymhkAFkt8Vo7YfYODUhP9lpVbIZeLd/qfRkM8GB23zMoU6vBd3yjCXDhY8D PFd6qIwHYcm9AyzaewqYlI+p/pNci4Il7qXjKViwmgHoKbESxPn65G86HWzI1zgvoz3i 4FyQ== X-Forwarded-Encrypted: i=1; AJvYcCW2KpCKoG00Bp1vV5EVLiKJijlGC4tjK11gbus7H5ykJiL4yZjzMKPLEimn2Yz9KoEwghdxWt+PdXMmXgIo@lists.postgresql.org X-Gm-Message-State: AOJu0Yy+qH+p/HZhG9k+0ZCORmBFdKcbkoLugioltmZKM77sBjCN7Cmk Z+/FL0YrKf0lx2puau103a85MN5wlVDsuBWPBfxEJIh9k7aCG+LiqkEfayvIbiGkWZ0FFl/nKyf fUk0aa6URnBCIsz+ZHxdz5tF3eLHubfA= X-Gm-Gg: AZuq6aJgEUO/okNzaC5Z0ULU81rmaK4TzbEC5zEvOxIkgVgrFLO8+BSauhEp6Q5WWVX 7rXx2pFAwvRORtcdwGOgNzd8m8oG6h53kqdedUsLCoxIJ4CAPOURnMUblgib8osu2JMdtKsIEkx 0TiQN9/x00exOfzugeH+rIq+cIFb8oNuJ1MMYP40nn+gcA8lbGUsqBD6O0JL6DLkjc+9GM+jZHs 2M5icMs/VCWcRjsCH+i/zxueCeT4dL2k4qb4jjPoH2RGGHwB0R77r+W95U5Mb4U1A== X-Received: by 2002:a17:907:987:b0:b7c:f5b6:bb52 with SMTP id a640c23a62f3a-b8edf3749e1mr18219566b.43.1770326637857; Thu, 05 Feb 2026 13:23:57 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Sami Imseih Date: Thu, 5 Feb 2026 15:23:46 -0600 X-Gm-Features: AZwV_QgDn-vToi6d4hNuWlvt6mY3wEprKXnavsPUPXcwrbm7jE_BMuRYZ9vzESE Message-ID: Subject: Re: Re[2]: [PATCH] Add last_executed timestamp to pg_stat_statements To: Pavlo Golub Cc: Bertrand Drouvot , Christoph Berg , pgsql-hackers@lists.postgresql.org Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > 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 concerns 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 Christoph'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. + + 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 completed. " + 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. + 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 = false), this reflects the start time of the top-level statement." what do you think? -- Sami Imseih Amazon Web Services (AWS)