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

From: shihao zhong <zhong950419(at)gmail(dot)com>
To: Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>
Cc: SATYANARAYANA NARLAPURAM <satyanarlapuram(at)gmail(dot)com>, Ashutosh Sharma <ashu(dot)coek88(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Thomas Munro <thomas(dot)munro(at)gmail(dot)com>, Lakshmi N <lakshmin(dot)jhs(at)gmail(dot)com>
Subject: Re: Skip prefetch for block references that follow a FPW or WILL_INIT of the same block
Date: 2026-10-25 15:56:26
Message-ID: CAGRkXqSg76NgJ3N5F0gEvVMm8NR94Cok6cSsQa+7cvNAvmnd8g@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi Bharath,

Thanks for the numbers. Elapsed time was noisy on my laptop, so I
counted instructions during redo on a release build.

With indexes it works as you said. I replayed pgbench with three
extra indexes. Master ran 12.1G instructions and v3 ran 11.7G. The
hash table ran 8.5G, close to 8.2G with prefetch off.

Without fpw, the hash table ran 3.5%(37.79G vs 36.50G) more instructions
than v3. Most of the extra cost is hashing. On a miss the slot is
computed twice, once in IsRecent and once in AddRecent. When I
computed it once, the extra cost fell to 2.8%.

Thanks,
Shihao

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message shihao zhong 2026-10-25 16:06:47 Re: Set 1s WaitLatch timeout if standby limit has expired in ResolveRecoveryConflictWithBufferPin
Previous Message Baji Shaik 2026-10-25 15:40:04 Avoid crashes on a concurrently dropped schema