public inbox for pgsql-hackers@postgresql.org
help / color / mirror / Atom feedFrom: Julien Rouhaud <rjuju123@gmail.com>
To: Lukas Fittl <lukas@fittl.com>
Cc: Sami Imseih <samimseih@gmail.com>
Cc: pgsql-hackers <pgsql-hackers@postgresql.org>
Subject: Re: Improve pg_stat_statements scalability
Date: Sun, 24 May 2026 07:25:57 +0800
Message-ID: <ahI3hfji3FI6fY5X@jrouhaud> (raw)
In-Reply-To: <CAP53PkyWD99bNwFVv2KibfL4bhm-D78QAnc9UqQQJdtJ3mQWPQ@mail.gmail.com>
References: <CAA5RZ0vZwR_dSK6fo0P2-EnskUVN0NjLHnGnJMFDPC8-kEW3sQ@mail.gmail.com>
<CAP53Pky9CViOfy1yQxJv0VE7aEiuDb13SppwGa7T_qOeBSumfA@mail.gmail.com>
<CAP53PkyWD99bNwFVv2KibfL4bhm-D78QAnc9UqQQJdtJ3mQWPQ@mail.gmail.com>
Hi,
On Fri, May 22, 2026 at 06:15:00PM -0700, Lukas Fittl wrote:
>
> For archive's sake and others reading along, we had a productive
> discussion about this today at PGConf.Dev.
>
> I've created a new wiki page combining the prior 2025 discussion, and
> notes from today:
>
> https://wiki.postgresql.org/wiki/Scalability_of_pg_stat_statements
Thanks a lot Lukas!
Just a small clarification, I wasn't asking for a way to remember the last time
a query was executed (although I think it's a very good thing to have), but
remembering the time each query text was saved.
In a reasonable system (that is a system where the number of entries doesn't
grow much more than pg_stat_statements.max, ie, you can actually use the
current version pg_stat_statements) you will likely get a lot of entries even
if you filter out the entries that didn't get executed in the last X minutes.
However, the vast majority of them should not be new queries. So if you
maintain an external system that snapshot pg_stat_statements once in a while
you only care about the (possibly) missing query texts, which should be a very
small fraction of all the records you otherwise need.
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: rjuju123@gmail.com, lukas@fittl.com, samimseih@gmail.com
Subject: Re: Improve pg_stat_statements scalability
In-Reply-To: <ahI3hfji3FI6fY5X@jrouhaud>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox