Re: Streamify more code paths

From: Xuneng Zhou <xunengzhou(at)gmail(dot)com>
To: Nazir Bilal Yavuz <byavuz81(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-12 03:27:10
Message-ID: CABPTF7Vjor4HhGZrgyTQ-+_ZC4Cu7V_4NOKf1T-f42q_oWxbag@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On Wed, Mar 11, 2026 at 3:53 PM Nazir Bilal Yavuz <byavuz81(at)gmail(dot)com> wrote:
>
> 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.
>

Thanks! That makes sense to me. Please see the patch I’ll post later.

--
Best,
Xuneng

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Mark Wong 2026-03-12 03:28:14 Re: updates for handling optional argument in system functions
Previous Message Richard Guo 2026-03-12 02:14:46 Re: Convert NOT IN sublinks to anti-joins when safe