Re: Use fadvise in wal replay - Mailing list pgsql-hackers

From Andrey Borodin
Subject Re: Use fadvise in wal replay
Date
Msg-id D694E73D-9633-407B-A015-95485EE352C9@yandex-team.ru
Whole thread Raw
In response to Re: Use fadvise in wal replay  (Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>)
Responses Re: Use fadvise in wal replay
List pgsql-hackers
Hi Bharath,

thank you for the suggestion.

> On 5 Aug 2022, at 16:02, Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com> wrote:
>
> On Thu, Aug 4, 2022 at 9:48 PM Andrey Borodin <x4mmm@yandex-team.ru> wrote:
>>
>>> On 18 Jul 2022, at 22:55, Robert Haas <robertmhaas@gmail.com> wrote:
>>>
>>> On Thu, Jun 23, 2022 at 5:49 AM Jakub Wartak <Jakub.Wartak@tomtom.com> wrote:
>
> I have a fundamental question on the overall idea - How beneficial it
> will be if the process that's reading the current WAL page only does
> (at least attempts) the prefetching of future WAL pages? Won't the
> benefit be higher if "some" other background process does prefetching?

IMO prefetching from other thread would have negative effect.
fadvise() call is non-blocking, startup process won't do IO. It just informs kernel to schedule asynchronous page read.
On the other hand synchronization with other process might cost more than fadvise().

Anyway cost of calling fadise() once per 16 page reads is neglectable.

Thank you!

Best regards, Andrey Borodin.


pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: [RFC] building postgres with meson -v
Next
From: Michael Paquier
Date:
Subject: Re: [PATCH] Expose port->authn_id to extensions and triggers