Re: pgstattuple: Use streaming read API in pgstatindex functions - Mailing list pgsql-hackers

From Xuneng Zhou
Subject Re: pgstattuple: Use streaming read API in pgstatindex functions
Date
Msg-id CABPTF7VWdwJ52cUhmt_7vsEomeRcP9k8JaMaPHvE-O7KM9KwMA@mail.gmail.com
Whole thread Raw
In response to Re: pgstattuple: Use streaming read API in pgstatindex functions  (Nazir Bilal Yavuz <byavuz81@gmail.com>)
Responses Re: pgstattuple: Use streaming read API in pgstatindex functions
Re: pgstattuple: Use streaming read API in pgstatindex functions
List pgsql-hackers
Hi Bilal,

Thanks for looking into this.

On Mon, Oct 13, 2025 at 3:00 PM Nazir Bilal Yavuz <byavuz81@gmail.com> wrote:
>
> Hi,
>
> Thank you for working on this!
>
> On Mon, 13 Oct 2025 at 06:20, Xuneng Zhou <xunengzhou@gmail.com> wrote:
> >
> > Fix indentation issue in v1.
>
> I did not look at the benchmarks, so here are my code comments.
>
> - I would avoid creating a new scope for the streaming read. While it
> makes the streaming code easier to interpret, it introduces a large
> diff due to indentation changes.
>
> - I suggest adding the following comment about streaming batching, as
> it is used in other places:
>
>         /*
>          * It is safe to use batchmode as block_range_read_stream_cb takes no
>          * locks.
>          */
>
> - For the '/* Scan all blocks except the metapage using streaming
> reads */' comments, it might be helpful to clarify that the 0th page
> is the metapage. Something like: '/* Scan all blocks except the
> metapage (0th page) using streaming reads */'.
>
> Other than these comments, the code looks good to me.
>

Here is patch v3. The comments have been added, and the extra scope
({}) has been removed as suggested.

Best,
Xuneng

Attachment

pgsql-hackers by date:

Previous
From: David Rowley
Date:
Subject: Re: Improve docs for n_distinct_inherited
Next
From: wenhui qiu
Date:
Subject: Re: pgstattuple: Use streaming read API in pgstatindex functions