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.94.2) (envelope-from ) id 1rAlem-0088dx-Th for pgsql-performance@arkaria.postgresql.org; Wed, 06 Dec 2023 06:45:16 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1rAlel-007qsP-6n for pgsql-performance@arkaria.postgresql.org; Wed, 06 Dec 2023 06:45:15 +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.94.2) (envelope-from ) id 1rAlek-007qsH-Ql for pgsql-performance@lists.postgresql.org; Wed, 06 Dec 2023 06:45:14 +0000 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1rAleh-00ALYl-Je for pgsql-performance@lists.postgresql.org; Wed, 06 Dec 2023 06:45:14 +0000 Received: by mail-wr1-x432.google.com with SMTP id ffacd0b85a97d-332fd81fc8dso390361f8f.3 for ; Tue, 05 Dec 2023 22:45:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701845110; x=1702449910; darn=lists.postgresql.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=BpO4oEvg4pf96HJsPKnEED6J1+pEi6OJ2Za2H4UahTE=; b=lVTcw6YCO5B36986P+JHv0PsiL9F0TtkRGL3J4r4i2bnQt4DmW4eUVpulz/7iYXwIf 7Yl5CNTtxJmmBPAt5ftjhmKVtmj7t51Ksjbgh7H2jWP1PwyChlxjZL8X8Tr6IX/N8Ksr 8Uf+7AYgVj2hGwhIVQ8/fW7YXolLmUJisNlz9YuWaXjIC2k0SZx3LSRmzfhwTkOmY9+2 Mw+0h4aX7+VM2SqnK1USsLFjGdsXx0nY0et8iI+VBvfZDl4eYZ9KiRfjdAIk+qZhbzAs OFXPHrbAcygYbPu69/ddraq3yxiX1N8h9h1RVWKPw3TZxQNJNVDOpLFxXdesuCpNMMAv GtfQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701845110; x=1702449910; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=BpO4oEvg4pf96HJsPKnEED6J1+pEi6OJ2Za2H4UahTE=; b=ns8FRcenPVpWKWL1HVy3sZoLleY+DgxMLuEOj7kGh0a0V4PWcubvz/usmlPqE6SPjJ 4zQPHHx+YcrAMeRaO0mQeFZevQlwM9g6vCo5gdHrXUBuYgik9qQkHvKwiSwyRYpGrQgk 1kpJFbgGaEVdCu5dE1U+xJmYKtCEsIyhsifKiyYkAxBTfR39pqxWQoXg4NesisFOuV5n 3QXD6TLJTPcqFxsbZ69tFXKZLVAShZ6YEaILwtolFtsFeCf7atiplS86yxKanxc611CS 5eJnZqJfThDu7QKnwBRpV89DkCksITblINMWei31eKpo0zNvub16f9Iici5jikOBHOX6 XAHg== X-Gm-Message-State: AOJu0YwvTN6babH5AdG8jrO+IefBu74nS8i33SwsAN19YkUb2MRjHVlh JDJu0WwgL+JoFLyVOv1Ys/A= X-Google-Smtp-Source: AGHT+IG/2jiJhVBvXOM2mUYn/U+pPFIdioJoTdagqhOKAAjMeXzkZIJ9JsEaHfhdMWXZtxyq5yAYZA== X-Received: by 2002:adf:f402:0:b0:333:2fd2:68bc with SMTP id g2-20020adff402000000b003332fd268bcmr186610wro.79.1701845109406; Tue, 05 Dec 2023 22:45:09 -0800 (PST) Received: from jrouhaud ([2a01:e0a:c:bcf0:dd4b:b60f:ae55:a0e6]) by smtp.gmail.com with ESMTPSA id w7-20020a5d6087000000b0033340937da6sm9270728wrt.95.2023.12.05.22.45.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 05 Dec 2023 22:45:09 -0800 (PST) Date: Wed, 6 Dec 2023 07:45:07 +0100 From: Julien Rouhaud To: Jerry Brenner Cc: pgsql-performance@lists.postgresql.org Subject: Re: Include a timestamp in future versions of pg_stat_statements when when a query entered the cache? 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 Hi, On Tue, Dec 05, 2023 at 06:28:54AM -0800, Jerry Brenner wrote: > It would be helpful if a timestamp column was added to pg_stat_statements > to denote when a query entered the view. This would make it easier to tell > how frequently a query is being executed (100,000 times since a specific > timestamp vs 100,000 times since the execution stats were last reset.) This was actually done a few weeks ago, and will be available with pg 17. You can see the 2 new timestamp counters (one for the whole record, one for the minmax counters only) documentation at https://www.postgresql.org/docs/devel/pgstatstatements.html