postgresql/src/include/utils
Thomas Munro 5dc0418fab Prefetch data referenced by the WAL, take II.
Introduce a new GUC recovery_prefetch.  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.  Since not all OSes have
that system call, "try" is provided so that it can be enabled where
available.  Better mechanisms for asynchronous I/O are possible in later
work.

Set to "try" for now for test coverage.  Default setting to be finalized
before release.

The GUC wal_decode_buffer_size limits the distance we can look ahead in
bytes of decoded data.

The existing GUC maintenance_io_concurrency is used to limit the number
of concurrent I/Os allowed, based on pessimistic heuristics used to
infer that I/Os have begun and completed.  We'll also not look more than
maintenance_io_concurrency * 4 block references ahead.

Reviewed-by: Julien Rouhaud <rjuju123@gmail.com>
Reviewed-by: Tomas Vondra <tomas.vondra@2ndquadrant.com>
Reviewed-by: Alvaro Herrera <alvherre@2ndquadrant.com> (earlier version)
Reviewed-by: Andres Freund <andres@anarazel.de> (earlier version)
Reviewed-by: Justin Pryzby <pryzby@telsasoft.com> (earlier version)
Tested-by: Tomas Vondra <tomas.vondra@2ndquadrant.com> (earlier version)
Tested-by: Jakub Wartak <Jakub.Wartak@tomtom.com> (earlier version)
Tested-by: Dmitry Dolgov <9erthalion6@gmail.com> (earlier version)
Tested-by: Sait Talha Nisanci <Sait.Nisanci@microsoft.com> (earlier version)
Discussion: https://postgr.es/m/CA%2BhUKGJ4VJN8ttxScUFM8dOKX0BrBiboo5uz1cq%3DAovOddfHpA%40mail.gmail.com
2022-04-07 19:42:14 +12:00
..
.gitignore Revert "Add gitignore entries for jsonpath_gram.h" 2019-03-23 00:19:34 +01:00
acl.h Allow granting SET and ALTER SYSTEM privileges on GUC parameters. 2022-04-06 13:24:33 -04:00
aclchk_internal.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
array.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
arrayaccess.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
ascii.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
attoptcache.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
backend_progress.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
backend_status.h pgstat: stats collector references in comments. 2022-04-06 13:56:06 -07:00
builtins.h Remove pg_atoi() 2022-02-15 07:44:26 +01:00
bytea.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
cash.h Phase 2 of pgindent updates. 2017-06-21 15:19:25 -04:00
catcache.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
combocid.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
date.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
datetime.h Fix overflow hazards in interval input and output conversions. 2022-04-02 16:12:29 -04:00
datum.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
dsa.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
dynahash.h Fix various typos, grammar and code style in comments and docs 2022-01-25 09:40:04 +09:00
elog.h Introduce log_destination=jsonlog 2022-01-17 10:16:53 +09:00
evtcache.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
expandeddatum.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
expandedrecord.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
float.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
fmgrtab.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
formatting.h SQL/JSON query functions 2022-03-29 16:57:13 -04:00
freepage.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
geo_decls.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
guc.h Prefetch data referenced by the WAL, take II. 2022-04-07 19:42:14 +12:00
guc_tables.h Prefetch data referenced by the WAL, take II. 2022-04-07 19:42:14 +12:00
help_config.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
hsearch.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
index_selfuncs.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
inet.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
inval.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
json.h SQL JSON functions 2022-03-30 16:30:37 -04:00
jsonb.h SQL JSON functions 2022-03-30 16:30:37 -04:00
jsonfuncs.h SQL/JSON query functions 2022-03-29 16:57:13 -04:00
jsonpath.h JSON_TABLE 2022-04-04 16:03:47 -04:00
logtape.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
lsyscache.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
memdebug.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
memutils.h Improve the generation memory allocator 2022-04-04 20:53:13 +12:00
multirangetypes.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
numeric.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
old_snapshot.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
palloc.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
partcache.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
pg_crc.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
pg_locale.h Fix global ICU collations for ICU < 54 2022-03-20 10:21:45 +01:00
pg_lsn.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
pg_rusage.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
pgstat_internal.h pgstat: store statistics in shared memory. 2022-04-06 21:29:46 -07:00
pidfile.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
plancache.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
portal.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
ps_status.h Refactor ps_status.c API 2020-03-11 16:38:31 +01:00
queryenvironment.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
queryjumble.h Add compute_query_id = regress 2022-02-22 10:22:15 +09:00
rangetypes.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
regproc.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
rel.h pgstat: store statistics in shared memory. 2022-04-06 21:29:46 -07:00
relcache.h Allow specifying row filters for logical replication of tables. 2022-02-22 08:11:50 +05:30
relfilenodemap.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
relmapper.h Add new block-by-block strategy for CREATE DATABASE. 2022-03-29 11:48:36 -04:00
relptr.h Suppress compiler warning in relptr_store(). 2022-03-26 14:30:09 -04:00
reltrigger.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
resowner.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
resowner_private.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
rls.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
ruleutils.h Add public ruleutils.c entry point to deparse a Query. 2022-03-28 11:19:37 -04:00
sampling.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
selfuncs.h Optimize order of GROUP BY keys 2022-03-31 01:13:33 +02:00
sharedtuplestore.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
snapmgr.h Assert in init_toast_snapshot() that some snapshot registered or active. 2022-02-21 08:58:29 -08:00
snapshot.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
sortsupport.h Specialize tuplesort routines for different kinds of abbreviated keys 2022-04-02 15:22:25 +07:00
spccache.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
syscache.h Allow granting SET and ALTER SYSTEM privileges on GUC parameters. 2022-04-06 13:24:33 -04:00
timeout.h pgstat: store statistics in shared memory. 2022-04-06 21:29:46 -07:00
timestamp.h Fix overflow hazards in interval input and output conversions. 2022-04-02 16:12:29 -04:00
tuplesort.h Use Generation memory contexts to store tuples in sorts 2022-04-04 22:52:35 +12:00
tuplestore.h Remove all traces of tuplestore_donestoring() in the C code 2022-02-17 09:52:02 +09:00
typcache.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
tzparser.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
uuid.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
varbit.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
varlena.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
wait_event.h pgstat: store statistics in shared memory. 2022-04-06 21:29:46 -07:00
xid8.h Update copyright for 2022 2022-01-07 19:04:57 -05:00
xml.h Update copyright for 2022 2022-01-07 19:04:57 -05:00