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
| Name | Type | Default | Scope | Allowed values | Description |
|---|---|---|---|---|---|
max_query_rows | integer | 1000000 | session | 1 to 1000000000 | Maximum number of result rows returned by a single query. |
result_overflow_mode | enumeration | throw | session | throw, break | Whether a query with more rows than max_query_rows fails (throw) or returns the first rows marked as truncated (break). |
max_execution_time_ms | integer | 0 | session | 0 to 86400000 | Longest time one query may run, in milliseconds. 0 means no limit. |
max_rows_to_read | integer | 0 | session | 0 to 4503599627370496 | Most rows one query may scan. 0 means no limit. |
max_result_rows | integer | 0 | session | 0 to 4503599627370496 | Most rows one query may return before it fails. 0 means no limit. |
max_memory_bytes | integer | 0 | session | 0 to 4503599627370496 | Most memory, in bytes, that one query may allocate. 0 means no limit. |
max_bytes_before_external_group_by | integer | 0 | session | -1 to 4503599627370496 | Size 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_sort | integer | 0 | session | -1 to 4503599627370496 | Size 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_bytes | integer | 8589934592 | server_static | 0 to 4503599627370496 | Most disk space, in bytes, that the spill files of all queries may use together. 0 means no limit. |
max_concurrent_queries | integer | 0 | server_runtime | 0 to 1000000 | Most queries that may run at once on the server. 0 means no limit. |
join_use_nulls | boolean | true | session | A 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_algorithm | enumeration | auto | session | auto, hash, merge | Algorithm 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_mode | enumeration | empty | session | empty, ALL, DISTINCT | How 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_nan | boolean | false | session | Result 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_alias | boolean | false | session | Which 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_priority | enumeration | normal | session | high, normal, low | Scheduling band of this session's queries when the CPU is busy. Only an administrator may choose high. |
Distributed query
| Name | Type | Default | Scope | Allowed values | Description |
|---|---|---|---|---|---|
distributed_timeout_ms | integer | 10000 | session | 0 to 3600000 | Time limit for a whole distributed query, in milliseconds. |
distributed_distinct_max | integer | 1048576 | session | 1 to 1073741824 | Most COUNT(DISTINCT) values kept per aggregate and fragment. |
distributed_consistency | enumeration | full | session | full, partial | Default read consistency of a distributed query. full waits for every shard, and partial answers without a shard that is down or slow. |
Tracing
| Name | Type | Default | Scope | Allowed values | Description |
|---|---|---|---|---|---|
opentelemetry_start_trace_probability | ratio | 0 | session | Chance from 0 to 1 that a query is traced whatever the query subsystem ratio. | |
opentelemetry_trace_processors | boolean | false | session | Accepted for ClickHouse compatibility and has no effect: every traced query records its operator spans. | |
log_processors_profiles | boolean | false | session | Writes one row per query operator to system.processors_profile_log. | |
memory_profiler_step | integer | 0 | session | 0 to 1099511627776 | Records 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_probability | ratio | 0 | session | Chance from 0 to 1 that one memory charge of a query is recorded in system.trace_log. |
Storage
| Name | Type | Default | Scope | Allowed values | Description |
|---|---|---|---|---|---|
flush_max_rows | integer | 1048576 | server_runtime | 0 to 17179869184 | Flushes a table's segment once this many rows are unflushed. 0 disables it. |
flush_interval_ms | integer | 60000 | server_runtime | 0 to 86400000 | Flushes a table's segment this many milliseconds after its previous flush. 0 disables it. |
Experimental
| Name | Type | Default | Scope | Allowed values | Description |
|---|---|---|---|---|---|
allow_experimental_arrays | boolean | true | server_static | Whether array and nested-type columns are enabled. The value is fixed at build time and cannot be changed. |
Search
| Name | Type | Default | Scope | Allowed values | Description |
|---|---|---|---|---|---|
search_nprobe | integer | 8 | session | 1 to 65536 | IVF 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_approximate | boolean | false | session | Whether KNN search uses the approximate IVF index. 0 compares every vector, and 1 uses the faster index, whose recall can be below 1. | |
bm25_k1 | string | 1.2 | session | BM25 term-frequency saturation k1, as decimal text. The standard value is 1.2. | |
bm25_b | string | 0.75 | session | BM25 document-length normalization b between 0 and 1, as decimal text. The standard value is 0.75. |
Retention
| Name | Type | Default | Scope | Allowed values | Description |
|---|---|---|---|---|---|
allow_partial_below_drop_horizon | boolean | false | session | Returns partial rows with a partial-consistency signal, instead of refusing a query that reaches below the raw-drop horizon and cannot use a rollup. |