postgresql/src/include/port
Thomas Munro 06fb5612c9 Increase io_combine_limit range to 1MB.
The default of 128kB is unchanged, but the upper limit is changed from
32 blocks to 128 blocks, unless the operating system's IOV_MAX is too
low.  Some other RDBMSes seem to cap their multi-block buffer pool I/O
around this number, and it seems useful to allow experimentation.

The concrete change is to our definition of PG_IOV_MAX, which provides
the maximum for io_combine_limit and io_max_combine_limit.  It also
affects a couple of other places that work with arrays of struct iovec
or smaller objects on the stack, so we still don't want to use the
system IOV_MAX directly without a clamp: it is not under our control and
likely to be 1024.  128 seems acceptable for our current usage.

For Windows, we can't use real scatter/gather yet, so we continue to
define our own IOV_MAX value of 16 and emulate preadv()/pwritev() with
loops.  Someone would need to research the trade-offs of raising that
number.

NB if trying to see this working: you might temporarily need to hack
BAS_BULKREAD to be bigger, since otherwise the obvious way of "a very
big SELECT" is limited by that for now.

Suggested-by: Tomas Vondra <tomas@vondra.me>
Discussion: https://postgr.es/m/CA%2BhUKG%2B2T9p-%2BzM6Eeou-RAJjTML6eit1qn26f9twznX59qtCA%40mail.gmail.com
2025-03-19 15:40:35 +13:00
..
atomics Update copyright for 2025 2025-01-01 11:21:55 -05:00
win32 Fix gai_strerror() thread-safety on Windows. 2024-02-12 11:14:21 +13:00
win32_msvc windows: msvc: Define STDIN/OUT/ERR_FILENO. 2022-07-18 17:21:54 -07:00
atomics.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
cygwin.h Simplify declaring variables exported from libpgcommon and libpgport. 2021-11-29 11:00:00 -05:00
darwin.h Add prefetching support on macOS 2024-08-28 07:28:27 +02:00
freebsd.h Improve the naming in wal_sync_method code. 2023-10-13 15:16:45 -05:00
linux.h Improve the naming in wal_sync_method code. 2023-10-13 15:16:45 -05:00
netbsd.h Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
openbsd.h Remove cvs keywords from all files. 2010-09-20 22:08:53 +02:00
pg_bitutils.h Fix comment about AVX-512 popcount support. 2025-01-22 14:11:37 -06:00
pg_bswap.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
pg_crc32c.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
pg_iovec.h Increase io_combine_limit range to 1MB. 2025-03-19 15:40:35 +13:00
pg_lfind.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
pg_pthread.h IWYU widely useful pragmas 2025-01-15 18:57:53 +01:00
simd.h Update copyright for 2025 2025-01-01 11:21:55 -05:00
solaris.h Remove obsolete HAVE_BUGGY_SOLARIS_STRTOD 2020-08-15 11:27:41 +02:00
win32.h mingw: Define PGDLLEXPORT as __declspec (dllexport) as done for msvc 2022-09-30 10:50:05 -07:00
win32_port.h Remove redefinitions of SIG_* macros in win32_port.h. 2025-01-16 20:55:24 -06:00
win32ntdll.h Update copyright for 2025 2025-01-01 11:21:55 -05:00