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

From Melanie Plageman
Subject Re: Using read stream in autoprewarm
Date
Msg-id CAAKRu_ahWvv5-4-VsCk8VY4K9kJ1q76mA4oP5YTYRNrcCHS4kw@mail.gmail.com
Whole thread Raw
In response to Re: Using read stream in autoprewarm  (Nazir Bilal Yavuz <byavuz81@gmail.com>)
List pgsql-hackers
On Tue, Apr 1, 2025 at 7:21 AM Nazir Bilal Yavuz <byavuz81@gmail.com> wrote:
>
> On Tue, 1 Apr 2025 at 05:14, Melanie Plageman <melanieplageman@gmail.com> wrote:
> >
> +1 for using the functions. I think it is hard to follow / maintain
> this with the do-while loops and goto statements.

I'll take a look at your downthread proposal in a bit.

But the attached patch is a new version of what I proposed with the
functions. It's still not totally correct, but I wanted to see what
you thought.

> > But the explicit looping for skipping the bad blocks and the nested
> > loops for rel and fork -- I think these are less error prone.
>
> One question in my mind is, the outermost loop stops when the database
> changes, we do not check if it is changed from the database oid = 0.
> Handling this might require some structural changes.

I don't understand why each database has global objects at the
beginning. If there are global objects, they are global to all
databases, so surely the sort function would have put them all at the
beginning? One problem is we need a database connection to prewarm
these, but if the global objects are all at the beginning, then maybe
we can handle those with a special case and not force ourselves to
check for them when trying to load blocks from every database.

- Melanie

Attachment

pgsql-hackers by date:

Previous
From: vignesh C
Date:
Subject: Re: in BeginCopyTo make materialized view using COPY TO instead of COPY (query).
Next
From: Christoph Berg
Date:
Subject: Re: Better HINT message for "unexpected data beyond EOF"