Re: pg_stat_statements has duplicate entries for the same query & queryId

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Daniel Verite <daniel(at)manitou-mail(dot)org>
Cc: Jevon Cowell <jcowell(at)atlassian(dot)com>, pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: pg_stat_statements has duplicate entries for the same query & queryId
Date: 2025-05-19 21:51:23
Message-ID: aCun21dAxukwyoW0@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, May 19, 2025 at 09:07:35AM +0200, Daniel Verite wrote:
> That looks normal. The unicity to expect is on
> (queryid, userid, dbid, toplevel).
>
> From https://www.postgresql.org/docs/current/pgstatstatements.html :
>
> This view contains one row for each distinct combination of database
> ID, user ID, query ID and whether it's a top-level statement or not
> (up to the maximum number of distinct statements that the module can
> track)

Yeah. The uniqueness of the entries in the PGSS hash table is
enforced by pgssHashKey in pg_stat_statements.c. Or an unknown bug
has been found, but there is no data proving that here.
--
Michael

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Moreno Andreo 2025-05-20 09:17:25 Re: Logical replication, need to reclaim big disk space
Previous Message Ron Johnson 2025-05-19 19:05:51 Re: get speed help