Re: Using read stream in autoprewarm

From: Nazir Bilal Yavuz <byavuz81(at)gmail(dot)com>
To: "Andrey M(dot) Borodin" <x4mmm(at)yandex-team(dot)ru>
Cc: PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Using read stream in autoprewarm
Date: 2024-11-06 14:56:41
Message-ID: CAN55FZ2xGRgLm368xYCvQAqLJ+Dkx5fJ8ZdKO6G=GxaAusuqkw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On Fri, 1 Nov 2024 at 21:06, Andrey M. Borodin <x4mmm(at)yandex-team(dot)ru> wrote:
>
> > On 1 Nov 2024, at 12:51, Nazir Bilal Yavuz <byavuz81(at)gmail(dot)com> wrote:
> >
> > am not
> > sure whether 'BufferStrategyControl.lastFreeBuffer -
> > BufferStrategyControl.firstFreeBuffer' is safe to use.
>
> Ugh... it will work. But it seems to me too dirty hack. There's no scalable way to know size of a free list.
> Let's just comment that we might read some more buffers if database does not fit into memory?
> Alternatively we can count size of a free list on the start.

I agree that it is too dirty to hack. There is a minor problem with
the counting size of a free list on the start. There may be other
processes that fill the buffer pool concurrently, so we can still end
up doing unnecessary I/Os. That said, I believe this approach remains
an improvement.

The first patch includes the comment you suggested, and the second
patch implements counting size of a free list on the start.

--
Regards,
Nazir Bilal Yavuz
Microsoft

Attachment Content-Type Size
v2-0001-Use-read-stream-in-autoprewarm.patch text/x-patch 5.9 KB
v2-0002-Count-free-buffers-at-the-start-of-the-autoprewar.patch text/x-patch 2.6 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Daniel Gustafsson 2024-11-06 15:03:35 Re: pg_upgrade check for invalid databases
Previous Message Robert Haas 2024-11-06 14:43:27 Re: Eager aggregation, take 3