Re: Streamify more code paths

From: Nazir Bilal Yavuz <byavuz81(at)gmail(dot)com>
To: Xuneng Zhou <xunengzhou(at)gmail(dot)com>
Cc: Michael Paquier <michael(at)paquier(dot)xyz>, pgsql-hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Streamify more code paths
Date: 2026-03-11 07:53:27
Message-ID: CAN55FZ3u_PSXX26pXJi8mo1-ykezV1L=GuFhfrGq73TCASeuyA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On Tue, 10 Mar 2026 at 16:23, Xuneng Zhou <xunengzhou(at)gmail(dot)com> wrote:
>
> Another code path that showed significant performance improvement is
> pgstatindex [1]. I've incorporated the test into the script too. Here
> are the results from my testing:
>
> method=worker io-workers=12
> pgstatindex_large base= 233.8ms patch= 54.1ms 4.32x
> ( 76.8%) (reads=27460→1757, io_time=213.94→6.31ms)
>
> method=io_uring
> pgstatindex_large base= 224.2ms patch= 56.4ms 3.98x
> ( 74.9%) (reads=27460→1757, io_time=204.41→4.88ms)

I didn't run the benchmark yet but here is a small suggestion for the
pgstatindex patch:

+ p.current_blocknum = BTREE_METAPAGE + 1;
+ p.last_exclusive = nblocks;

for (blkno = 1; blkno < nblocks; blkno++)

...

+ p.current_blocknum = HASH_METAPAGE + 1;
+ p.last_exclusive = nblocks;

for (blkno = 1; blkno < nblocks; blkno++)

Could you move 'BTREE_METAPAGE + 1' and 'HASH_METAPAGE + 1' into
variables and then set p.current_blocknum and blkno using those
variables? p.current_blocknum and blkno should have the same initial
values, this change makes code less error prone and easier to read in
my opinion.

Other than the comment above, LGTM.

--
Regards,
Nazir Bilal Yavuz
Microsoft

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Hayato Kuroda (Fujitsu) 2026-03-11 07:55:36 RE: Patch for migration of the pg_commit_ts directory
Previous Message Ashutosh Bapat 2026-03-11 07:34:43 Re: SQL Property Graph Queries (SQL/PGQ)