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 1w07Fx-001dCu-24 for pgsql-hackers@arkaria.postgresql.org; Wed, 11 Mar 2026 00:16:57 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w07Fw-006p8g-0L for pgsql-hackers@arkaria.postgresql.org; Wed, 11 Mar 2026 00:16:56 +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 1w07Fv-006p8Q-2h for pgsql-hackers@lists.postgresql.org; Wed, 11 Mar 2026 00:16:56 +0000 Received: from fout-a2-smtp.messagingengine.com ([103.168.172.145]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1w07Ft-000000023Cb-3bKb for pgsql-hackers@lists.postgresql.org; Wed, 11 Mar 2026 00:16:56 +0000 Received: from phl-compute-06.internal (phl-compute-06.internal [10.202.2.46]) by mailfout.phl.internal (Postfix) with ESMTP id 3AB02EC0B7C; Tue, 10 Mar 2026 20:16:51 -0400 (EDT) Received: from phl-frontend-03 ([10.202.2.162]) by phl-compute-06.internal (MEProxy); Tue, 10 Mar 2026 20:16:51 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; 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=1773188211; x=1773274611; bh=U4e0K3lmg/ Rj+H1Qc+FtU1whQS0KVkF6zazkD+ZkMCY=; b=u27PBdKdSqsSaj4kpf4ITWmtvZ LdxgC5x6b6QdtRvAASCK6waA4ACEyvW7lIqYWYT12fJpi1Ojlr+XCzWKLIEQj/aA HvdPRpLH+jLGPOq/OExSSeleRt9KN16Xo3y5iLP0YTc3REoEGLbBvUxsXd+UIuYj VRi+GY29HET8VSolLY2dbc3aKyRTLdM+CqHLeKi3HtW8FLSyeYq3IEZJxWm1uSMq 5LB/s/5Q1AgRKyz/dgYjh6IypFRabAhU2waZdW3reFwsnV/UHI8h4njOy1oWOFJ4 DABleNbfsqudZbU1cFRkExsTzO/c3BP7B5VROYIygwdFTeuUve7kQOu2YcWQ== 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= 1773188211; x=1773274611; bh=U4e0K3lmg/Rj+H1Qc+FtU1whQS0KVkF6zaz kD+ZkMCY=; b=gqzC68CjuCvGzvy15iaBxoYo7zCZs5VASe8Vz0vfNoPBT6zf386 jAxVYGVqZLMtGd0tZlheMywRFIIEvaDi9jKn0dBY6b44QhAHVFP++S38vvW4rf5Z 5jr5yhezCZVWj92OVkR26fCHftqE55SHxLPwjIpCNj4ZvCZF1L7RT1gcnhBLa8nj OnaQucS7wa3zuuyu9zKEjHna3FpD2+tQYTC+yfR4qoXVsd6lskS3UoMNzeOgPNTO C/clDyjoWx3papOc2O0f5B56IxjjvD169Bn0NoaDEZC//s3ExaSVR+O4zUQmPAUM QGvmhtmGFnO4ugFuM9M3Kss43DyVyqlihIQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefgedrtddtgddvkedvgeegucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfurfetoffkrfgpnffqhgenuceu rghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujf gurhepfffhvfevuffkfhggtggujgesthdtsfdttddtvdenucfhrhhomheptehnughrvghs ucfhrhgvuhhnugcuoegrnhgurhgvshesrghnrghrrgiivghlrdguvgeqnecuggftrfgrth htvghrnhepfeffgfelvdffgedtveelgfdtgefghfdvkefggeetieevjeekteduleevjefh ueegnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprg hnughrvghssegrnhgrrhgriigvlhdruggvpdhnsggprhgtphhtthhopeegpdhmohguvgep shhmthhpohhuthdprhgtphhtthhopegshigrvhhuiiekudesghhmrghilhdrtghomhdprh gtphhtthhopeiguhhnvghnghiihhhouhesghhmrghilhdrtghomhdprhgtphhtthhopehp ghhsqhhlqdhhrggtkhgvrhhssehlihhsthhsrdhpohhsthhgrhgvshhqlhdrohhrghdprh gtphhtthhopehmihgthhgrvghlsehprghquhhivghrrdighiii X-ME-Proxy: Feedback-ID: id4a34324:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 10 Mar 2026 20:16:50 -0400 (EDT) Date: Tue, 10 Mar 2026 20:16:50 -0400 From: Andres Freund To: Xuneng Zhou Cc: Michael Paquier , pgsql-hackers , Nazir Bilal Yavuz Subject: Re: Streamify more code paths Message-ID: References: <6vfwrw7xci7pccrfcne5ekvjw5l2uvjsjzpmgi356h7y2rkojx@6ogr34zctcue> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <6vfwrw7xci7pccrfcne5ekvjw5l2uvjsjzpmgi356h7y2rkojx@6ogr34zctcue> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On 2026-03-10 19:27:59 -0400, Andres Freund wrote: > > > pgstattuple_large base= 12429.3ms patch= 11916.8ms 1.04x > > > ( 4.1%) (reads=206945->12983, io_time=6501.91->32.24ms) > > > > > pgstattuple_large base= 12642.9ms patch= 11873.5ms 1.06x > > > ( 6.1%) (reads=206945->12983, io_time=6516.70->143.46ms) > > > > Yeah, this looks somewhat strange. The io_time has been reduced > > significantly, which should also lead to a substantial reduction in > > runtime. > > It's possible that the bottleneck just moved, e.g to the checksum computation, > if you have data checksums enabled. > > It's also worth noting that likely each of the test reps measures > something different, as likely > psql_run "$ROOT" "$PORT" -c "UPDATE heap_test SET data = data || '!' WHERE id % 5 = 0;" > > leads to some out-of-page updates. > > You're probably better off deleting some of the data in a transaction that is > then rolled back. That will also unset all-visible, but won't otherwise change > the layout, no matter how many test iterations you run. > > > I'd also guess that you're seeing a relatively small win because you're > updating every page. When reading every page from disk, the OS can do > efficient readahead. If there are only occasional misses, that does not work. I think that last one is a big part - if I use BEGIN; DELETE FROM heap_test WHERE id % 500 = 0; ROLLBACK; (which leaves a lot of I see much bigger wins due to the pgstattuple changes. time buffered time DIO w/o read stream 2222.078 ms 2090.239 ms w read stream 299.455 ms 155.124 ms That's with local storage. io_uring, but numbers with worker are similar. Greetings, Andres Freund