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 1w0Wwc-001z1U-1v for pgsql-hackers@arkaria.postgresql.org; Thu, 12 Mar 2026 03:42:43 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w0Wwa-00DA9q-28 for pgsql-hackers@arkaria.postgresql.org; Thu, 12 Mar 2026 03:42:41 +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.96) (envelope-from ) id 1w0WwZ-00DA9h-2S for pgsql-hackers@lists.postgresql.org; Thu, 12 Mar 2026 03:42:40 +0000 Received: from fhigh-a6-smtp.messagingengine.com ([103.168.172.157]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1w0WwX-00000002Ezd-0ww6 for pgsql-hackers@lists.postgresql.org; Thu, 12 Mar 2026 03:42:39 +0000 Received: from phl-compute-06.internal (phl-compute-06.internal [10.202.2.46]) by mailfhigh.phl.internal (Postfix) with ESMTP id 8410C140022A; Wed, 11 Mar 2026 23:42:35 -0400 (EDT) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-06.internal (MEProxy); Wed, 11 Mar 2026 23:42:35 -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=1773286955; x=1773373355; bh=he4ezSkgu1 vz0JOBZyPIG12IMOrJFEhJcyEYKhGPTzU=; b=NUFwTfGjmz0ua83wKq2unwp6yQ ajcTyLYOuwoAsJ9r9/XZu+ENvz+Cm2POWO5dcLU6MMzAzxFcar3L/irIKiQn3d4r 2XWQy7w0MieJ48ylPsyE0S38w4f2LxkkxuSix4FnTPy5PSHa5KAdBZg75mLuortc 0R36/47M1W7d1Fv6NVqki1+OY9+L94yCB6s0MW1lhQkESF6HhSxtj2Q6IVpuN3ct UxFCIRpMABEljvehqVrojSkx0ukKaDyYhU8ypGDh2376ln7PkbVHqYJSBAf2fTlI NDwDO70JDEVf/SKCMvIrcDduycPNmuOdcC9xOIatr/d3TOsPBw4dfwnzZUgA== 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= 1773286955; x=1773373355; bh=he4ezSkgu1vz0JOBZyPIG12IMOrJFEhJcyE YKhGPTzU=; b=NnClwoIaGwRQvhxt80MkSQjqQ6yad5DhGCh0PI/zlHzESXYE0sd z0VNr7sVxec1GM4QwWAacucGduPsy9nFQPEKjBALRxtCc1KiNvNbZHop8uegJSc0 xhOxx7E5qYh1L7cj188T0SRNh80JvoiXYFngMV/bPcnkUBzKt0/tuR1Hs/UdaPZX eb9mdrQRDopPo6BSVU2WdKqwF3le7EMxn8VQx94+WUOmaTvEa99q6m09kgm/iMVs 8F9om1dNtERe27PZo0yV3i3pczjhiDtnnEFa1C4pUIgNBLABvPNjam86i2X5u2Uo 3XZLNG+IW/JQisTcxsjZfVrsRUFmHmvamTg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgddvkeehjeefucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnegfrh hlucfvnfffucdljedtmdenucfjughrpeffhffvvefukfhfgggtuggjsehgtderredttdej necuhfhrohhmpefoihgthhgrvghlucfrrghquhhivghruceomhhitghhrggvlhesphgrqh huihgvrhdrgiihiieqnecuggftrfgrthhtvghrnhepveetjefgjeevgedukeehieeuieeu ieevueeiudegheevuefggfduueelgeelieetnecuvehluhhsthgvrhfuihiivgeptdenuc frrghrrghmpehmrghilhhfrhhomhepmhhitghhrggvlhesphgrqhhuihgvrhdrgiihiidp nhgspghrtghpthhtohepgedpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepgihunh gvnhhgiihhohhusehgmhgrihhlrdgtohhmpdhrtghpthhtoheprghnughrvghssegrnhgr rhgriigvlhdruggvpdhrtghpthhtohepphhgshhqlhdqhhgrtghkvghrsheslhhishhtsh drphhoshhtghhrvghsqhhlrdhorhhgpdhrtghpthhtohepsgihrghvuhiikedusehgmhgr ihhlrdgtohhm X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 11 Mar 2026 23:42:33 -0400 (EDT) Date: Thu, 12 Mar 2026 12:42:28 +0900 From: Michael Paquier To: Xuneng Zhou Cc: Andres Freund , pgsql-hackers , Nazir Bilal Yavuz Subject: Re: Streamify more code paths Message-ID: References: MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="BAMQTcWBw/q4CS9s" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --BAMQTcWBw/q4CS9s Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Mar 12, 2026 at 06:33:08AM +0900, Michael Paquier wrote: > Thanks for doing that. On my side, I am going to look at the gin and > hash vacuum paths first with more testing as these don't use a custom > callback. I don't think that I am going to need a lot of convincing, > but I'd rather produce some numbers myself because doing something. > I'll tweak a mounting point with the delay trick, as well. While debug_io_direct has been helping a bit, the trick for the delay to throttle the IO activity has helped much more with my runtime numbers. I have mounted a separate partition with a delay of 5ms, disabled checkums (this part did not make a real difference), and evicted shared buffers for relation and indexes before the VACUUM. Then I got better numbers. Here is an extract: - worker=3D3: gin_vacuum (100k tuples) base=3D 1448.2ms patch=3D 572.5ms 2.53x ( 60.5%) (reads=3D175=E2=86=92104, io_time=3D1382.70=E2=86=92506.64ms) gin_vacuum (300k tuples) base=3D 3728.0ms patch=3D 1332.0ms 2.80x ( 64.3%) (reads=3D486=E2=86=92293, io_time=3D3669.89=E2=86=921266.27ms) bloom_vacuum (100k tuples) base=3D 21826.8ms patch=3D 17220.3ms 1.27x ( 21.1%) (reads=3D485=E2=86=92117, io_time=3D4773.33=E2=86=92270.56ms) bloom_vacuum (300k tuples) base=3D 67054.0ms patch=3D 53164.7ms 1.26x ( 20.7%) (reads=3D1431.5=E2=86=92327.5, io_time=3D13880.2=E2=86=92381.395m= s) - io_uring: gin_vacuum (100k tuples) base=3D 1240.3ms patch=3D 360.5ms 3.44x ( 70.9%) (reads=3D175=E2=86=92104, io_time=3D1175.35=E2=86=92299.75ms)=20 gin_vacuum (300k tuples) base=3D 2829.9ms patch=3D 642.0ms 4.41x ( 77.3%) (reads=3D465.5=E2=86=92293, io_time=3D2768.46=E2=86=92579.04ms) bloom_vacuum (100k tuples) base=3D 22121.7ms patch=3D 17532.3ms 1.26x ( 20.7%) (reads=3D485=E2=86=92117, io_time=3D4850.46=E2=86=92285.28ms) bloom_vacuum (300k tuples) base=3D 67058.0ms patch=3D 53118.0ms 1.26x ( 20.8%) (reads=3D1431.5=E2=86=92327.5, io_time=3D13870.9=E2=86=92305.44ms) The higher the number of tuples, the better the performance for each individual operation, but the tests take a much longer time (tens of seconds vs tens of minutes). For GIN, the numbers can be quite good once these reads are pushed. For bloom, the runtime is improved, and the IO numbers are much better. At the end, I have applied these two parts. Remains now the hash vacuum and the two parts for pgstattuple. -- Michael --BAMQTcWBw/q4CS9s Content-Type: application/pgp-signature; name=signature.asc -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmmyNiQACgkQnvQgOdby QH2oHA/9F3CfP4ImioA5ioftDzesjiqMxhhf2QGLPPXwewPgwVZHvFssu3SWTNr2 p408ArD1IW3BCkF03eys3vLFDUWBrBuaYzJ10PJMLTNLEuTnCmQSd7Z9XC7D1aDT gAZaPudyHSAGc1PKAKX8ZwghIvVbwnTraBHG/i+MKS6QlRk6lJn7DYIXmA/4+p0M 3BaMNi9e6m1xKLFXJ5jv9lW+N25y5UrdBu9Ao/9BQS2zkIUcV+j50yhAr8KpGksw +VcB148PezlobbFMJ8z0MWoNPrJZ0Jv4meyyOgNNcm/yUrtJeFLE0PmAJukZAuWS byek0QQSfkDnvqYHG8LUCcOdTjzhQSSd/xjsuYmoWlsACkkLO7T3O/6itTTwjhit iVSwHVguMFGCG0i3Fu6tkikO2yYas4MctZqV6CoeouLr+9PuuVqsCB5BRAcfBT1m 4g9V+vAt/WINhG3NtnfpbGR5WKTMM3xm05SA3TajNfu628ifPZ2PwCCsE1rQZXXO d+lul7AnvjuVeVkwCHWOOMkdc29XE7ZbhSUdQFLLD7THaH2VY98s61K6obWM5o9i U6Q44ZSKk986/YT3qQuO/Hr/Xi6Dw1CmItzNRUgh/vOLQsdFfkN87Na7bZ8MxWLC 3v+gzTVqrdAuHxI3akEd/AR89pkYkYaYfOIKQhWlF2k3pO8gFPU= =TrQ/ -----END PGP SIGNATURE----- --BAMQTcWBw/q4CS9s--