Re: Skip prefetch for block references that follow a FPW or WILL_INIT of the same block

From: Ethan Mertz <ethan(dot)mertz(at)gmail(dot)com>
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Cc: SATYANARAYANA NARLAPURAM <satyanarlapuram(at)gmail(dot)com>
Subject: Re: Skip prefetch for block references that follow a FPW or WILL_INIT of the same block
Date: 2026-06-04 20:07:00
Message-ID: 178060362097.594057.16093365170628444552.pgcf@coridan.postgresql.org
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

The following review has been posted through the commitfest application:
make installcheck-world: tested, passed
Implements feature: tested, passed
Spec compliant: tested, passed
Documentation: tested, passed

Hi Satya,

I reviewed the v2 patch (0001-xlogprefetcher-record-FPW-WILL_INIT-...).

Applied cleanly to current HEAD, built with --enable-cassert and
--enable-debug, make check and make installcheck pass.

> Fixed this by making these blocks as recently seen in the FPW and WILL_INIT
> skip paths. The existing duplicate-check loop then naturally suppresses
> prefetch attempts for subsequent references to the same block, counting
> them under the skip_rep stat.

The approach integrates cleanly into the existing prefetch infrastructure
reusing the recently-seen window for deduplication rather than adding new
tracking state is a nice design choice.

I also agree with the choice to add this logic to init and fpw records but not the
filtered pages because these may still be beneficial to read later in the window.

I read through the code and it looks correct to me. One minor nit: there's
an extra blank line added just before lrq_complete_lsn that seems unrelated
to the change. Removing this would keep the diff focused.

I'm marking this Ready for Committer.

Best,
Ethan Mertz
SDE, Amazon Web Services

The new status of this patch is: Ready for Committer

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Daniel Gustafsson 2026-06-04 20:19:30 Re: Fix OAuth validator docs for error_detail on internal errors
Previous Message Zsolt Parragi 2026-06-04 19:08:02 Re: Fix bug of CHECK constraint enforceability recursion