Re: Improve pg_stat_statements scalability - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: Improve pg_stat_statements scalability
Date
Msg-id ajtac8Fml_UPB6uL@paquier.xyz
Whole thread
In response to Re: Improve pg_stat_statements scalability  (Sami Imseih <samimseih@gmail.com>)
List pgsql-hackers
On Fri, Jun 12, 2026 at 06:21:42PM -0500, Sami Imseih wrote:
> I have implemented an approach, which I will share in the next
> revision, where every stats kind is written to its own dedicated
> dshash rather than into the common one. This is a new
> configuration in PgStat_KindInfo where an extension (or even a
> core stats kind) can request to be placed in a dedicated hash,
> else in the common hash.
>
> I like this better, especially for kinds with unique access
> patterns like pg_stat_statements, where the view function and
> eviction need to iterate over all their own entries frequently.
> A dedicated hash eliminates the full-scan problem without a
> secondary coordination dshash.

I'm finding this alternative quite appealing, indeed.  For PGSS, I was
wondering about how it would be possible to avoid a secondary hash,
and I did not consider an approach where we could bypass the main one.
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: Gilles Darold
Date:
Subject: Re: Global temporary tables
Next
From: Bharath Rupireddy
Date:
Subject: Re: enhance wraparound warnings