columns_cache_free_memory_ratio
Fraction of the server memory limit (max_server_memory_usage) that the columns cache keeps free for the queries.
The memory of the cache counts against the same limit as the queries do, so the size of the cache in effect is lowered
while the rest of the server uses more than max_server_memory_usage * (1 - columns_cache_free_memory_ratio) - columns_cache_size,
and raised back towards columns_cache_size once that usage subsides. An allocation that would exceed the limit also evicts
from the cache before a query is stopped for it. Analogous to page_cache_free_memory_ratio.
The limit in effect is reported by CurrentMetrics.ColumnsCacheSizeLimit, while system.server_settings keeps reporting
the configured columns_cache_size.
columns_cache_history_window_ms
The columns cache takes the peak memory usage of the rest of the server over this many milliseconds (and the same window before it) when it decides how much memory it may use, so that a brief dip of the usage does not let the cache grow only to be evicted again a moment later. Analogous topage_cache_history_window_ms.
columns_cache_policy
Columns cache policy name.columns_cache_size
Maximum size (in bytes) for the columns cache, which stores deserialized columns from MergeTree tables. The columns cache eliminates repeated decompression and deserialization for frequently accessed columns. The cache is used if the query-level optionuse_columns_cache is enabled.
When this setting is not present in the server configuration, the cache is sized to columns_cache_size_to_ram_ratio
of the memory available to the server (10% by default), so that a server with more memory gets a cache large enough
to hold the working set of heavier queries. The built-in value of this setting is used only when the amount of
memory cannot be determined. Like the other caches, the size is capped by cache_size_to_ram_max_ratio.
The limit applies to the memory the cache retains: an entry is charged the allocated size of its column,
which can exceed the logical size of the rows in it, plus a small per-entry overhead. system.columns_cache
reports the same quantity per entry, and CurrentMetrics.ColumnsCacheBytes its total.
system.server_settings reports this setting as configured. The limit actually in effect can be lower while the
rest of the server is short of memory, see columns_cache_free_memory_ratio; that value is published separately
as CurrentMetrics.ColumnsCacheSizeLimit.
A value of
0 means disabled.This setting can be modified at runtime and will take effect immediately.columns_cache_size_ratio
The size of the protected queue (in case of SLRU policy) in the columns cache relative to the cache’s total size.columns_cache_size_to_ram_ratio
The size of the columns cache as a fraction of the memory available to the server. It is used whencolumns_cache_size
is not present in the server configuration: the cache is then sized to this fraction of the RAM (subject to the
cache_size_to_ram_max_ratio cap), so that a large server gets a cache that can hold the working set of heavier queries,
while a small one gives up only a small part of its memory to it. Memory is allocated only on demand, and only when
queries run with use_columns_cache enabled.
A value of 0 disables the cache unless columns_cache_size is set explicitly.