> On 7 Aug 2022, at 06:39, Bharath Rupireddy 
> <bharath.rupireddyforpostg...@gmail.com> wrote:
> 
> Agree. Why can't we just prefetch the entire WAL file once whenever it
> is opened for the first time? Does the OS have any limitations on max
> size to prefetch at once? It may sound aggressive, but it avoids
> fadvise() system calls, this will be especially useful if there are
> many WAL files to recover (crash, PITR or standby recovery),
> eventually we would want the total WAL file to be prefetched.
> 
> If prefetching the entire WAL file is okay, we could further do this:
> 1) prefetch in XLogFileOpen() and all of segment_open callbacks, 2)
> release in XLogFileClose (it's being dong right now) and all of
> segment_close callbacks - do this perhaps optionally.
> 
> Also, can't we use an existing function FilePrefetch()? That way,
> there is no need for a new wait event type.
> 
> Thoughts?

Thomas expressed this idea upthread. Benchmarks done by Jakub showed that this 
approach had no significant improvement over existing master code.
The same benchmarks showed almost x1.5 improvement of readahead in 8Kb or 128Kb 
chunks.

Best regards, Andrey Borodin.

Reply via email to