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 1w5GWK-0034b4-2i for pgsql-hackers@arkaria.postgresql.org; Wed, 25 Mar 2026 05:11:08 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w5GWJ-00Bpck-19 for pgsql-hackers@arkaria.postgresql.org; Wed, 25 Mar 2026 05:11:07 +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 1w5GWJ-00Bpcb-0C for pgsql-hackers@lists.postgresql.org; Wed, 25 Mar 2026 05:11:07 +0000 Received: from fhigh-a7-smtp.messagingengine.com ([103.168.172.158]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1w5GWH-00000000uZw-33b2 for pgsql-hackers@postgresql.org; Wed, 25 Mar 2026 05:11:06 +0000 Received: from phl-compute-06.internal (phl-compute-06.internal [10.202.2.46]) by mailfhigh.phl.internal (Postfix) with ESMTP id 3570E140026C; Wed, 25 Mar 2026 01:11:05 -0400 (EDT) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-06.internal (MEProxy); Wed, 25 Mar 2026 01:11:05 -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=fm1; t=1774415465; x=1774501865; bh=xn/SJub8IP dstUtt+6J5l0Ov+tB4LZilwul7WihCeHY=; b=FBIEi2g+AjNkfGAk3S+rBVdRwl 4aPGvsPHaE0KAQRCXnGc/+S/pQND2he7vyzPDt34iYsrX7TuMebzahCI+folOYIX R37Xt7CDYEJ2YeQODtWlJmu1tsBmqGLunP1JbpZCSpmvfkQcazDN/Rwr3I/CAhgU PhkkgQD9NyHFTj+aPZqmkRI0xn0M/93tu/tfguETALQdxSM4OWF90EwNmhm71seU /8yIxD2KxDmLl+HvoBmmkaWiiOZ0nivzE2Qn7MRlRAN0vDPDDE6drl2jyS9aWLyJ wfovNeID2fsdG+8R7oKU62BPIUsbGqduB+w7IhvODnFcBinS7vwv3F/15zHw== 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=fm1; t= 1774415465; x=1774501865; bh=xn/SJub8IPdstUtt+6J5l0Ov+tB4LZilwul 7WihCeHY=; b=na3mZkYXjvJR8lGw2qEnyKsNYW+TJ2Q5154EhP1e40QqHaUlaGh walDP1xhRMR3Qs6Q3Fbo4rcnt4lXtoRi+UNZ1PxIGjK76wWTMTMzz9UYpPS2CHDv K//XXFzK6g9Do5FxUGxZZe6vu2IZoVs62NA5xWNqOVQbkIvBflgnuAsMq7uogEtT 45W5sUDKcpVtCBl+a8dmhTJU0E3ChY+vdeyJqGO8WQFRdU14NphJAIbpHgqwnP3l ByhYM0On4t0+Qqy6gqvbhUHkhIsv/s33pcebIxVIZedXyQ/0tEMJh7MAWh25whjn gqXeRKa8pVF36RnHZyb9qBbfyNgHbkm2XFQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgdefvdefheelucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnegfrh hlucfvnfffucdljedtmdenucfjughrpeffhffvvefukfhfgggtuggjsehgtderredttddv necuhfhrohhmpefoihgthhgrvghlucfrrghquhhivghruceomhhitghhrggvlhesphgrqh huihgvrhdrgiihiieqnecuggftrfgrthhtvghrnhepteelieefudffhffhtdetleeggeeg fffhkeeuveetiefgudduvedutefggeeivdejnecuvehluhhsthgvrhfuihiivgeptdenuc frrghrrghmpehmrghilhhfrhhomhepmhhitghhrggvlhesphgrqhhuihgvrhdrgiihiidp nhgspghrtghpthhtohepfedpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtoheprhhkhh grphhovheshigrnhguvgigqdhtvggrmhdrrhhupdhrtghpthhtohepgiegmhhmmheshigr nhguvgigqdhtvggrmhdrrhhupdhrtghpthhtohepphhgshhqlhdqhhgrtghkvghrshesph hoshhtghhrvghsqhhlrdhorhhg X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 25 Mar 2026 01:11:03 -0400 (EDT) Date: Wed, 25 Mar 2026 14:11:00 +0900 From: Michael Paquier To: Roman Khapov Cc: Andrey Borodin , "pgsql-hackers@postgresql.org" Subject: Re: [PATCH v2] Re: Cancel problems of query to pg_stat_statements Message-ID: References: <31431745515032@mail.yandex-team.ru> <26A1F7AF-810A-4D60-A6CB-8B749BCCE747@yandex-team.ru> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="fLoHdRFoaR3zvXk4" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --fLoHdRFoaR3zvXk4 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mon, May 12, 2025 at 03:48:29PM +0500, Roman Khapov wrote: > Its true that qtext_load_file() can be called with acquired lock in > pg_stat_statements_internal()... > So I perform INTERRUPTS_PENDING_CONDITION in v2 patch and call > CHECK_FOR_INTERRUPTS later, after cycle ended and lock released. This patch is only a workaround for a larger problem: the PGSS text file does not and will never scale once it reaches a large size and once we have a high turnover rate of the PGSS entries due to different query IDs. FWIW, Sami Imseih has mentioned to me a few days ago that the state of the pgstats API (that can be used for custom stats kinds as well) was basically in a shape good enough to move PGSS to pgstats as a custom kind, and we should be able to move the query text file to be entirely in-memory. This proposal will hopefully materialize at the beginning of the v20 cycle. -- Michael --fLoHdRFoaR3zvXk4 Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmnDbmMACgkQnvQgOdby QH3U7w/8C0cORrLyqFaTluxc9h9llO+sjmNZ0iun2HURstOTz+L1xL3EX0/KsmoC 4/F76Y0F82sNEPopq0bW/OQFA7sN9RUBMri5JP2nRc6A+RuKymBvtxaWBby+L1BH 7v1sHfyG/wJ1z3+X6WWjydKna7pxVK212MPhwVqXYz9B1W3fTeQ/pZjvIOtnRfuL IFFjc53xJBsfqH1gTenRTAYdDBxcnYJiz7DhMa4vM8d/AyM0K0LZZNcPFMgHRkKA Ta1A+7tpfei0hgs4p5gl71+4A9h2tTVCkM5BvNADeKCW2VibKaYpztRCzaiJ6w8+ z5/Jw4E0N9wPn47l2T6tMvX6FHnHYxFKLnpc8O/M+JHD0cX5g2IMP3uSDxbyCFX5 a30li5UdlsQi/IhU/9JlUilLwgys5ulILITIVAk5iw8EG/Mpm+YKMdC3alrk+8Rt 777rQgYFJYw1COk6bZ/aAYT9S6R6xjUPJeMb3yfwFDWmWZzfVKVklZqXJfI446+v MXHWbRYuNtlt827ZSzY/ENs6rXpkaQUQm9ET8FIHsw/vytV6oBLrVcTAiScDsuzk jS29KQgB+Ddlu2xLBJU5qUakKjG5kI9Ztn5zdd36tR8O2+EjqEiBqgT2JrLJnVai JFWGLgHRDr0m06CRmjY7+yrqeZOQAt4xZggwyKKApIliucrvMRA= =fiKT -----END PGP SIGNATURE----- --fLoHdRFoaR3zvXk4--