git.postgresql.org Git - postgresql.git/commit

git projects / postgresql.git / commit
? search:
summary | shortlog | log | commit | commitdiff | tree
(parent: f003d9f) | patch
Optionally prefetch referenced data in recovery.
Thu, 8 Apr 2021 11:03:43 +0000 (23:03 +1200)
Thu, 8 Apr 2021 11:20:42 +0000 (23:20 +1200)
commit 1d257577e08d3e598011d6850fd1025858de8c8c
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
23 files changed:
doc/src/sgml/config.sgml diff | blob | blame | history
doc/src/sgml/monitoring.sgml diff | blob | blame | history
doc/src/sgml/wal.sgml diff | blob | blame | history
src/backend/access/transam/Makefile diff | blob | blame | history
src/backend/access/transam/xlog.c diff | blob | blame | history
src/backend/access/transam/xlogprefetch.c [new file with mode: 0644] blob
src/backend/access/transam/xlogreader.c diff | blob | blame | history
src/backend/access/transam/xlogutils.c diff | blob | blame | history
src/backend/catalog/system_views.sql diff | blob | blame | history
src/backend/postmaster/pgstat.c diff | blob | blame | history
src/backend/storage/freespace/freespace.c diff | blob | blame | history
src/backend/storage/ipc/ipci.c diff | blob | blame | history
src/backend/utils/misc/guc.c diff | blob | blame | history
src/backend/utils/misc/postgresql.conf.sample diff | blob | blame | history
src/include/access/xlog.h diff | blob | blame | history
src/include/access/xlogprefetch.h [new file with mode: 0644] blob
src/include/access/xlogreader.h diff | blob | blame | history
src/include/access/xlogutils.h diff | blob | blame | history
src/include/catalog/pg_proc.dat diff | blob | blame | history
src/include/pgstat.h diff | blob | blame | history
src/include/utils/guc.h diff | blob | blame | history
src/test/regress/expected/rules.out diff | blob | blame | history
src/tools/pgindent/typedefs.list diff | blob | blame | history
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /