muscles

Settings

A session can change a setting with SET name = value when its scope is session. The scope server_runtime settings change with ALTER SETTING, and server_static settings change only in the configuration.

Query

NameTypeDefaultScopeAllowed valuesDescription
max_query_rowsinteger1000000session1 to 1000000000Maximum number of result rows returned by a single query.
result_overflow_modeenumerationthrowsessionthrow, breakWhether a query with more rows than max_query_rows fails (throw) or returns the first rows marked as truncated (break).
max_execution_time_msinteger0session0 to 86400000Longest time one query may run, in milliseconds. 0 means no limit.
max_rows_to_readinteger0session0 to 4503599627370496Most rows one query may scan. 0 means no limit.
max_result_rowsinteger0session0 to 4503599627370496Most rows one query may return before it fails. 0 means no limit.
max_memory_bytesinteger0session0 to 4503599627370496Most memory, in bytes, that one query may allocate. 0 means no limit.
max_bytes_before_external_group_byinteger0session-1 to 4503599627370496Size of aggregate state, in bytes, at which GROUP BY writes its groups to temporary files. 0 means half of max_memory_bytes, and -1 means never.
max_bytes_before_external_sortinteger0session-1 to 4503599627370496Size of buffered ORDER BY rows, in bytes, at which a sort writes sorted runs to temporary files. 0 means half of max_memory_bytes, and -1 means never.
max_temp_space_bytesinteger8589934592server_static0 to 4503599627370496Most disk space, in bytes, that the spill files of all queries may use together. 0 means no limit.
max_concurrent_queriesinteger0server_runtime0 to 1000000Most queries that may run at once on the server. 0 means no limit.
join_use_nullsbooleantruesessionA LEFT join fills unmatched right-side columns with NULL when this is true, and with the type's default value when it is false. A boolean setting also takes 1 and 0.
asof_join_algorithmenumerationautosessionauto, hash, mergeAlgorithm for ASOF joins. auto lets the planner choose, hash searches sorted vectors per key, and merge sorts both sides and walks them once.
union_default_modeenumerationemptysessionempty, ALL, DISTINCTHow a UNION without ALL or DISTINCT behaves. ALL keeps duplicate rows, DISTINCT drops them, and empty refuses the query, as ClickHouse does.
aggregate_undefined_returns_nanbooleanfalsesessionResult of varSamp, stddevSamp, covarSamp and corr for a group with fewer than two rows. 0 gives NULL, and 1 gives nan as ClickHouse does.
prefer_column_name_to_aliasbooleanfalsesessionWhich one wins when an identifier is both a SELECT alias and a column. 0 picks the alias, as ClickHouse does, and 1 picks the column.
query_priorityenumerationnormalsessionhigh, normal, lowScheduling band of this session's queries when the CPU is busy. Only an administrator may choose high.

Distributed query

NameTypeDefaultScopeAllowed valuesDescription
distributed_timeout_msinteger10000session0 to 3600000Time limit for a whole distributed query, in milliseconds.
distributed_distinct_maxinteger1048576session1 to 1073741824Most COUNT(DISTINCT) values kept per aggregate and fragment.
distributed_consistencyenumerationfullsessionfull, partialDefault read consistency of a distributed query. full waits for every shard, and partial answers without a shard that is down or slow.

Tracing

NameTypeDefaultScopeAllowed valuesDescription
opentelemetry_start_trace_probabilityratio0sessionChance from 0 to 1 that a query is traced whatever the query subsystem ratio.
opentelemetry_trace_processorsbooleanfalsesessionAccepted for ClickHouse compatibility and has no effect: every traced query records its operator spans.
log_processors_profilesbooleanfalsesessionWrites one row per query operator to system.processors_profile_log.
memory_profiler_stepinteger0session0 to 1099511627776Records a system.trace_log row each time a query's memory charges add up to this many bytes. 0 turns it off.
memory_profiler_sample_probabilityratio0sessionChance from 0 to 1 that one memory charge of a query is recorded in system.trace_log.

Storage

NameTypeDefaultScopeAllowed valuesDescription
flush_max_rowsinteger1048576server_runtime0 to 17179869184Flushes a table's segment once this many rows are unflushed. 0 disables it.
flush_interval_msinteger60000server_runtime0 to 86400000Flushes a table's segment this many milliseconds after its previous flush. 0 disables it.

Experimental

NameTypeDefaultScopeAllowed valuesDescription
allow_experimental_arraysbooleantrueserver_staticWhether array and nested-type columns are enabled. The value is fixed at build time and cannot be changed.
NameTypeDefaultScopeAllowed valuesDescription
search_nprobeinteger8session1 to 65536IVF cells probed per part by an approximate vector KNN query. A higher value gives better recall and a slower query, and it applies only when vector_search_approximate is 1.
vector_search_approximatebooleanfalsesessionWhether KNN search uses the approximate IVF index. 0 compares every vector, and 1 uses the faster index, whose recall can be below 1.
bm25_k1string1.2sessionBM25 term-frequency saturation k1, as decimal text. The standard value is 1.2.
bm25_bstring0.75sessionBM25 document-length normalization b between 0 and 1, as decimal text. The standard value is 0.75.

Retention

NameTypeDefaultScopeAllowed valuesDescription
allow_partial_below_drop_horizonbooleanfalsesessionReturns partial rows with a partial-consistency signal, instead of refusing a query that reaches below the raw-drop horizon and cannot use a rollup.