Hi, I went through the WAL redo code in the neon page server and came across the code where we updated the page to the latest lsn (apply_wal_records).
This code starts up a pg process and calls
Even though the job of this function
apply_wal_records is to apply wal records of a particular page, rm_redo would read and update all pages involved in the wal record.
for ex: A heap_update wal record will have a block to apply on the page in which the tuple is deleted and another block to apply on the page where the tuple is inserted.
Am I getting this right? Wouldn’t it be wasteful to apply WAL for all pages and then discard the unnecessary pages that where modified? Is there some hack we could do so we avoid reading unneeded pages while calling
RmgrTable[record->xl_rmid].rm_redo and save on the i/o ??