Skip to content

Commit 210622c

Browse files
committed
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 <[email protected]> Author: Andres Freund <[email protected]> (some optimization tweaks) Reviewed-by: Melanie Plageman <[email protected]> Reviewed-by: Heikki Linnakangas <[email protected]> Reviewed-by: Nazir Bilal Yavuz <[email protected]> Reviewed-by: Dilip Kumar <[email protected]> Reviewed-by: Andres Freund <[email protected]> Tested-by: Tomas Vondra <[email protected]> Discussion: https://postgr.es/m/CA+hUKGJkOiOCa+mag4BF+zHo7qo=o9CFheB8=g6uT5TUm2gkvA@mail.gmail.com
1 parent 13b3b62 commit 210622c

File tree

7 files changed

+605
-221
lines changed

7 files changed

+605
-221
lines changed

doc/src/sgml/config.sgml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2708,6 +2708,20 @@ include_dir 'conf.d'
27082708
</listitem>
27092709
</varlistentry>
27102710

2711+
<varlistentry id="guc-io-combine-limit" xreflabel="io_combine_limit">
2712+
<term><varname>io_combine_limit</varname> (<type>integer</type>)
2713+
<indexterm>
2714+
<primary><varname>io_combine_limit</varname> configuration parameter</primary>
2715+
</indexterm>
2716+
</term>
2717+
<listitem>
2718+
<para>
2719+
Controls the largest I/O size in operations that combine I/O.
2720+
The default is 128kB.
2721+
</para>
2722+
</listitem>
2723+
</varlistentry>
2724+
27112725
<varlistentry id="guc-max-worker-processes" xreflabel="max_worker_processes">
27122726
<term><varname>max_worker_processes</varname> (<type>integer</type>)
27132727
<indexterm>

0 commit comments

Comments
 (0)