aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/misc/guc_tables.c
diff options
context:
space:
mode:
authorThomas Munro <tmunro@postgresql.org>2024-04-03 00:03:08 +1300
committerThomas Munro <tmunro@postgresql.org>2024-04-03 00:23:20 +1300
commit210622c60e1a9db2e2730140b8106ab57d259d15 (patch)
tree9c8de4c53e6cd36fd48ac078d45037e5e8623e23 /src/backend/utils/misc/guc_tables.c
parent13b3b62746ec8bd9c8e3f0bc23862f1172996333 (diff)
downloadpostgresql-210622c60e1a9db2e2730140b8106ab57d259d15.tar.gz
postgresql-210622c60e1a9db2e2730140b8106ab57d259d15.zip
Provide vectored variant of ReadBuffer().
Break ReadBuffer() up into two steps. StartReadBuffers() and WaitReadBuffers() give us two main advantages: 1. Multiple consecutive blocks can be read with one system call. 2. Advice (hints of future reads) can optionally be issued to the kernel ahead of time. The traditional ReadBuffer() function is now implemented in terms of those functions, to avoid duplication. A new GUC io_combine_limit is defined, and the functions for limiting per-backend pin counts are made into public APIs. Those are provided for use by callers of StartReadBuffers(), when deciding how many buffers to read at once. The following commit will add a higher level mechanism for doing that automatically with a practical interface. With some more infrastructure in later work, StartReadBuffers() could be extended to start real asynchronous I/O instead of just issuing advice and leaving WaitReadBuffers() to do the work synchronously. Author: Thomas Munro <thomas.munro@gmail.com> Author: Andres Freund <andres@anarazel.de> (some optimization tweaks) Reviewed-by: Melanie Plageman <melanieplageman@gmail.com> Reviewed-by: Heikki Linnakangas <hlinnaka@iki.fi> Reviewed-by: Nazir Bilal Yavuz <byavuz81@gmail.com> Reviewed-by: Dilip Kumar <dilipbalaut@gmail.com> Reviewed-by: Andres Freund <andres@anarazel.de> Tested-by: Tomas Vondra <tomas.vondra@enterprisedb.com> Discussion: https://postgr.es/m/CA+hUKGJkOiOCa+mag4BF+zHo7qo=o9CFheB8=g6uT5TUm2gkvA@mail.gmail.com
Diffstat (limited to 'src/backend/utils/misc/guc_tables.c')
-rw-r--r--src/backend/utils/misc/guc_tables.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/backend/utils/misc/guc_tables.c b/src/backend/utils/misc/guc_tables.c
index 92fcd5fa4d5..c12784cbec8 100644
--- a/src/backend/utils/misc/guc_tables.c
+++ b/src/backend/utils/misc/guc_tables.c
@@ -3130,6 +3130,20 @@ struct config_int ConfigureNamesInt[] =
},
{
+ {"io_combine_limit",
+ PGC_USERSET,
+ RESOURCES_ASYNCHRONOUS,
+ gettext_noop("Limit on the size of data reads and writes."),
+ NULL,
+ GUC_UNIT_BLOCKS
+ },
+ &io_combine_limit,
+ DEFAULT_IO_COMBINE_LIMIT,
+ 1, MAX_IO_COMBINE_LIMIT,
+ NULL, NULL, NULL
+ },
+
+ {
{"backend_flush_after", PGC_USERSET, RESOURCES_ASYNCHRONOUS,
gettext_noop("Number of pages after which previously performed writes are flushed to disk."),
NULL,