Skip to main content
These settings are available in system.settings and are autogenerated from source.

min_bytes_before_external_group_by

The minimum size in bytes of the aggregation state of one thread before external GROUP BY writes it to disk. When the memory of the query is over max_bytes_before_external_group_by or max_bytes_ratio_before_external_group_by because of other operators, for example a hash join that holds a large table, each thread would otherwise write every block it aggregates to disk as a separate small file. Reading many small files back costs more memory than the writes saved. With this setting a thread keeps aggregating until its own state reaches the given size, and only then writes it out as one file. The memory used above the threshold is bounded by this value multiplied by the number of threads. Possible values:
  • A positive integer, the size in bytes.
  • 0 — no minimum, the state is written as soon as the threshold is reached.

min_bytes_to_spill

Used in workload scheduling. The minimum amount of bytes to spill. This setting takes effect only if MEMORY RESERVATION resource is created.

min_bytes_to_use_direct_io

The minimum data volume required for using direct I/O access to the storage disk. ClickHouse uses this setting when reading data from tables. If the total storage volume of all the data to be read exceeds min_bytes_to_use_direct_io bytes, then ClickHouse reads the data from the storage disk with the O_DIRECT option. Possible values:
  • 0 — Direct I/O is disabled.
  • Positive integer.

min_bytes_to_use_mmap_io

This is an experimental setting. Sets the minimum amount of memory for reading large files without copying data from the kernel to userspace. Recommended threshold is about 64 MB, because mmap/munmap is slow. It makes sense only for large files and helps only if data reside in the page cache. Possible values:
  • Positive integer.
  • 0 — Big files read with only copying data from kernel to userspace.