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.96) (envelope-from ) id 1x0wSm-004tgP-1G for pgsql-hackers@arkaria.postgresql.org; Mon, 31 Aug 2026 07:29:52 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1x0wSl-00G6Ub-0m for pgsql-hackers@arkaria.postgresql.org; Mon, 31 Aug 2026 07:29:51 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1x0wSk-00G6U5-33 for pgsql-hackers@lists.postgresql.org; Mon, 31 Aug 2026 07:29:50 +0000 Received: from fhigh-b4-smtp.messagingengine.com ([202.12.124.155]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1x0wSj-00000003GUF-1glA for pgsql-hackers@postgresql.org; Mon, 31 Aug 2026 07:29:50 +0000 Received: from phl-compute-05.internal (phl-compute-05.internal [10.202.2.45]) by mailfhigh.stl.internal (Postfix) with ESMTP id 54C077A0171; Mon, 31 Aug 2026 03:29:48 -0400 (EDT) Received: from phl-frontend-04 ([10.202.2.163]) by phl-compute-05.internal (MEProxy); Mon, 31 Aug 2026 03:29:48 -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=1788161388; x=1788247788; bh=L6buq+qWa0 qf0kPZEl3UIqi+PywsJfLfsUsilkiuVNg=; b=kD7FlF73yfSieDjLuONJjqYBkM kT/x0V3ryTKwxouhLFMSKY/qWpdonjEjqe9uPMLvBGlc92Que0gyb2eSmQhk7lmA B2djuYutW+L6EPcwRT3E0tCBnQz1ImNmcEA5s/9XBnnwOm/QtiQzNTTG5cmjfes2 6rbhTjza1hVQoryZ30HCf08clgS8vGyUiCg3t+b21D6kEPfjZNxNEDY1ZXOOQ7HY mQkhrfmXCd0mtmk4xAbZFMdq6P93DCH9PoTDDqxHChTr7kmvoKgmbca08YsNv1eb ShspiN9GaKogr+poQc/yPs2MXoo7FA+QRPpg/l2HlJVxVMIOxCYWV+hLUHaw== 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= 1788161388; x=1788247788; bh=L6buq+qWa0qf0kPZEl3UIqi+PywsJfLfsUs ilkiuVNg=; b=UUtAmoSeTpbKBv0WKmYij+aXDkf4m+vwmZxiDMuMb2KWRsBKbht KURQonk+tYKnQ46m+TXa+Z3SfS50DcyVGeoWBatpkQ1I2S+sRJHcTEPDTXbCVjNn bW4/bA/k36yaJi/hkLkSFuZcckZP0cGthQzVD/8PAdbUW0ml9TvAw50WRcFtboJQ VQ6p8a9700vpSfZXSwTaAU5BBtnpwRErKAgyfWqOgZ731CzbfPY7xeMTCYMD0X+O /yFXkmy3kEt4Hci+qYRgls4b6Np1YepBRMy6aYKFCc1yrARjl7ey+WeWagorxsGZ T0DA2SF4P2KO+v09RhAGMdPZJN7/KQrB4yQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: dmFkZTE1ajIYDu2ujG3Kd5fjtniKY+UViAmevaeWz7HFNtKtbcKMm47eyWtQnKbjZWElfi wlcvA4+r/o8X+hkc9k28SRnrVt3xMEb1gQEIy5losGhTeZkOoLnfwsG7P449zzJKmsN8oB KBpjlU1Uevmj4oJ+Ix4oYoUevPQC5zeYOIue9HBSy1Fe++BCECupFU1IFosA4/g2qh9KYU cYcYr3NKZXXpqr+yhdOOdz5+rBuQ3NQHZGTht3xaO5YrFiJ/pCW5w3qW9zzorRIf1f8FW3 AiQZdZ3a4IDckYk00VUWfFsoRFVozs15gdKufGHNCDG/ON3Eq8Jo4pW1P696ZbrZdTiTJ/ SZcQLhVc6B1KFqU+EHJi78WIZxoWpcLz/axhhZjPIFvejmeW6SBsn4xnbxTpHNb0Xakdfe Q6hXxwNkHnVjLhparEP/+l5aaOQRHMFZZAYlZ1MNb2uLb6vjhFefRTDmu0Wg6lyyYA4cmy 5XRqymtLahfRFPVrTvZbPcoIxjGt7rw6q11/KEulOWO13tJPxE7VZft0TVSOi1jmgQVfQz Qn9WXb44qMWWUqR6S8Mi//S3hPQwy6zim1L5IjSuzA51lClKcZeHoMQofSGI5jXqmXpwtC Eh6bawcIB8ekIXzZyC43Fkp3kOLt/iqYCoRAEtG/NA0QW2DeIYJ1ffk73yzg X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 31 Aug 2026 03:29:46 -0400 (EDT) Date: Mon, 31 Aug 2026 16:29:42 +0900 From: Michael Paquier To: Chao Li Cc: PostgreSQL-development , chong.peng@enmotech.com, Lukas Fittl Subject: Re: Fix pg_stat_statements losing normalized query text after reset Message-ID: References: <29410A4B-9E7B-4557-A289-B8AB6299707F@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="KodXiBNHhOF4qvFy" Content-Disposition: inline In-Reply-To: <29410A4B-9E7B-4557-A289-B8AB6299707F@gmail.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --KodXiBNHhOF4qvFy Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, Aug 31, 2026 at 03:07:47PM +0800, Chao Li wrote: > Based on this understanding, I made a fix that resets existing > entries back to the sticky state rather than deleting them. This > preserves the normalized query text for cached prepared > statements. If a query with the same query ID is parsed again later, > the sticky entry is updated with the newly normalized query > text. I=E2=80=99m not very familiar with the history and design > considerations around pg_stat_statements_reset(), so I don=E2=80=99t have > full confidence that retaining the entries is the intended approach, > so comments are welcome. I doubt that this is worth complicating the code of PGSS for. pg_stat_statements_reset() is used, sure, but the case of a prepared statement reusing a non-normalized query post-reset feels too edgy for me to care about. Let's keep the code simpler. -- Michael --KodXiBNHhOF4qvFy Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmqVLWYACgkQnvQgOdby QH04nQ//WYqIpSqy19w7eq/XDSfaJ/q6+xl/71VsvT+njD2RhcgsOfymipahP+Il WaWnbe6GQHVUDTIaWAwiUVKRUczw7rlyxwUoZqJirTaqXvNL40ZwY+17keDD4QOb MjbJ9WaGZum0l5BvoMmDCtNaupTKGkGWBfaJbs34QCfS3UiBwvm//9Fuj2KCBfes 3Pp5DxFUVo6bATaZDe4fhQz6M8kW558ozCd/LFz+Tg62HLO4DliUrTS5Vc3j4coo 4B/OC6tNtQLTeAwiZKe3GA/Ya7LXkaPxRXldy8CjexMlTng5D4TTbfBTYH6kQwMw D2RtyUpMuwDb79v+KluB7v6HjOZXUapnM3zs0PNU+v2Oru/rP4+Fp7JVi/aTj0zf 5ZgfkFB6uEEnTpFZXPcXMwh+mZ3XyQjTmiXORpkAk45jvMB2WGAZmeL7XCmu6kx5 ShXc4yxrsImSaZbiKVHgFXXVYLdjU3qZFRaXNEr1TJPxua35LAcX9n8DAbXk/xBK KmfqfLCAcM2M8wmt6kNeOgK/3xzT9clYCewn9NPttXAL8ay+5rj8K/IgbiCaedKN UN8gNiAjt32r68KeZ/FKKE8OvncswxgVLH6aShzjYn3I7U+bwyVW+uXrgkZ6+bbN cCZJRZm5rAkuZ5VPeaCswQVExq5wtlul+lafndZmpg6SYQfjpmo= =gctF -----END PGP SIGNATURE----- --KodXiBNHhOF4qvFy--