Skip to content
ClickHouse Docs
ClickHouse DocsClickHouse Docs

use_query_* session settings

These settings are available in system.settings and are autogenerated from source.

use_query_cache

Type
Bool
Default
0

If turned on, SELECT queries may utilize the query cache. Parameters enable_reads_from_query_cache and enable_writes_to_query_cache control in more detail how the cache is used.

Possible values:

  • 0 - Disabled
  • 1 - Enabled

use_query_condition_cache

Type
Bool
Default
1
Version history
VersionDefault valueComment
25.41A new optimization
25.30New setting.

Enable the query condition cache. The cache stores ranges of granules in data parts which do not satisfy the condition in the WHERE clause, and reuse this information as an ephemeral index for subsequent queries.

Possible values:

  • 0 - Disabled
  • 1 - Enabled

use_query_condition_cache_for_top_k

Type
Bool
Default
1
Version history
VersionDefault valueComment
26.81New setting to gate the query condition cache for `ORDER BY ... LIMIT n` (TopK) reads; enabled by default. The gate is disabled in 26.7, so `compatibility` with an earlier version keeps it off.

Enable the query condition cache for queries that use the ORDER BY <column> LIMIT n (TopK) optimization (dynamic filtering or skip-index based). When disabled, such reads neither consult nor populate the cache.

Such queries can drop granules during execution depending on the running threshold, so their cache entries are partitioned by the TopK plan parameters and by the set of parts read. This setting has no effect unless use_query_condition_cache is also enabled.

Possible values:

  • 0 - Disabled
  • 1 - Enabled
Navigation