Re: Use streaming read I/O in BRIN vacuuming

Nazir Bilal Yavuz <byavuz81@gmail.com>

From: Nazir Bilal Yavuz <byavuz81@gmail.com>
To: Masahiko Sawada <sawada.mshk@gmail.com>
Cc: Arseniy Mukhin <arseniy.mukhin.dev@gmail.com>, Andrey Borodin <x4mmm@yandex-team.ru>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2025-10-13T07:24:38Z
Lists: pgsql-hackers

Commits

Same data as JSON: GET /api/v1/messages/:b64id/commits the thread's linked commits as JSON, with link sources. API reference →
  1. Use streaming read I/O in BRIN vacuum scan.

Hi,

On Thu, 9 Oct 2025 at 02:03, Masahiko Sawada <sawada.mshk@gmail.com> wrote:
>
> Thank you for proposing the patch! I've reviewed the patch and have
> some comments:
>
> +   stream = read_stream_begin_relation(READ_STREAM_MAINTENANCE |
> +                                       READ_STREAM_FULL |
> +                                       READ_STREAM_SEQUENTIAL |
> +                                       READ_STREAM_USE_BATCHING,
> +                                       strategy,
> +                                       idxrel,
> +                                       MAIN_FORKNUM,
> +                                       block_range_read_stream_cb,
> +                                       &p,
> +                                       0);
>
> Unlike other index AM's it uses READ_STREAM_SEQUENTIAL. If there are
> some reasons to use it, we should leave comments there.

Andres has some comments about retiring the READ_STREAM_SEQUENTIAL
flag as it is automatically detected and can potentially hurt
performance [1].

[1] https://postgr.es/m/go7c2sudqg4pp7dsabsak4ajugti4f3tyqoweja5ihcjiw65dc%40yh6wi4zqys23

-- 
Regards,
Nazir Bilal Yavuz
Microsoft