v.20.1Experimental Feature

Added Experimental Setting for mmap I/O to Read Large Files Efficiently

Added experimental setting min_bytes_to_use_mmap_io. It allows to read big files without copying data from kernel to userspace. The setting is disabled by default. Recommended threshold is about 64 MB, because mmap/munmap is slow. #8520 (alexey-milovidov)
Added an experimental setting min_bytes_to_use_mmap_io that enables reading large files using memory-mapped I/O (mmap) to avoid copying data from kernel to userspace.

Why it matters

This feature aims to improve the efficiency of reading large files by leveraging mmap, which can reduce CPU overhead by eliminating the need to copy data between kernel and userspace. It is designed for large files (recommended threshold around 64 MB) because mmap and munmap operations can be slow for smaller files.

How to use it

Enable the feature by setting min_bytes_to_use_mmap_io to a desired threshold (in bytes) in the ClickHouse settings. For example, to enable mmap I/O for files larger than 64 MB, set min_bytes_to_use_mmap_io=67108864. The setting is disabled by default.