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 1w09En-001en7-0R for pgsql-hackers@arkaria.postgresql.org; Wed, 11 Mar 2026 02:23:53 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w09El-007CAv-0v for pgsql-hackers@arkaria.postgresql.org; Wed, 11 Mar 2026 02:23: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 1w09El-007CAm-04 for pgsql-hackers@lists.postgresql.org; Wed, 11 Mar 2026 02:23:51 +0000 Received: from mail-ed1-x52b.google.com ([2a00:1450:4864:20::52b]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1w09Ej-00000001XiI-32Js for pgsql-hackers@lists.postgresql.org; Wed, 11 Mar 2026 02:23:50 +0000 Received: by mail-ed1-x52b.google.com with SMTP id 4fb4d7f45d1cf-6631e0edcf1so213698a12.1 for ; Tue, 10 Mar 2026 19:23:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1773195828; cv=none; d=google.com; s=arc-20240605; b=XTQFcXSkdeOLdTg8j3fpFvMMTcCo/foNbrVPGz4axG058Js23fVk+986n2eCYGp1Tz M+FREpyZmacXG+CMMl3EKwS3qk4uxwkc9zSl9OOeO3Xhu1NQhY5mijtl9a45ePq8ZpaV b8sserViwOBf3Jjl7FjgZ9ELjGKL2MK0893RFna+7gKV1VFssr2uQPjPBm9rhtYV8I0H LFLn0beL+jqQ+T2oletYixWEfJ6y4IM3mBMnoCz78DWjdzl4Bs1j6+/Y647AOJkDbSvh hYh+o/41Asz5FQUNLNIfP3kMjWhn4auEeOZA1iG+K2UNI5obkxRjQ6htmNpBX2gLdFDP ZT6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=AELdIirGPrx5O7/7i3tTPg7+yCXWaKFb8BEi9YZvBJc=; fh=t1RlwriUhVM7zeGIoVYORCSaZbYy7srYtNpWKQdZlOM=; b=HT+2nTuJWP4qfIQbycQaKA2Ee7yvbC8greM7+rt8zXnqSq13BbKvtG7gv+kisWVJH+ Araq1zui/KaCXvXJFhAC7twgflAA64WM8rQzuul1Q8awGGer3eaHSwz9HvNVSmvNQtY0 nkFS8ecPaE006tW45jlrQnuwFKDPNpJ22UN3+iN4Bs/ADOO1j4GgJpLDiX848vATNyx9 XooRS43vKZh+QwVb8+7NTrVqtXYonCJ0FLsjpW1WkLv5BsqpcCWcRxKh/1vMqA5FLFPJ Ef5YFIp7EF9gLSsIfVh8NP+DtyL2BY39DliO8KsE12FLB+MO37LFaFRkefOfUZgw+sEa Ne+g==; darn=lists.postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1773195828; x=1773800628; darn=lists.postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=AELdIirGPrx5O7/7i3tTPg7+yCXWaKFb8BEi9YZvBJc=; b=DbYIa1yMzUHlhdZerRjo8YUiR+rZ/bUttP/K/Bvm14Q9HFpFHVRV4pzfx/S5/9fzsk khR1x8rrLp2ydozERh4AeyD/4BjewTi6ljx60HgoOAYXPMsYXAHGZVxml4HXHnhtMO87 ABx7iSVwV/ODe2wXGPliSg7pcSxYyPTTkDNJZm3l8PfFxzjbLWlYEY5V/xgH3wal2BhC 5xGuIFfCTH/FHtmNxxJX7FjCGGqTo1/F2soj4HDzA80uvDjAAh259J2BH/u913yScmXr 6HpsLQW3bgBttfVe3CRQXos65j21hmSoHqGLjtiVo4+Ea/Al0jrnPsQkgtUboKhwxVAT X2jg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1773195828; x=1773800628; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=AELdIirGPrx5O7/7i3tTPg7+yCXWaKFb8BEi9YZvBJc=; b=LElRbUQBonkjAipq2fqxBSZMc6gENaM6dgKMuD7W2QpnDwhQ7z8FKxCZcy7TsnIl5R CjH5AbuGaLnpynnIr+PA9zoBdpaeWfYVqJa9wlMStwlCPJrVL/WIxPmgtkyDiQCGcEfC IeVJJIP2tTyc0eecG5HQ0Rk6M5n7nahSi2LTfG5R4NdNp3QCwKPkE3VjcvmPInktBymp BAEmWQBPf29+T9LBc3xJmXPEmWXnITXYJqmzbIqG0uLO16/H4XaS/Yvz15bW4ji8f0sR cLoL4k1Mf+iLYFR0UR2SKv4uzk7szlTYJRP7xEwuHO+/i4HjacMt8e2JRYubtnk92YEs jwsQ== X-Forwarded-Encrypted: i=1; AJvYcCUwvcZX0V2HjmuhB7KizpvwKIJouIAqxgD0MwaIhKPd3gTE21jn94D3mmD89mWTotpzH7VOfLjkgt9YUgf6@lists.postgresql.org X-Gm-Message-State: AOJu0YxpkoIAYDWtknBJgyhmuQzaeLV7FTsxldp+T6I2L6zVbo/17DMr FSul1Ao07R8AWRaylDWejWGwlGbfuNMORIaU54U710fP6BB9bs3zaimwzfb7lObq+phojk6d8ZU NnEfIiwe9jyChbIb+xNg4bhi7PPXZO2U= X-Gm-Gg: ATEYQzx3l/jBY9uat4lEFkbs0pUOMy0Hus+juh1w+TQ8VAUbXWxJiYBGAA6iprshbbR sb/3oEl68JSSVUGaj9pUD4b7JVGiNtsbbaMulwBDBm8dYXdjAC20OSLZE8048kfYtMj3wykWDDi cZ0BXtBvy5zvAnm7BX18mpWId94cawkuNk82GxfK9ybfJBptJxBZlCs/1kgHecr73Nhf01oRbx6 h5p+JqUqZBUwiS6n64zJOXXi+mtOWbUARA4tA3/2siBbfyDaAxdfATV43swRf/dlwvQzUwlELHX f6Uvz93IkAsDdC2CPl201FI3peRUQVsdWyQ54GgDaqWvuoA/OnYtduoP+DLH8CuhdUxR9CVeU1B mxHEw+u8F X-Received: by 2002:a05:6402:3547:b0:662:f7f4:58e4 with SMTP id 4fb4d7f45d1cf-66319ee1783mr385732a12.23.1773195828215; Tue, 10 Mar 2026 19:23:48 -0700 (PDT) MIME-Version: 1.0 References: <6vfwrw7xci7pccrfcne5ekvjw5l2uvjsjzpmgi356h7y2rkojx@6ogr34zctcue> In-Reply-To: From: Xuneng Zhou Date: Wed, 11 Mar 2026 10:23:36 +0800 X-Gm-Features: AaiRm52NGCuBD_SbbcpLReK2yP6wC8SXWdbYPPRYMDtgSmW9i7kUvf5tSSKHKV4 Message-ID: Subject: Re: Streamify more code paths To: Andres Freund Cc: Michael Paquier , pgsql-hackers , Nazir Bilal Yavuz Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On Wed, Mar 11, 2026 at 8:16=E2=80=AFAM Andres Freund = wrote: > > Hi, > > On 2026-03-10 19:27:59 -0400, Andres Freund wrote: > > > > pgstattuple_large base=3D 12429.3ms patch=3D 11916.8ms = 1.04x > > > > ( 4.1%) (reads=3D206945->12983, io_time=3D6501.91->32.24ms) > > > > > > > pgstattuple_large base=3D 12642.9ms patch=3D 11873.5ms = 1.06x > > > > ( 6.1%) (reads=3D206945->12983, io_time=3D6516.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 compu= tation, > > 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 =3D data || '!= ' WHERE id % 5 =3D 0;" > > > > leads to some out-of-page updates. > > > > You're probably better off deleting some of the data in a transaction t= hat 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 no= t work. > > I think that last one is a big part - if I use > BEGIN; DELETE FROM heap_test WHERE id % 500 =3D 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. > The results look great and interesting. This looks far better than what I observed in my earlier tests. I=E2=80=99ll run perf for pgstattuple without the switching to see what is keeping the CPU busy. --=20 Best, Xuneng