public inbox for [email protected]  
help / color / mirror / Atom feed
From: Rahila Syed <[email protected]>
To: Bharath Rupireddy <[email protected]>
Cc: PostgreSQL-development <[email protected]>
Subject: Re: Use WALReadFromBuffers in more places
Date: Fri, 19 Sep 2025 18:42:32 +0530
Message-ID: <CAH2L28vxZg0PgiweVw=FqczD0zJC+Ud9+=H2yP-GPJeE2NwDQw@mail.gmail.com> (raw)
In-Reply-To: <CALj2ACVfF2Uj9NoFy-5m98HNtjHpuD17EDE9twVeJng-jTAe7A@mail.gmail.com>
References: <CALj2ACVfF2Uj9NoFy-5m98HNtjHpuD17EDE9twVeJng-jTAe7A@mail.gmail.com>

Hi Bharath,


Hi,
>
> Commit 91f2cae7a4e that introduced WALReadFromBuffers only used it for
> physical walsenders. It can also be used in more places benefitting
> logical walsenders, backends running pg_walinspect and logical
> decoding functions if the WAL is available in WAL buffers. I'm
> attaching a 0001 patch for this.
>
>
Thank you for working on this. It seems like a useful optimization. Do you
have any information
on how much this improves the performance of the new callers of
WALReadFromBuffers?

Regarding the v3 version of the patch, do you also intend to include other
callers of WALRead,
such as walsummarizer.c and pg_waldump.c?

In WALReadFromBuffers, the buffer scan currently stops when it encounters a
buffer that
doesn't have the needed WAL page. However, it's possible to continue
scanning past the
missing page and find other relevant pages further along. By keeping track
of which pages
are missing, we could read only those specific pages from files, instead of
reading everything
after the first missing page. I am wondering if this was taken into account
during the design
of the function.

Thank you,
Rahila Syed


view thread (10+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected]
  Subject: Re: Use WALReadFromBuffers in more places
  In-Reply-To: <CAH2L28vxZg0PgiweVw=FqczD0zJC+Ud9+=H2yP-GPJeE2NwDQw@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox