postgresql/src/backend/storage
Thomas Munro 1d257577e0 Optionally prefetch referenced data in recovery.
Introduce a new GUC recovery_prefetch, disabled by default.  When
enabled, look ahead in the WAL and try to initiate asynchronous reading
of referenced data blocks that are not yet cached in our buffer pool.
For now, this is done with posix_fadvise(), which has several caveats.
Better mechanisms will follow in later work on the I/O subsystem.

The GUC maintenance_io_concurrency is used to limit the number of
concurrent I/Os we allow ourselves to initiate, based on pessimistic
heuristics used to infer that I/Os have begun and completed.

The GUC wal_decode_buffer_size is used to limit the maximum distance we
are prepared to read ahead in the WAL to find uncached blocks.

Reviewed-by: Alvaro Herrera <alvherre@2ndquadrant.com> (parts)
Reviewed-by: Andres Freund <andres@anarazel.de> (parts)
Reviewed-by: Tomas Vondra <tomas.vondra@2ndquadrant.com> (parts)
Tested-by: Tomas Vondra <tomas.vondra@2ndquadrant.com>
Tested-by: Jakub Wartak <Jakub.Wartak@tomtom.com>
Tested-by: Dmitry Dolgov <9erthalion6@gmail.com>
Tested-by: Sait Talha Nisanci <Sait.Nisanci@microsoft.com>
Discussion: https://postgr.es/m/CA%2BhUKGJ4VJN8ttxScUFM8dOKX0BrBiboo5uz1cq%3DAovOddfHpA%40mail.gmail.com
2021-04-08 23:20:42 +12:00
..
buffer Provide ReadRecentBuffer() to re-pin buffers by ID. 2021-04-08 17:50:25 +12:00
file Fix concurrency issues with WAL segment recycling on Windows 2021-03-22 14:02:26 +09:00
freespace Optionally prefetch referenced data in recovery. 2021-04-08 23:20:42 +12:00
ipc Optionally prefetch referenced data in recovery. 2021-04-08 23:20:42 +12:00
large_object Update copyright for 2021 2021-01-02 13:06:25 -05:00
lmgr Improve efficiency of wait event reporting, remove proc.h dependency. 2021-04-03 12:03:45 -07:00
page Truncate line pointer array during VACUUM. 2021-04-07 08:47:15 -07:00
smgr Use errmsg_internal for debug messages 2021-02-17 11:33:25 +01:00
sync Use errmsg_internal for debug messages 2021-02-17 11:33:25 +01:00
Makefile Refactor the fsync queue for wider use. 2019-04-04 23:38:38 +13:00