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

From Melanie Plageman
Subject Re: Using read stream in autoprewarm
Date
Msg-id CAAKRu_ZufybEzRbqeV7sYV4eskk-P7MVLDNMQQembQknG=XNuw@mail.gmail.com
Whole thread Raw
In response to Re: Using read stream in autoprewarm  (Melanie Plageman <melanieplageman@gmail.com>)
List pgsql-hackers
On Sat, Mar 29, 2025 at 4:09 PM Melanie Plageman
<melanieplageman@gmail.com> wrote:
>
> One alternative is to loop through the array of BlockInfoRecords and
> get the start and end positions of the blocks in the arary for a
> single relation/fork combo. Then we could make the read stream and
> pass those two positions and the array as callback_private_data. That
> would mean we loop through the whole array twice, but I wonder if the
> improvement in clarity is worth it?

An alternative to this alternative is to somehow include the length of
each "span" (BlockInfoRecords from a single relation/fork) in the
first BlockInfoRecord of that span when building the array. Dunno how
hard that would be, but then you wouldn't have to loop through it
twice.

- Melanie



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: Why does wait_for_log() return current file size
Next
From: Andres Freund
Date:
Subject: Re: Using read stream in autoprewarm