Re: Using read stream in autoprewarm - Mailing list pgsql-hackers

From Melanie Plageman
Subject Re: Using read stream in autoprewarm
Date
Msg-id CAAKRu_b_b7n75gx2uT_4f4HCEKC1cEn2T3xzuESkpbs--UO_Fg@mail.gmail.com
Whole thread Raw
In response to Re: Using read stream in autoprewarm  (Andres Freund <andres@anarazel.de>)
List pgsql-hackers
On Sat, Mar 29, 2025 at 4:44 PM Andres Freund <andres@anarazel.de> wrote:
>
> How about having an iterator function operating on a pointer to iterator state
> that's used both by the main loop and the read stream callback? If the
> iterator reaches the next relation, it returns InvalidBlockNumber and the main
> loop starts the next stream?

I don't think that removes the need for the first_block special case.
And we still need to duplicate the logic for detecting the next
database, block, or filenumber in both places. It maybe reduces the
potential for error a little bit. But I don't think it improves the
clarity.

- Melanie



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: AIO v2.5
Next
From: vignesh C
Date:
Subject: Re: speedup COPY TO for partitioned table.