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 1uH8OY-00E7Jx-Sc for pgsql-general@arkaria.postgresql.org; Mon, 19 May 2025 21:51:39 +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 1uH8OX-001gAz-Uo for pgsql-general@arkaria.postgresql.org; Mon, 19 May 2025 21:51:37 +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 1uH8OX-001gAq-KV for pgsql-general@lists.postgresql.org; Mon, 19 May 2025 21:51:37 +0000 Received: from fhigh-b3-smtp.messagingengine.com ([202.12.124.154]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1uH8OU-002ktQ-27 for pgsql-general@lists.postgresql.org; Mon, 19 May 2025 21:51:37 +0000 Received: from phl-compute-05.internal (phl-compute-05.phl.internal [10.202.2.45]) by mailfhigh.stl.internal (Postfix) with ESMTP id 8FF9E2540126; Mon, 19 May 2025 17:51:32 -0400 (EDT) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-05.internal (MEProxy); Mon, 19 May 2025 17:51:32 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= cc:cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:subject :subject:to:to; s=fm3; t=1747691492; x=1747777892; bh=NeOHYXZyC1 SbYHx+uaTwo94u5MyNMzEXErhmilrtRhg=; b=Z2eGRJbxPOBi4IvSShuVwMj+KT zsKVZfrx9+CG7HLu3mLAa22pxllhTL0UEn1oFDIqYpEDtglUoMxac0MqqLtiP5gW UdL6R42wxwtqoYCeJwjbRRY/5eWikS7IaBsqD2lXXjLN1zyy0rWqlBxADoUAAc1E 2shOkRqVKQ36+GPheuQ8apHquNLMFDdAH2cFhrbZ2tBDgLXb58PClEc/CAnXCb8h p7jHWGFW3IWNkTWSzybDl1E3OjA4jeKhPA2TPNDw9ByHWBg8xvAohtN7303YHlfe SZczk0/zhSObRBNy7NBIsM3TUcLscHWlrowXYCHczT9KFrO78kaHG3koRZig== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-type:content-type:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:subject:subject:to :to:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t= 1747691492; x=1747777892; bh=NeOHYXZyC1SbYHx+uaTwo94u5MyNMzEXErh milrtRhg=; b=ew89YJplj9/6tCgvOUZh1m1nrKvX+zHI9jvy4lB+iszgEnX61Qc wt01WwmaMdr2Emnhx5VwRE9upNWgyDPxu86hxEYNEpbFl0OUJyH41KOn4KfFLxfv BQW7aA9u+pbtkPUBe0FQXF35RlPAPwxFY8CkKt7T/6zBFEC+URhZDtooyemNWI65 Q2MiTSjMqQsFfmzRZ2kmKTKNZb0K2bskQuvVzfs505PJzQ04jluB7oIWnWsQ3PT7 7rBELqrxZbkDThn7U4iCJC7k2RMBHzxi+6Bap+YumbmwR6T8TX5ZNWQfvnPArSk+ r9IfoNVvCAWG8V/oroD5nGyLvyafBPTk9pA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdefvddvhedtucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggv pdfurfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpih gvnhhtshculddquddttddmnegfrhhlucfvnfffucdlfeehmdenucfjughrpeffhffvvefu kfhfgggtuggjsehgtderredttddvnecuhfhrohhmpefoihgthhgrvghlucfrrghquhhivg hruceomhhitghhrggvlhesphgrqhhuihgvrhdrgiihiieqnecuggftrfgrthhtvghrnhep geffjeevgfevuddvjedtvddtieejheduueelvddufedtgfefjedvkeevkeeivddvnecuff homhgrihhnpehpohhsthhgrhgvshhqlhdrohhrghenucevlhhushhtvghrufhiiigvpedt necurfgrrhgrmhepmhgrihhlfhhrohhmpehmihgthhgrvghlsehprghquhhivghrrdighi iipdhnsggprhgtphhtthhopeefpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopegu rghnihgvlhesmhgrnhhithhouhdqmhgrihhlrdhorhhgpdhrtghpthhtohepjhgtohifvg hllhesrghtlhgrshhsihgrnhdrtghomhdprhgtphhtthhopehpghhsqhhlqdhgvghnvghr rghlsehlihhsthhsrdhpohhsthhgrhgvshhqlhdrohhrgh X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 19 May 2025 17:51:30 -0400 (EDT) Date: Tue, 20 May 2025 06:51:23 +0900 From: Michael Paquier To: Daniel Verite Cc: Jevon Cowell , pgsql-general@lists.postgresql.org Subject: Re: pg_stat_statements has duplicate entries for the same query & queryId Message-ID: References: <2c2446a8-ec7e-4a91-b69d-62e70f1dc51c@manitou-mail.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="Zurnl/wA0Ov18ful" Content-Disposition: inline In-Reply-To: <2c2446a8-ec7e-4a91-b69d-62e70f1dc51c@manitou-mail.org> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --Zurnl/wA0Ov18ful Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, May 19, 2025 at 09:07:35AM +0200, Daniel Verite wrote: > That looks normal. The unicity to expect is on=20 > (queryid, userid, dbid, toplevel). >=20 > From https://www.postgresql.org/docs/current/pgstatstatements.html : >=20 > 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 --Zurnl/wA0Ov18ful Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmgrp9sACgkQnvQgOdby QH0QaRAAglIdj0mdI8O4oqc8ScZdwnYbiRQu4+yEHmaINN73uVAORAoB1/JnSPfq j5rRiUMH2FGcoYCRzJlQqP2u33r8LowZ0Rg4IStdW0pzAVaLpRvdX2OJIRlGjeNr Ocf6lD76Xe1jUmEW+zBnI3o7yUX6819xXN6YAqp3cORY5sWdGxvIxW157yayPfXS RKqyETOeYg/h2TLKVgB2oZZ/huRge8v4Ahn/QQswlYbtUJ4SH6DccyMt7tD9v7g2 Wc4B7ApvKQVvnlPsz4Pdx7SQzALXofthz7oV2gkAuDLGqttSNEkoEW/8Y0F80ACl U+CKfKbX7JOwSOLMv0AHsOhmmkUkPkluo91k3Bl2K9gSni2P2cVN6gNMfeBIslYc aLLlbwAyzq7CQ5E3MkjctNTt6hrLJ7/ZMiQA3hN+5qdEDfJKWh1ClTOlpD0c1iUa LQMbkNRcb5Nv69lfEFZrCUTIiClDOQFOwJBsj1br7YaBABTbKem7wlr77k0l0WWZ ChZe4Ev+HYhZs7Fbme0zc0HPeD8WHH4wMsQRDoFZs0DmRq35Q0OIGS+/0u0jv2Yf Exgw7wyd7B/Bjyvz8QgqZeocdewrbdujjoAQ+5StSEXVdLH3JkXyAAZlr5do5OaR hryZRVc//TUil7P4dRoawYdFwKyZG7l8/n/nAksYFemidI3rtf8= =EZqn -----END PGP SIGNATURE----- --Zurnl/wA0Ov18ful--