Re: log XLogPrefetch stats at end of recovery

From: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>
To: Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>
Cc: Ashutosh Sharma <ashu(dot)coek88(at)gmail(dot)com>, Jakub Wartak <jakub(dot)wartak(at)enterprisedb(dot)com>, SATYANARAYANA NARLAPURAM <satyanarlapuram(at)gmail(dot)com>, Lakshmi N <lakshmin(dot)jhs(at)gmail(dot)com>, Thomas Munro <thomas(dot)munro(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: log XLogPrefetch stats at end of recovery
Date: 2026-11-19 12:17:20
Message-ID: CAHGQGwEcUK_iuy5XRVtqfQNRwvFn2nDf2JZe9-2=mvj3mYa0KQ@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Nov 12, 2026 at 5:58 AM Bharath Rupireddy
<bharath(dot)rupireddyforpostgres(at)gmail(dot)com> wrote:
> I think it is RfC. Thoughts?

I'm not sure how useful it is to log these statistics even though
they are already available in pg_stat_recovery_prefetch.

Currently, the counters in pg_stat_recovery_prefetch are not saved
and restored by pgstat, so they are lost even across a clean restart.
So, if the goal of this patch is to preserve them for later analysis,
logging them could be useful.

But, making these statistics persistent was already discussed when
recovery prefetch was introduced [1]. If we eventually implement that
in the future, the statistics could be queried from the view after
a clean restart. So I'm wondering what additional value the log message
would provide in that case.... Sorry if I'm missing something.

Regards,

[1] https://www.postgresql.org/message-id/CA%2BhUKGJ7OqpdnbSTq5oK%3DdjSeVW2JMnrVPSm8JC-_dbN6Y7bpw%40mail.gmail.com

--
Fujii Masao

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Fujii Masao 2026-11-19 12:37:34 Re: Fix resource leaks in pg_receivewal on LZ4 close failures
Previous Message Rajesh Kumar Thandapani 2026-11-19 12:16:15 Re: BUG #19776: pg_combinebackup ignores the truncation_block_length of an intermediate incremental backup