βΉοΈ Skipped - page is already crawled
| Filter | Status | Condition | Details |
|---|---|---|---|
| HTTP status | PASS | download_http_code = 200 | HTTP 200 |
| Age cutoff | PASS | download_stamp > now() - 6 MONTH | 0.1 months ago |
| History drop | PASS | isNull(history_drop_reason) | No drop reason |
| Spam/ban | PASS | fh_dont_index != 1 AND ml_spam_score = 0 | ml_spam_score=0 |
| Canonical | PASS | meta_canonical IS NULL OR = '' OR = src_unparsed | Not set |
| Property | Value |
|---|---|
| URL | https://clickhouse.com/docs/operations/settings/settings |
| Last Crawled | 2026-04-12 10:42:36 (2 days ago) |
| First Indexed | 2025-02-21 00:06:21 (1 year ago) |
| HTTP Status Code | 200 |
| Meta Title | Session Settings | ClickHouse Docs |
| Meta Description | Settings which are found in the ``system.settings`` table. |
| Meta Canonical | null |
| Boilerpipe Text | All below settings are also available in table
system.settings
. These settings are autogenerated from
source
.
Type
Default value
Type
Bool
Default value
0
Write add http CORS header.
additional_result_filter
β
An additional filter expression to apply to the result of
SELECT
query.
This setting is not applied to any subquery.
Example
INSERT
INTO
table_1
VALUES
(
1
,
'a'
)
,
(
2
,
'bb'
)
,
(
3
,
'ccc'
)
,
(
4
,
'dddd'
)
;
SElECT
*
FROM
table_1
;
ββxββ¬βyβββββ
β 1 β a β
β 2 β bb β
β 3 β ccc β
β 4 β dddd β
βββββ΄βββββββ
SELECT
*
FROM
table_1
SETTINGS additional_result_filter
=
'x != 2'
ββxββ¬βyβββββ
β 1 β a β
β 3 β ccc β
β 4 β dddd β
βββββ΄βββββββ
additional_table_filters
β
Type
Default value
Type
Map
Default value
{}
An additional filter expression that is applied after reading
from the specified table.
Example
INSERT
INTO
table_1
VALUES
(
1
,
'a'
)
,
(
2
,
'bb'
)
,
(
3
,
'ccc'
)
,
(
4
,
'dddd'
)
;
SELECT
*
FROM
table_1
;
ββxββ¬βyβββββ
β 1 β a β
β 2 β bb β
β 3 β ccc β
β 4 β dddd β
βββββ΄βββββββ
SELECT
*
FROM
table_1
SETTINGS additional_table_filters
=
{
'table_1'
:
'x != 2'
}
ββxββ¬βyβββββ
β 1 β a β
β 3 β ccc β
β 4 β dddd β
βββββ΄βββββββ
aggregate_function_input_format
β
Type
Default value
Type
AggregateFunctionInputFormat
Default value
state
Format for AggregateFunction input during INSERT operations.
Possible values:
state
β Binary string with the serialized state (the default). This is the default behavior where AggregateFunction values are expected as binary data.
value
β The format expects a single value of the argument of the aggregate function, or in the case of multiple arguments, a tuple of them. They will be deserialized using the corresponding IDataType or DataTypeTuple and then aggregated to form the state.
array
β The format expects an Array of values, as described in the
value
option above. All elements of the array will be aggregated to form the state.
Examples
For a table with structure:
CREATE
TABLE
example
(
user_id UInt64
,
avg_session_length AggregateFunction
(
avg
,
UInt32
)
)
;
With
aggregate_function_input_format = 'value'
:
INSERT
INTO
example FORMAT CSV
123
,
456
With
aggregate_function_input_format = 'array'
:
INSERT
INTO
example FORMAT CSV
123
,
"[456,789,101]"
Note: The
value
and
array
formats are slower than the default
state
format as they require creating and aggregating values during insertion.
aggregate_functions_null_for_empty
β
Type
Default value
Type
Bool
Default value
0
Enables or disables rewriting all aggregate functions in a query, adding
-OrNull
suffix to them. Enable it for SQL standard compatibility.
It is implemented via query rewrite (similar to
count_distinct_implementation
setting) to get consistent results for distributed queries.
Possible values:
0 β Disabled.
1 β Enabled.
Example
Consider the following query with aggregate functions:
SELECT
SUM
(
-
1
)
,
MAX
(
0
)
FROM
system
.
one
WHERE
0
;
With
aggregate_functions_null_for_empty = 0
it would produce:
ββSUM(-1)ββ¬βMAX(0)ββ
β 0 β 0 β
βββββββββββ΄βββββββββ
With
aggregate_functions_null_for_empty = 1
the result would be:
ββSUMOrNull(-1)ββ¬βMAXOrNull(0)ββ
β NULL β NULL β
βββββββββββββββββ΄βββββββββββββββ
aggregation_in_order_max_block_bytes
β
Type
Default value
Type
UInt64
Default value
50000000
Maximal size of block in bytes accumulated during aggregation in order of primary key. Lower block size allows to parallelize more final merge stage of aggregation.
aggregation_memory_efficient_merge_threads
β
Type
Default value
Type
UInt64
Default value
0
Number of threads to use for merge intermediate aggregation results in memory efficient mode. When bigger, then more memory is consumed. 0 means - same as 'max_threads'.
allow_aggregate_partitions_independently
β
Type
Default value
Type
Bool
Default value
0
Enable independent aggregation of partitions on separate threads when partition key suits group by key. Beneficial when number of partitions close to number of cores and partitions have roughly the same size
allow_archive_path_syntax
β
Type
Default value
Type
Bool
Default value
1
File/S3 engines/table function will parse paths with '::' as
<archive> :: <file>
if the archive has correct extension.
allow_asynchronous_read_from_io_pool_for_merge_tree
β
Type
Default value
Type
Bool
Default value
0
Use background I/O pool to read from MergeTree tables. This setting may increase performance for I/O bound queries
allow_calculating_subcolumns_sizes_for_merge_tree_reading
β
Type
Default value
Type
Bool
Default value
1
When enabled, ClickHouse will calculate the size of files required for each subcolumn reading for better task and block sizes calculation.
allow_changing_replica_until_first_data_packet
β
Type
Default value
Type
Bool
Default value
0
If it's enabled, in hedged requests we can start new connection until receiving first data packet even if we have already made some progress
(but progress haven't updated for
receive_data_timeout
timeout), otherwise we disable changing replica after the first time we made progress.
allow_create_index_without_type
β
Type
Default value
Type
Bool
Default value
0
Allow CREATE INDEX query without TYPE. Query will be ignored. Made for SQL compatibility tests.
allow_custom_error_code_in_throwif
β
Type
Default value
Type
Bool
Default value
0
Enable custom error code in function throwIf(). If true, thrown exceptions may have unexpected error codes.
allow_ddl
β
Type
Default value
Type
Bool
Default value
1
If it is set to true, then a user is allowed to executed DDL queries.
allow_deprecated_database_ordinary
β
Type
Default value
Type
Bool
Default value
0
Allow to create databases with deprecated Ordinary engine
allow_deprecated_error_prone_window_functions
β
Type
Default value
Type
Bool
Default value
0
Allow usage of deprecated error prone window functions (neighbor, runningAccumulate, runningDifferenceStartingWithFirstValue, runningDifference)
allow_deprecated_snowflake_conversion_functions
β
Type
Default value
Type
Bool
Default value
0
Functions
snowflakeToDateTime
,
snowflakeToDateTime64
,
dateTimeToSnowflake
, and
dateTime64ToSnowflake
are deprecated and disabled by default.
Please use functions
snowflakeIDToDateTime
,
snowflakeIDToDateTime64
,
dateTimeToSnowflakeID
, and
dateTime64ToSnowflakeID
instead.
To re-enable the deprecated functions (e.g., during a transition period), please set this setting to
true
.
allow_deprecated_syntax_for_merge_tree
β
Type
Default value
Type
Bool
Default value
0
Allow to create *MergeTree tables with deprecated engine definition syntax
allow_distributed_ddl
β
Type
Default value
Type
Bool
Default value
1
If it is set to true, then a user is allowed to executed distributed DDL queries.
allow_drop_detached
β
Type
Default value
Type
Bool
Default value
0
Allow ALTER TABLE ... DROP DETACHED PART[ITION] ... queries
allow_dynamic_type_in_join_keys
β
Type
Default value
Type
Bool
Default value
0
Allows using Dynamic type in JOIN keys. Added for compatibility. It's not recommended to use Dynamic type in JOIN keys because comparison with other types may lead to unexpected results.
allow_execute_multiif_columnar
β
Type
Default value
Type
Bool
Default value
1
Allow execute multiIf function columnar
allow_experimental_alias_table_engine
β
Type
Default value
Type
Bool
Default value
0
Allow to create table with the Alias engine.
allow_experimental_analyzer
β
Aliases
:
enable_analyzer
Type
Default value
Type
Bool
Default value
1
Allow new query analyzer.
allow_experimental_codecs
β
Type
Default value
Type
Bool
Default value
0
If it is set to true, allow to specify experimental compression codecs (but we don't have those yet and this option does nothing).
Type
Default value
Type
Bool
Default value
1
Allow to execute correlated subqueries.
allow_experimental_database_glue_catalog
β
Aliases
:
allow_database_glue_catalog
Type
Default value
Type
Bool
Default value
0
Allow experimental database engine DataLakeCatalog with catalog_type = 'glue'
Cloud default value:
1
.
allow_experimental_database_hms_catalog
β
Type
Default value
Type
Bool
Default value
0
Allow experimental database engine DataLakeCatalog with catalog_type = 'hms'
allow_experimental_database_iceberg
β
Aliases
:
allow_database_iceberg
Type
Default value
Type
Bool
Default value
0
Allow experimental database engine DataLakeCatalog with catalog_type = 'iceberg'
Cloud default value:
1
.
allow_experimental_database_materialized_postgresql
β
Type
Default value
Type
Bool
Default value
0
Allow to create database with Engine=MaterializedPostgreSQL(...).
allow_experimental_database_paimon_rest_catalog
β
Type
Default value
Type
Bool
Default value
0
Allow experimental database engine DataLakeCatalog with catalog_type = 'paimon_rest'
allow_experimental_database_unity_catalog
β
Aliases
:
allow_database_unity_catalog
Type
Default value
Type
Bool
Default value
0
Allow experimental database engine DataLakeCatalog with catalog_type = 'unity'
Cloud default value:
1
.
allow_experimental_delta_kernel_rs
β
Type
Default value
Type
Bool
Default value
1
Allow experimental delta-kernel-rs implementation.
allow_experimental_delta_lake_writes
β
Type
Default value
Type
Bool
Default value
0
Enables delta-kernel writes feature.
allow_experimental_expire_snapshots
β
Type
Default value
Type
Bool
Default value
0
Allow to execute experimental Iceberg command
ALTER TABLE ... EXECUTE expire_snapshots
.
allow_experimental_funnel_functions
β
Type
Default value
Type
Bool
Default value
0
Enable experimental functions for funnel analysis.
allow_experimental_hash_functions
β
Type
Default value
Type
Bool
Default value
0
Enable experimental hash functions
allow_experimental_iceberg_compaction
β
Type
Default value
Type
Bool
Default value
0
Allow to explicitly use 'OPTIMIZE' for iceberg tables.
allow_experimental_join_right_table_sorting
β
Type
Default value
Type
Bool
Default value
0
If it is set to true, and the conditions of
join_to_sort_minimum_perkey_rows
and
join_to_sort_maximum_table_rows
are met, rerange the right table by key to improve the performance in left or inner hash join.
allow_experimental_json_lazy_type_hints
β
Type
Default value
Type
Bool
Default value
0
Enable experimental lazy type hints for JSON type. This feature allows optimizing JSON type conversions by deferring type hint evaluation.
allow_experimental_kafka_offsets_storage_in_keeper
β
Type
Default value
Type
Bool
Default value
0
Allow experimental feature to store Kafka related offsets in ClickHouse Keeper. When enabled a ClickHouse Keeper path and replica name can be specified to the Kafka table engine. As a result instead of the regular Kafka engine, a new type of storage engine will be used that stores the committed offsets primarily in ClickHouse Keeper
allow_experimental_kusto_dialect
β
Type
Default value
Type
Bool
Default value
0
Enable Kusto Query Language (KQL) - an alternative to SQL.
allow_experimental_materialized_postgresql_table
β
Type
Default value
Type
Bool
Default value
0
Allows to use the MaterializedPostgreSQL table engine. Disabled by default, because this feature is experimental
allow_experimental_nlp_functions
β
Type
Default value
Type
Bool
Default value
0
Enable experimental functions for natural language processing.
allow_experimental_nullable_tuple_type
β
Type
Default value
Type
Bool
Default value
0
Allows creation of
Nullable
Tuple
columns in tables.
This setting does not control whether extracted tuple subcolumns can be
Nullable
(for example, from Dynamic, Variant, JSON, or Tuple columns).
Use
allow_nullable_tuple_in_extracted_subcolumns
to control whether extracted tuple subcolumns can be
Nullable
.
allow_experimental_object_storage_queue_hive_partitioning
β
Type
Default value
Type
Bool
Default value
0
Allow to use hive partitioning with S3Queue/AzureQueue engines
allow_experimental_parallel_reading_from_replicas
β
Aliases
:
enable_parallel_replicas
Type
Default value
Type
UInt64
Default value
0
Use up to
max_parallel_replicas
the number of replicas from each shard for SELECT query execution. Reading is parallelized and coordinated dynamically. 0 - disabled, 1 - enabled, silently disable them in case of failure, 2 - enabled, throw an exception in case of failure
allow_experimental_polyglot_dialect
β
Type
Default value
Type
Bool
Default value
0
Enable polyglot SQL transpiler - transpiles SQL from 30+ dialects (MySQL, PostgreSQL, SQLite, Snowflake, DuckDB, etc.) into ClickHouse SQL.
allow_experimental_prql_dialect
β
Type
Default value
Type
Bool
Default value
0
Enable PRQL - an alternative to SQL.
allow_experimental_query_deduplication
β
Type
Default value
Type
Bool
Default value
0
Experimental data deduplication for SELECT queries based on part UUIDs
allow_experimental_time_series_aggregate_functions
β
Aliases
:
allow_experimental_ts_to_grid_aggregate_function
Type
Default value
Type
Bool
Default value
0
Experimental timeSeries* aggregate functions for Prometheus-like timeseries resampling, rate, delta calculation.
allow_experimental_time_series_table
β
Type
Default value
Type
Bool
Default value
0
Allows creation of tables with the
TimeSeries
table engine. Possible values:
0 β the
TimeSeries
table engine is disabled.
1 β the
TimeSeries
table engine is enabled.
allow_experimental_window_view
β
Type
Default value
Type
Bool
Default value
0
Enable WINDOW VIEW. Not mature enough.
allow_experimental_ytsaurus_dictionary_source
β
Type
Default value
Type
Bool
Default value
0
Experimental dictionary source for integration with YTsaurus.
allow_experimental_ytsaurus_table_engine
β
Type
Default value
Type
Bool
Default value
0
Experimental table engine for integration with YTsaurus.
allow_experimental_ytsaurus_table_function
β
Type
Default value
Type
Bool
Default value
0
Experimental table engine for integration with YTsaurus.
allow_fuzz_query_functions
β
Type
Default value
Type
Bool
Default value
0
Enables the
fuzzQuery
function that applies random AST mutations to a query string.
allow_general_join_planning
β
Type
Default value
Type
Bool
Default value
1
Allows a more general join planning algorithm that can handle more complex conditions, but only works with hash join. If hash join is not enabled, then the usual join planning algorithm is used regardless of the value of this setting.
Type
Default value
Type
Bool
Default value
0
Allow to use the function
getClientHTTPHeader
which lets to obtain a value of an the current HTTP request's header. It is not enabled by default for security reasons, because some headers, such as
Cookie
, could contain sensitive info. Note that the
X-ClickHouse-*
and
Authentication
headers are always restricted and cannot be obtained with this function.
allow_hyperscan
β
Type
Default value
Type
Bool
Default value
1
Allow functions that use Hyperscan library. Disable to avoid potentially long compilation times and excessive resource usage.
allow_insert_into_iceberg
β
Aliases
:
allow_experimental_insert_into_iceberg
Type
Default value
Type
Bool
Default value
0
Allow to execute
insert
queries into iceberg.
allow_introspection_functions
β
Type
Default value
Type
Bool
Default value
0
Enables or disables
introspection functions
for query profiling.
Possible values:
1 β Introspection functions enabled.
0 β Introspection functions disabled.
See Also
Sampling Query Profiler
System table
trace_log
allow_materialized_view_with_bad_select
β
Type
Default value
Type
Bool
Default value
0
Allow CREATE MATERIALIZED VIEW with SELECT query that references nonexistent tables or columns. It must still be syntactically valid. Doesn't apply to refreshable MVs. Doesn't apply if the MV schema needs to be inferred from the SELECT query (i.e. if the CREATE has no column list and no TO table). Can be used for creating MV before its source table.
allow_named_collection_override_by_default
β
Type
Default value
Type
Bool
Default value
1
Allow named collections' fields override by default.
Type
Default value
Type
Bool
Default value
1
Allow to execute alters which affects not only tables metadata, but also data on disk
allow_nonconst_timezone_arguments
β
Type
Default value
Type
Bool
Default value
0
Allow non-const timezone arguments in certain time-related functions like toTimeZone(), fromUnixTimestamp*(), snowflakeToDateTime*().
This setting exists only for compatibility reasons. In ClickHouse, the time zone is a property of the data type, respectively of the column.
Enabling this setting gives the wrong impression that different values within a column can have different timezones.
Therefore, please do not enable this setting.
allow_nondeterministic_mutations
β
Type
Default value
Type
Bool
Default value
0
User-level setting that allows mutations on replicated tables to make use of non-deterministic functions such as
dictGet
.
Given that, for example, dictionaries, can be out of sync across nodes, mutations that pull values from them are disallowed on replicated tables by default. Enabling this setting allows this behavior, making it the user's responsibility to ensure that the data used is in sync across all nodes.
Example
<profiles>
<default>
<allow_nondeterministic_mutations>1</allow_nondeterministic_mutations>
<!-- ... -->
</default>
<!-- ... -->
</profiles>
allow_nondeterministic_optimize_skip_unused_shards
β
Type
Default value
Type
Bool
Default value
0
Allow nondeterministic (like
rand
or
dictGet
, since later has some caveats with updates) functions in sharding key.
Possible values:
0 β Disallowed.
1 β Allowed.
allow_nullable_tuple_in_extracted_subcolumns
β
Type
Default value
Type
Bool
Default value
0
Controls whether extracted subcolumns of type
Tuple(...)
can be typed as
Nullable(Tuple(...))
.
false
: Return
Tuple(...)
and use default tuple values for rows where the subcolumn is missing.
true
: Return
Nullable(Tuple(...))
and use
NULL
for rows where the subcolumn is missing.
This setting controls extracted subcolumn behavior only.
It does not control whether
Nullable(Tuple(...))
columns can be created in tables; that is controlled by
allow_experimental_nullable_tuple_type
.
ClickHouse uses the value for this setting loaded at server startup.
Changes made with
SET
or query-level
SETTINGS
do not change extracted subcolumn behavior.
To change extracted subcolumn behavior, update
allow_nullable_tuple_in_extracted_subcolumns
in startup profile configuration (for example, users.xml) and restart the server.
allow_prefetched_read_pool_for_local_filesystem
β
Type
Default value
Type
Bool
Default value
0
Prefer prefetched threadpool if all parts are on local filesystem
allow_prefetched_read_pool_for_remote_filesystem
β
Type
Default value
Type
Bool
Default value
1
Prefer prefetched threadpool if all parts are on remote filesystem
allow_push_predicate_ast_for_distributed_subqueries
β
Type
Default value
Type
Bool
Default value
1
Allows push predicate on AST level for distributed subqueries with enabled anlyzer
allow_push_predicate_when_subquery_contains_with
β
Type
Default value
Type
Bool
Default value
1
Allows push predicate when subquery contains WITH clause
allow_reorder_prewhere_conditions
β
Type
Default value
Type
Bool
Default value
1
When moving conditions from WHERE to PREWHERE, allow reordering them to optimize filtering
allow_settings_after_format_in_insert
β
Type
Default value
Type
Bool
Default value
0
Control whether
SETTINGS
after
FORMAT
in
INSERT
queries is allowed or not. It is not recommended to use this, since this may interpret part of
SETTINGS
as values.
Example:
INSERT INTO FUNCTION null('foo String') SETTINGS max_threads=1 VALUES ('bar');
But the following query will work only with
allow_settings_after_format_in_insert
:
SET allow_settings_after_format_in_insert=1;
INSERT INTO FUNCTION null('foo String') VALUES ('bar') SETTINGS max_threads=1;
Possible values:
0 β Disallow.
1 β Allow.
Note
Use this setting only for backward compatibility if your use cases depend on old syntax.
allow_simdjson
β
Type
Default value
Type
Bool
Default value
1
Allow using simdjson library in 'JSON*' functions if AVX2 instructions are available. If disabled rapidjson will be used.
allow_special_serialization_kinds_in_output_formats
β
Type
Default value
Type
Bool
Default value
1
Allows to output columns with special serialization kinds like Sparse and Replicated without converting them to full column representation.
It helps to avoid unnecessary data copy during formatting.
allow_statistics
β
Aliases
:
allow_experimental_statistics
Type
Default value
Type
Bool
Default value
1
Allows defining columns with
statistics
and
manipulate statistics
.
allow_statistics_optimize
β
Aliases
:
allow_statistic_optimize
Type
Default value
Type
Bool
Default value
1
Allows using statistics to optimize queries
allow_suspicious_codecs
β
Type
Default value
Type
Bool
Default value
0
If it is set to true, allow to specify meaningless compression codecs.
allow_suspicious_fixed_string_types
β
Type
Default value
Type
Bool
Default value
0
In CREATE TABLE statement allows creating columns of type FixedString(n) with n > 256. FixedString with length >= 256 is suspicious and most likely indicates a misuse
allow_suspicious_indices
β
Type
Default value
Type
Bool
Default value
0
Reject primary/secondary indexes and sorting keys with identical expressions
allow_suspicious_low_cardinality_types
β
Type
Default value
Type
Bool
Default value
0
Allows or restricts using
LowCardinality
with data types with fixed size of 8 bytes or less: numeric data types and
FixedString(8_bytes_or_less)
.
For small fixed values using of
LowCardinality
is usually inefficient, because ClickHouse stores a numeric index for each row. As a result:
Disk space usage can rise.
RAM consumption can be higher, depending on a dictionary size.
Some functions can work slower due to extra coding/encoding operations.
Merge times in
MergeTree
-engine tables can grow due to all the reasons described above.
Possible values:
1 β Usage of
LowCardinality
is not restricted.
0 β Usage of
LowCardinality
is restricted.
allow_suspicious_primary_key
β
Type
Default value
Type
Bool
Default value
0
Allow suspicious
PRIMARY KEY
/
ORDER BY
for MergeTree (i.e. SimpleAggregateFunction).
allow_suspicious_ttl_expressions
β
Type
Default value
Type
Bool
Default value
0
Reject TTL expressions that don't depend on any of table's columns. It indicates a user error most of the time.
allow_suspicious_types_in_group_by
β
Type
Default value
Type
Bool
Default value
0
Allows or restricts using
Variant
and
Dynamic
types in GROUP BY keys.
allow_suspicious_types_in_order_by
β
Type
Default value
Type
Bool
Default value
0
Allows or restricts using
Variant
and
Dynamic
types in ORDER BY keys.
allow_suspicious_variant_types
β
Type
Default value
Type
Bool
Default value
0
In CREATE TABLE statement allows specifying Variant type with similar variant types (for example, with different numeric or date types). Enabling this setting may introduce some ambiguity when working with values with similar types.
allow_unrestricted_reads_from_keeper
β
Type
Default value
Type
Bool
Default value
0
Allow unrestricted (without condition on path) reads from system.zookeeper table, can be handy, but is not safe for zookeeper
alter_move_to_space_execute_async
β
Type
Default value
Type
Bool
Default value
0
Execute ALTER TABLE MOVE ... TO [DISK|VOLUME] asynchronously
alter_partition_verbose_result
β
Type
Default value
Type
Bool
Default value
0
Enables or disables the display of information about the parts to which the manipulation operations with partitions and parts have been successfully applied.
Applicable to
ATTACH PARTITION|PART
and to
FREEZE PARTITION
.
Possible values:
0 β disable verbosity.
1 β enable verbosity.
Example
CREATE TABLE test(a Int64, d Date, s String) ENGINE = MergeTree PARTITION BY toYYYYMDECLARE(d) ORDER BY a;
INSERT INTO test VALUES(1, '2021-01-01', '');
INSERT INTO test VALUES(1, '2021-01-01', '');
ALTER TABLE test DETACH PARTITION ID '202101';
ALTER TABLE test ATTACH PARTITION ID '202101' SETTINGS alter_partition_verbose_result = 1;
ββcommand_typeββββββ¬βpartition_idββ¬βpart_nameβββββ¬βold_part_nameββ
β ATTACH PARTITION β 202101 β 202101_7_7_0 β 202101_5_5_0 β
β ATTACH PARTITION β 202101 β 202101_8_8_0 β 202101_6_6_0 β
ββββββββββββββββββββ΄βββββββββββββββ΄βββββββββββββββ΄ββββββββββββββββ
ALTER TABLE test FREEZE SETTINGS alter_partition_verbose_result = 1;
ββcommand_typeββ¬βpartition_idββ¬βpart_nameβββββ¬βbackup_nameββ¬βbackup_pathββββββββββββββββββββ¬βpart_backup_pathβββββββββββββββββββββββββββββββββββββββββββββ
β FREEZE ALL β 202101 β 202101_7_7_0 β 8 β /var/lib/clickhouse/shadow/8/ β /var/lib/clickhouse/shadow/8/data/default/test/202101_7_7_0 β
β FREEZE ALL β 202101 β 202101_8_8_0 β 8 β /var/lib/clickhouse/shadow/8/ β /var/lib/clickhouse/shadow/8/data/default/test/202101_8_8_0 β
ββββββββββββββββ΄βββββββββββββββ΄βββββββββββββββ΄ββββββββββββββ΄ββββββββββββββββββββββββββββββββ΄ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
alter_sync
β
Aliases
:
replication_alter_partitions_sync
Type
Default value
Type
UInt64
Default value
1
Allows you to specify the wait behavior for actions that are to be executed on replicas by
ALTER
,
OPTIMIZE
or
TRUNCATE
queries.
Possible values:
0
β Do not wait.
1
β Wait for own execution.
2
β Wait for everyone.
3
- Only wait for active replicas.
Cloud default value:
0
.
Note
alter_sync
is applicable to
Replicated
and
SharedMergeTree
tables only, it does nothing to alter non
Replicated
or
Shared
tables.
alter_update_mode
β
Type
Default value
Type
AlterUpdateMode
Default value
heavy
A mode for
ALTER
queries that have the
UPDATE
commands.
Possible values:
heavy
- run regular mutation.
lightweight
- run lightweight update if possible, run regular mutation otherwise.
lightweight_force
- run lightweight update if possible, throw otherwise.
analyze_index_with_space_filling_curves
β
Type
Default value
Type
Bool
Default value
1
If a table has a space-filling curve in its index, e.g.
ORDER BY mortonEncode(x, y)
or
ORDER BY hilbertEncode(x, y)
, and the query has conditions on its arguments, e.g.
x >= 10 AND x <= 20 AND y >= 20 AND y <= 30
, use the space-filling curve for index analysis.
analyzer_compatibility_allow_compound_identifiers_in_unflatten_nested
β
Type
Default value
Type
Bool
Default value
1
Allow to add compound identifiers to nested. This is a compatibility setting because it changes the query result. When disabled,
SELECT a.b.c FROM table ARRAY JOIN a
does not work, and
SELECT a FROM table
does not include
a.b.c
column into
Nested a
result.
analyzer_compatibility_join_using_top_level_identifier
β
Type
Default value
Type
Bool
Default value
0
Force to resolve identifier in JOIN USING from projection (for example, in
SELECT a + 1 AS b FROM t1 JOIN t2 USING (b)
join will be performed by
t1.a + 1 = t2.b
, rather then
t1.b = t2.b
).
analyzer_inline_views
β
Type
Default value
Type
Bool
Default value
0
When enabled, the analyzer substitutes ordinary (non-materialized, non-parameterized) views with their defining subqueries, enabling cross-boundary optimizations such as predicate pushdown and column pruning.
any_join_distinct_right_table_keys
β
Type
Default value
Type
Bool
Default value
0
Enables legacy ClickHouse server behaviour in
ANY INNER|LEFT JOIN
operations.
Note
Use this setting only for backward compatibility if your use cases depend on legacy
JOIN
behaviour.
When the legacy behaviour is enabled:
Results of
t1 ANY LEFT JOIN t2
and
t2 ANY RIGHT JOIN t1
operations are not equal because ClickHouse uses the logic with many-to-one left-to-right table keys mapping.
Results of
ANY INNER JOIN
operations contain all rows from the left table like the
SEMI LEFT JOIN
operations do.
When the legacy behaviour is disabled:
Results of
t1 ANY LEFT JOIN t2
and
t2 ANY RIGHT JOIN t1
operations are equal because ClickHouse uses the logic which provides one-to-many keys mapping in
ANY RIGHT JOIN
operations.
Results of
ANY INNER JOIN
operations contain one row per key from both the left and right tables.
Possible values:
0 β Legacy behaviour is disabled.
1 β Legacy behaviour is enabled.
See also:
JOIN strictness
apply_deleted_mask
β
Type
Default value
Type
Bool
Default value
1
Enables filtering out rows deleted with lightweight DELETE. If disabled, a query will be able to read those rows. This is useful for debugging and "undelete" scenarios
apply_mutations_on_fly
β
Type
Default value
Type
Bool
Default value
0
If true, mutations (UPDATEs and DELETEs) which are not materialized in data part will be applied on SELECTs.
apply_patch_parts
β
Type
Default value
Type
Bool
Default value
1
If true, patch parts (that represent lightweight updates) are applied on SELECTs.
apply_patch_parts_join_cache_buckets
β
Type
Default value
Type
NonZeroUInt64
Default value
8
The number of buckets in the temporary cache for applying patch parts in Join mode.
apply_prewhere_after_final
β
Type
Default value
Type
Bool
Default value
0
When enabled, PREWHERE conditions are applied after FINAL processing for ReplacingMergeTree and similar engines.
This can be useful when PREWHERE references columns that may have different values across duplicate rows,
and you want FINAL to select the winning row before filtering. When disabled, PREWHERE is applied during reading.
Note: If apply_row_level_security_after_final is enabled and row policy uses non-sorting-key columns, PREWHERE will also
be deferred to maintain correct execution order (row policy must be applied before PREWHERE).
apply_row_policy_after_final
β
Type
Default value
Type
Bool
Default value
1
When enabled, row policies and PREWHERE are applied after FINAL processing for *MergeTree tables. (Especially for ReplacingMergeTree)
When disabled, row policies are applied before FINAL, which can cause different results when the policy
filters out rows that should be used for deduplication in ReplacingMergeTree or similar engines.
If the row policy expression depends only on columns in ORDER BY, it will still be applied before FINAL as an optimization,
since such filtering cannot affect the deduplication result.
Possible values:
0 β Row policy and PREWHERE are applied before FINAL (default).
1 β Row policy and PREWHERE are applied after FINAL.
apply_settings_from_server
β
Type
Default value
Type
Bool
Default value
1
Whether the client should accept settings from server.
This only affects operations performed on the client side, in particular parsing the INSERT input data and formatting the query result. Most of query execution happens on the server and is not affected by this setting.
Normally this setting should be set in user profile (users.xml or queries like
ALTER USER
), not through the client (client command line arguments,
SET
query, or
SETTINGS
section of
SELECT
query). Through the client it can be changed to false, but can't be changed to true (because the server won't send the settings if user profile has
apply_settings_from_server = false
).
Note that initially (24.12) there was a server setting (
send_settings_to_client
), but latter it got replaced with this client setting, for better usability.
archive_adaptive_buffer_max_size_bytes
β
Type
Default value
Type
UInt64
Default value
8388608
Limits the maximum size of the adaptive buffer used when writing to archive files (for example, tar archives
arrow_flight_request_descriptor_type
β
Type
Default value
Type
ArrowFlightDescriptorType
Default value
path
Type of descriptor to use for Arrow Flight requests. 'path' sends the dataset name as a path descriptor. 'command' sends a SQL query as a command descriptor (required for Dremio).
Possible values:
'path' β Use FlightDescriptor::Path (default, works with most Arrow Flight servers)
'command' β Use FlightDescriptor::Command with a SELECT query (required for Dremio)
ast_fuzzer_any_query
β
Type
Default value
Type
Bool
Default value
0
When false (default), the server-side AST fuzzer (controlled by
ast_fuzzer_runs
) only fuzzes read-only queries (SELECT, EXPLAIN, SHOW, DESCRIBE, EXISTS). When true, all query types including DDL and INSERT are fuzzed.
ast_fuzzer_runs
β
Type
Default value
Type
Float
Default value
0
Enables the server-side AST fuzzer that runs randomized queries after each normal query, discarding their results.
0: disabled (default).
A value between 0 and 1 (exclusive): probability of running a single fuzzed query.
A value >= 1: the number of fuzzed queries to run per normal query.
The fuzzer accumulates AST fragments from all queries across all sessions, producing increasingly interesting mutations over time. Fuzzed queries that fail are silently discarded; results are never returned to the client.
asterisk_include_alias_columns
β
Type
Default value
Type
Bool
Default value
0
Include
ALIAS
columns for wildcard query (
SELECT *
).
Possible values:
0 - disabled
1 - enabled
asterisk_include_materialized_columns
β
Type
Default value
Type
Bool
Default value
0
Include
MATERIALIZED
columns for wildcard query (
SELECT *
).
Possible values:
0 - disabled
1 - enabled
async_insert
β
Type
Default value
Type
Bool
Default value
1
If true, data from INSERT query is stored in queue and later flushed to table in background. If wait_for_async_insert is false, INSERT query is processed almost instantly, otherwise client will wait until data will be flushed to table
async_insert_busy_timeout_decrease_rate
β
Type
Default value
Type
Double
Default value
0.2
The exponential growth rate at which the adaptive asynchronous insert timeout decreases
async_insert_busy_timeout_increase_rate
β
Type
Default value
Type
Double
Default value
0.2
The exponential growth rate at which the adaptive asynchronous insert timeout increases
async_insert_busy_timeout_max_ms
β
Aliases
:
async_insert_busy_timeout_ms
Type
Default value
Type
Milliseconds
Default value
200
Maximum time to wait before dumping collected data per query since the first data appeared.
Cloud default value:
1000
(1s).
async_insert_busy_timeout_min_ms
β
Type
Default value
Type
Milliseconds
Default value
50
If auto-adjusting is enabled through async_insert_use_adaptive_busy_timeout, minimum time to wait before dumping collected data per query since the first data appeared. It also serves as the initial value for the adaptive algorithm
async_insert_deduplicate
β
Type
Default value
Type
Bool
Default value
0
For async INSERT queries in the replicated table, specifies that deduplication of inserting blocks should be performed
async_insert_max_data_size
β
Type
Default value
Type
UInt64
Default value
10485760
Maximum size in bytes of unparsed data collected per query before being inserted
Cloud default value:
104857600
(100 MiB).
async_insert_max_query_number
β
Type
Default value
Type
UInt64
Default value
450
Maximum number of insert queries before being inserted.
Only takes effect if setting
async_insert_deduplicate
is 1.
async_insert_poll_timeout_ms
β
Type
Default value
Type
Milliseconds
Default value
10
Timeout for polling data from asynchronous insert queue
async_insert_use_adaptive_busy_timeout
β
Type
Default value
Type
Bool
Default value
1
If it is set to true, use adaptive busy timeout for asynchronous inserts
async_query_sending_for_remote
β
Type
Default value
Type
Bool
Default value
1
Enables asynchronous connection creation and query sending while executing remote query.
Enabled by default.
async_socket_for_remote
β
Type
Default value
Type
Bool
Default value
1
Enables asynchronous read from socket while executing remote query.
Enabled by default.
automatic_parallel_replicas_min_bytes_per_replica
β
Type
Default value
Type
UInt64
Default value
1048576
Threshold of bytes to read per replica to enable parallel replicas automatically (applies only when
automatic_parallel_replicas_mode
=1). 0 means no threshold.
The total number of bytes to read is estimated based on the collected statistics.
automatic_parallel_replicas_mode
β
Type
Default value
Type
UInt64
Default value
0
Enable automatic switching to execution with parallel replicas based on collected statistics. Requires
enable_analyzer = 1
,
enable_parallel_replicas != 0
,
parallel_replicas_local_plan = 1
and providing
cluster_for_parallel_replicas
.
0 - disabled, 1 - enabled, 2 - only statistics collection is enabled (switching to execution with parallel replicas is disabled).
azure_allow_parallel_part_upload
β
Type
Default value
Type
Bool
Default value
1
Use multiple threads for azure multipart upload.
azure_check_objects_after_upload
β
Type
Default value
Type
Bool
Default value
0
Check each uploaded object in azure blob storage to be sure that upload was successful
azure_connect_timeout_ms
β
Type
Default value
Type
UInt64
Default value
1000
Connection timeout for host from azure disks.
azure_create_new_file_on_insert
β
Type
Default value
Type
Bool
Default value
0
Enables or disables creating a new file on each insert in azure engine tables
azure_ignore_file_doesnt_exist
β
Type
Default value
Type
Bool
Default value
0
Ignore absence of file if it does not exist when reading certain keys.
Possible values:
1 β
SELECT
returns empty result.
0 β
SELECT
throws an exception.
azure_list_object_keys_size
β
Type
Default value
Type
UInt64
Default value
1000
Maximum number of files that could be returned in batch by ListObject request
azure_max_blocks_in_multipart_upload
β
Type
Default value
Type
UInt64
Default value
50000
Maximum number of blocks in multipart upload for Azure.
azure_max_get_burst
β
Type
Default value
Type
UInt64
Default value
0
Max number of requests that can be issued simultaneously before hitting request per second limit. By default (0) equals to
azure_max_get_rps
azure_max_get_rps
β
Type
Default value
Type
UInt64
Default value
0
Limit on Azure GET request per second rate before throttling. Zero means unlimited.
azure_max_inflight_parts_for_one_file
β
Type
Default value
Type
UInt64
Default value
20
The maximum number of a concurrent loaded parts in multipart upload request. 0 means unlimited.
azure_max_put_burst
β
Type
Default value
Type
UInt64
Default value
0
Max number of requests that can be issued simultaneously before hitting request per second limit. By default (0) equals to
azure_max_put_rps
azure_max_put_rps
β
Type
Default value
Type
UInt64
Default value
0
Limit on Azure PUT request per second rate before throttling. Zero means unlimited.
azure_max_redirects
β
Type
Default value
Type
UInt64
Default value
10
Max number of azure redirects hops allowed.
azure_max_single_part_copy_size
β
Type
Default value
Type
UInt64
Default value
268435456
The maximum size of object to copy using single part copy to Azure blob storage.
azure_max_single_part_upload_size
β
Type
Default value
Type
UInt64
Default value
33554432
The maximum size of object to upload using singlepart upload to Azure blob storage.
azure_max_single_read_retries
β
Type
Default value
Type
UInt64
Default value
4
The maximum number of retries during single Azure blob storage read.
azure_max_unexpected_write_error_retries
β
Type
Default value
Type
UInt64
Default value
4
The maximum number of retries in case of unexpected errors during Azure blob storage write
azure_max_upload_part_size
β
Type
Default value
Type
UInt64
Default value
5368709120
The maximum size of part to upload during multipart upload to Azure blob storage.
azure_min_upload_part_size
β
Type
Default value
Type
UInt64
Default value
16777216
The minimum size of part to upload during multipart upload to Azure blob storage.
azure_request_timeout_ms
β
Type
Default value
Type
UInt64
Default value
30000
Idleness timeout for sending and receiving data to/from azure. Fail if a single TCP read or write call blocks for this long.
azure_sdk_max_retries
β
Type
Default value
Type
UInt64
Default value
10
Maximum number of retries in azure sdk
azure_sdk_retry_initial_backoff_ms
β
Type
Default value
Type
UInt64
Default value
10
Minimal backoff between retries in azure sdk
azure_sdk_retry_max_backoff_ms
β
Type
Default value
Type
UInt64
Default value
1000
Maximal backoff between retries in azure sdk
azure_skip_empty_files
β
Type
Default value
Type
Bool
Default value
0
Enables or disables skipping empty files in S3 engine.
Possible values:
0 β
SELECT
throws an exception if empty file is not compatible with requested format.
1 β
SELECT
returns empty result for empty file.
azure_strict_upload_part_size
β
Type
Default value
Type
UInt64
Default value
0
The exact size of part to upload during multipart upload to Azure blob storage.
azure_throw_on_zero_files_match
β
Type
Default value
Type
Bool
Default value
0
Throw an error if matched zero files according to glob expansion rules.
Possible values:
1 β
SELECT
throws an exception.
0 β
SELECT
returns empty result.
azure_truncate_on_insert
β
Type
Default value
Type
Bool
Default value
0
Enables or disables truncate before insert in azure engine tables.
azure_upload_part_size_multiply_factor
β
Type
Default value
Type
UInt64
Default value
2
Multiply azure_min_upload_part_size by this factor each time azure_multiply_parts_count_threshold parts were uploaded from a single write to Azure blob storage.
azure_upload_part_size_multiply_parts_count_threshold
β
Type
Default value
Type
UInt64
Default value
500
Each time this number of parts was uploaded to Azure blob storage, azure_min_upload_part_size is multiplied by azure_upload_part_size_multiply_factor.
azure_use_adaptive_timeouts
β
Type
Default value
Type
Bool
Default value
1
When set to
true
than for all azure requests first two attempts are made with low send and receive timeouts.
When set to
false
than all attempts are made with identical timeouts.
backup_restore_batch_size_for_keeper_multi
β
Type
Default value
Type
UInt64
Default value
1000
Maximum size of batch for multi request to [Zoo]Keeper during backup or restore
backup_restore_batch_size_for_keeper_multiread
β
Type
Default value
Type
UInt64
Default value
10000
Maximum size of batch for multiread request to [Zoo]Keeper during backup or restore
backup_restore_failure_after_host_disconnected_for_seconds
β
Type
Default value
Type
UInt64
Default value
3600
If a host during a BACKUP ON CLUSTER or RESTORE ON CLUSTER operation doesn't recreate its ephemeral 'alive' node in ZooKeeper for this amount of time then the whole backup or restore is considered as failed.
This value should be bigger than any reasonable time for a host to reconnect to ZooKeeper after a failure.
Zero means unlimited.
backup_restore_finish_timeout_after_error_sec
β
Type
Default value
Type
UInt64
Default value
180
How long the initiator should wait for other host to react to the 'error' node and stop their work on the current BACKUP ON CLUSTER or RESTORE ON CLUSTER operation.
backup_restore_keeper_fault_injection_probability
β
Type
Default value
Type
Float
Default value
0
Approximate probability of failure for a keeper request during backup or restore. Valid value is in interval [0.0f, 1.0f]
backup_restore_keeper_fault_injection_seed
β
Type
Default value
Type
UInt64
Default value
0
0 - random seed, otherwise the setting value
backup_restore_keeper_max_retries
β
Type
Default value
Type
UInt64
Default value
1000
Max retries for [Zoo]Keeper operations in the middle of a BACKUP or RESTORE operation.
Should be big enough so the whole operation won't fail because of a temporary [Zoo]Keeper failure.
backup_restore_keeper_max_retries_while_handling_error
β
Type
Default value
Type
UInt64
Default value
20
Max retries for [Zoo]Keeper operations while handling an error of a BACKUP ON CLUSTER or RESTORE ON CLUSTER operation.
backup_restore_keeper_max_retries_while_initializing
β
Type
Default value
Type
UInt64
Default value
20
Max retries for [Zoo]Keeper operations during the initialization of a BACKUP ON CLUSTER or RESTORE ON CLUSTER operation.
backup_restore_keeper_retry_initial_backoff_ms
β
Type
Default value
Type
UInt64
Default value
100
Initial backoff timeout for [Zoo]Keeper operations during backup or restore
backup_restore_keeper_retry_max_backoff_ms
β
Type
Default value
Type
UInt64
Default value
5000
Max backoff timeout for [Zoo]Keeper operations during backup or restore
Cloud default value:
60000
.
backup_restore_keeper_value_max_size
β
Type
Default value
Type
UInt64
Default value
1048576
Maximum size of data of a [Zoo]Keeper's node during backup
backup_restore_s3_retry_attempts
β
Type
Default value
Type
UInt64
Default value
1000
Setting for Aws::Client::RetryStrategy, Aws::Client does retries itself, 0 means no retries. It takes place only for backup/restore.
backup_restore_s3_retry_initial_backoff_ms
β
Type
Default value
Type
UInt64
Default value
25
Initial backoff delay in milliseconds before the first retry attempt during backup and restore. Each subsequent retry increases the delay exponentially, up to the maximum specified by
backup_restore_s3_retry_max_backoff_ms
backup_restore_s3_retry_jitter_factor
β
Type
Default value
Type
Float
Default value
0.1
Jitter factor applied to the retry backoff delay in Aws::Client::RetryStrategy during backup and restore operations. The computed backoff delay is multiplied by a random factor in the range [1.0, 1.0 + jitter], up to the maximum
backup_restore_s3_retry_max_backoff_ms
. Must be in [0.0, 1.0] interval
backup_restore_s3_retry_max_backoff_ms
β
Type
Default value
Type
UInt64
Default value
5000
Maximum delay in milliseconds between retries during backup and restore operations.
backup_slow_all_threads_after_retryable_s3_error
β
Type
Default value
Type
Bool
Default value
0
When set to
true
, all threads executing S3 requests to the same backup endpoint are slowed down
after any single S3 request encounters a retryable S3 error, such as 'Slow Down'.
When set to
false
, each thread handles s3 request backoff independently of the others.
cache_warmer_threads
β
ClickHouse Cloud only
Type
Default value
Type
UInt64
Default value
4
Only has an effect in ClickHouse Cloud. Number of background threads for speculatively downloading new data parts into the filesystem cache, when
cache_populated_by_fetch
is enabled. Zero to disable.
calculate_text_stack_trace
β
Type
Default value
Type
Bool
Default value
1
Calculate text stack trace in case of exceptions during query execution. This is the default. It requires symbol lookups that may slow down fuzzing tests when a huge amount of wrong queries are executed. In normal cases, you should not disable this option.
cancel_http_readonly_queries_on_client_close
β
Type
Default value
Type
Bool
Default value
0
Cancels HTTP read-only queries (e.g.Β SELECT) when a client closes the connection without waiting for the response.
Cloud default value:
1
.
cast_ipv4_ipv6_default_on_conversion_error
β
Type
Default value
Type
Bool
Default value
0
CAST operator into IPv4, CAST operator into IPV6 type, toIPv4, toIPv6 functions will return default value instead of throwing exception on conversion error.
cast_keep_nullable
β
Type
Default value
Type
Bool
Default value
0
Enables or disables keeping of the
Nullable
data type in
CAST
operations.
When the setting is enabled and the argument of
CAST
function is
Nullable
, the result is also transformed to
Nullable
type. When the setting is disabled, the result always has the destination type exactly.
Possible values:
0 β The
CAST
result has exactly the destination type specified.
1 β If the argument type is
Nullable
, the
CAST
result is transformed to
Nullable(DestinationDataType)
.
Examples
The following query results in the destination data type exactly:
SET cast_keep_nullable = 0;
SELECT CAST(toNullable(toInt32(0)) AS Int32) as x, toTypeName(x);
Result:
ββxββ¬βtoTypeName(CAST(toNullable(toInt32(0)), 'Int32'))ββ
β 0 β Int32 β
βββββ΄ββββββββββββββββββββββββββββββββββββββββββββββββββββ
The following query results in the
Nullable
modification on the destination data type:
SET cast_keep_nullable = 1;
SELECT CAST(toNullable(toInt32(0)) AS Int32) as x, toTypeName(x);
Result:
ββxββ¬βtoTypeName(CAST(toNullable(toInt32(0)), 'Int32'))ββ
β 0 β Nullable(Int32) β
βββββ΄ββββββββββββββββββββββββββββββββββββββββββββββββββββ
See Also
CAST
functio
cast_string_to_date_time_mode
β
Type
Default value
Type
DateTimeInputFormat
Default value
basic
Allows choosing a parser of the text representation of date and time during cast from String.
Possible values:
'best_effort'
β Enables extended parsing.
ClickHouse can parse the basic
YYYY-MM-DD HH:MM:SS
format and all
ISO 8601
date and time formats. For example,
'2018-06-08T01:02:03.000Z'
.
'best_effort_us'
β Similar to
best_effort
(see the difference in
parseDateTimeBestEffortUS
'basic'
β Use basic parser.
ClickHouse can parse only the basic
YYYY-MM-DD HH:MM:SS
or
YYYY-MM-DD
format. For example,
2019-08-20 10:18:56
or
2019-08-20
.
See also:
DateTime data type.
Functions for working with dates and times.
cast_string_to_dynamic_use_inference
β
Type
Default value
Type
Bool
Default value
0
Use types inference during String to Dynamic conversio
cast_string_to_variant_use_inference
β
Type
Default value
Type
Bool
Default value
1
Use types inference during String to Variant conversion.
check_named_collection_dependencies
β
Type
Default value
Type
Bool
Default value
1
Check that DROP NAMED COLLECTION will not break tables that depend on it
check_query_single_value_result
β
Type
Default value
Type
Bool
Default value
0
Defines the level of detail for the
CHECK TABLE
query result for
MergeTree
family engines .
Possible values:
0 β the query shows a check status for every individual data part of a table.
1 β the query shows the general table check status.
check_referential_table_dependencies
β
Type
Default value
Type
Bool
Default value
0
Check that DDL query (such as DROP TABLE or RENAME) will not break referential dependencies
check_table_dependencies
β
Type
Default value
Type
Bool
Default value
1
Check that DDL query (such as DROP TABLE or RENAME) will not break dependencies
checksum_on_read
β
Type
Default value
Type
Bool
Default value
1
Validate checksums on reading. It is enabled by default and should be always enabled in production. Please do not expect any benefits in disabling this setting. It may only be used for experiments and benchmarks. The setting is only applicable for tables of MergeTree family. Checksums are always validated for other table engines and when receiving data over the network.
cloud_mode
β
Type
Default value
Type
Bool
Default value
0
Cloud mode
Cloud default value:
1
.
cloud_mode_database_engine
β
Type
Default value
Type
UInt64
Default value
1
The database engine allowed in Cloud. 1 - rewrite DDLs to use Replicated database, 2 - rewrite DDLs to use Shared database
Cloud default value:
2
.
cloud_mode_engine
β
Type
Default value
Type
UInt64
Default value
1
The engine family allowed in Cloud.
0 - allow everything
1 - rewrite DDLs to use *ReplicatedMergeTree
2 - rewrite DDLs to use SharedMergeTree
3 - rewrite DDLs to use SharedMergeTree except when explicitly passed remote disk is specified
4 - same as 3, plus additionally use Alias instead of Distributed (the Alias table will point to the destination table of the Distributed table, so it will use the corresponding local table)
UInt64 to minimize public part
Cloud default value:
2
.
cluster_for_parallel_replicas
β
Cluster for a shard in which current server is located
Cloud default value:
default
.
cluster_function_process_archive_on_multiple_nodes
β
Type
Default value
Type
Bool
Default value
1
If set to
true
, increases performance of processing archives in cluster functions. Should be set to
false
for compatibility and to avoid errors during upgrade to 25.7+ if using cluster functions with archives on earlier versions.
cluster_table_function_buckets_batch_size
β
Type
Default value
Type
UInt64
Default value
0
Defines the approximate size of a batch (in bytes) used in distributed processing of tasks in cluster table functions with
bucket
split granularity. The system accumulates data until at least this amount is reached. The actual size may be slightly larger to align with data boundaries.
cluster_table_function_split_granularity
β
Type
Default value
Type
ObjectStorageGranularityLevel
Default value
file
Controls how data is split into tasks when executing a CLUSTER TABLE FUNCTION.
This setting defines the granularity of work distribution across the cluster:
file
β each task processes an entire file.
bucket
β tasks are created per internal data block within a file (for example, Parquet row groups).
Choosing finer granularity (like
bucket
) can improve parallelism when working with a small number of large files.
For instance, if a Parquet file contains multiple row groups, enabling
bucket
granularity allows each group to be processed independently by different workers.
collect_hash_table_stats_during_aggregation
β
Type
Default value
Type
Bool
Default value
1
Enable collecting hash table statistics to optimize memory allocatio
collect_hash_table_stats_during_joins
β
Type
Default value
Type
Bool
Default value
1
Enable collecting hash table statistics to optimize memory allocatio
compatibility
β
The
compatibility
setting causes ClickHouse to use the default settings of a previous version of ClickHouse, where the previous version is provided as the setting.
If settings are set to non-default values, then those settings are honored (only settings that have not been modified are affected by the
compatibility
setting).
This setting takes a ClickHouse version number as a string, like
22.3
,
22.8
. An empty value means that this setting is disabled.
Disabled by default.
Note
In ClickHouse Cloud, the service-level default compatibility setting must be set by ClickHouse Cloud support. Please
open a case
to have it set.
However, the compatibility setting can be overridden at the user, role, profile, query, or session level using standard ClickHouse setting mechanisms such as
SET compatibility = '22.3'
in a session or
SETTINGS compatibility = '22.3'
in a query.
compatibility_ignore_auto_increment_in_create_table
β
Type
Default value
Type
Bool
Default value
0
Ignore AUTO_INCREMENT keyword in column declaration if true, otherwise return error. It simplifies migration from MySQL
compatibility_ignore_collation_in_create_table
β
Type
Default value
Type
Bool
Default value
1
Compatibility ignore collation in create table
compatibility_s3_presigned_url_query_in_path
β
Type
Default value
Type
Bool
Default value
0
Compatibility: when enabled, folds pre-signed URL query parameters (e.g. X-Amz-*) into the S3 key (legacy behavior),
so '?' acts as a wildcard in the path. When disabled (default), pre-signed URL query parameters are kept in the URL query
to avoid interpreting '?' as a wildcard.
compile_aggregate_expressions
β
Type
Default value
Type
Bool
Default value
1
Enables or disables JIT-compilation of aggregate functions to native code. Enabling this setting can improve the performance.
Possible values:
0 β Aggregation is done without JIT compilation.
1 β Aggregation is done using JIT compilation.
See Also
min_count_to_compile_aggregate_expression
compile_expressions
β
Type
Default value
Type
Bool
Default value
1
Compile some scalar functions and operators to native code.
compile_sort_description
β
Type
Default value
Type
Bool
Default value
1
Compile sort description to native code.
connect_timeout
β
Type
Default value
Type
Seconds
Default value
10
Connection timeout if there are no replicas.
connect_timeout_with_failover_ms
β
Type
Default value
Type
Milliseconds
Default value
1000
The timeout in milliseconds for connecting to a remote server for a Distributed table engine, if the 'shard' and 'replica' sections are used in the cluster definition.
If unsuccessful, several attempts are made to connect to various replicas.
connect_timeout_with_failover_secure_ms
β
Type
Default value
Type
Milliseconds
Default value
1000
Connection timeout for selecting first healthy replica (for secure connections).
connection_pool_max_wait_ms
β
Type
Default value
Type
Milliseconds
Default value
0
The wait time in milliseconds for a connection when the connection pool is full.
Possible values:
Positive integer.
0 β Infinite timeout.
connections_with_failover_max_tries
β
Type
Default value
Type
UInt64
Default value
3
The maximum number of connection attempts with each replica for the Distributed table engine.
convert_query_to_cnf
β
Type
Default value
Type
Bool
Default value
0
When set to
true
, a
SELECT
query will be converted to conjuctive normal form (CNF). There are scenarios where rewriting a query in CNF may execute faster (view this
Github issue
for an explanation).
For example, notice how the following
SELECT
query is not modified (the default behavior):
EXPLAIN SYNTAX
SELECT *
FROM
(
SELECT number AS x
FROM numbers(20)
) AS a
WHERE ((x >= 1) AND (x <= 5)) OR ((x >= 10) AND (x <= 15))
SETTINGS convert_query_to_cnf = false;
The result is:
ββexplainβββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β SELECT x β
β FROM β
β ( β
β SELECT number AS x β
β FROM numbers(20) β
β WHERE ((x >= 1) AND (x <= 5)) OR ((x >= 10) AND (x <= 15)) β
β ) AS a β
β WHERE ((x >= 1) AND (x <= 5)) OR ((x >= 10) AND (x <= 15)) β
β SETTINGS convert_query_to_cnf = 0 β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Let's set
convert_query_to_cnf
to
true
and see what changes:
EXPLAIN SYNTAX
SELECT *
FROM
(
SELECT number AS x
FROM numbers(20)
) AS a
WHERE ((x >= 1) AND (x <= 5)) OR ((x >= 10) AND (x <= 15))
SETTINGS convert_query_to_cnf = true;
Notice the
WHERE
clause is rewritten in CNF, but the result set is the identical - the Boolean logic is unchanged:
ββexplainββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β SELECT x β
β FROM β
β ( β
β SELECT number AS x β
β FROM numbers(20) β
β WHERE ((x <= 15) OR (x <= 5)) AND ((x <= 15) OR (x >= 1)) AND ((x >= 10) OR (x <= 5)) AND ((x >= 10) OR (x >= 1)) β
β ) AS a β
β WHERE ((x >= 10) OR (x >= 1)) AND ((x >= 10) OR (x <= 5)) AND ((x <= 15) OR (x >= 1)) AND ((x <= 15) OR (x <= 5)) β
β SETTINGS convert_query_to_cnf = 1 β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Possible values: true, false
Type
Default value
Type
DecorrelationJoinKind
Default value
right
Controls the kind of joins in the decorrelated query plan. The default value is
right
, which means that decorrelated plan will contain RIGHT JOINs with subquery input on the right side.
Possible values:
left
- Decorrelation process will produce LEFT JOINs and input table will appear on the left side.
right
- Decorrelation process will produce RIGHT JOINs and input table will appear on the right side.
Type
Default value
Type
Bool
Default value
1
Use filter expressions to inference equivalent expressions and substitute them instead of creating a CROSS JOIN.
Type
Default value
Type
Bool
Default value
1
Use in-memory buffer for correlated subquery input to avoid its repeated evaluation.
count_distinct_implementation
β
Type
Default value
Type
String
Default value
uniqExact
Specifies which of the
uniq*
functions should be used to perform the
COUNT(DISTINCT ...)
construction.
Possible values:
uniq
uniqCombined
uniqCombined64
uniqHLL12
uniqExact
count_distinct_optimization
β
Type
Default value
Type
Bool
Default value
0
Rewrite count distinct to subquery of group by
count_matches_stop_at_empty_match
β
Type
Default value
Type
Bool
Default value
0
Stop counting once a pattern matches zero-length in the
countMatches
function.
create_if_not_exists
β
Type
Default value
Type
Bool
Default value
0
Enable
IF NOT EXISTS
for
CREATE
statement by default. If either this setting or
IF NOT EXISTS
is specified and a table with the provided name already exists, no exception will be thrown.
create_index_ignore_unique
β
Type
Default value
Type
Bool
Default value
0
Ignore UNIQUE keyword in CREATE UNIQUE INDEX. Made for SQL compatibility tests.
create_replicated_merge_tree_fault_injection_probability
β
Type
Default value
Type
Float
Default value
0
The probability of a fault injection during table creation after creating metadata in ZooKeeper
create_table_empty_primary_key_by_default
β
Type
Default value
Type
Bool
Default value
1
Allow to create *MergeTree tables with empty primary key when ORDER BY and PRIMARY KEY not specified
cross_join_min_bytes_to_compress
β
Type
Default value
Type
UInt64
Default value
1073741824
Minimal size of block to compress in CROSS JOIN. Zero value means - disable this threshold. This block is compressed when any of the two thresholds (by rows or by bytes) are reached.
cross_join_min_rows_to_compress
β
Type
Default value
Type
UInt64
Default value
10000000
Minimal count of rows to compress block in CROSS JOIN. Zero value means - disable this threshold. This block is compressed when any of the two thresholds (by rows or by bytes) are reached.
cross_to_inner_join_rewrite
β
Type
Default value
Type
UInt64
Default value
1
Use inner join instead of comma/cross join if there are joining expressions in the WHERE section. Values: 0 - no rewrite, 1 - apply if possible for comma/cross, 2 - force rewrite all comma joins, cross - if possible
data_type_default_nullable
β
Type
Default value
Type
Bool
Default value
0
Allows data types without explicit modifiers
NULL or NOT NULL
in column definition will be
Nullable
.
Possible values:
1 β The data types in column definitions are set to
Nullable
by default.
0 β The data types in column definitions are set to not
Nullable
by default.
database_atomic_wait_for_drop_and_detach_synchronously
β
Type
Default value
Type
Bool
Default value
0
Adds a modifier
SYNC
to all
DROP
and
DETACH
queries.
Possible values:
0 β Queries will be executed with delay.
1 β Queries will be executed without delay.
Type
Default value
Type
Bool
Default value
1
Either to throw error or not if we don't have rights to get table's metadata in database engine DataLakeCatalog.
database_replicated_allow_explicit_uuid
β
Type
Default value
Type
UInt64
Default value
0
0 - Don't allow to explicitly specify UUIDs for tables in Replicated databases. 1 - Allow. 2 - Allow, but ignore the specified UUID and generate a random one instead.
database_replicated_allow_heavy_create
β
Type
Default value
Type
Bool
Default value
0
Allow long-running DDL queries (CREATE AS SELECT and POPULATE) in Replicated database engine. Note that it can block DDL queue for a long time.
database_replicated_allow_only_replicated_engine
β
Type
Default value
Type
Bool
Default value
0
Allow to create only Replicated tables in database with engine Replicated
Cloud default value:
1
.
database_replicated_allow_replicated_engine_arguments
β
Type
Default value
Type
UInt64
Default value
0
0 - Don't allow to explicitly specify ZooKeeper path and replica name for *MergeTree tables in Replicated databases. 1 - Allow. 2 - Allow, but ignore the specified path and use default one instead. 3 - Allow and don't log a warning.
database_replicated_always_detach_permanently
β
Type
Default value
Type
Bool
Default value
0
Execute DETACH TABLE as DETACH TABLE PERMANENTLY if database engine is Replicated
database_replicated_enforce_synchronous_settings
β
Type
Default value
Type
Bool
Default value
0
Enforces synchronous waiting for some queries (see also database_atomic_wait_for_drop_and_detach_synchronously, mutations_sync, alter_sync). Not recommended to enable these settings.
database_replicated_initial_query_timeout_sec
β
Type
Default value
Type
UInt64
Default value
300
Sets how long initial DDL query should wait for Replicated database to process previous DDL queue entries in seconds.
Possible values:
Positive integer.
0 β Unlimited.
Type
Default value
Type
UInt64
Default value
28800
The delay in seconds before a dropped table is actually removed from a Shared database. This allows to recover the table within this time using
UNDROP TABLE
statement.
decimal_check_overflow
β
Type
Default value
Type
Bool
Default value
1
Check overflow of decimal arithmetic/comparison operations
deduplicate_blocks_in_dependent_materialized_views
β
Type
Default value
Type
Bool
Default value
1
Enables or disables the deduplication check for materialized views that receive data from Replicated* tables.
Possible values:
0 β Disabled.
1 β Enabled.
When enabled, ClickHouse performs deduplication of blocks in materialized views that depend on Replicated* tables.
This setting is useful for ensuring that materialized views do not contain duplicate data when the insertion operation is being retried due to a failure.
See Also
NULL Processing in IN Operators
deduplicate_insert
β
Type
Default value
Type
DeduplicateInsertMode
Default value
enable
Enables or disables block deduplication of
INSERT INTO
(for Replicated* tables).
The setting overrides
insert_deduplicate
and
async_insert_deduplicate
settings.
That setting has three possible values:
disable β Deduplication is disabled for
INSERT INTO
query.
enable β Deduplication is enabled for
INSERT INTO
query.
backward_compatible_choice β Deduplication is enabled if
insert_deduplicate
or
async_insert_deduplicate
are enabled for specific insert type.
deduplicate_insert_select
β
Type
Default value
Type
DeduplicateInsertSelectMode
Default value
enable_when_possible
Enables or disables block deduplication of
INSERT SELECT
(for Replicated* tables).
The setting overrids
insert_deduplicate
and
deduplicate_insert
for
INSERT SELECT
queries.
That setting has four possible values:
disable β Deduplication is disabled for
INSERT SELECT
query.
force_enable β Deduplication is enabled for
INSERT SELECT
query. If select result is not stable, exception is thrown.
enable_when_possible β Deduplication is enabled if
insert_deduplicate
is enable and select result is stable, otherwise disabled.
enable_even_for_bad_queries - Deduplication is enabled if
insert_deduplicate
is enable. If select result is not stable, warning is logged, but query is executed with deduplication. This option is for backward compatibility. Consider to use other options instead as it may lead to unexpected results.
default_materialized_view_sql_security
β
Type
Default value
Type
SQLSecurityType
Default value
DEFINER
Allows to set a default value for SQL SECURITY option when creating a materialized view.
More about SQL security
.
The default value is
DEFINER
.
default_max_bytes_in_join
β
Type
Default value
Type
UInt64
Default value
1000000000
Maximum size of right-side table if limit is required but
max_bytes_in_join
is not set.
default_normal_view_sql_security
β
Type
Default value
Type
SQLSecurityType
Default value
INVOKER
Allows to set default
SQL SECURITY
option while creating a normal view.
More about SQL security
.
The default value is
INVOKER
.
default_table_engine
β
Type
Default value
Type
DefaultTableEngine
Default value
MergeTree
Default table engine to use when
ENGINE
is not set in a
CREATE
statement.
Possible values:
a string representing any valid table engine name
Cloud default value:
SharedMergeTree
.
Example
Query:
SET default_table_engine = 'Log';
SELECT name, value, changed FROM system.settings WHERE name = 'default_table_engine';
Result:
ββnameββββββββββββββββββ¬βvalueββ¬βchangedββ
β default_table_engine β Log β 1 β
ββββββββββββββββββββββββ΄ββββββββ΄ββββββββββ
In this example, any new table that does not specify an
Engine
will use the
Log
table engine:
Query:
CREATE TABLE my_table (
x UInt32,
y UInt32
);
SHOW CREATE TABLE my_table;
Result:
ββstatementβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β CREATE TABLE default.my_table
(
`x` UInt32,
`y` UInt32
)
ENGINE = Log
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
default_temporary_table_engine
β
Type
Default value
Type
DefaultTableEngine
Default value
Memory
Same as
default_table_engine
but for temporary tables.
In this example, any new temporary table that does not specify an
Engine
will use the
Log
table engine:
Query:
SET default_temporary_table_engine = 'Log';
CREATE TEMPORARY TABLE my_table (
x UInt32,
y UInt32
);
SHOW CREATE TEMPORARY TABLE my_table;
Result:
ββstatementβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β CREATE TEMPORARY TABLE default.my_table
(
`x` UInt32,
`y` UInt32
)
ENGINE = Log
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
default_view_definer
β
Type
Default value
Type
String
Default value
CURRENT_USER
Allows to set default
DEFINER
option while creating a view.
More about SQL security
.
The default value is
CURRENT_USER
.
delta_lake_enable_engine_predicate
β
Type
Default value
Type
Bool
Default value
1
Enables delta-kernel internal data pruning.
delta_lake_enable_expression_visitor_logging
β
Type
Default value
Type
Bool
Default value
0
Enables Test level logs of DeltaLake expression visitor. These logs can be too verbose even for test logging.
delta_lake_insert_max_bytes_in_data_file
β
Type
Default value
Type
NonZeroUInt64
Default value
1073741824
Defines a bytes limit for a single inserted data file in delta lake.
delta_lake_insert_max_rows_in_data_file
β
Type
Default value
Type
NonZeroUInt64
Default value
1000000
Defines a rows limit for a single inserted data file in delta lake.
Type
Default value
Type
Bool
Default value
0
Enables logging delta lake metadata files into system table.
delta_lake_reload_schema_for_consistency
β
Type
Default value
Type
Bool
Default value
0
If enabled, schema is reloaded from the DeltaLake metadata before each query execution to ensure
consistency between the schema used during query analysis and the schema used during execution.
delta_lake_snapshot_end_version
β
Type
Default value
Type
Int64
Default value
-1
End version of delta lake snapshot to read. Value -1 means to read latest version (value 0 is a valid snapshot version).
delta_lake_snapshot_start_version
β
Type
Default value
Type
Int64
Default value
-1
Start version of delta lake snapshot to read. Value -1 means to read latest version (value 0 is a valid snapshot version).
delta_lake_snapshot_version
β
Type
Default value
Type
Int64
Default value
-1
Version of delta lake snapshot to read. Value -1 means to read latest version (value 0 is a valid snapshot version).
delta_lake_throw_on_engine_predicate_error
β
Type
Default value
Type
Bool
Default value
0
Enables throwing an exception if there was an error when analyzing scan predicate in delta-kernel.
describe_compact_output
β
Type
Default value
Type
Bool
Default value
0
If true, include only column names and types into result of DESCRIBE query
describe_include_subcolumns
β
Type
Default value
Type
Bool
Default value
0
Enables describing subcolumns for a
DESCRIBE
query. For example, members of a
Tuple
or subcolumns of a
Map
,
Nullable
or an
Array
data type.
Possible values:
0 β Subcolumns are not included in
DESCRIBE
queries.
1 β Subcolumns are included in
DESCRIBE
queries.
Example
See an example for the
DESCRIBE
statement.
describe_include_virtual_columns
β
Type
Default value
Type
Bool
Default value
0
If true, virtual columns of table will be included into result of DESCRIBE query
dialect
β
Type
Default value
Type
Dialect
Default value
clickhouse
Which dialect will be used to parse query
dictionary_use_async_executor
β
Type
Default value
Type
Bool
Default value
0
Execute a pipeline for reading dictionary source in several threads. It's supported only by dictionaries with local CLICKHOUSE source.
dictionary_validate_primary_key_type
β
Type
Default value
Type
Bool
Default value
0
Validate primary key type for dictionaries. By default id type for simple layouts will be implicitly converted to UInt64.
distinct_overflow_mode
β
Type
Default value
Type
OverflowMode
Default value
throw
Sets what happens when the amount of data exceeds one of the limits.
Possible values:
throw
: throw an exception (default).
break
: stop executing the query and return the partial result, as if the
source data ran out.
distributed_aggregation_memory_efficient
β
Type
Default value
Type
Bool
Default value
1
Is the memory-saving mode of distributed aggregation enabled.
distributed_background_insert_batch
β
Aliases
:
distributed_directory_monitor_batch_inserts
Type
Default value
Type
Bool
Default value
0
Enables/disables inserted data sending in batches.
When batch sending is enabled, the
Distributed
table engine tries to send multiple files of inserted data in one operation instead of sending them separately. Batch sending improves cluster performance by better-utilizing server and network resources.
Possible values:
1 β Enabled.
0 β Disabled.
distributed_background_insert_max_sleep_time_ms
β
Aliases
:
distributed_directory_monitor_max_sleep_time_ms
Type
Default value
Type
Milliseconds
Default value
30000
Maximum interval for the
Distributed
table engine to send data. Limits exponential growth of the interval set in the
distributed_background_insert_sleep_time_ms
setting.
Possible values:
A positive integer number of milliseconds.
distributed_background_insert_sleep_time_ms
β
Aliases
:
distributed_directory_monitor_sleep_time_ms
Type
Default value
Type
Milliseconds
Default value
100
Base interval for the
Distributed
table engine to send data. The actual interval grows exponentially in the event of errors.
Possible values:
A positive integer number of milliseconds.
distributed_background_insert_split_batch_on_failure
β
Aliases
:
distributed_directory_monitor_split_batch_on_failure
Type
Default value
Type
Bool
Default value
0
Enables/disables splitting batches on failures.
Sometimes sending particular batch to the remote shard may fail, because of some complex pipeline after (i.e.
MATERIALIZED VIEW
with
GROUP BY
) due to
Memory limit exceeded
or similar errors. In this case, retrying will not help (and this will stuck distributed sends for the table) but sending files from that batch one by one may succeed INSERT.
So installing this setting to
1
will disable batching for such batches (i.e. temporary disables
distributed_background_insert_batch
for failed batches).
Possible values:
1 β Enabled.
0 β Disabled.
Note
This setting also affects broken batches (that may appears because of abnormal server (machine) termination and no
fsync_after_insert
/
fsync_directories
for
Distributed
table engine).
Note
You should not rely on automatic batch splitting, since this may hurt performance.
distributed_background_insert_timeout
β
Aliases
:
insert_distributed_timeout
Type
Default value
Type
UInt64
Default value
0
Timeout for insert query into distributed. Setting is used only with insert_distributed_sync enabled. Zero value means no timeout.
distributed_cache_alignment
β
ClickHouse Cloud only
Type
Default value
Type
UInt64
Default value
0
Only has an effect in ClickHouse Cloud. A setting for testing purposes, do not change it
distributed_cache_bypass_connection_pool
β
ClickHouse Cloud only
Type
Default value
Type
Bool
Default value
0
Only has an effect in ClickHouse Cloud. Allow to bypass distributed cache connection pool
distributed_cache_connect_backoff_max_ms
β
ClickHouse Cloud only
Type
Default value
Type
UInt64
Default value
50
Only has an effect in ClickHouse Cloud. Maximum backoff milliseconds for distributed cache connection creation.
distributed_cache_connect_backoff_min_ms
β
ClickHouse Cloud only
Type
Default value
Type
UInt64
Default value
0
Only has an effect in ClickHouse Cloud. Minimum backoff milliseconds for distributed cache connection creation.
distributed_cache_connect_max_tries
β
ClickHouse Cloud only
Type
Default value
Type
UInt64
Default value
5
Only has an effect in ClickHouse Cloud. Number of tries to connect to distributed cache if unsuccessful
distributed_cache_connect_timeout_ms
β
ClickHouse Cloud only
Type
Default value
Type
UInt64
Default value
50
Only has an effect in ClickHouse Cloud. Connection timeout when connecting to distributed cache server.
distributed_cache_credentials_refresh_period_seconds
β
ClickHouse Cloud only
Type
Default value
Type
UInt64
Default value
5
Only has an effect in ClickHouse Cloud. A period of credentials refresh.
distributed_cache_data_packet_ack_window
β
ClickHouse Cloud only
Type
Default value
Type
UInt64
Default value
5
Only has an effect in ClickHouse Cloud. A window for sending ACK for DataPacket sequence in a single distributed cache read request
distributed_cache_discard_connection_if_unread_data
β
ClickHouse Cloud only
Type
Default value
Type
Bool
Default value
1
Only has an effect in ClickHouse Cloud. Discard connection if some data is unread.
distributed_cache_fetch_metrics_only_from_current_az
β
ClickHouse Cloud only
Type
Default value
Type
Bool
Default value
1
Only has an effect in ClickHouse Cloud. Fetch metrics only from current availability zone in system.distributed_cache_metrics, system.distributed_cache_events
distributed_cache_file_cache_name
β
ClickHouse Cloud only
Only has an effect in ClickHouse Cloud. A setting used only for CI tests - filesystem cache name to use on distributed cache.
distributed_cache_log_mode
β
ClickHouse Cloud only
Type
Default value
Type
DistributedCacheLogMode
Default value
on_error
Only has an effect in ClickHouse Cloud. Mode for writing to system.distributed_cache_log
distributed_cache_max_unacked_inflight_packets
β
ClickHouse Cloud only
Type
Default value
Type
UInt64
Default value
10
Only has an effect in ClickHouse Cloud. A maximum number of unacknowledged in-flight packets in a single distributed cache read request
distributed_cache_min_bytes_for_seek
β
ClickHouse Cloud only
Type
Default value
Type
UInt64
Default value
0
Only has an effect in ClickHouse Cloud. Minimum number of bytes to do seek in distributed cache.
distributed_cache_pool_behaviour_on_limit
β
ClickHouse Cloud only
Type
Default value
Type
DistributedCachePoolBehaviourOnLimit
Default value
wait
Only has an effect in ClickHouse Cloud. Identifies behaviour of distributed cache connection on pool limit reached
distributed_cache_prefer_bigger_buffer_size
β
ClickHouse Cloud only
Type
Default value
Type
Bool
Default value
0
Only has an effect in ClickHouse Cloud. Same as filesystem_cache_prefer_bigger_buffer_size, but for distributed cache.
distributed_cache_read_only_from_current_az
β
ClickHouse Cloud only
Type
Default value
Type
Bool
Default value
1
Only has an effect in ClickHouse Cloud. Allow to read only from current availability zone. If disabled, will read from all cache servers in all availability zones.
distributed_cache_read_request_max_tries
β
ClickHouse Cloud only
Type
Default value
Type
UInt64
Default value
10
Only has an effect in ClickHouse Cloud. Number of tries to do distributed cache request if unsuccessful
distributed_cache_receive_response_wait_milliseconds
β
ClickHouse Cloud only
Type
Default value
Type
UInt64
Default value
60000
Only has an effect in ClickHouse Cloud. Wait time in milliseconds to receive data for request from distributed cache
distributed_cache_receive_timeout_milliseconds
β
ClickHouse Cloud only
Type
Default value
Type
UInt64
Default value
10000
Only has an effect in ClickHouse Cloud. Wait time in milliseconds to receive any kind of response from distributed cache
Cloud default value:
20000
.
distributed_cache_receive_timeout_ms
β
ClickHouse Cloud only
Type
Default value
Type
UInt64
Default value
3000
Only has an effect in ClickHouse Cloud. Timeout for receiving data from distributed cache server, in milliseconds. If no bytes were received in this interval, the exception is thrown.
distributed_cache_send_timeout_ms
β
ClickHouse Cloud only
Type
Default value
Type
UInt64
Default value
3000
Only has an effect in ClickHouse Cloud. Timeout for sending data to istributed cache server, in milliseconds. If a client needs to send some data but is not able to send any bytes in this interval, the exception is thrown.
distributed_cache_tcp_keep_alive_timeout_ms
β
ClickHouse Cloud only
Type
Default value
Type
UInt64
Default value
2900
Only has an effect in ClickHouse Cloud. The time in milliseconds the connection to distributed cache server needs to remain idle before TCP starts sending keepalive probes.
distributed_cache_throw_on_error
β
ClickHouse Cloud only
Type
Default value
Type
Bool
Default value
0
Only has an effect in ClickHouse Cloud. Rethrow exception happened during communication with distributed cache or exception received from distributed cache. Otherwise fallback to skipping distributed cache on error
distributed_cache_use_clients_cache_for_read
β
ClickHouse Cloud only
Type
Default value
Type
Bool
Default value
1
Only has an effect in ClickHouse Cloud. Use clients cache for read requests.
distributed_cache_use_clients_cache_for_write
β
ClickHouse Cloud only
Type
Default value
Type
Bool
Default value
0
Only has an effect in ClickHouse Cloud. Use clients cache for write requests.
distributed_cache_wait_connection_from_pool_milliseconds
β
ClickHouse Cloud only
Type
Default value
Type
UInt64
Default value
100
Only has an effect in ClickHouse Cloud. Wait time in milliseconds to receive connection from connection pool if distributed_cache_pool_behaviour_on_limit is wait
distributed_connections_pool_size
β
Type
Default value
Type
UInt64
Default value
1024
The maximum number of simultaneous connections with remote servers for distributed processing of all queries to a single Distributed table. We recommend setting a value no less than the number of servers in the cluster.
distributed_ddl_entry_format_version
β
Type
Default value
Type
UInt64
Default value
5
Compatibility version of distributed DDL (ON CLUSTER) queries
Cloud default value:
6
.
distributed_ddl_output_mode
β
Type
Default value
Type
DistributedDDLOutputMode
Default value
throw
Sets format of distributed DDL query result.
Possible values:
throw
β Returns result set with query execution status for all hosts where query is finished. If query has failed on some hosts, then it will rethrow the first exception. If query is not finished yet on some hosts and
distributed_ddl_task_timeout
exceeded, then it throws
TIMEOUT_EXCEEDED
exception.
none
β Is similar to throw, but distributed DDL query returns no result set.
null_status_on_timeout
β Returns
NULL
as execution status in some rows of result set instead of throwing
TIMEOUT_EXCEEDED
if query is not finished on the corresponding hosts.
never_throw
β Do not throw
TIMEOUT_EXCEEDED
and do not rethrow exceptions if query has failed on some hosts.
none_only_active
- similar to
none
, but doesn't wait for inactive replicas of the
Replicated
database. Note: with this mode it's impossible to figure out that the query was not executed on some replica and will be executed in background.
null_status_on_timeout_only_active
β similar to
null_status_on_timeout
, but doesn't wait for inactive replicas of the
Replicated
database
throw_only_active
β similar to
throw
, but doesn't wait for inactive replicas of the
Replicated
database
Cloud default value:
none_only_active
.
distributed_ddl_task_timeout
β
Type
Default value
Type
Int64
Default value
180
Sets timeout for DDL query responses from all hosts in cluster. If a DDL request has not been performed on all hosts, a response will contain a timeout error and a request will be executed in an async mode. Negative value means infinite.
Possible values:
Positive integer.
0 β Async mode.
Negative integer β infinite timeout.
distributed_foreground_insert
β
Aliases
:
insert_distributed_sync
Type
Default value
Type
Bool
Default value
0
Enables or disables synchronous data insertion into a
Distributed
table.
By default, when inserting data into a
Distributed
table, the ClickHouse server sends data to cluster nodes in background mode. When
distributed_foreground_insert=1
, the data is processed synchronously, and the
INSERT
operation succeeds only after all the data is saved on all shards (at least one replica for each shard if
internal_replication
is true).
Possible values:
0
β Data is inserted in background mode.
1
β Data is inserted in synchronous mode.
Cloud default value:
1
.
See Also
Distributed Table Engine
Managing Distributed Tables
distributed_group_by_no_merge
β
Type
Default value
Type
UInt64
Default value
0
Do not merge aggregation states from different servers for distributed query processing, you can use this in case it is for certain that there are different keys on different shards
Possible values:
0
β Disabled (final query processing is done on the initiator node).
1
- Do not merge aggregation states from different servers for distributed query processing (query completely processed on the shard, initiator only proxy the data), can be used in case it is for certain that there are different keys on different shards.
2
- Same as
1
but applies
ORDER BY
and
LIMIT
(it is not possible when the query processed completely on the remote node, like for
distributed_group_by_no_merge=1
) on the initiator (can be used for queries with
ORDER BY
and/or
LIMIT
).
Example
SELECT *
FROM remote('127.0.0.{2,3}', system.one)
GROUP BY dummy
LIMIT 1
SETTINGS distributed_group_by_no_merge = 1
FORMAT PrettyCompactMonoBlock
ββdummyββ
β 0 β
β 0 β
βββββββββ
SELECT *
FROM remote('127.0.0.{2,3}', system.one)
GROUP BY dummy
LIMIT 1
SETTINGS distributed_group_by_no_merge = 2
FORMAT PrettyCompactMonoBlock
ββdummyββ
β 0 β
βββββββββ
distributed_index_analysis
β
Type
Default value
Type
Bool
Default value
0
Index analysis will be distributed across replicas.
Beneficial for shared storage and huge amount of data in cluster.
Uses replicas from cluster_for_parallel_replicas.
See also
distributed_index_analysis_for_non_shared_merge_tree
distributed_index_analysis_min_parts_to_activate
distributed_index_analysis_min_indexes_bytes_to_activate
Type
Default value
Type
Bool
Default value
0
Enable distributed index analysis even for non SharedMergeTree (cloud only engine).
distributed_index_analysis_only_on_coordinator
β
Type
Default value
Type
Bool
Default value
0
If enabled, distributed index analysis runs only on the coordinator.
This prevents O(N^2) spawned queries when the predicate contains subqueries (e.g.,
IN (SELECT ...)
),
because each follower replica would otherwise independently trigger its own distributed index analysis,
but makes distributed index analysis less efficient if large tables are used in the subqueries.
distributed_insert_skip_read_only_replicas
β
Type
Default value
Type
Bool
Default value
0
Enables skipping read-only replicas for INSERT queries into Distributed.
Possible values:
0 β INSERT was as usual, if it will go to read-only replica it will fail
1 β Initiator will skip read-only replicas before sending data to shards.
distributed_plan_default_reader_bucket_count
β
Type
Default value
Type
UInt64
Default value
8
Default number of tasks for parallel reading in distributed query. Tasks are spread across between replicas.
distributed_plan_default_shuffle_join_bucket_count
β
Type
Default value
Type
NonZeroUInt64
Default value
8
Default number of buckets for distributed shuffle-hash-join.
distributed_plan_execute_locally
β
Type
Default value
Type
Bool
Default value
0
Run all tasks of a distributed query plan locally. Useful for testing and debugging.
distributed_plan_force_exchange_kind
β
Force specified kind of Exchange operators between distributed query stages.
Possible values:
'' - do not force any kind of Exchange operators, let the optimizer choose,
'Persisted' - use temporary files in object storage,
'Streaming' - stream exchange data over network.
distributed_plan_force_shuffle_aggregation
β
Type
Default value
Type
Bool
Default value
0
Use Shuffle aggregation strategy instead of PartialAggregation + Merge in distributed query plan.
distributed_plan_max_rows_to_broadcast
β
Type
Default value
Type
UInt64
Default value
20000
Maximum rows to use broadcast join instead of shuffle join in distributed query plan.
distributed_plan_optimize_exchanges
β
Type
Default value
Type
Bool
Default value
1
Removes unnecessary exchanges in distributed query plan. Disable it for debugging.
distributed_plan_prefer_replicas_over_workers
β
Type
Default value
Type
Bool
Default value
0
Serialize the distributed query plan for execution at replicas.
distributed_product_mode
β
Type
Default value
Type
DistributedProductMode
Default value
deny
Changes the behaviour of
distributed subqueries
.
ClickHouse applies this setting when the query contains the product of distributed tables, i.e.Β when the query for a distributed table contains a non-GLOBAL subquery for the distributed table.
Restrictions:
Only applied for IN and JOIN subqueries.
Only if the FROM section uses a distributed table containing more than one shard.
If the subquery concerns a distributed table containing more than one shard.
Not used for a table-valued
remote
function.
Possible values:
deny
β Default value. Prohibits using these types of subqueries (returns the "Double-distributed in/JOIN subqueries is denied" exception).
local
β Replaces the database and table in the subquery with local ones for the destination server (shard), leaving the normal
IN
/
JOIN.
global
β Replaces the
IN
/
JOIN
query with
GLOBAL IN
/
GLOBAL JOIN.
allow
β Allows the use of these types of subqueries.
distributed_push_down_limit
β
Type
Default value
Type
UInt64
Default value
1
Enables or disables
LIMIT
applying on each shard separately.
This will allow to avoid:
Sending extra rows over network;
Processing rows behind the limit on the initiator.
Starting from 21.9 version you cannot get inaccurate results anymore, since
distributed_push_down_limit
changes query execution only if at least one of the conditions met:
distributed_group_by_no_merge
> 0.
Query
does not have
GROUP BY
/
DISTINCT
/
LIMIT BY
, but it has
ORDER BY
/
LIMIT
.
Query
has
GROUP BY
/
DISTINCT
/
LIMIT BY
with
ORDER BY
/
LIMIT
and:
optimize_skip_unused_shards
is enabled.
optimize_distributed_group_by_sharding_key
is enabled.
Possible values:
0 β Disabled.
1 β Enabled.
See also:
distributed_group_by_no_merge
optimize_skip_unused_shards
optimize_distributed_group_by_sharding_key
distributed_replica_error_cap
β
Type
Default value
Type
UInt64
Default value
1000
Type: unsigned int
Default value: 1000
The error count of each replica is capped at this value, preventing a single replica from accumulating too many errors.
See also:
load_balancing
Table engine Distributed
distributed_replica_error_half_life
distributed_replica_max_ignored_errors
distributed_replica_error_half_life
β
Type
Default value
Type
Seconds
Default value
60
Type: seconds
Default value: 60 seconds
Controls how fast errors in distributed tables are zeroed. If a replica is unavailable for some time, accumulates 5 errors, and distributed_replica_error_half_life is set to 1 second, then the replica is considered normal 3 seconds after the last error.
See also:
load_balancing
Table engine Distributed
distributed_replica_error_cap
distributed_replica_max_ignored_errors
distributed_replica_max_ignored_errors
β
Type
Default value
Type
UInt64
Default value
0
Type: unsigned int
Default value: 0
The number of errors that will be ignored while choosing replicas (according to
load_balancing
algorithm).
See also:
load_balancing
Table engine Distributed
distributed_replica_error_cap
distributed_replica_error_half_life
do_not_merge_across_partitions_select_final
β
Type
Default value
Type
Bool
Default value
0
Improve FINAL queries by avoiding merges across different partitions.
When enabled, during SELECT FINAL queries, parts from different partitions will not be merged together. Instead, merging will only occur within each partition separately. This can significantly improve query performance when working with partitioned tables.
empty_result_for_aggregation_by_constant_keys_on_empty_set
β
Type
Default value
Type
Bool
Default value
1
Return empty result when aggregating by constant keys on empty set.
empty_result_for_aggregation_by_empty_set
β
Type
Default value
Type
Bool
Default value
0
Return empty result when aggregating without keys on empty set.
enable_adaptive_memory_spill_scheduler
β
Type
Default value
Type
Bool
Default value
0
Trigger processor to spill data into external storage adpatively. grace join is supported at present.
enable_add_distinct_to_in_subqueries
β
Type
Default value
Type
Bool
Default value
0
Enable
DISTINCT
in
IN
subqueries. This is a trade-off setting: enabling it can greatly reduce the size of temporary tables transferred for distributed IN subqueries and significantly speed up data transfer between shards, by ensuring only unique values are sent.
However, enabling this setting adds extra merging effort on each node, as deduplication (DISTINCT) must be performed. Use this setting when network transfer is a bottleneck and the additional merging cost is acceptable.
enable_automatic_decision_for_merging_across_partitions_for_final
β
Type
Default value
Type
Bool
Default value
1
If set, ClickHouse will automatically enable this optimization when the partition key expression is deterministic and all columns used in the partition key expression are included in the primary key.
This automatic derivation ensures that rows with the same primary key values will always belong to the same partition, making it safe to avoid cross-partition merges.
enable_blob_storage_log
β
Type
Default value
Type
Bool
Default value
1
Write information about blob storage operations to system.blob_storage_log table
enable_early_constant_folding
β
Type
Default value
Type
Bool
Default value
1
Enable query optimization where we analyze function and subqueries results and rewrite query if there are constants there
enable_extended_results_for_datetime_functions
β
Type
Default value
Type
Bool
Default value
0
Enables or disables returning results of type
Date32
with extended range (compared to type
Date
)
or
DateTime64
with extended range (compared to type
DateTime
).
Possible values:
0
β Functions return
Date
or
DateTime
for all types of arguments.
1
β Functions return
Date32
or
DateTime64
for
Date32
or
DateTime64
arguments and
Date
or
DateTime
otherwise.
The table below shows the behavior of this setting for various date-time functions.
Function
enable_extended_results_for_datetime_functions = 0
enable_extended_results_for_datetime_functions = 1
toStartOfYear
Returns
Date
or
DateTime
Returns
Date
/
DateTime
for
Date
/
DateTime
input
Returns
Date32
/
DateTime64
for
Date32
/
DateTime64
input
toStartOfISOYear
Returns
Date
or
DateTime
Returns
Date
/
DateTime
for
Date
/
DateTime
input
Returns
Date32
/
DateTime64
for
Date32
/
DateTime64
input
toStartOfQuarter
Returns
Date
or
DateTime
Returns
Date
/
DateTime
for
Date
/
DateTime
input
Returns
Date32
/
DateTime64
for
Date32
/
DateTime64
input
toStartOfMonth
Returns
Date
or
DateTime
Returns
Date
/
DateTime
for
Date
/
DateTime
input
Returns
Date32
/
DateTime64
for
Date32
/
DateTime64
input
toStartOfWeek
Returns
Date
or
DateTime
Returns
Date
/
DateTime
for
Date
/
DateTime
input
Returns
Date32
/
DateTime64
for
Date32
/
DateTime64
input
toLastDayOfWeek
Returns
Date
or
DateTime
Returns
Date
/
DateTime
for
Date
/
DateTime
input
Returns
Date32
/
DateTime64
for
Date32
/
DateTime64
input
toLastDayOfMonth
Returns
Date
or
DateTime
Returns
Date
/
DateTime
for
Date
/
DateTime
input
Returns
Date32
/
DateTime64
for
Date32
/
DateTime64
input
toMonday
Returns
Date
or
DateTime
Returns
Date
/
DateTime
for
Date
/
DateTime
input
Returns
Date32
/
DateTime64
for
Date32
/
DateTime64
input
toStartOfDay
Returns
DateTime
Note: Wrong results for values outside 1970-2149 range
Returns
DateTime
for
Date
/
DateTime
input
Returns
DateTime64
for
Date32
/
DateTime64
input
toStartOfHour
Returns
DateTime
Note: Wrong results for values outside 1970-2149 range
Returns
DateTime
for
Date
/
DateTime
input
Returns
DateTime64
for
Date32
/
DateTime64
input
toStartOfFifteenMinutes
Returns
DateTime
Note: Wrong results for values outside 1970-2149 range
Returns
DateTime
for
Date
/
DateTime
input
Returns
DateTime64
for
Date32
/
DateTime64
input
toStartOfTenMinutes
Returns
DateTime
Note: Wrong results for values outside 1970-2149 range
Returns
DateTime
for
Date
/
DateTime
input
Returns
DateTime64
for
Date32
/
DateTime64
input
toStartOfFiveMinutes
Returns
DateTime
Note: Wrong results for values outside 1970-2149 range
Returns
DateTime
for
Date
/
DateTime
input
Returns
DateTime64
for
Date32
/
DateTime64
input
toStartOfMinute
Returns
DateTime
Note: Wrong results for values outside 1970-2149 range
Returns
DateTime
for
Date
/
DateTime
input
Returns
DateTime64
for
Date32
/
DateTime64
input
timeSlot
Returns
DateTime
Note: Wrong results for values outside 1970-2149 range
Returns
DateTime
for
Date
/
DateTime
input
Returns
DateTime64
for
Date32
/
DateTime64
input
enable_filesystem_cache
β
Type
Default value
Type
Bool
Default value
1
Use cache for remote filesystem. This setting does not turn on/off cache for disks (must be done via disk config), but allows to bypass cache for some queries if intended
enable_filesystem_cache_log
β
Type
Default value
Type
Bool
Default value
0
Allows to record the filesystem caching log for each query
enable_filesystem_cache_on_write_operations
β
Type
Default value
Type
Bool
Default value
0
Enables or disables
write-through
cache. If set to
false
, the
write-through
cache is disabled for write operations. If set to
true
,
write-through
cache is enabled as long as
cache_on_write_operations
is turned on in the server config's cache disk configuration section.
See
"Using local cache"
for more details.
Cloud default value:
1
.
enable_filesystem_read_prefetches_log
β
Type
Default value
Type
Bool
Default value
0
Log to system.filesystem prefetch_log during query. Should be used only for testing or debugging, not recommended to be turned on by default
enable_full_text_index
β
Aliases
:
allow_experimental_full_text_index
Type
Default value
Type
Bool
Default value
1
If set to true, allow using the text index.
enable_global_with_statement
β
Type
Default value
Type
Bool
Default value
1
Propagate WITH statements to UNION queries and all subqueries
enable_hdfs_pread
β
Type
Default value
Type
Bool
Default value
1
Enable or disables pread for HDFS files. By default,
hdfsPread
is used. If disabled,
hdfsRead
and
hdfsSeek
will be used to read hdfs files.
enable_http_compression
β
Type
Default value
Type
Bool
Default value
1
Enables or disables data compression in the response to an HTTP request.
For more information, read the
HTTP interface description
.
Possible values:
0 β Disabled.
1 β Enabled.
enable_job_stack_trace
β
Type
Default value
Type
Bool
Default value
0
Output stack trace of a job creator when job results in exception. Disabled by default to avoid performance overhead.
enable_join_runtime_filters
β
Type
Default value
Type
Bool
Default value
1
Filter left side by set of JOIN keys collected from the right side at runtime.
enable_join_transitive_predicates
β
Type
Default value
Type
Bool
Default value
0
Infer transitive equi-join predicates from existing join conditions.
For example, given
A.x = B.x
and
B.x = C.x
, a synthetic
A.x = C.x
predicate
is added so the join order optimizer can consider direct (A JOIN C) plans.
enable_lazy_columns_replication
β
Type
Default value
Type
Bool
Default value
1
Enables lazy columns replication in JOIN and ARRAY JOIN, it allows to avoid unnecessary copy of the same rows multiple times in memory.
enable_lightweight_delete
β
Aliases
:
allow_experimental_lightweight_delete
Type
Default value
Type
Bool
Default value
1
Enable lightweight DELETE mutations for mergetree tables.
enable_lightweight_update
β
Aliases
:
allow_experimental_lightweight_update
Type
Default value
Type
Bool
Default value
1
Allow to use lightweight updates.
enable_materialized_cte
β
Type
Default value
Type
Bool
Default value
0
Enable materialized common table expressions, it will be preferred over enable_global_with_statement
enable_memory_bound_merging_of_aggregation_results
β
Type
Default value
Type
Bool
Default value
1
Enable memory bound merging strategy for aggregation.
enable_multiple_prewhere_read_steps
β
Type
Default value
Type
Bool
Default value
1
Move more conditions from WHERE to PREWHERE and do reads from disk and filtering in multiple steps if there are multiple conditions combined with AND
enable_named_columns_in_function_tuple
β
Type
Default value
Type
Bool
Default value
0
Generate named tuples in function tuple() when all names are unique and can be treated as unquoted identifiers.
enable_optimize_predicate_expression
β
Type
Default value
Type
Bool
Default value
1
Turns on predicate pushdown in
SELECT
queries.
Predicate pushdown may significantly reduce network traffic for distributed queries.
Possible values:
0 β Disabled.
1 β Enabled.
Usage
Consider the following queries:
SELECT count() FROM test_table WHERE date = '2018-10-10'
SELECT count() FROM (SELECT * FROM test_table) WHERE date = '2018-10-10'
If
enable_optimize_predicate_expression = 1
, then the execution time of these queries is equal because ClickHouse applies
WHERE
to the subquery when processing it.
If
enable_optimize_predicate_expression = 0
, then the execution time of the second query is much longer because the
WHERE
clause applies to all the data after the subquery finishes.
enable_optimize_predicate_expression_to_final_subquery
β
Type
Default value
Type
Bool
Default value
1
Allow push predicate to final subquery.
enable_order_by_all
β
Type
Default value
Type
Bool
Default value
1
Enables or disables sorting with
ORDER BY ALL
syntax, see
ORDER BY
.
Possible values:
0 β Disable ORDER BY ALL.
1 β Enable ORDER BY ALL.
Example
Query:
CREATE TABLE TAB(C1 Int, C2 Int, ALL Int) ENGINE=Memory();
INSERT INTO TAB VALUES (10, 20, 30), (20, 20, 10), (30, 10, 20);
SELECT * FROM TAB ORDER BY ALL; -- returns an error that ALL is ambiguous
SELECT * FROM TAB ORDER BY ALL SETTINGS enable_order_by_all = 0;
Result:
ββC1ββ¬βC2ββ¬βALLββ
β 20 β 20 β 10 β
β 30 β 10 β 20 β
β 10 β 20 β 30 β
ββββββ΄βββββ΄ββββββ
enable_parallel_blocks_marshalling
β
Type
Default value
Type
Bool
Default value
1
Affects only distributed queries. If enabled, blocks will be (de)serialized and (de)compressed on pipeline threads (i.e. with higher parallelism that what we have by default) before/after sending to the initiator.
enable_parsing_to_custom_serialization
β
Type
Default value
Type
Bool
Default value
1
If true then data can be parsed directly to columns with custom serialization (e.g. Sparse) according to hints for serialization got from the table.
enable_positional_arguments
β
Type
Default value
Type
Bool
Default value
1
Enables or disables supporting positional arguments for
GROUP BY
,
LIMIT BY
,
ORDER BY
statements.
Possible values:
0 β Positional arguments aren't supported.
1 β Positional arguments are supported: column numbers can use instead of column names.
Example
Query:
CREATE TABLE positional_arguments(one Int, two Int, three Int) ENGINE=Memory();
INSERT INTO positional_arguments VALUES (10, 20, 30), (20, 20, 10), (30, 10, 20);
SELECT * FROM positional_arguments ORDER BY 2,3;
Result:
ββoneββ¬βtwoββ¬βthreeββ
β 30 β 10 β 20 β
β 20 β 20 β 10 β
β 10 β 20 β 30 β
βββββββ΄ββββββ΄ββββββββ
enable_positional_arguments_for_projections
β
Type
Default value
Type
Bool
Default value
0
Enables or disables supporting positional arguments in PROJECTION definitions. See also
enable_positional_arguments
setting.
Note
This is an expert-level setting, and you shouldn't change it if you're just getting started with ClickHouse.
Possible values:
0 β Positional arguments aren't supported.
1 β Positional arguments are supported: column numbers can use instead of column names.
enable_producing_buckets_out_of_order_in_aggregation
β
Type
Default value
Type
Bool
Default value
1
Allow memory-efficient aggregation (see
distributed_aggregation_memory_efficient
) to produce buckets out of order.
It may improve performance when aggregation bucket sizes are skewed by letting a replica to send buckets with higher id-s to the initiator while it is still processing some heavy buckets with lower id-s.
The downside is potentially higher memory usage.
enable_reads_from_query_cache
β
Type
Default value
Type
Bool
Default value
1
If turned on, results of
SELECT
queries are retrieved from the
query cache
.
Possible values:
0 - Disabled
1 - Enabled
enable_s3_requests_logging
β
Type
Default value
Type
Bool
Default value
0
Enable very explicit logging of S3 requests. Makes sense for debug only.
enable_scalar_subquery_optimization
β
Type
Default value
Type
Bool
Default value
1
If it is set to true, prevent scalar subqueries from (de)serializing large scalar values and possibly avoid running the same subquery more than once.
enable_scopes_for_with_statement
β
Type
Default value
Type
Bool
Default value
1
If disabled, declarations in parent WITH cluases will behave the same scope as they declared in the current scope.
Note that this is a compatibility setting for the analyzer to allow running some invalid queries that old analyzer could execute.
Type
Default value
Type
Bool
Default value
1
If enabled, all subqueries within a single query will share the same StorageSnapshot for each table.
This ensures a consistent view of the data across the entire query, even if the same table is accessed multiple times.
This is required for queries where internal consistency of data parts is important. Example:
SELECT
count()
FROM events
WHERE (_part, _part_offset) IN (
SELECT _part, _part_offset
FROM events
WHERE user_id = 42
)
Without this setting, the outer and inner queries may operate on different data snapshots, leading to incorrect results.
Note
Enabling this setting disables the optimization which removes unnecessary data parts from snapshots once the planning stage is complete.
As a result, long-running queries may hold onto obsolete parts for their entire duration, delaying part cleanup and increasing storage pressure.
This setting currently applies only to tables from the MergeTree family.
Possible values:
0 - Disabled
1 - Enabled
enable_sharing_sets_for_mutations
β
Type
Default value
Type
Bool
Default value
1
Allow sharing set objects build for IN subqueries between different tasks of the same mutation. This reduces memory usage and CPU consumptio
enable_software_prefetch_in_aggregation
β
Type
Default value
Type
Bool
Default value
1
Enable use of software prefetch in aggregatio
enable_time_time64_type
β
Aliases
:
allow_experimental_time_time64_type
Type
Default value
Type
Bool
Default value
1
Allows creation of
Time
and
Time64
data types.
enable_unaligned_array_join
β
Type
Default value
Type
Bool
Default value
0
Allow ARRAY JOIN with multiple arrays that have different sizes. When this settings is enabled, arrays will be resized to the longest one.
enable_url_encoding
β
Type
Default value
Type
Bool
Default value
0
Allows to enable/disable decoding/encoding path in uri in
URL
engine tables.
Disabled by default.
enable_vertical_final
β
Type
Default value
Type
Bool
Default value
1
If enable, remove duplicated rows during FINAL by marking rows as deleted and filtering them later instead of merging rows
enable_writes_to_query_cache
β
Type
Default value
Type
Bool
Default value
1
If turned on, results of
SELECT
queries are stored in the
query cache
.
Possible values:
0 - Disabled
1 - Enabled
enforce_strict_identifier_format
β
Type
Default value
Type
Bool
Default value
0
If enabled, only allow identifiers containing alphanumeric characters and underscores.
engine_file_allow_create_multiple_files
β
Type
Default value
Type
Bool
Default value
0
Enables or disables creating a new file on each insert in file engine tables if the format has the suffix (
JSON
,
ORC
,
Parquet
, etc.). If enabled, on each insert a new file will be created with a name following this pattern:
data.Parquet
->
data.1.Parquet
->
data.2.Parquet
, etc.
Possible values:
0 β
INSERT
query appends new data to the end of the file.
1 β
INSERT
query creates a new file.
engine_file_empty_if_not_exists
β
Type
Default value
Type
Bool
Default value
0
Allows to select data from a file engine table without file.
Possible values:
0 β
SELECT
throws exception.
1 β
SELECT
returns empty result.
engine_file_skip_empty_files
β
Type
Default value
Type
Bool
Default value
0
Enables or disables skipping empty files in
File
engine tables.
Possible values:
0 β
SELECT
throws an exception if empty file is not compatible with requested format.
1 β
SELECT
returns empty result for empty file.
engine_file_truncate_on_insert
β
Type
Default value
Type
Bool
Default value
0
Enables or disables truncate before insert in
File
engine tables.
Possible values:
0 β
INSERT
query appends new data to the end of the file.
1 β
INSERT
query replaces existing content of the file with the new data.
engine_url_skip_empty_files
β
Type
Default value
Type
Bool
Default value
0
Enables or disables skipping empty files in
URL
engine tables.
Possible values:
0 β
SELECT
throws an exception if empty file is not compatible with requested format.
1 β
SELECT
returns empty result for empty file.
exact_rows_before_limit
β
Type
Default value
Type
Bool
Default value
0
When enabled, ClickHouse will provide exact value for rows_before_limit_at_least statistic, but with the cost that the data before limit will have to be read completely
except_default_mode
β
Type
Default value
Type
SetOperationMode
Default value
ALL
Set default mode in EXCEPT query. Possible values: empty string, 'ALL', 'DISTINCT'. If empty, query without mode will throw exception.
exclude_materialize_skip_indexes_on_insert
β
Excludes specified skip indexes from being built and stored during INSERTs. The excluded skip indexes will still be built and stored
during merges
or by an explicit
MATERIALIZE INDEX
query.
Has no effect if
materialize_skip_indexes_on_insert
is false.
Example:
CREATE TABLE tab
(
a UInt64,
b UInt64,
INDEX idx_a a TYPE minmax,
INDEX idx_b b TYPE set(3)
)
ENGINE = MergeTree ORDER BY tuple();
SET exclude_materialize_skip_indexes_on_insert='idx_a'; -- idx_a will be not be updated upon insert
--SET exclude_materialize_skip_indexes_on_insert='idx_a, idx_b'; -- neither index would be updated on insert
INSERT INTO tab SELECT number, number / 50 FROM numbers(100); -- only idx_b is updated
-- since it is a session setting it can be set on a per-query level
INSERT INTO tab SELECT number, number / 50 FROM numbers(100, 100) SETTINGS exclude_materialize_skip_indexes_on_insert='idx_b';
ALTER TABLE tab MATERIALIZE INDEX idx_a; -- this query can be used to explicitly materialize the index
SET exclude_materialize_skip_indexes_on_insert = DEFAULT; -- reset setting to default
execute_exists_as_scalar_subquery
β
Type
Default value
Type
Bool
Default value
1
Execute non-correlated EXISTS subqueries as scalar subqueries. As for scalar subqueries, the cache is used, and the constant folding applies to the result.
Cloud default value:
0
.
external_storage_connect_timeout_sec
β
Type
Default value
Type
UInt64
Default value
10
Connect timeout in seconds. Now supported only for MySQL
external_storage_max_read_bytes
β
Type
Default value
Type
UInt64
Default value
0
Limit maximum number of bytes when table with external engine should flush history data. Now supported only for MySQL table engine, database engine, and dictionary. If equal to 0, this setting is disabled
external_storage_max_read_rows
β
Type
Default value
Type
UInt64
Default value
0
Limit maximum number of rows when table with external engine should flush history data. Now supported only for MySQL table engine, database engine, and dictionary. If equal to 0, this setting is disabled
external_storage_rw_timeout_sec
β
Type
Default value
Type
UInt64
Default value
300
Read/write timeout in seconds. Now supported only for MySQL
external_table_functions_use_nulls
β
Type
Default value
Type
Bool
Default value
1
Defines how
mysql
,
postgresql
and
odbc
table functions use Nullable columns.
Possible values:
0 β The table function explicitly uses Nullable columns.
1 β The table function implicitly uses Nullable columns.
Usage
If the setting is set to
0
, the table function does not make Nullable columns and inserts default values instead of NULL. This is also applicable for NULL values inside arrays.
external_table_strict_query
β
Type
Default value
Type
Bool
Default value
0
If it is set to true, transforming expression to local filter is forbidden for queries to external tables.
Aliases
:
extract_kvp_max_pairs_per_row
Type
Default value
Type
UInt64
Default value
1000
Max number of pairs that can be produced by the
extractKeyValuePairs
function. Used as a safeguard against consuming too much memory.
extremes
β
Type
Default value
Type
Bool
Default value
0
Whether to count extreme values (the minimums and maximums in columns of a query result). Accepts 0 or 1. By default, 0 (disabled).
For more information, see the section "Extreme values".
fallback_to_stale_replicas_for_distributed_queries
β
Type
Default value
Type
Bool
Default value
1
Forces a query to an out-of-date replica if updated data is not available. See
Replication
.
ClickHouse selects the most relevant from the outdated replicas of the table.
Used when performing
SELECT
from a distributed table that points to replicated tables.
By default, 1 (enabled).
filesystem_cache_allow_background_download
β
Type
Default value
Type
Bool
Default value
1
Allow filesystem cache to enqueue background downloads for data read from remote storage. Disable to keep downloads in the foreground for the current query/session.
filesystem_cache_boundary_alignment
β
Type
Default value
Type
UInt64
Default value
0
Filesystem cache boundary alignment. This setting is applied only for non-disk read (e.g. for cache of remote table engines / table functions, but not for storage configuration of MergeTree tables). Value 0 means no alignment.
filesystem_cache_enable_background_download_during_fetch
β
ClickHouse Cloud only
Type
Default value
Type
Bool
Default value
1
Only has an effect in ClickHouse Cloud. Wait time to lock cache for space reservation in filesystem cache
ClickHouse Cloud only
Type
Default value
Type
Bool
Default value
1
Only has an effect in ClickHouse Cloud. Wait time to lock cache for space reservation in filesystem cache
filesystem_cache_max_download_size
β
Type
Default value
Type
UInt64
Default value
137438953472
Max remote filesystem cache size that can be downloaded by a single query
filesystem_cache_name
β
Filesystem cache name to use for stateless table engines or data lakes
filesystem_cache_prefer_bigger_buffer_size
β
Type
Default value
Type
Bool
Default value
1
Prefer bigger buffer size if filesystem cache is enabled to avoid writing small file segments which deteriorate cache performance. On the other hand, enabling this setting might increase memory usage.
filesystem_cache_reserve_space_wait_lock_timeout_milliseconds
β
Type
Default value
Type
UInt64
Default value
1000
Wait time to lock cache for space reservation in filesystem cache
filesystem_cache_segments_batch_size
β
Type
Default value
Type
UInt64
Default value
20
Limit on size of a single batch of file segments that a read buffer can request from cache. Too low value will lead to excessive requests to cache, too large may slow down eviction from cache
filesystem_cache_skip_download_if_exceeds_per_query_cache_write_limit
β
Aliases
:
skip_download_if_exceeds_query_cache
Type
Default value
Type
Bool
Default value
1
Skip download from remote filesystem if exceeds query cache size
filesystem_prefetch_max_memory_usage
β
Type
Default value
Type
NonZeroUInt64
Default value
1073741824
Maximum memory usage for prefetches.
Cloud default value: 10% of total memory.
filesystem_prefetch_step_bytes
β
Type
Default value
Type
UInt64
Default value
0
Prefetch step in bytes. Zero means
auto
- approximately the best prefetch step will be auto deduced, but might not be 100% the best. The actual value might be different because of setting filesystem_prefetch_min_bytes_for_single_read_task
filesystem_prefetch_step_marks
β
Type
Default value
Type
UInt64
Default value
0
Prefetch step in marks. Zero means
auto
- approximately the best prefetch step will be auto deduced, but might not be 100% the best. The actual value might be different because of setting filesystem_prefetch_min_bytes_for_single_read_task
filesystem_prefetches_limit
β
Type
Default value
Type
UInt64
Default value
200
Maximum number of prefetches. Zero means unlimited. A setting
filesystem_prefetches_max_memory_usage
is more recommended if you want to limit the number of prefetches
final
β
Type
Default value
Type
Bool
Default value
0
Automatically applies
FINAL
modifier to all tables in a query, to tables where
FINAL
is applicable, including joined tables and tables in sub-queries, and
distributed tables.
Possible values:
0 - disabled
1 - enabled
Example:
CREATE TABLE test
(
key Int64,
some String
)
ENGINE = ReplacingMergeTree
ORDER BY key;
INSERT INTO test FORMAT Values (1, 'first');
INSERT INTO test FORMAT Values (1, 'second');
SELECT * FROM test;
ββkeyββ¬βsomeββββ
β 1 β second β
βββββββ΄βββββββββ
ββkeyββ¬βsomeβββ
β 1 β first β
βββββββ΄ββββββββ
SELECT * FROM test SETTINGS final = 1;
ββkeyββ¬βsomeββββ
β 1 β second β
βββββββ΄βββββββββ
SET final = 1;
SELECT * FROM test;
ββkeyββ¬βsomeββββ
β 1 β second β
βββββββ΄βββββββββ
finalize_projection_parts_synchronously
β
Type
Default value
Type
Bool
Default value
0
When enabled, projection parts are finalized synchronously during INSERT, reducing peak memory usage at the cost of reduced S3 upload parallelism. By default, each projection's output stream is kept alive until the entire part (including all projections) is finalized, which allows overlapping S3 uploads but increases peak memory proportional to the number of projections. This setting only affects the INSERT path; merge and mutation already finalize projections synchronously.
flatten_nested
β
Type
Default value
Type
Bool
Default value
1
Sets the data format of a
nested
columns.
Possible values:
1 β Nested column is flattened to separate arrays.
0 β Nested column stays a single array of tuples.
Usage
If the setting is set to
0
, it is possible to use an arbitrary level of nesting.
Examples
Query:
SET flatten_nested = 1;
CREATE TABLE t_nest (`n` Nested(a UInt32, b UInt32)) ENGINE = MergeTree ORDER BY tuple();
SHOW CREATE TABLE t_nest;
Result:
ββstatementββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β CREATE TABLE default.t_nest
(
`n.a` Array(UInt32),
`n.b` Array(UInt32)
)
ENGINE = MergeTree
ORDER BY tuple()
SETTINGS index_granularity = 8192 β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
Query:
SET flatten_nested = 0;
CREATE TABLE t_nest (`n` Nested(a UInt32, b UInt32)) ENGINE = MergeTree ORDER BY tuple();
SHOW CREATE TABLE t_nest;
Result:
ββstatementβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β CREATE TABLE default.t_nest
(
`n` Nested(a UInt32, b UInt32)
)
ENGINE = MergeTree
ORDER BY tuple()
SETTINGS index_granularity = 8192 β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
force_aggregate_partitions_independently
β
Type
Default value
Type
Bool
Default value
0
Force the use of optimization when it is applicable, but heuristics decided not to use it
force_aggregation_in_order
β
Type
Default value
Type
Bool
Default value
0
The setting is used by the server itself to support distributed queries. Do not change it manually, because it will break normal operations. (Forces use of aggregation in order on remote nodes during distributed aggregation).
force_data_skipping_indices
β
Disables query execution if passed data skipping indices wasn't used.
Consider the following example:
CREATE TABLE data
(
key Int,
d1 Int,
d1_null Nullable(Int),
INDEX d1_idx d1 TYPE minmax GRANULARITY 1,
INDEX d1_null_idx assumeNotNull(d1_null) TYPE minmax GRANULARITY 1
)
Engine=MergeTree()
ORDER BY key;
SELECT * FROM data_01515;
SELECT * FROM data_01515 SETTINGS force_data_skipping_indices=''; -- query will produce CANNOT_PARSE_TEXT error.
SELECT * FROM data_01515 SETTINGS force_data_skipping_indices='d1_idx'; -- query will produce INDEX_NOT_USED error.
SELECT * FROM data_01515 WHERE d1 = 0 SETTINGS force_data_skipping_indices='d1_idx'; -- Ok.
SELECT * FROM data_01515 WHERE d1 = 0 SETTINGS force_data_skipping_indices='`d1_idx`'; -- Ok (example of full featured parser).
SELECT * FROM data_01515 WHERE d1 = 0 SETTINGS force_data_skipping_indices='`d1_idx`, d1_null_idx'; -- query will produce INDEX_NOT_USED error, since d1_null_idx is not used.
SELECT * FROM data_01515 WHERE d1 = 0 AND assumeNotNull(d1_null) = 0 SETTINGS force_data_skipping_indices='`d1_idx`, d1_null_idx'; -- Ok.
force_grouping_standard_compatibility
β
Type
Default value
Type
Bool
Default value
1
Make GROUPING function to return 1 when argument is not used as an aggregation key
force_index_by_date
β
Type
Default value
Type
Bool
Default value
0
Disables query execution if the index can't be used by date.
Works with tables in the MergeTree family.
If
force_index_by_date=1
, ClickHouse checks whether the query has a date key condition that can be used for restricting data ranges. If there is no suitable condition, it throws an exception. However, it does not check whether the condition reduces the amount of data to read. For example, the condition
Date != ' 2000-01-01 '
is acceptable even when it matches all the data in the table (i.e., running the query requires a full scan). For more information about ranges of data in MergeTree tables, see
MergeTree
.
force_optimize_projection
β
Type
Default value
Type
Bool
Default value
0
Enables or disables the obligatory use of
projections
in
SELECT
queries, when projection optimization is enabled (see
optimize_use_projections
setting).
Possible values:
0 β Projection optimization is not obligatory.
1 β Projection optimization is obligatory.
force_optimize_projection_name
β
If it is set to a non-empty string, check that this projection is used in the query at least once.
Possible values:
string: name of projection that used in a query
force_optimize_skip_unused_shards
β
Type
Default value
Type
UInt64
Default value
0
Enables or disables query execution if
optimize_skip_unused_shards
is enabled and skipping of unused shards is not possible. If the skipping is not possible and the setting is enabled, an exception will be thrown.
Possible values:
0 β Disabled. ClickHouse does not throw an exception.
1 β Enabled. Query execution is disabled only if the table has a sharding key.
2 β Enabled. Query execution is disabled regardless of whether a sharding key is defined for the table.
force_optimize_skip_unused_shards_nesting
β
Type
Default value
Type
UInt64
Default value
0
Controls
force_optimize_skip_unused_shards
(hence still requires
force_optimize_skip_unused_shards
) depends on the nesting level of the distributed query (case when you have
Distributed
table that look into another
Distributed
table).
Possible values:
0 - Disabled,
force_optimize_skip_unused_shards
works always.
1 β Enables
force_optimize_skip_unused_shards
only for the first level.
2 β Enables
force_optimize_skip_unused_shards
up to the second level.
force_primary_key
β
Type
Default value
Type
Bool
Default value
0
Disables query execution if indexing by the primary key is not possible.
Works with tables in the MergeTree family.
If
force_primary_key=1
, ClickHouse checks to see if the query has a primary key condition that can be used for restricting data ranges. If there is no suitable condition, it throws an exception. However, it does not check whether the condition reduces the amount of data to read. For more information about data ranges in MergeTree tables, see
MergeTree
.
force_remove_data_recursively_on_drop
β
Type
Default value
Type
Bool
Default value
0
Recursively remove data on DROP query. Avoids 'Directory not empty' error, but may silently remove detached data
formatdatetime_e_with_space_padding
β
Type
Default value
Type
Bool
Default value
0
Formatter '%e' in function 'formatDateTime' prints single-digit days with a leading space, e.g. ' 2' instead of '2'.
formatdatetime_f_prints_scale_number_of_digits
β
Type
Default value
Type
Bool
Default value
0
Formatter '%f' in function 'formatDateTime' prints only the scale amount of digits for a DateTime64 instead of fixed 6 digits.
formatdatetime_f_prints_single_zero
β
Type
Default value
Type
Bool
Default value
0
Formatter '%f' in function 'formatDateTime' prints a single zero instead of six zeros if the formatted value has no fractional seconds.
formatdatetime_format_without_leading_zeros
β
Type
Default value
Type
Bool
Default value
0
Formatters '%c', '%l' and '%k' in function 'formatDateTime' print months and hours without leading zeros.
formatdatetime_parsedatetime_m_is_month_name
β
Type
Default value
Type
Bool
Default value
1
Formatter '%M' in functions 'formatDateTime' and 'parseDateTime' print/parse the month name instead of minutes.
Type
Default value
Type
Bool
Default value
1
Enables or disables
fsync
when writing
.sql
files. Enabled by default.
It makes sense to disable it if the server has millions of tiny tables that are constantly being created and destroyed.
function_date_trunc_return_type_behavior
β
Type
Default value
Type
UInt64
Default value
0
Allows to change the behaviour of the result type of
dateTrunc
function.
Possible values:
0 - When the second argument is
DateTime64/Date32
the return type will be
DateTime64/Date32
regardless of the time unit in the first argument.
1 - For
Date32
the result is always
Date
. For
DateTime64
the result is
DateTime
for time units
second
and higher.
function_implementation
β
Choose function implementation for specific target or variant (experimental). If empty enable all of them.
function_json_value_return_type_allow_complex
β
Type
Default value
Type
Bool
Default value
0
Control whether allow to return complex type (such as: struct, array, map) for json_value function.
SELECT JSON_VALUE('{"hello":{"world":"!"}}', '$.hello') settings function_json_value_return_type_allow_complex=true
ββJSON_VALUE('{"hello":{"world":"!"}}', '$.hello')ββ
β {"world":"!"} β
ββββββββββββββββββββββββββββββββββββββββββββββββββββ
1 row in set. Elapsed: 0.001 sec.
Possible values:
true β Allow.
false β Disallow.
function_json_value_return_type_allow_nullable
β
Type
Default value
Type
Bool
Default value
0
Control whether allow to return
NULL
when value is not exist for JSON_VALUE function.
SELECT JSON_VALUE('{"hello":"world"}', '$.b') settings function_json_value_return_type_allow_nullable=true;
ββJSON_VALUE('{"hello":"world"}', '$.b')ββ
β α΄Ία΅α΄Έα΄Έ β
ββββββββββββββββββββββββββββββββββββββββββ
1 row in set. Elapsed: 0.001 sec.
Possible values:
true β Allow.
false β Disallow.
function_locate_has_mysql_compatible_argument_order
β
Type
Default value
Type
Bool
Default value
1
Controls the order of arguments in function
locate
.
Possible values:
0 β Function
locate
accepts arguments
(haystack, needle[, start_pos])
.
1 β Function
locate
accepts arguments
(needle, haystack, [, start_pos])
(MySQL-compatible behavior)
function_range_max_elements_in_block
β
Type
Default value
Type
UInt64
Default value
500000000
Sets the safety threshold for data volume generated by function
range
. Defines the maximum number of values generated by function per block of data (sum of array sizes for every row in a block).
Possible values:
Positive integer.
See Also
max_block_size
min_insert_block_size_rows
function_sleep_max_microseconds_per_block
β
Type
Default value
Type
UInt64
Default value
3000000
Maximum number of microseconds the function
sleep
is allowed to sleep for each block. If a user called it with a larger value, it throws an exception. It is a safety threshold.
function_visible_width_behavior
β
Type
Default value
Type
UInt64
Default value
1
The version of
visibleWidth
behavior. 0 - only count the number of code points; 1 - correctly count zero-width and combining characters, count full-width characters as two, estimate the tab width, count delete characters.
functions_h3_default_if_invalid
β
Type
Default value
Type
Bool
Default value
0
If false, h3 functions, e.g. h3CellAreaM2, throw an exception if input is invalid. If true, they return 0 or default value.
geo_distance_returns_float64_on_float64_arguments
β
Type
Default value
Type
Bool
Default value
1
If all four arguments to
geoDistance
,
greatCircleDistance
,
greatCircleAngle
functions are Float64, return Float64 and use double precision for internal calculations. In previous ClickHouse versions, the functions always returned Float32.
geotoh3_argument_order
β
Type
Default value
Type
GeoToH3ArgumentOrder
Default value
lat_lon
Function 'geoToH3' accepts (lon, lat) if set to 'lon_lat' and (lat, lon) if set to 'lat_lon'.
glob_expansion_max_elements
β
Type
Default value
Type
UInt64
Default value
1000
Maximum number of allowed addresses (For external storages, table functions, etc).
grace_hash_join_initial_buckets
β
Type
Default value
Type
NonZeroUInt64
Default value
1
Initial number of grace hash join buckets
grace_hash_join_max_buckets
β
Type
Default value
Type
NonZeroUInt64
Default value
1024
Limit on the number of grace hash join buckets
group_by_overflow_mode
β
Type
Default value
Type
OverflowModeGroupBy
Default value
throw
Sets what happens when the number of unique keys for aggregation exceeds the limit:
throw
: throw an exception
break
: stop executing the query and return the partial result
any
: continue aggregation for the keys that got into the set, but do not add new keys to the set.
Using the 'any' value lets you run an approximation of GROUP BY. The quality of
this approximation depends on the statistical nature of the data.
group_by_two_level_threshold
β
Type
Default value
Type
UInt64
Default value
100000
From what number of keys, a two-level aggregation starts. 0 - the threshold is not set.
group_by_two_level_threshold_bytes
β
Type
Default value
Type
UInt64
Default value
50000000
From what size of the aggregation state in bytes, a two-level aggregation begins to be used. 0 - the threshold is not set. Two-level aggregation is used when at least one of the thresholds is triggered.
group_by_use_nulls
β
Type
Default value
Type
Bool
Default value
0
Changes the way the
GROUP BY clause
treats the types of aggregation keys.
When the
ROLLUP
,
CUBE
, or
GROUPING SETS
specifiers are used, some aggregation keys may not be used to produce some result rows.
Columns for these keys are filled with either default value or
NULL
in corresponding rows depending on this setting.
Possible values:
0 β The default value for the aggregation key type is used to produce missing values.
1 β ClickHouse executes
GROUP BY
the same way as the SQL standard says. The types of aggregation keys are converted to
Nullable
. Columns for corresponding aggregation keys are filled with
NULL
for rows that didn't use it.
See also:
GROUP BY clause
h3togeo_lon_lat_result_order
β
Type
Default value
Type
Bool
Default value
0
Function 'h3ToGeo' returns (lon, lat) if true, otherwise (lat, lon).
handshake_timeout_ms
β
Type
Default value
Type
Milliseconds
Default value
10000
Timeout in milliseconds for receiving Hello packet from replicas during handshake.
hdfs_create_new_file_on_insert
β
Type
Default value
Type
Bool
Default value
0
Enables or disables creating a new file on each insert in HDFS engine tables. If enabled, on each insert a new HDFS file will be created with the name, similar to this pattern:
initial:
data.Parquet.gz
->
data.1.Parquet.gz
->
data.2.Parquet.gz
, etc.
Possible values:
0 β
INSERT
query appends new data to the end of the file.
1 β
INSERT
query creates a new file.
hdfs_ignore_file_doesnt_exist
β
Type
Default value
Type
Bool
Default value
0
Ignore absence of file if it does not exist when reading certain keys.
Possible values:
1 β
SELECT
returns empty result.
0 β
SELECT
throws an exception.
hdfs_replication
β
Type
Default value
Type
UInt64
Default value
0
The actual number of replications can be specified when the hdfs file is created.
hdfs_skip_empty_files
β
Type
Default value
Type
Bool
Default value
0
Enables or disables skipping empty files in
HDFS
engine tables.
Possible values:
0 β
SELECT
throws an exception if empty file is not compatible with requested format.
1 β
SELECT
returns empty result for empty file.
hdfs_throw_on_zero_files_match
β
Type
Default value
Type
Bool
Default value
0
Throw an error if matched zero files according to glob expansion rules.
Possible values:
1 β
SELECT
throws an exception.
0 β
SELECT
returns empty result.
hdfs_truncate_on_insert
β
Type
Default value
Type
Bool
Default value
0
Enables or disables truncation before an insert in hdfs engine tables. If disabled, an exception will be thrown on an attempt to insert if a file in HDFS already exists.
Possible values:
0 β
INSERT
query appends new data to the end of the file.
1 β
INSERT
query replaces existing content of the file with the new data.
hedged_connection_timeout_ms
β
Type
Default value
Type
Milliseconds
Default value
50
Connection timeout for establishing connection with replica for Hedged requests
highlight_max_matches_per_row
β
Type
Default value
Type
UInt64
Default value
10000
Sets the maximum number of highlight matches per row in the
highlight
function. Use it to protect against excessive memory usage when highlighting highly repetitive patterns in large texts.
Possible values:
Positive integer.
hnsw_candidate_list_size_for_search
β
Type
Default value
Type
UInt64
Default value
256
The size of the dynamic candidate list when searching the vector similarity index, also known as 'ef_search'.
hsts_max_age
β
Type
Default value
Type
UInt64
Default value
0
Expired time for HSTS. 0 means disable HSTS.
http_connection_timeout
β
Type
Default value
Type
Seconds
Default value
1
HTTP connection timeout (in seconds).
Possible values:
Any positive integer.
0 - Disabled (infinite timeout).
Type
Default value
Type
UInt64
Default value
100
Do not send HTTP headers X-ClickHouse-Progress more frequently than at each specified interval.
http_make_head_request
β
Type
Default value
Type
Bool
Default value
1
The
http_make_head_request
setting allows the execution of a
HEAD
request while reading data from HTTP to retrieve information about the file to be read, such as its size. Since it's enabled by default, it may be desirable to disable this setting in cases where the server does not support
HEAD
requests.
http_max_field_name_size
β
Type
Default value
Type
UInt64
Default value
131072
Maximum length of field name in HTTP header
http_max_field_value_size
β
Type
Default value
Type
UInt64
Default value
131072
Maximum length of field value in HTTP header
http_max_fields
β
Type
Default value
Type
UInt64
Default value
1000000
Maximum number of fields in HTTP header
http_max_multipart_form_data_size
β
Type
Default value
Type
UInt64
Default value
1073741824
Limit on size of multipart/form-data content. This setting cannot be parsed from URL parameters and should be set in a user profile. Note that content is parsed and external tables are created in memory before the start of query execution. And this is the only limit that has an effect on that stage (limits on max memory usage and max execution time have no effect while reading HTTP form data).
http_max_request_param_data_size
β
Type
Default value
Type
UInt64
Default value
10485760
Limit on size of request data used as a query parameter in predefined HTTP requests.
http_max_tries
β
Type
Default value
Type
UInt64
Default value
10
Max attempts to read via http.
http_max_uri_size
β
Type
Default value
Type
UInt64
Default value
1048576
Sets the maximum URI length of an HTTP request.
Possible values:
Positive integer.
http_native_compression_disable_checksumming_on_decompress
β
Type
Default value
Type
Bool
Default value
0
Enables or disables checksum verification when decompressing the HTTP POST data from the client. Used only for ClickHouse native compression format (not used with
gzip
or
deflate
).
For more information, read the
HTTP interface description
.
Possible values:
0 β Disabled.
1 β Enabled.
http_receive_timeout
β
Type
Default value
Type
Seconds
Default value
30
HTTP receive timeout (in seconds).
Possible values:
Any positive integer.
0 - Disabled (infinite timeout).
http_response_buffer_size
β
Type
Default value
Type
UInt64
Default value
0
The number of bytes to buffer in the server memory before sending a HTTP response to the client or flushing to disk (when http_wait_end_of_query is enabled).
Type
Default value
Type
Map
Default value
{}
Allows to add or override HTTP headers which the server will return in the response with a successful query result.
This only affects the HTTP interface.
If the header is already set by default, the provided value will override it.
If the header was not set by default, it will be added to the list of headers.
Headers that are set by the server by default and not overridden by this setting, will remain.
The setting allows you to set a header to a constant value. Currently there is no way to set a header to a dynamically calculated value.
Neither names or values can contain ASCII control characters.
If you implement a UI application which allows users to modify settings but at the same time makes decisions based on the returned headers, it is recommended to restrict this setting to readonly.
Example:
SET http_response_headers = '{"Content-Type": "image/png"}'
http_retry_initial_backoff_ms
β
Type
Default value
Type
UInt64
Default value
100
Min milliseconds for backoff, when retrying read via http
http_retry_max_backoff_ms
β
Type
Default value
Type
UInt64
Default value
10000
Max milliseconds for backoff, when retrying read via http
http_send_timeout
β
Type
Default value
Type
Seconds
Default value
30
HTTP send timeout (in seconds).
Possible values:
Any positive integer.
0 - Disabled (infinite timeout).
Note
It's applicable only to the default profile. A server reboot is required for the changes to take effect.
http_skip_not_found_url_for_globs
β
Type
Default value
Type
Bool
Default value
1
Skip URLs for globs with HTTP_NOT_FOUND error
http_wait_end_of_query
β
Type
Default value
Type
Bool
Default value
0
Enable HTTP response buffering on the server-side.
http_write_exception_in_output_format
β
Type
Default value
Type
Bool
Default value
0
Write exception in output format to produce valid output. Works with JSON and XML formats.
http_zlib_compression_level
β
Type
Default value
Type
Int64
Default value
3
Sets the level of data compression in the response to an HTTP request if
enable_http_compression = 1
.
Possible values: Numbers from 1 to 9.
iceberg_delete_data_on_drop
β
Type
Default value
Type
Bool
Default value
0
Whether to delete all iceberg files on drop or not.
iceberg_expire_default_max_ref_age_ms
β
Type
Default value
Type
Int64
Default value
9223372036854775807
Default value for Iceberg table property
history.expire.max-ref-age-ms
used by
expire_snapshots
when that property is absent.
iceberg_expire_default_max_snapshot_age_ms
β
Type
Default value
Type
Int64
Default value
432000000
Default value for Iceberg table property
history.expire.max-snapshot-age-ms
used by
expire_snapshots
when that property is absent.
iceberg_expire_default_min_snapshots_to_keep
β
Type
Default value
Type
Int64
Default value
1
Default value for Iceberg table property
history.expire.min-snapshots-to-keep
used by
expire_snapshots
when that property is absent.
iceberg_insert_max_bytes_in_data_file
β
Type
Default value
Type
UInt64
Default value
1073741824
Max bytes of iceberg parquet data file on insert operation.
iceberg_insert_max_partitions
β
Type
Default value
Type
UInt64
Default value
100
Max allowed partitions count per one insert operation for Iceberg table engine.
iceberg_insert_max_rows_in_data_file
β
Type
Default value
Type
UInt64
Default value
1000000
Max rows of iceberg parquet data file on insert operation.
Method to compress
.metadata.json
file.
Type
Default value
Type
IcebergMetadataLogLevel
Default value
none
Controls the level of metadata logging for Iceberg tables to system.iceberg_metadata_log.
Usually this setting can be modified for debugging purposes.
Possible values:
none - No metadata log.
metadata - Root metadata.json file.
manifest_list_metadata - Everything above + metadata from avro manifest list which corresponds to a snapshot.
manifest_list_entry - Everything above + avro manifest list entries.
manifest_file_metadata - Everything above + metadata from traversed avro manifest files.
manifest_file_entry - Everything above + traversed avro manifest files entries.
Type
Default value
Type
UInt64
Default value
0
If non-zero, skip fetching iceberg metadata from remote catalog if there is a cached metadata snapshot, more recent than the given staleness window. Zero means to always fetch the latest metadata version from the remote catalog. Setting this a non-zero trades staleness to a lower latency of read operations.
iceberg_snapshot_id
β
Type
Default value
Type
Int64
Default value
0
Query Iceberg table using the specific snapshot id.
iceberg_timestamp_ms
β
Type
Default value
Type
Int64
Default value
0
Query Iceberg table using the snapshot that was current at a specific timestamp.
idle_connection_timeout
β
Type
Default value
Type
UInt64
Default value
3600
Timeout to close idle TCP connections after specified number of seconds.
Possible values:
Positive integer (0 - close immediately, after 0 seconds).
ignore_cold_parts_seconds
β
ClickHouse Cloud only
Type
Default value
Type
Int64
Default value
0
Only has an effect in ClickHouse Cloud. Exclude new data parts from SELECT queries until they're either pre-warmed (see
cache_populated_by_fetch
) or this many seconds old. Only for Replicated-/SharedMergeTree.
ignore_data_skipping_indices
β
Ignores the skipping indexes specified if used by the query.
Consider the following example:
CREATE TABLE data
(
key Int,
x Int,
y Int,
INDEX x_idx x TYPE minmax GRANULARITY 1,
INDEX y_idx y TYPE minmax GRANULARITY 1,
INDEX xy_idx (x,y) TYPE minmax GRANULARITY 1
)
Engine=MergeTree()
ORDER BY key;
INSERT INTO data VALUES (1, 2, 3);
SELECT * FROM data;
SELECT * FROM data SETTINGS ignore_data_skipping_indices=''; -- query will produce CANNOT_PARSE_TEXT error.
SELECT * FROM data SETTINGS ignore_data_skipping_indices='x_idx'; -- Ok.
SELECT * FROM data SETTINGS ignore_data_skipping_indices='na_idx'; -- Ok.
SELECT * FROM data WHERE x = 1 AND y = 1 SETTINGS ignore_data_skipping_indices='xy_idx',force_data_skipping_indices='xy_idx' ; -- query will produce INDEX_NOT_USED error, since xy_idx is explicitly ignored.
SELECT * FROM data WHERE x = 1 AND y = 2 SETTINGS ignore_data_skipping_indices='xy_idx';
The query without ignoring any indexes:
EXPLAIN indexes = 1 SELECT * FROM data WHERE x = 1 AND y = 2;
Expression ((Projection + Before ORDER BY))
Filter (WHERE)
ReadFromMergeTree (default.data)
Indexes:
PrimaryKey
Condition: true
Parts: 1/1
Granules: 1/1
Skip
Name: x_idx
Description: minmax GRANULARITY 1
Parts: 0/1
Granules: 0/1
Skip
Name: y_idx
Description: minmax GRANULARITY 1
Parts: 0/0
Granules: 0/0
Skip
Name: xy_idx
Description: minmax GRANULARITY 1
Parts: 0/0
Granules: 0/0
Ignoring the
xy_idx
index:
EXPLAIN indexes = 1 SELECT * FROM data WHERE x = 1 AND y = 2 SETTINGS ignore_data_skipping_indices='xy_idx';
Expression ((Projection + Before ORDER BY))
Filter (WHERE)
ReadFromMergeTree (default.data)
Indexes:
PrimaryKey
Condition: true
Parts: 1/1
Granules: 1/1
Skip
Name: x_idx
Description: minmax GRANULARITY 1
Parts: 0/1
Granules: 0/1
Skip
Name: y_idx
Description: minmax GRANULARITY 1
Parts: 0/0
Granules: 0/0
Works with tables in the MergeTree family.
ignore_drop_queries_probability
β
Type
Default value
Type
Float
Default value
0
If enabled, server will ignore all DROP table queries with specified probability (for Memory and JOIN engines it will replace DROP to TRUNCATE). Used for testing purposes
ignore_format_null_for_explain
β
Type
Default value
Type
Bool
Default value
1
If enabled,
FORMAT Null
will be ignored for
EXPLAIN
queries and default output format will be used instead.
When disabled,
EXPLAIN
queries with
FORMAT Null
will produce no output (backward compatible behavior).
ignore_materialized_views_with_dropped_target_table
β
Type
Default value
Type
Bool
Default value
0
Ignore MVs with dropped target table during pushing to views
ignore_on_cluster_for_replicated_access_entities_queries
β
Type
Default value
Type
Bool
Default value
0
Ignore ON CLUSTER clause for replicated access entities management queries.
ignore_on_cluster_for_replicated_database
β
Type
Default value
Type
Bool
Default value
0
Always ignore ON CLUSTER clause for DDL queries with replicated databases.
ignore_on_cluster_for_replicated_named_collections_queries
β
Type
Default value
Type
Bool
Default value
0
Ignore ON CLUSTER clause for replicated named collections management queries.
ignore_on_cluster_for_replicated_udf_queries
β
Type
Default value
Type
Bool
Default value
0
Ignore ON CLUSTER clause for replicated UDF management queries.
implicit_select
β
Type
Default value
Type
Bool
Default value
0
Allow writing simple SELECT queries without the leading SELECT keyword, which makes it simple for calculator-style usage, e.g.
1 + 2
becomes a valid query.
In
clickhouse-local
it is enabled by default and can be explicitly disabled.
implicit_table_at_top_level
β
If not empty, queries without FROM at the top level will read from this table instead of system.one.
This is used in clickhouse-local for input data processing.
The setting could be set explicitly by a user but is not intended for this type of usage.
Subqueries are not affected by this setting (neither scalar, FROM, or IN subqueries).
SELECTs at the top level of UNION, INTERSECT, EXCEPT chains are treated uniformly and affected by this setting, regardless of their grouping in parentheses.
It is unspecified how this setting affects views and distributed queries.
The setting accepts a table name (then the table is resolved from the current database) or a qualified name in the form of 'database.table'.
Both database and table names have to be unquoted - only simple identifiers are allowed.
implicit_transaction
β
Type
Default value
Type
Bool
Default value
0
If enabled and not already inside a transaction, wraps the query inside a full transaction (begin + commit or rollback)
inject_random_order_for_select_without_order_by
β
Type
Default value
Type
Bool
Default value
0
If enabled, injects 'ORDER BY rand()' into SELECT queries without ORDER BY clause.
Applied only for subquery depth = 0. Subqueries and INSERT INTO ... SELECT are not affected.
If the top-level construct is UNION, 'ORDER BY rand()' is injected into all children independently.
Only useful for testing and development (missing ORDER BY is a source of non-deterministic query results).
insert_allow_materialized_columns
β
Type
Default value
Type
Bool
Default value
0
If setting is enabled, Allow materialized columns in INSERT.
insert_deduplicate
β
Type
Default value
Type
Bool
Default value
1
Enables or disables block deduplication of
INSERT
(for Replicated* tables).
Possible values:
0 β Disabled.
1 β Enabled.
By default, blocks inserted into replicated tables by the
INSERT
statement are deduplicated (see
Data Replication
).
For the replicated tables by default the only 100 of the most recent blocks for each partition are deduplicated (see
replicated_deduplication_window
,
replicated_deduplication_window_seconds
).
For not replicated tables see
non_replicated_deduplication_window
.
insert_deduplication_token
β
The setting allows a user to provide own deduplication semantic in MergeTree/ReplicatedMergeTree
For example, by providing a unique value for the setting in each INSERT statement,
user can avoid the same inserted data being deduplicated.
Possible values:
Any string
insert_deduplication_token
is used for deduplication
only
when not empty.
For the replicated tables by default the only 100 of the most recent inserts for each partition are deduplicated (see
replicated_deduplication_window
,
replicated_deduplication_window_seconds
).
For not replicated tables see
non_replicated_deduplication_window
.
Note
insert_deduplication_token
works on a partition level (the same as
insert_deduplication
checksum). Multiple partitions can have the same
insert_deduplication_token
.
Example:
CREATE TABLE test_table
( A Int64 )
ENGINE = MergeTree
ORDER BY A
SETTINGS non_replicated_deduplication_window = 100;
INSERT INTO test_table SETTINGS insert_deduplication_token = 'test' VALUES (1);
-- the next insert won't be deduplicated because insert_deduplication_token is different
INSERT INTO test_table SETTINGS insert_deduplication_token = 'test1' VALUES (1);
-- the next insert will be deduplicated because insert_deduplication_token
-- is the same as one of the previous
INSERT INTO test_table SETTINGS insert_deduplication_token = 'test' VALUES (2);
SELECT * FROM test_table
ββAββ
β 1 β
βββββ
ββAββ
β 1 β
βββββ
insert_keeper_fault_injection_probability
β
Type
Default value
Type
Float
Default value
0
Approximate probability of failure for a keeper request during insert. Valid value is in interval [0.0f, 1.0f]
insert_keeper_fault_injection_seed
β
Type
Default value
Type
UInt64
Default value
0
0 - random seed, otherwise the setting value
insert_keeper_max_retries
β
Type
Default value
Type
UInt64
Default value
20
The setting sets the maximum number of retries for ClickHouse Keeper (or ZooKeeper) requests during insert into replicated MergeTree. Only Keeper requests which failed due to network error, Keeper session timeout, or request timeout are considered for retries.
Possible values:
Positive integer.
0 β Retries are disabled
Cloud default value:
20
.
Keeper request retries are done after some timeout. The timeout is controlled by the following settings:
insert_keeper_retry_initial_backoff_ms
,
insert_keeper_retry_max_backoff_ms
.
The first retry is done after
insert_keeper_retry_initial_backoff_ms
timeout. The consequent timeouts will be calculated as follows:
timeout = min(insert_keeper_retry_max_backoff_ms, latest_timeout * 2)
For example, if
insert_keeper_retry_initial_backoff_ms=100
,
insert_keeper_retry_max_backoff_ms=10000
and
insert_keeper_max_retries=8
then timeouts will be
100, 200, 400, 800, 1600, 3200, 6400, 10000
.
Apart from fault tolerance, the retries aim to provide a better user experience - they allow to avoid returning an error during INSERT execution if Keeper is restarted, for example, due to an upgrade.
insert_keeper_retry_initial_backoff_ms
β
Type
Default value
Type
UInt64
Default value
100
Initial timeout(in milliseconds) to retry a failed Keeper request during INSERT query execution
Possible values:
Positive integer.
0 β No timeout
insert_keeper_retry_max_backoff_ms
β
Type
Default value
Type
UInt64
Default value
10000
Maximum timeout (in milliseconds) to retry a failed Keeper request during INSERT query execution
Possible values:
Positive integer.
0 β Maximum timeout is not limited
insert_null_as_default
β
Type
Default value
Type
Bool
Default value
1
Enables or disables the insertion of
default values
instead of
NULL
into columns with not
nullable
data type.
If column type is not nullable and this setting is disabled, then inserting
NULL
causes an exception. If column type is nullable, then
NULL
values are inserted as is, regardless of this setting.
This setting is applicable to
INSERT ... SELECT
queries. Note that
SELECT
subqueries may be concatenated with
UNION ALL
clause.
Possible values:
0 β Inserting
NULL
into a not nullable column causes an exception.
1 β Default column value is inserted instead of
NULL
.
insert_quorum
β
Type
Default value
Type
UInt64Auto
Default value
0
Enables the quorum writes.
If
insert_quorum < 2
, the quorum writes are disabled.
If
insert_quorum >= 2
, the quorum writes are enabled.
If
insert_quorum = 'auto'
, use majority number (
number_of_replicas / 2 + 1
) as quorum number.
Quorum writes
INSERT
succeeds only when ClickHouse manages to correctly write data to the
insert_quorum
of replicas during the
insert_quorum_timeout
. If for any reason the number of replicas with successful writes does not reach the
insert_quorum
, the write is considered failed and ClickHouse will delete the inserted block from all the replicas where data has already been written.
When
insert_quorum_parallel
is disabled, all replicas in the quorum are consistent, i.e. they contain data from all previous
INSERT
queries (the
INSERT
sequence is linearized). When reading data written using
insert_quorum
and
insert_quorum_parallel
is disabled, you can turn on sequential consistency for
SELECT
queries using
select_sequential_consistency
.
ClickHouse generates an exception:
If the number of available replicas at the time of the query is less than the
insert_quorum
.
When
insert_quorum_parallel
is disabled and an attempt to write data is made when the previous block has not yet been inserted in
insert_quorum
of replicas. This situation may occur if the user tries to perform another
INSERT
query to the same table before the previous one with
insert_quorum
is completed.
See also:
insert_quorum_timeout
insert_quorum_parallel
select_sequential_consistency
insert_quorum_parallel
β
Type
Default value
Type
Bool
Default value
1
Enables or disables parallelism for quorum
INSERT
queries. If enabled, additional
INSERT
queries can be sent while previous queries have not yet finished. If disabled, additional writes to the same table will be rejected.
Possible values:
0 β Disabled.
1 β Enabled.
See also:
insert_quorum
insert_quorum_timeout
select_sequential_consistency
insert_quorum_timeout
β
Type
Default value
Type
Milliseconds
Default value
600000
Write to a quorum timeout in milliseconds. If the timeout has passed and no write has taken place yet, ClickHouse will generate an exception and the client must repeat the query to write the same block to the same or any other replica.
See also:
insert_quorum
insert_quorum_parallel
select_sequential_consistency
insert_shard_id
β
Type
Default value
Type
UInt64
Default value
0
If not
0
, specifies the shard of
Distributed
table into which the data will be inserted synchronously.
If
insert_shard_id
value is incorrect, the server will throw an exception.
To get the number of shards on
requested_cluster
, you can check server config or use this query:
SELECT uniq(shard_num) FROM system.clusters WHERE cluster = 'requested_cluster';
Possible values:
0 β Disabled.
Any number from
1
to
shards_num
of corresponding
Distributed
table.
Example
Query:
CREATE TABLE x AS system.numbers ENGINE = MergeTree ORDER BY number;
CREATE TABLE x_dist AS x ENGINE = Distributed('test_cluster_two_shards_localhost', currentDatabase(), x);
INSERT INTO x_dist SELECT * FROM numbers(5) SETTINGS insert_shard_id = 1;
SELECT * FROM x_dist ORDER BY number ASC;
Result:
ββnumberββ
β 0 β
β 0 β
β 1 β
β 1 β
β 2 β
β 2 β
β 3 β
β 3 β
β 4 β
β 4 β
ββββββββββ
interactive_delay
β
Type
Default value
Type
UInt64
Default value
100000
The interval in microseconds for checking whether request execution has been canceled and sending the progress.
intersect_default_mode
β
Type
Default value
Type
SetOperationMode
Default value
ALL
Set default mode in INTERSECT query. Possible values: empty string, 'ALL', 'DISTINCT'. If empty, query without mode will throw exception.
jemalloc_collect_profile_samples_in_trace_log
β
Type
Default value
Type
Bool
Default value
0
Collect jemalloc allocation and deallocation samples in trace log.
jemalloc_enable_profiler
β
Type
Default value
Type
Bool
Default value
0
Enable jemalloc profiler for the query. Jemalloc will sample allocations and all deallocations for sampled allocations.
Profiles can be flushed using SYSTEM JEMALLOC FLUSH PROFILE which can be used for allocation analysis.
Samples can also be stored in system.trace_log using config jemalloc_collect_global_profile_samples_in_trace_log or with query setting jemalloc_collect_profile_samples_in_trace_log.
See
Allocation Profiling
jemalloc_profile_text_collapsed_use_count
β
Type
Default value
Type
Bool
Default value
0
When using the 'collapsed' output format for jemalloc heap profile, aggregate by allocation count instead of bytes. When false (default), each stack is weighted by live bytes; when true, by live allocation count.
jemalloc_profile_text_output_format
β
Type
Default value
Type
JemallocProfileFormat
Default value
collapsed
Output format for jemalloc heap profile in system.jemalloc_profile_text table. Can be: 'raw' (raw profile), 'symbolized' (jeprof format with symbols), or 'collapsed' (FlameGraph format).
jemalloc_profile_text_symbolize_with_inline
β
Type
Default value
Type
Bool
Default value
1
Whether to include inline frames when symbolizing jemalloc heap profile. When enabled, inline frames are included which can slow down symbolization process drastically; when disabled, they are skipped. Only affects 'symbolized' and 'collapsed' output formats.
join_algorithm
β
Type
Default value
Type
JoinAlgorithm
Default value
direct,parallel_hash,hash
Specifies which
JOIN
algorithm is used.
Several algorithms can be specified, and an available one would be chosen for a particular query based on kind/strictness and table engine.
Possible values:
grace_hash
Grace hash join
is used. Grace hash provides an algorithm option that provides performant complex joins while limiting memory use.
The first phase of a grace join reads the right table and splits it into N buckets depending on the hash value of key columns (initially, N is
grace_hash_join_initial_buckets
). This is done in a way to ensure that each bucket can be processed independently. Rows from the first bucket are added to an in-memory hash table while the others are saved to disk. If the hash table grows beyond the memory limit (e.g., as set by
max_bytes_in_join
, the number of buckets is increased and the assigned bucket for each row. Any rows which don't belong to the current bucket are flushed and reassigned.
Supports
INNER/LEFT/RIGHT/FULL ALL/ANY JOIN
.
hash
Hash join algorithm
is used. The most generic implementation that supports all combinations of kind and strictness and multiple join keys that are combined with
OR
in the
JOIN ON
section.
When using the
hash
algorithm, the right part of
JOIN
is uploaded into RAM.
parallel_hash
A variation of
hash
join that splits the data into buckets and builds several hashtables instead of one concurrently to speed up this process.
When using the
parallel_hash
algorithm, the right part of
JOIN
is uploaded into RAM.
partial_merge
A variation of the
sort-merge algorithm
, where only the right table is fully sorted.
The
RIGHT JOIN
and
FULL JOIN
are supported only with
ALL
strictness (
SEMI
,
ANTI
,
ANY
, and
ASOF
are not supported).
When using the
partial_merge
algorithm, ClickHouse sorts the data and dumps it to the disk. The
partial_merge
algorithm in ClickHouse differs slightly from the classic realization. First, ClickHouse sorts the right table by joining keys in blocks and creates a min-max index for sorted blocks. Then it sorts parts of the left table by the
join key
and joins them over the right table. The min-max index is also used to skip unneeded right table blocks.
direct
The
direct
(also known as nested loop) algorithm performs a lookup in the right table using rows from the left table as keys.
It's supported by special storages such as
Dictionary
,
EmbeddedRocksDB
, and
MergeTree
tables.
For MergeTree tables, the algorithm pushes join key filters directly to the storage layer. This can be more efficient when the key can use the table's primary key index for lookups, otherwise it performs full scans of the right table for each left table block.
Supports
INNER
and
LEFT
joins and only single-column equality join keys without other conditions.
auto
When set to
auto
,
hash
join is tried first, and the algorithm is switched on the fly to another algorithm if the memory limit is violated.
full_sorting_merge
Sort-merge algorithm
with full sorting of joined tables before joining.
prefer_partial_merge
ClickHouse always tries to use
partial_merge
join if possible, otherwise, it uses
hash
.
Deprecated
, same as
partial_merge,hash
.
default (deprecated)
Legacy value, please don't use anymore.
Same as
direct,hash
, i.e. try to use direct join and hash join (in this order).
join_any_take_last_row
β
Type
Default value
Type
Bool
Default value
0
Changes the behaviour of join operations with
ANY
strictness.
Note
This setting applies only for
JOIN
operations with
Join
engine tables.
Possible values:
0 β If the right table has more than one matching row, only the first one found is joined.
1 β If the right table has more than one matching row, only the last one found is joined.
See also:
JOIN clause
Join table engine
join_default_strictness
join_default_strictness
β
Type
Default value
Type
JoinStrictness
Default value
ALL
Sets default strictness for
JOIN clauses
.
Possible values:
ALL
β If the right table has several matching rows, ClickHouse creates a
Cartesian product
from matching rows. This is the normal
JOIN
behaviour from standard SQL.
ANY
β If the right table has several matching rows, only the first one found is joined. If the right table has only one matching row, the results of
ANY
and
ALL
are the same.
ASOF
β For joining sequences with an uncertain match.
Empty string
β If
ALL
or
ANY
is not specified in the query, ClickHouse throws an exception.
join_on_disk_max_files_to_merge
β
Type
Default value
Type
UInt64
Default value
64
Limits the number of files allowed for parallel sorting in MergeJoin operations when they are executed on disk.
The bigger the value of the setting, the more RAM is used and the less disk I/O is needed.
Possible values:
Any positive integer, starting from 2.
join_output_by_rowlist_perkey_rows_threshold
β
Type
Default value
Type
UInt64
Default value
5
The lower limit of per-key average rows in the right table to determine whether to output by row list in hash join.
join_overflow_mode
β
Type
Default value
Type
OverflowMode
Default value
throw
Defines what action ClickHouse performs when any of the following join limits is reached:
max_bytes_in_join
max_rows_in_join
Possible values:
THROW
β ClickHouse throws an exception and breaks operation.
BREAK
β ClickHouse breaks operation and does not throw an exception.
Default value:
THROW
.
See Also
JOIN clause
Join table engine
join_runtime_bloom_filter_bytes
β
Type
Default value
Type
UInt64
Default value
524288
Size in bytes of a bloom filter used as JOIN runtime filter (see enable_join_runtime_filters setting).
join_runtime_bloom_filter_hash_functions
β
Type
Default value
Type
UInt64
Default value
3
Number of hash functions in a bloom filter used as JOIN runtime filter (see enable_join_runtime_filters setting).
join_runtime_bloom_filter_max_ratio_of_set_bits
β
Type
Default value
Type
Double
Default value
0.7
If the number of set bits in a runtime bloom filter exceeds this ratio the filter is completely disabled to reduce the overhead.
join_runtime_filter_blocks_to_skip_before_reenabling
β
Type
Default value
Type
UInt64
Default value
30
Number of blocks that are skipped before trying to dynamically re-enable a runtime filter that previously was disabled due to poor filtering ratio.
join_runtime_filter_exact_values_limit
β
Type
Default value
Type
UInt64
Default value
10000
Maximum number of elements in runtime filter that are stored as is in a set, when this threshold is exceeded it switches to bloom filter.
join_runtime_filter_pass_ratio_threshold_for_disabling
β
Type
Default value
Type
Double
Default value
0.7
If ratio of passed rows to checked rows is greater than this threshold the runtime filter is considered as poorly performing and is disabled for the next
join_runtime_filter_blocks_to_skip_before_reenabling
blocks to reduce the overhead.
join_to_sort_maximum_table_rows
β
Type
Default value
Type
UInt64
Default value
10000
The maximum number of rows in the right table to determine whether to rerange the right table by key in left or inner join.
join_to_sort_minimum_perkey_rows
β
Type
Default value
Type
UInt64
Default value
40
The lower limit of per-key average rows in the right table to determine whether to rerange the right table by key in left or inner join. This setting ensures that the optimization is not applied for sparse table keys
join_use_nulls
β
Type
Default value
Type
Bool
Default value
0
Sets the type of
JOIN
behaviour. When merging tables, empty cells may appear. ClickHouse fills them differently based on this setting.
Possible values:
0 β The empty cells are filled with the default value of the corresponding field type.
1 β
JOIN
behaves the same way as in standard SQL. The type of the corresponding field is converted to
Nullable
, and empty cells are filled with
NULL
.
joined_block_split_single_row
β
Type
Default value
Type
Bool
Default value
0
Allow to chunk hash join result by rows corresponding to single row from left table.
This may reduce memory usage in case of row with many matches in right table, but may increase CPU usage.
Note that
max_joined_block_size_rows != 0
is mandatory for this setting to have effect.
The
max_joined_block_size_bytes
combined with this setting is helpful to avoid excessive memory usage in case of skewed data with some large rows having many matches in right table.
joined_subquery_requires_alias
β
Type
Default value
Type
Bool
Default value
1
Force joined subqueries and table functions to have aliases for correct name qualification.
kafka_disable_num_consumers_limit
β
Type
Default value
Type
Bool
Default value
0
Disable limit on kafka_num_consumers that depends on the number of available CPU cores.
kafka_max_wait_ms
β
Type
Default value
Type
Milliseconds
Default value
5000
The wait time in milliseconds for reading messages from
Kafka
before retry.
Possible values:
Positive integer.
0 β Infinite timeout.
See also:
Apache Kafka
keeper_map_strict_mode
β
Type
Default value
Type
Bool
Default value
0
Enforce additional checks during operations on KeeperMap. E.g. throw an exception on an insert for already existing key
keeper_max_retries
β
Type
Default value
Type
UInt64
Default value
10
Max retries for general keeper operations
keeper_retry_initial_backoff_ms
β
Type
Default value
Type
UInt64
Default value
100
Initial backoff timeout for general keeper operations
keeper_retry_max_backoff_ms
β
Type
Default value
Type
UInt64
Default value
5000
Max backoff timeout for general keeper operations
least_greatest_legacy_null_behavior
β
Type
Default value
Type
Bool
Default value
0
If enabled, functions 'least' and 'greatest' return NULL if one of their arguments is NULL.
legacy_column_name_of_tuple_literal
β
Type
Default value
Type
Bool
Default value
0
List all names of element of large tuple literals in their column names instead of hash. This settings exists only for compatibility reasons. It makes sense to set to 'true', while doing rolling update of cluster from version lower than 21.7 to higher.
lightweight_delete_mode
β
Type
Default value
Type
LightweightDeleteMode
Default value
alter_update
A mode of internal update query that is executed as a part of lightweight delete.
Possible values:
alter_update
- run
ALTER UPDATE
query that creates a heavyweight mutation.
lightweight_update
- run lightweight update if possible, run
ALTER UPDATE
otherwise.
lightweight_update_force
- run lightweight update if possible, throw otherwise.
lightweight_deletes_sync
β
Type
Default value
Type
UInt64
Default value
2
The same as
mutations_sync
, but controls only execution of lightweight deletes.
Possible values:
Value
Description
0
Mutations execute asynchronously.
1
The query waits for the lightweight deletes to complete on the current server.
2
The query waits for the lightweight deletes to complete on all replicas (if they exist).
3
The query waits only for active replicas. Supported only for
SharedMergeTree
. For
ReplicatedMergeTree
it behaves the same as
mutations_sync = 2
.
See Also
Synchronicity of ALTER Queries
Mutations
Cloud default value:
1
.
limit
β
Type
Default value
Type
UInt64
Default value
0
Sets the maximum number of rows to get from the query result. It adjusts the value set by the
LIMIT
clause, so that the limit, specified in the query, cannot exceed the limit, set by this setting.
Possible values:
0 β The number of rows is not limited.
Positive integer.
load_balancing
β
Type
Default value
Type
LoadBalancing
Default value
random
Specifies the algorithm of replicas selection that is used for distributed query processing.
ClickHouse supports the following algorithms of choosing replicas:
Random
(by default)
Nearest hostname
Hostname levenshtein distance
In order
First or random
Round robin
See also:
distributed_replica_max_ignored_errors
Random (by Default)
β
load_balancing = random
The number of errors is counted for each replica. The query is sent to the replica with the fewest errors, and if there are several of these, to anyone of them.
Disadvantages: Server proximity is not accounted for; if the replicas have different data, you will also get different data.
Nearest Hostname
β
load_balancing = nearest_hostname
The number of errors is counted for each replica. Every 5 minutes, the number of errors is integrally divided by 2. Thus, the number of errors is calculated for a recent time with exponential smoothing. If there is one replica with a minimal number of errors (i.e.Β errors occurred recently on the other replicas), the query is sent to it. If there are multiple replicas with the same minimal number of errors, the query is sent to the replica with a hostname that is most similar to the server's hostname in the config file (for the number of different characters in identical positions, up to the minimum length of both hostnames).
For instance, example01-01-1 and example01-01-2 are different in one position, while example01-01-1 and example01-02-2 differ in two places.
This method might seem primitive, but it does not require external data about network topology, and it does not compare IP addresses, which would be complicated for our IPv6 addresses.
Thus, if there are equivalent replicas, the closest one by name is preferred.
We can also assume that when sending a query to the same server, in the absence of failures, a distributed query will also go to the same servers. So even if different data is placed on the replicas, the query will return mostly the same results.
Hostname levenshtein distance
β
load_balancing = hostname_levenshtein_distance
Just like
nearest_hostname
, but it compares hostname in a
levenshtein distance
manner. For example:
example-clickhouse-0-0 ample-clickhouse-0-0
1
example-clickhouse-0-0 example-clickhouse-1-10
2
example-clickhouse-0-0 example-clickhouse-12-0
3
In Order
β
load_balancing = in_order
Replicas with the same number of errors are accessed in the same order as they are specified in the configuration.
This method is appropriate when you know exactly which replica is preferable.
First or Random
β
load_balancing = first_or_random
This algorithm chooses the first replica in the set or a random replica if the first is unavailable. It's effective in cross-replication topology setups, but useless in other configurations.
The
first_or_random
algorithm solves the problem of the
in_order
algorithm. With
in_order
, if one replica goes down, the next one gets a double load while the remaining replicas handle the usual amount of traffic. When using the
first_or_random
algorithm, the load is evenly distributed among replicas that are still available.
It's possible to explicitly define what the first replica is by using the setting
load_balancing_first_offset
. This gives more control to rebalance query workloads among replicas.
Round Robin
β
load_balancing = round_robin
This algorithm uses a round-robin policy across replicas with the same number of errors (only the queries with
round_robin
policy is accounted).
load_balancing_first_offset
β
Type
Default value
Type
UInt64
Default value
0
Which replica to preferably send a query when FIRST_OR_RANDOM load balancing strategy is used.
load_marks_asynchronously
β
Type
Default value
Type
Bool
Default value
0
Load MergeTree marks asynchronously
Cloud default value:
1
.
local_filesystem_read_method
β
Type
Default value
Type
String
Default value
pread_threadpool
Method of reading data from local filesystem, one of: read, pread, mmap, io_uring, pread_threadpool.
The 'io_uring' method is experimental and does not work for Log, TinyLog, StripeLog, File, Set and Join, and other tables with append-able files in presence of concurrent reads and writes.
If you read various articles about 'io_uring' on the Internet, don't be blinded by them. It is not a better method of reading files, unless the case of a large amount of small IO requests, which is not the case in ClickHouse. There are no reasons to enable 'io_uring'.
local_filesystem_read_prefetch
β
Type
Default value
Type
Bool
Default value
0
Should use prefetching when reading data from local filesystem.
lock_acquire_timeout
β
Type
Default value
Type
Seconds
Default value
120
Defines how many seconds a locking request waits before failing.
Locking timeout is used to protect from deadlocks while executing read/write operations with tables. When the timeout expires and the locking request fails, the ClickHouse server throws an exception "Locking attempt timed out! Possible deadlock avoided. Client should retry." with error code
DEADLOCK_AVOIDED
.
Possible values:
Positive integer (in seconds).
0 β No locking timeout.
Specifies the value for the
log_comment
field of the
system.query_log
table and comment text for the server log.
It can be used to improve the readability of server logs. Additionally, it helps to select queries related to the test from the
system.query_log
after running
clickhouse-test
.
Possible values:
Any string no longer than
max_query_size
. If the max_query_size is exceeded, the server throws an exception.
Example
Query:
SET log_comment = 'log_comment test', log_queries = 1;
SELECT 1;
SYSTEM FLUSH LOGS;
SELECT type, query FROM system.query_log WHERE log_comment = 'log_comment test' AND event_date >= yesterday() ORDER BY event_time DESC LIMIT 2;
Result:
ββtypeβββββββββ¬βqueryββββββ
β QueryStart β SELECT 1; β
β QueryFinish β SELECT 1; β
βββββββββββββββ΄ββββββββββββ
log_formatted_queries
β
Type
Default value
Type
Bool
Default value
0
Allows to log formatted queries to the
system.query_log
system table (populates
formatted_query
column in the
system.query_log
).
Possible values:
0 β Formatted queries are not logged in the system table.
1 β Formatted queries are logged in the system table.
log_processors_profiles
β
Type
Default value
Type
Bool
Default value
1
Write time that processor spent during execution/waiting for data to
system.processors_profile_log
table.
See also:
system.processors_profile_log
EXPLAIN PIPELINE
log_profile_events
β
Type
Default value
Type
Bool
Default value
1
Log query performance statistics into the query_log, query_thread_log and query_views_log.
log_queries
β
Type
Default value
Type
Bool
Default value
1
Setting up query logging.
Queries sent to ClickHouse with this setup are logged according to the rules in the
query_log
server configuration parameter.
Example:
log_queries=1
log_queries_cut_to_length
β
Type
Default value
Type
UInt64
Default value
100000
If query length is greater than a specified threshold (in bytes), then cut query when writing to query log. Also limit the length of printed query in ordinary text log.
log_queries_min_query_duration_ms
β
Type
Default value
Type
Milliseconds
Default value
0
If enabled (non-zero), queries faster than the value of this setting will not be logged (you can think about this as a
long_query_time
for
MySQL Slow Query Log
), and this basically means that you will not find them in the following tables:
system.query_log
system.query_thread_log
Only the queries with the following type will get to the log:
QUERY_FINISH
EXCEPTION_WHILE_PROCESSING
Type: milliseconds
Default value: 0 (any query)
log_queries_min_type
β
Type
Default value
Type
LogQueriesType
Default value
QUERY_START
query_log
minimal type to log.
Possible values:
QUERY_START
(
=1
)
QUERY_FINISH
(
=2
)
EXCEPTION_BEFORE_START
(
=3
)
EXCEPTION_WHILE_PROCESSING
(
=4
)
Can be used to limit which entities will go to
query_log
, say you are interested only in errors, then you can use
EXCEPTION_WHILE_PROCESSING
:
log_queries_min_type='EXCEPTION_WHILE_PROCESSING'
log_queries_probability
β
Type
Default value
Type
Float
Default value
1
Allows a user to write to
query_log
,
query_thread_log
, and
query_views_log
system tables only a sample of queries selected randomly with the specified probability. It helps to reduce the load with a large volume of queries in a second.
Possible values:
0 β Queries are not logged in the system tables.
Positive floating-point number in the range [0..1]. For example, if the setting value is
0.5
, about half of the queries are logged in the system tables.
1 β All queries are logged in the system tables.
log_query_settings
β
Type
Default value
Type
Bool
Default value
1
Log query settings into the query_log and OpenTelemetry span log.
log_query_threads
β
Type
Default value
Type
Bool
Default value
0
Setting up query threads logging.
Query threads log into the
system.query_thread_log
table. This setting has effect only when
log_queries
is true. Queries' threads run by ClickHouse with this setup are logged according to the rules in the
query_thread_log
server configuration parameter.
Possible values:
0 β Disabled.
1 β Enabled.
Example
log_query_threads=1
log_query_views
β
Type
Default value
Type
Bool
Default value
1
Setting up query views logging.
When a query run by ClickHouse with this setting enabled has associated views (materialized or live views), they are logged in the
query_views_log
server configuration parameter.
Example:
log_query_views=1
low_cardinality_allow_in_native_format
β
Type
Default value
Type
Bool
Default value
1
Allows or restricts using the
LowCardinality
data type with the
Native
format.
If usage of
LowCardinality
is restricted, ClickHouse server converts
LowCardinality
-columns to ordinary ones for
SELECT
queries, and convert ordinary columns to
LowCardinality
-columns for
INSERT
queries.
This setting is required mainly for third-party clients which do not support
LowCardinality
data type.
Possible values:
1 β Usage of
LowCardinality
is not restricted.
0 β Usage of
LowCardinality
is restricted.
low_cardinality_max_dictionary_size
β
Type
Default value
Type
UInt64
Default value
8192
Sets a maximum size in rows of a shared global dictionary for the
LowCardinality
data type that can be written to a storage file system. This setting prevents issues with RAM in case of unlimited dictionary growth. All the data that can't be encoded due to maximum dictionary size limitation ClickHouse writes in an ordinary method.
Possible values:
Any positive integer.
low_cardinality_use_single_dictionary_for_part
β
Type
Default value
Type
Bool
Default value
0
Turns on or turns off using of single dictionary for the data part.
By default, the ClickHouse server monitors the size of dictionaries and if a dictionary overflows then the server starts to write the next one. To prohibit creating several dictionaries set
low_cardinality_use_single_dictionary_for_part = 1
.
Possible values:
1 β Creating several dictionaries for the data part is prohibited.
0 β Creating several dictionaries for the data part is not prohibited.
low_priority_query_wait_time_ms
β
Type
Default value
Type
Milliseconds
Default value
1000
When the query prioritization mechanism is employed (see setting
priority
), low-priority queries wait for higher-priority queries to finish. This setting specifies the duration of waiting.
make_distributed_plan
β
Type
Default value
Type
Bool
Default value
0
Make distributed query plan.
materialize_skip_indexes_on_insert
β
Type
Default value
Type
Bool
Default value
1
If INSERTs build and store skip indexes. If disabled, skip indexes will only be built and stored
during merges
or by explicit
MATERIALIZE INDEX
.
See also
exclude_materialize_skip_indexes_on_insert
.
materialize_statistics_on_insert
β
Type
Default value
Type
Bool
Default value
1
If INSERTs build and insert statistics. If disabled, statistics will be build and stored during merges or by explicit MATERIALIZE STATISTICS
materialize_ttl_after_modify
β
Type
Default value
Type
Bool
Default value
1
Apply TTL for old data, after ALTER MODIFY TTL query
materialized_views_ignore_errors
β
Type
Default value
Type
Bool
Default value
0
Allows to ignore errors for MATERIALIZED VIEW, and deliver original block to the table regardless of MVs
materialized_views_squash_parallel_inserts
β
Type
Default value
Type
Bool
Default value
1
Squash inserts to materialized views destination table of a single INSERT query from parallel inserts to reduce amount of generated parts.
If set to false and
parallel_view_processing
is enabled, INSERT query will generate part in the destination table for each
max_insert_thread
.
max_analyze_depth
β
Type
Default value
Type
UInt64
Default value
5000
Maximum number of analyses performed by interpreter.
max_ast_depth
β
Type
Default value
Type
UInt64
Default value
1000
The maximum nesting depth of a query syntactic tree. If exceeded, an exception is thrown.
Note
At this time, it isn't checked during parsing, but only after parsing the query.
This means that a syntactic tree that is too deep can be created during parsing,
but the query will fail.
max_ast_elements
β
Type
Default value
Type
UInt64
Default value
50000
The maximum number of elements in a query syntactic tree. If exceeded, an exception is thrown.
Note
At this time, it isn't checked during parsing, but only after parsing the query.
This means that a syntactic tree that is too deep can be created during parsing,
but the query will fail.
max_autoincrement_series
β
Type
Default value
Type
UInt64
Default value
1000
The limit on the number of series created by the
generateSerialID
function.
As each series represents a node in Keeper, it is recommended to have no more than a couple of millions of them.
max_backup_bandwidth
β
Type
Default value
Type
UInt64
Default value
0
The maximum read speed in bytes per second for particular backup on server. Zero means unlimited.
max_block_size
β
Type
Default value
Type
NonZeroUInt64
Default value
65409
In ClickHouse, data is processed by blocks, which are sets of column parts. The internal processing cycles for a single block are efficient but there are noticeable costs when processing each block.
The
max_block_size
setting indicates the recommended maximum number of rows to include in a single block when loading data from tables. Blocks the size of
max_block_size
are not always loaded from the table: if ClickHouse determines that less data needs to be retrieved, a smaller block is processed.
The block size should not be too small to avoid noticeable costs when processing each block. It should also not be too large to ensure that queries with a LIMIT clause execute quickly after processing the first block. When setting
max_block_size
, the goal should be to avoid consuming too much memory when extracting a large number of columns in multiple threads and to preserve at least some cache locality.
max_bytes_before_external_group_by
β
Type
Default value
Type
UInt64
Default value
0
Cloud default value: half the memory amount per replica.
Enables or disables execution of
GROUP BY
clauses in external memory.
(See
GROUP BY in external memory
)
Possible values:
Maximum volume of RAM (in bytes) that can be used by the single
GROUP BY
operation.
0
β
GROUP BY
in external memory disabled.
Note
If memory usage during GROUP BY operations is exceeding this threshold in bytes,
activate the 'external aggregation' mode (spill data to disk).
The recommended value is half of the available system memory.
max_bytes_before_external_sort
β
Type
Default value
Type
UInt64
Default value
0
Cloud default value: half the memory amount per replica.
Enables or disables execution of
ORDER BY
clauses in external memory. See
ORDER BY Implementation Details
If memory usage during ORDER BY operation exceeds this threshold in bytes, the 'external sorting' mode (spill data to disk) is activated.
Possible values:
Maximum volume of RAM (in bytes) that can be used by the single
ORDER BY
operation.
The recommended value is half of available system memory
0
β
ORDER BY
in external memory disabled.
max_bytes_before_remerge_sort
β
Type
Default value
Type
UInt64
Default value
1000000000
In case of ORDER BY with LIMIT, when memory usage is higher than specified threshold, perform additional steps of merging blocks before final merge to keep just top LIMIT rows.
max_bytes_in_distinct
β
Type
Default value
Type
UInt64
Default value
0
The maximum number of bytes of the state (in uncompressed bytes) in memory, which
is used by a hash table when using DISTINCT.
max_bytes_in_join
β
Type
Default value
Type
UInt64
Default value
0
The maximum size in number of bytes of the hash table used when joining tables.
This setting applies to
SELECT ... JOIN
operations and the
Join table engine
.
If the query contains joins, ClickHouse checks this setting for every intermediate result.
ClickHouse can proceed with different actions when the limit is reached. Use
the
join_overflow_mode
settings to choose the action.
Possible values:
Positive integer.
0 β Memory control is disabled.
max_bytes_in_set
β
Type
Default value
Type
UInt64
Default value
0
The maximum number of bytes (of uncompressed data) used by a set in the IN clause
created from a subquery.
max_bytes_ratio_before_external_group_by
β
Type
Default value
Type
Double
Default value
0.5
The ratio of available memory that is allowed for
GROUP BY
. Once reached,
external memory is used for aggregation.
For example, if set to
0.6
,
GROUP BY
will allow using 60% of the available memory
(to server/user/merges) at the beginning of the execution, after that, it will
start using external aggregation.
max_bytes_ratio_before_external_sort
β
Type
Default value
Type
Double
Default value
0.5
The ratio of available memory that is allowed for
ORDER BY
. Once reached, external sort is used.
For example, if set to
0.6
,
ORDER BY
will allow using
60%
of available memory (to server/user/merges) at the beginning of the execution, after that, it will start using external sort.
Note, that
max_bytes_before_external_sort
is still respected, spilling to disk will be done only if the sorting block is bigger then
max_bytes_before_external_sort
.
max_bytes_to_read
β
Type
Default value
Type
UInt64
Default value
0
The maximum number of bytes (of uncompressed data) that can be read from a table when running a query.
The restriction is checked for each processed chunk of data, applied only to the
deepest table expression and when reading from a remote server, checked only on
the remote server.
max_bytes_to_read_leaf
β
Type
Default value
Type
UInt64
Default value
0
The maximum number of bytes (of uncompressed data) that can be read from a local
table on a leaf node when running a distributed query. While distributed queries
can issue a multiple sub-queries to each shard (leaf) - this limit will
be checked only on the read stage on the leaf nodes and will be ignored on the
merging of results stage on the root node.
For example, a cluster consists of 2 shards and each shard contains a table with
100 bytes of data. A distributed query which is supposed to read all the data
from both tables with setting
max_bytes_to_read=150
will fail as in total it
will be 200 bytes. A query with
max_bytes_to_read_leaf=150
will succeed since
leaf nodes will read 100 bytes at max.
The restriction is checked for each processed chunk of data.
Note
This setting is unstable with
prefer_localhost_replica=1
.
max_bytes_to_sort
β
Type
Default value
Type
UInt64
Default value
0
The maximum number of bytes before sorting. If more than the specified amount of
uncompressed bytes have to be processed for ORDER BY operation, the behavior will
be determined by the
sort_overflow_mode
which by default is set to
throw
.
max_bytes_to_transfer
β
Type
Default value
Type
UInt64
Default value
0
The maximum number of bytes (uncompressed data) that can be passed to a remote
server or saved in a temporary table when the GLOBAL IN/JOIN section is executed.
max_columns_to_read
β
Type
Default value
Type
UInt64
Default value
0
The maximum number of columns that can be read from a table in a single query.
If a query requires reading more than the specified number of columns, an exception
is thrown.
Tip
This setting is useful for preventing overly complex queries.
0
value means unlimited.
max_compress_block_size
β
Type
Default value
Type
UInt64
Default value
1048576
The maximum size of blocks of uncompressed data before compressing for writing to a table. By default, 1,048,576 (1 MiB). Specifying a smaller block size generally leads to slightly reduced compression ratio, the compression and decompression speed increases slightly due to cache locality, and memory consumption is reduced.
Note
This is an expert-level setting, and you shouldn't change it if you're just getting started with ClickHouse.
Don't confuse blocks for compression (a chunk of memory consisting of bytes) with blocks for query processing (a set of rows from a table).
max_concurrent_queries_for_all_users
β
Type
Default value
Type
UInt64
Default value
0
Throw exception if the value of this setting is less or equal than the current number of simultaneously processed queries.
Example:
max_concurrent_queries_for_all_users
can be set to 99 for all users and database administrator can set it to 100 for itself to run queries for investigation even when the server is overloaded.
Modifying the setting for one query or user does not affect other queries.
Possible values:
Positive integer.
0 β No limit.
Example
<max_concurrent_queries_for_all_users>99</max_concurrent_queries_for_all_users>
See Also
max_concurrent_queries
Cloud default value:
1000
.
max_concurrent_queries_for_user
β
Type
Default value
Type
UInt64
Default value
0
The maximum number of simultaneously processed queries per user.
Possible values:
Positive integer.
0 β No limit.
Example
<max_concurrent_queries_for_user>5</max_concurrent_queries_for_user>
max_distributed_connections
β
Type
Default value
Type
UInt64
Default value
1024
The maximum number of simultaneous connections with remote servers for distributed processing of a single query to a single Distributed table. We recommend setting a value no less than the number of servers in the cluster.
The following parameters are only used when creating Distributed tables (and when launching a server), so there is no reason to change them at runtime.
max_distributed_depth
β
Type
Default value
Type
UInt64
Default value
5
Limits the maximum depth of recursive queries for
Distributed
tables.
If the value is exceeded, the server throws an exception.
Possible values:
Positive integer.
0 β Unlimited depth.
max_download_buffer_size
β
Type
Default value
Type
UInt64
Default value
10485760
The maximal size of buffer for parallel downloading (e.g. for URL engine) per each thread.
max_download_threads
β
Type
Default value
Type
MaxThreads
Default value
4
The maximum number of threads to download data (e.g. for URL engine).
max_estimated_execution_time
β
Type
Default value
Type
Seconds
Default value
0
Maximum query estimate execution time in seconds. Checked on every data block
when
timeout_before_checking_execution_speed
expires.
max_execution_speed
β
Type
Default value
Type
UInt64
Default value
0
The maximum number of execution rows per second. Checked on every data block when
timeout_before_checking_execution_speed
expires. If the execution speed is high, the execution speed will be reduced.
max_execution_speed_bytes
β
Type
Default value
Type
UInt64
Default value
0
The maximum number of execution bytes per second. Checked on every data block when
timeout_before_checking_execution_speed
expires. If the execution speed is high, the execution speed will be reduced.
max_execution_time
β
Type
Default value
Type
Seconds
Default value
0
The maximum query execution time in seconds.
The
max_execution_time
parameter can be a bit tricky to understand.
It operates based on interpolation relative to the current query execution speed
(this behaviour is controlled by
timeout_before_checking_execution_speed
).
ClickHouse will interrupt a query if the projected execution time exceeds the
specified
max_execution_time
. By default, the
timeout_before_checking_execution_speed
is set to 10 seconds. This means that after 10 seconds of query execution, ClickHouse
will begin estimating the total execution time. If, for example,
max_execution_time
is set to 3600 seconds (1 hour), ClickHouse will terminate the query if the estimated
time exceeds this 3600-second limit. If you set
timeout_before_checking_execution_speed
to 0, ClickHouse will use the clock time as the basis for
max_execution_time
.
If query runtime exceeds the specified number of seconds, the behavior will be
determined by the 'timeout_overflow_mode', which by default is set to
throw
.
Note
The timeout is checked and the query can stop only in designated places during data processing.
It currently cannot stop during merging of aggregation states or during query analysis,
and the actual run time will be higher than the value of this setting.
max_execution_time_leaf
β
Type
Default value
Type
Seconds
Default value
0
Similar semantically to
max_execution_time
but only
applied on leaf nodes for distributed or remote queries.
For example, if we want to limit the execution time on a leaf node to
10s
but
have no limit on the initial node, instead of having
max_execution_time
in the
nested subquery settings:
SELECT count()
FROM cluster(cluster, view(SELECT * FROM t SETTINGS max_execution_time = 10));
We can use
max_execution_time_leaf
as the query settings:
SELECT count()
FROM cluster(cluster, view(SELECT * FROM t)) SETTINGS max_execution_time_leaf = 10;
max_expanded_ast_elements
β
Type
Default value
Type
UInt64
Default value
500000
Maximum size of query syntax tree in number of nodes after expansion of aliases and the asterisk.
max_fetch_partition_retries_count
β
Type
Default value
Type
UInt64
Default value
5
Amount of retries while fetching partition from another host.
max_final_threads
β
Type
Default value
Type
MaxThreads
Default value
'auto(N)'
Sets the maximum number of parallel threads for the
SELECT
query data read phase with the
FINAL
modifier.
Possible values:
Positive integer.
0 or 1 β Disabled.
SELECT
queries are executed in a single thread.
max_http_get_redirects
β
Type
Default value
Type
UInt64
Default value
0
Max number of HTTP GET redirects hops allowed. Ensures additional security measures are in place to prevent a malicious server from redirecting your requests to unexpected services.\n\nIt is the case when an external server redirects to another address, but that address appears to be internal to the company's infrastructure, and by sending an HTTP request to an internal server, you could request an internal API from the internal network, bypassing the auth, or even query other services, such as Redis or Memcached. When you don't have an internal infrastructure (including something running on your localhost), or you trust the server, it is safe to allow redirects. Although keep in mind, that if the URL uses HTTP instead of HTTPS, and you will have to trust not only the remote server but also your ISP and every network in the middle.
Cloud default value:
10
.
max_hyperscan_regexp_length
β
Type
Default value
Type
UInt64
Default value
0
Defines the maximum length for each regular expression in the
hyperscan multi-match functions
.
Possible values:
Positive integer.
0 - The length is not limited.
Example
Query:
SELECT multiMatchAny('abcd', ['ab','bcd','c','d']) SETTINGS max_hyperscan_regexp_length = 3;
Result:
ββmultiMatchAny('abcd', ['ab', 'bcd', 'c', 'd'])ββ
β 1 β
ββββββββββββββββββββββββββββββββββββββββββββββββββ
Query:
SELECT multiMatchAny('abcd', ['ab','bcd','c','d']) SETTINGS max_hyperscan_regexp_length = 2;
Result:
Exception: Regexp length too large.
See Also
max_hyperscan_regexp_total_length
max_hyperscan_regexp_total_length
β
Type
Default value
Type
UInt64
Default value
0
Sets the maximum length total of all regular expressions in each
hyperscan multi-match function
.
Possible values:
Positive integer.
0 - The length is not limited.
Example
Query:
SELECT multiMatchAny('abcd', ['a','b','c','d']) SETTINGS max_hyperscan_regexp_total_length = 5;
Result:
ββmultiMatchAny('abcd', ['a', 'b', 'c', 'd'])ββ
β 1 β
βββββββββββββββββββββββββββββββββββββββββββββββ
Query:
SELECT multiMatchAny('abcd', ['ab','bc','c','d']) SETTINGS max_hyperscan_regexp_total_length = 5;
Result:
Exception: Total regexp lengths too large.
See Also
max_hyperscan_regexp_length
max_insert_block_size
β
Aliases
:
max_insert_block_size_rows
Type
Default value
Type
NonZeroUInt64
Default value
1048449
The maximum size of blocks (in a count of rows) to form for insertion into a table.
This setting controls block formation in two contexts:
Format parsing: When the server parses row-based input formats (CSV, TSV, JSONEachRow, etc.) from any interface (HTTP, clickhouse-client with inline data, gRPC, PostgreSQL wire protocol), blocks are emitted when:
Both min_insert_block_size_rows AND min_insert_block_size_bytes are reached, OR
Either max_insert_block_size_rows OR max_insert_block_size_bytes is reached
Note: When using clickhouse-client or clickhouse-local to read from a file, the client itself parses the data and this setting applies on the client side.
INSERT operations: During INSERT queries and when data flows through materialized views, this setting's behavior depends on
use_strict_insert_block_limits
:
When enabled: Blocks are emitted when:
Min thresholds (AND): Both min_insert_block_size_rows AND min_insert_block_size_bytes are reached
Max thresholds (OR): Either max_insert_block_size_rows OR max_insert_block_size_bytes is reached
When disabled: Blocks are emitted when min_insert_block_size_rows OR min_insert_block_size_bytes is reached. The max_insert_block_size settings are not enforced.
Possible values:
Positive integer.
max_insert_block_size_bytes
β
Type
Default value
Type
UInt64
Default value
0
The maximum size of blocks (in bytes) to form for insertion into a table.
This setting works together with max_insert_block_size_rows and controls block formation in the same context. See max_insert_block_size_rows for detailed information about when and how these settings are applied.
Possible values:
Positive integer.
0 β setting does not participate in block formation.
max_insert_delayed_streams_for_parallel_write
β
Type
Default value
Type
UInt64
Default value
0
The maximum number of streams (columns) to delay final part flush. Default - auto (100 in case of underlying storage supports parallel write, for example S3 and disabled otherwise)
Cloud default value:
50
.
max_insert_threads
β
Type
Default value
Type
UInt64
Default value
0
The maximum number of threads to execute the
INSERT SELECT
query.
Possible values:
0 (or 1) β
INSERT SELECT
no parallel execution.
Positive integer. Bigger than 1.
Cloud default value:
1
for nodes with 8 GiB memory
2
for nodes with 16 GiB memory
4
for larger nodes
Parallel
INSERT SELECT
has effect only if the
SELECT
part is executed in parallel, see
max_threads
setting.
Higher values will lead to higher memory usage.
max_joined_block_size_bytes
β
Type
Default value
Type
UInt64
Default value
4194304
Maximum block size in bytes for JOIN result (if join algorithm supports it). 0 means unlimited.
max_joined_block_size_rows
β
Type
Default value
Type
UInt64
Default value
65409
Maximum block size for JOIN result (if join algorithm supports it). 0 means unlimited.
max_limit_for_vector_search_queries
β
Type
Default value
Type
UInt64
Default value
1000
SELECT queries with LIMIT bigger than this setting cannot use vector similarity indices. Helps to prevent memory overflows in vector similarity indices.
max_local_read_bandwidth
β
Type
Default value
Type
UInt64
Default value
0
The maximum speed of local reads in bytes per second.
max_local_write_bandwidth
β
Type
Default value
Type
UInt64
Default value
0
The maximum speed of local writes in bytes per second.
max_memory_usage
β
Type
Default value
Type
UInt64
Default value
0
Cloud default value: depends on the amount of RAM on the replica.
The maximum amount of RAM to use for running a query on a single server.
A value of
0
means unlimited.
This setting does not consider the volume of available memory or the total volume
of memory on the machine. The restriction applies to a single query within a
single server.
You can use
SHOW PROCESSLIST
to see the current memory consumption for each query.
Peak memory consumption is tracked for each query and written to the log.
Memory usage is not fully tracked for states of the following aggregate functions
from
String
and
Array
arguments:
min
max
any
anyLast
argMin
argMax
Memory consumption is also restricted by the parameters
max_memory_usage_for_user
and
max_server_memory_usage
.
max_memory_usage_for_user
β
Type
Default value
Type
UInt64
Default value
0
The maximum amount of RAM to use for running a user's queries on a single server. Zero means unlimited.
By default, the amount is not restricted (
max_memory_usage_for_user = 0
).
Also see the description of
max_memory_usage
.
For example if you want to set
max_memory_usage_for_user
to 1000 bytes for a user named
clickhouse_read
, you can use the statement
ALTER USER clickhouse_read SETTINGS max_memory_usage_for_user = 1000;
You can verify it worked by logging out of your client, logging back in, then use the
getSetting
function:
SELECT getSetting('max_memory_usage_for_user');
max_network_bandwidth
β
Type
Default value
Type
UInt64
Default value
0
Limits the speed of the data exchange over the network in bytes per second. This setting applies to every query.
Possible values:
Positive integer.
0 β Bandwidth control is disabled.
max_network_bandwidth_for_all_users
β
Type
Default value
Type
UInt64
Default value
0
Limits the speed that data is exchanged at over the network in bytes per second. This setting applies to all concurrently running queries on the server.
Possible values:
Positive integer.
0 β Control of the data speed is disabled.
max_network_bandwidth_for_user
β
Type
Default value
Type
UInt64
Default value
0
Limits the speed of the data exchange over the network in bytes per second. This setting applies to all concurrently running queries performed by a single user.
Possible values:
Positive integer.
0 β Control of the data speed is disabled.
max_network_bytes
β
Type
Default value
Type
UInt64
Default value
0
Limits the data volume (in bytes) that is received or transmitted over the network when executing a query. This setting applies to every individual query.
Possible values:
Positive integer.
0 β Data volume control is disabled.
max_number_of_partitions_for_independent_aggregation
β
Type
Default value
Type
UInt64
Default value
128
Maximal number of partitions in table to apply optimizatio
max_os_cpu_wait_time_ratio_to_throw
β
Type
Default value
Type
Float
Default value
0
Max ratio between OS CPU wait (OSCPUWaitMicroseconds metric) and busy (OSCPUVirtualTimeMicroseconds metric) times to consider rejecting queries. Linear interpolation between min and max ratio is used to calculate the probability, the probability is 1 at this point.
max_parallel_replicas
β
Type
Default value
Type
NonZeroUInt64
Default value
1000
The maximum number of replicas for each shard when executing a query.
Possible values:
Positive integer.
Additional Info
This options will produce different results depending on the settings used.
Parallel processing using
SAMPLE
key
β
A query may be processed faster if it is executed on several servers in parallel. But the query performance may degrade in the following cases:
The position of the sampling key in the partitioning key does not allow efficient range scans.
Adding a sampling key to the table makes filtering by other columns less efficient.
The sampling key is an expression that is expensive to calculate.
The cluster latency distribution has a long tail, so that querying more servers increases the query overall latency.
Parallel processing using
parallel_replicas_custom_key
β
This setting is useful for any replicated table.
max_parser_backtracks
β
Type
Default value
Type
UInt64
Default value
1000000
Maximum parser backtracking (how many times it tries different alternatives in the recursive descend parsing process).
max_parser_depth
β
Type
Default value
Type
UInt64
Default value
1000
Limits maximum recursion depth in the recursive descent parser. Allows controlling the stack size.
Possible values:
Positive integer.
0 β Recursion depth is unlimited.
max_parsing_threads
β
Type
Default value
Type
MaxThreads
Default value
'auto(N)'
The maximum number of threads to parse data in input formats that support parallel parsing. By default, it is determined automatically.
max_partition_size_to_drop
β
Type
Default value
Type
UInt64
Default value
50000000000
Restriction on dropping partitions in query time. The value
0
means that you can drop partitions without any restrictions.
Cloud default value: 1 TB.
max_partitions_per_insert_block
β
Type
Default value
Type
UInt64
Default value
100
Limits the maximum number of partitions in a single inserted block
and an exception is thrown if the block contains too many partitions.
Positive integer.
0
β Unlimited number of partitions.
Details
When inserting data, ClickHouse calculates the number of partitions in the
inserted block. If the number of partitions is more than
max_partitions_per_insert_block
, ClickHouse either logs a warning or throws an
exception based on
throw_on_max_partitions_per_insert_block
. Exceptions have
the following text:
"Too many partitions for a single INSERT block (
partitions_count
partitions, limit is " + toString(max_partitions) + ").
The limit is controlled by the 'max_partitions_per_insert_block' setting.
A large number of partitions is a common misconception. It will lead to severe
negative performance impact, including slow server startup, slow INSERT queries
and slow SELECT queries. Recommended total number of partitions for a table is
under 1000..10000. Please note, that partitioning is not intended to speed up
SELECT queries (ORDER BY key is sufficient to make range queries fast).
Partitions are intended for data manipulation (DROP PARTITION, etc)."
Note
This setting is a safety threshold because using a large number of partitions is a common misconception.
max_partitions_to_read
β
Type
Default value
Type
Int64
Default value
-1
Limits the maximum number of partitions that can be accessed in a single query.
The setting value specified when the table is created can be overridden via query-level setting.
Possible values:
Positive integer
-1
- unlimited (default)
max_parts_to_move
β
Type
Default value
Type
UInt64
Default value
1000
Limit the number of parts that can be moved in one query. Zero means unlimited.
max_projection_rows_to_use_projection_index
β
Type
Default value
Type
UInt64
Default value
1000000
If the number of rows to read from the projection index is less than or equal to this threshold, ClickHouse will try to apply the projection index during query execution.
max_query_size
β
Type
Default value
Type
UInt64
Default value
262144
The maximum number of bytes of a query string parsed by the SQL parser.
Data in the VALUES clause of INSERT queries is processed by a separate stream parser (that consumes O(1) RAM) and not affected by this restriction.
Note
max_query_size
cannot be set within an SQL query (e.g.,
SELECT now() SETTINGS max_query_size=10000
) because ClickHouse needs to allocate a buffer to parse the query, and this buffer size is determined by the
max_query_size
setting, which must be configured before the query is executed.
max_rand_distribution_parameter
β
Type
Default value
Type
Float
Default value
1000000
Maximum value for distribution shape parameters in random distribution functions such as
randChiSquared
,
randStudentT
, and
randFisherF
. This prevents extremely long computation times with extreme parameter values.
max_rand_distribution_trials
β
Type
Default value
Type
UInt64
Default value
1000000000
Maximum number of trials allowed for random distribution functions such as
randBinomial
and
randNegativeBinomial
. This prevents extremely long computation times with large trial counts.
max_read_buffer_size
β
Type
Default value
Type
NonZeroUInt64
Default value
1048576
The maximum size of the buffer to read from the filesystem.
max_read_buffer_size_local_fs
β
Type
Default value
Type
UInt64
Default value
131072
The maximum size of the buffer to read from local filesystem. If set to 0 then max_read_buffer_size will be used.
max_read_buffer_size_remote_fs
β
Type
Default value
Type
UInt64
Default value
0
The maximum size of the buffer to read from remote filesystem. If set to 0 then max_read_buffer_size will be used.
max_recursive_cte_evaluation_depth
β
Type
Default value
Type
UInt64
Default value
1000
Maximum limit on recursive CTE evaluation depth
max_remote_read_network_bandwidth
β
Type
Default value
Type
UInt64
Default value
0
The maximum speed of data exchange over the network in bytes per second for read.
max_remote_write_network_bandwidth
β
Type
Default value
Type
UInt64
Default value
0
The maximum speed of data exchange over the network in bytes per second for write.
max_replica_delay_for_distributed_queries
β
Type
Default value
Type
UInt64
Default value
300
Disables lagging replicas for distributed queries. See
Replication
.
Sets the time in seconds. If a replica's lag is greater than or equal to the set value, this replica is not used.
Possible values:
Positive integer.
0 β Replica lags are not checked.
To prevent the use of any replica with a non-zero lag, set this parameter to 1.
Used when performing
SELECT
from a distributed table that points to replicated tables.
max_result_bytes
β
Type
Default value
Type
UInt64
Default value
0
Limits the result size in bytes (uncompressed). The query will stop after processing a block of data if the threshold is met,
but it will not cut the last block of the result, therefore the result size can be larger than the threshold.
Caveats
The result size in memory is taken into account for this threshold.
Even if the result size is small, it can reference larger data structures in memory,
representing dictionaries of LowCardinality columns, and Arenas of AggregateFunction columns,
so the threshold can be exceeded despite the small result size.
Note
The setting is fairly low level and should be used with caution
max_result_rows
β
Type
Default value
Type
UInt64
Default value
0
Cloud default value:
0
.
Limits the number of rows in the result. Also checked for subqueries, and on remote servers when running parts of a distributed query.
No limit is applied when the value is
0
.
The query will stop after processing a block of data if the threshold is met, but
it will not cut the last block of the result, therefore the result size can be
larger than the threshold.
max_reverse_dictionary_lookup_cache_size_bytes
β
Type
Default value
Type
UInt64
Default value
104857600
Maximum size in bytes of the per-query reverse dictionary lookup cache used by the function
dictGetKeys
. The cache stores serialized key tuples per attribute value to avoid re-scanning the dictionary within the same query. When the limit is reached, entries are evicted using LRU. Set to 0 to disable caching.
max_rows_in_distinct
β
Type
Default value
Type
UInt64
Default value
0
The maximum number of different rows when using DISTINCT.
max_rows_in_join
β
Type
Default value
Type
UInt64
Default value
0
Limits the number of rows in the hash table that is used when joining tables.
This settings applies to
SELECT ... JOIN
operations and the
Join
table engine.
If a query contains multiple joins, ClickHouse checks this setting for every intermediate result.
ClickHouse can proceed with different actions when the limit is reached. Use the
join_overflow_mode
setting to choose the action.
Possible values:
Positive integer.
0
β Unlimited number of rows.
max_rows_in_set
β
Type
Default value
Type
UInt64
Default value
0
The maximum number of rows for a data set in the IN clause created from a subquery.
max_rows_in_set_to_optimize_join
β
Type
Default value
Type
UInt64
Default value
0
Maximal size of the set to filter joined tables by each other's row sets before joining.
Possible values:
0 β Disable.
Any positive integer.
max_rows_to_group_by
β
Type
Default value
Type
UInt64
Default value
0
The maximum number of unique keys received from aggregation. This setting lets
you limit memory consumption when aggregating.
If aggregation during GROUP BY is generating more than the specified number of
rows (unique GROUP BY keys), the behavior will be determined by the
'group_by_overflow_mode' which by default is
throw
, but can be also switched
to an approximate GROUP BY mode.
max_rows_to_read
β
Type
Default value
Type
UInt64
Default value
0
The maximum number of rows that can be read from a table when running a query.
The restriction is checked for each processed chunk of data, applied only to the
deepest table expression and when reading from a remote server, checked only on
the remote server.
max_rows_to_read_leaf
β
Type
Default value
Type
UInt64
Default value
0
The maximum number of rows that can be read from a local table on a leaf node when
running a distributed query. While distributed queries can issue multiple sub-queries
to each shard (leaf) - this limit will be checked only on the read stage on the
leaf nodes and ignored on the merging of results stage on the root node.
For example, a cluster consists of 2 shards and each shard contains a table with
100 rows. The distributed query which is supposed to read all the data from both
tables with setting
max_rows_to_read=150
will fail, as in total there will be
200 rows. A query with
max_rows_to_read_leaf=150
will succeed, since leaf nodes
will read at max 100 rows.
The restriction is checked for each processed chunk of data.
Note
This setting is unstable with
prefer_localhost_replica=1
.
max_rows_to_sort
β
Type
Default value
Type
UInt64
Default value
0
The maximum number of rows before sorting. This allows you to limit memory consumption when sorting.
If more than the specified amount of records have to be processed for the ORDER BY operation,
the behavior will be determined by the
sort_overflow_mode
which by default is set to
throw
.
max_rows_to_transfer
β
Type
Default value
Type
UInt64
Default value
0
Maximum size (in rows) that can be passed to a remote server or saved in a
temporary table when the GLOBAL IN/JOIN section is executed.
max_sessions_for_user
β
Type
Default value
Type
UInt64
Default value
0
Maximum number of simultaneous sessions per authenticated user to the ClickHouse server.
Example:
<profiles>
<single_session_profile>
<max_sessions_for_user>1</max_sessions_for_user>
</single_session_profile>
<two_sessions_profile>
<max_sessions_for_user>2</max_sessions_for_user>
</two_sessions_profile>
<unlimited_sessions_profile>
<max_sessions_for_user>0</max_sessions_for_user>
</unlimited_sessions_profile>
</profiles>
<users>
<!-- User Alice can connect to a ClickHouse server no more than once at a time. -->
<Alice>
<profile>single_session_user</profile>
</Alice>
<!-- User Bob can use 2 simultaneous sessions. -->
<Bob>
<profile>two_sessions_profile</profile>
</Bob>
<!-- User Charles can use arbitrarily many of simultaneous sessions. -->
<Charles>
<profile>unlimited_sessions_profile</profile>
</Charles>
</users>
Possible values:
Positive integer
0
- infinite count of simultaneous sessions (default)
max_size_to_preallocate_for_aggregation
β
Type
Default value
Type
UInt64
Default value
1000000000000
For how many elements it is allowed to preallocate space in all hash tables in total before aggregatio
max_size_to_preallocate_for_joins
β
Type
Default value
Type
UInt64
Default value
1000000000000
For how many elements it is allowed to preallocate space in all hash tables in total before joi
max_skip_unavailable_shards_num
β
Type
Default value
Type
UInt64
Default value
0
When
skip_unavailable_shards
is enabled, limits the maximum number of shards that can be silently skipped.
If the number of unavailable shards exceeds this value, an exception is thrown instead of silently skipping.
A value of 0 means no limit (default behavior β all unavailable shards can be skipped).
max_skip_unavailable_shards_ratio
β
Type
Default value
Type
Float
Default value
0
When
skip_unavailable_shards
is enabled, limits the maximum ratio (0 to 1) of shards that can be silently skipped.
If the ratio of unavailable shards to total shards exceeds this value, an exception is thrown instead of silently skipping.
A value of 0 means no limit (default behavior β all unavailable shards can be skipped).
max_streams_for_files_processing_in_cluster_functions
β
Type
Default value
Type
UInt64
Default value
0
If is not zero, limit the number of threads reading data from files in *Cluster table functions.
max_streams_for_merge_tree_reading
β
Type
Default value
Type
UInt64
Default value
0
If is not zero, limit the number of reading streams for MergeTree table.
max_streams_multiplier_for_merge_tables
β
Type
Default value
Type
Float
Default value
5
Ask more streams when reading from Merge table. Streams will be spread across tables that Merge table will use. This allows more even distribution of work across threads and is especially helpful when merged tables differ in size.
max_streams_to_max_threads_ratio
β
Type
Default value
Type
Float
Default value
1
Allows you to use more sources than the number of threads - to more evenly distribute work across threads. It is assumed that this is a temporary solution since it will be possible in the future to make the number of sources equal to the number of threads, but for each source to dynamically select available work for itself.
max_subquery_depth
β
Type
Default value
Type
UInt64
Default value
100
If a query has more than the specified number of nested subqueries, throws an
exception.
Tip
This allows you to have a sanity check to protect against the users of your
cluster from writing overly complex queries.
max_table_size_to_drop
β
Type
Default value
Type
UInt64
Default value
50000000000
Restriction on deleting tables in query time. The value
0
means that you can delete all tables without any restrictions.
Cloud default value: 1 TB.
max_temporary_columns
β
Type
Default value
Type
UInt64
Default value
0
The maximum number of temporary columns that must be kept in RAM simultaneously
when running a query, including constant columns. If a query generates more than
the specified number of temporary columns in memory as a result of intermediate
calculation, then an exception is thrown.
Tip
This setting is useful for preventing overly complex queries.
0
value means unlimited.
max_temporary_data_on_disk_size_for_query
β
Type
Default value
Type
UInt64
Default value
0
The maximum amount of data consumed by temporary files on disk in bytes for all
concurrently running queries.
Possible values:
Positive integer.
0
β unlimited (default)
max_temporary_data_on_disk_size_for_user
β
Type
Default value
Type
UInt64
Default value
0
The maximum amount of data consumed by temporary files on disk in bytes for all
concurrently running user queries.
Possible values:
Positive integer.
0
β unlimited (default)
max_temporary_non_const_columns
β
Type
Default value
Type
UInt64
Default value
0
Like
max_temporary_columns
, the maximum number of temporary columns that must
be kept in RAM simultaneously when running a query, but without counting constant
columns.
Note
Constant columns are formed fairly often when running a query, but they require
approximately zero computing resources.
max_threads
β
Type
Default value
Type
MaxThreads
Default value
'auto(N)'
The maximum number of query processing threads, excluding threads for retrieving data from remote servers (see the
'max_distributed_connections'
parameter).
This parameter applies to threads that perform the same stages of the query processing pipeline in parallel.
For example, when reading from a table, if it is possible to evaluate expressions with functions, filter with
WHERE
and pre-aggregate for
GROUP BY
in parallel using at least 'max_threads' number of threads, then 'max_threads' are used.
For queries that are completed quickly because of a LIMIT, you can set a lower 'max_threads'.
For example, if the necessary number of entries are located in every block and max_threads = 8, then 8 blocks are retrieved, although it would have been enough to read just one.
The smaller the
max_threads
value, the less memory is consumed.
The
max_threads
setting by default matches the number of hardware threads (number of CPU cores) available to ClickHouse.
As a special case, for x86 processors with less than 32 CPU cores and SMT (e.g. Intel HyperThreading), ClickHouse uses the number of logical cores (= 2 x physical core count) by default.
Without SMT (e.g. Intel HyperThreading), this corresponds to the number of CPU cores.
For ClickHouse Cloud users, the default value will display as
auto(N)
where N matches the vCPU size of your service e.g. 2vCPU/8GiB, 4vCPU/16GiB etc.
See the settings tab in the Cloud console for a list of all service sizes.
max_threads_for_indexes
β
Type
Default value
Type
UInt64
Default value
0
The maximum number of threads process indices.
max_untracked_memory
β
Type
Default value
Type
UInt64
Default value
4194304
Small allocations and deallocations are grouped in thread local variable and tracked or profiled only when an amount (in absolute value) becomes larger than the specified value. If the value is higher than 'memory_profiler_step' it will be effectively lowered to 'memory_profiler_step'.
max_wkb_geometry_elements
β
Type
Default value
Type
UInt64
Default value
1000000
Maximum number of points, rings, or polygons allowed in a single WKB geometry element during parsing by
readWKB
and related functions. This protects against excessive memory allocations from malformed WKB data. Set to 0 to use the hard-coded limit (100 million).
memory_overcommit_ratio_denominator
β
Type
Default value
Type
UInt64
Default value
1073741824
It represents the soft memory limit when the hard limit is reached on the global level.
This value is used to compute the overcommit ratio for the query.
Zero means skip the query.
Read more about
memory overcommit
.
memory_overcommit_ratio_denominator_for_user
β
Type
Default value
Type
UInt64
Default value
1073741824
It represents the soft memory limit when the hard limit is reached on the user level.
This value is used to compute the overcommit ratio for the query.
Zero means skip the query.
Read more about
memory overcommit
.
memory_profiler_sample_max_allocation_size
β
Type
Default value
Type
UInt64
Default value
0
Collect random allocations of size less or equal than the specified value with probability equal to
memory_profiler_sample_probability
. 0 means disabled. You may want to set 'max_untracked_memory' to 0 to make this threshold work as expected.
memory_profiler_sample_min_allocation_size
β
Type
Default value
Type
UInt64
Default value
0
Collect random allocations of size greater or equal than the specified value with probability equal to
memory_profiler_sample_probability
. 0 means disabled. You may want to set 'max_untracked_memory' to 0 to make this threshold work as expected.
memory_profiler_sample_probability
β
Type
Default value
Type
Float
Default value
0
Collect random allocations and deallocations and write them into system.trace_log with 'MemorySample' trace_type. The probability is for every alloc/free regardless of the size of the allocation (can be changed with
memory_profiler_sample_min_allocation_size
and
memory_profiler_sample_max_allocation_size
). Note that sampling happens only when the amount of untracked memory exceeds 'max_untracked_memory'. You may want to set 'max_untracked_memory' to 0 for extra fine-grained sampling.
memory_profiler_step
β
Type
Default value
Type
UInt64
Default value
4194304
Sets the step of memory profiler. Whenever query memory usage becomes larger than every next step in number of bytes the memory profiler will collect the allocating stacktrace and will write it into
trace_log
.
Possible values:
A positive integer number of bytes.
0 for turning off the memory profiler.
memory_tracker_fault_probability
β
Type
Default value
Type
Float
Default value
0
For testing of
exception safety
- throw an exception every time you allocate memory with the specified probability.
memory_usage_overcommit_max_wait_microseconds
β
Type
Default value
Type
UInt64
Default value
5000000
Maximum time thread will wait for memory to be freed in the case of memory overcommit on a user level.
If the timeout is reached and memory is not freed, an exception is thrown.
Read more about
memory overcommit
.
merge_table_max_tables_to_look_for_schema_inference
β
Type
Default value
Type
UInt64
Default value
1000
When creating a
Merge
table without an explicit schema or when using the
merge
table function, infer schema as a union of not more than the specified number of matching tables.
If there is a larger number of tables, the schema will be inferred from the first specified number of tables.
merge_tree_coarse_index_granularity
β
Type
Default value
Type
UInt64
Default value
8
When searching for data, ClickHouse checks the data marks in the index file. If ClickHouse finds that required keys are in some range, it divides this range into
merge_tree_coarse_index_granularity
subranges and searches the required keys there recursively.
Possible values:
Any positive even integer.
merge_tree_compact_parts_min_granules_to_multibuffer_read
β
ClickHouse Cloud only
Type
Default value
Type
UInt64
Default value
16
Only has an effect in ClickHouse Cloud. Number of granules in stripe of compact part of MergeTree tables to use multibuffer reader, which supports parallel reading and prefetch. In case of reading from remote fs using of multibuffer reader increases number of read request.
merge_tree_determine_task_size_by_prewhere_columns
β
Type
Default value
Type
Bool
Default value
1
Whether to use only prewhere columns size to determine reading task size.
merge_tree_max_bytes_to_use_cache
β
Type
Default value
Type
UInt64
Default value
2013265920
If ClickHouse should read more than
merge_tree_max_bytes_to_use_cache
bytes in one query, it does not use the cache of uncompressed blocks.
The cache of uncompressed blocks stores data extracted for queries. ClickHouse uses this cache to speed up responses to repeated small queries. This setting protects the cache from trashing by queries that read a large amount of data. The
uncompressed_cache_size
server setting defines the size of the cache of uncompressed blocks.
Possible values:
Any positive integer.
merge_tree_max_rows_to_use_cache
β
Type
Default value
Type
UInt64
Default value
1048576
If ClickHouse should read more than
merge_tree_max_rows_to_use_cache
rows in one query, it does not use the cache of uncompressed blocks.
The cache of uncompressed blocks stores data extracted for queries. ClickHouse uses this cache to speed up responses to repeated small queries. This setting protects the cache from trashing by queries that read a large amount of data. The
uncompressed_cache_size
server setting defines the size of the cache of uncompressed blocks.
Possible values:
Any positive integer.
merge_tree_min_bytes_for_concurrent_read
β
Type
Default value
Type
UInt64
Default value
251658240
If the number of bytes to read from one file of a
MergeTree
-engine table exceeds
merge_tree_min_bytes_for_concurrent_read
, then ClickHouse tries to concurrently read from this file in several threads.
Possible value:
Positive integer.
merge_tree_min_bytes_for_concurrent_read_for_remote_filesystem
β
Type
Default value
Type
UInt64
Default value
0
The minimum number of bytes to read from one file before
MergeTree
engine can parallelize reading, when reading from remote filesystem. We do not recommend using this setting.
Possible values:
Positive integer.
merge_tree_min_bytes_for_seek
β
Type
Default value
Type
UInt64
Default value
0
If the distance between two data blocks to be read in one file is less than
merge_tree_min_bytes_for_seek
bytes, then ClickHouse sequentially reads a range of file that contains both blocks, thus avoiding extra seek.
Possible values:
Any positive integer.
merge_tree_min_bytes_per_task_for_remote_reading
β
Aliases
:
filesystem_prefetch_min_bytes_for_single_read_task
Type
Default value
Type
UInt64
Default value
2097152
Min bytes to read per task.
merge_tree_min_read_task_size
β
Type
Default value
Type
NonZeroUInt64
Default value
8
Hard lower limit on the task size (even when the number of granules is low and the number of available threads is high we won't allocate smaller tasks
merge_tree_min_rows_for_concurrent_read
β
Type
Default value
Type
UInt64
Default value
163840
If the number of rows to be read from a file of a
MergeTree
table exceeds
merge_tree_min_rows_for_concurrent_read
then ClickHouse tries to perform a concurrent reading from this file on several threads.
Possible values:
Positive integer.
merge_tree_min_rows_for_concurrent_read_for_remote_filesystem
β
Type
Default value
Type
UInt64
Default value
0
The minimum number of lines to read from one file before the
MergeTree
engine can parallelize reading, when reading from remote filesystem. We do not recommend using this setting.
Possible values:
Positive integer.
merge_tree_min_rows_for_seek
β
Type
Default value
Type
UInt64
Default value
0
If the distance between two data blocks to be read in one file is less than
merge_tree_min_rows_for_seek
rows, then ClickHouse does not seek through the file but reads the data sequentially.
Possible values:
Any positive integer.
merge_tree_read_split_ranges_into_intersecting_and_non_intersecting_injection_probability
β
Type
Default value
Type
Float
Default value
0
For testing of
PartsSplitter
- split read ranges into intersecting and non intersecting every time you read from MergeTree with the specified probability.
merge_tree_storage_snapshot_sleep_ms
β
Type
Default value
Type
UInt64
Default value
0
Inject artificial delay (in milliseconds) when creating a storage snapshot for MergeTree tables.
Used for testing and debugging purposes only.
Possible values:
0 - No delay (default)
N - Delay in milliseconds
merge_tree_use_const_size_tasks_for_remote_reading
β
Type
Default value
Type
Bool
Default value
1
Whether to use constant size tasks for reading from a remote table.
merge_tree_use_deserialization_prefixes_cache
β
Type
Default value
Type
Bool
Default value
1
Enables caching of columns metadata from the file prefixes during reading from remote disks in MergeTree.
merge_tree_use_prefixes_deserialization_thread_pool
β
Type
Default value
Type
Bool
Default value
1
Enables usage of the thread pool for parallel prefixes reading in Wide parts in MergeTree. Size of that thread pool is controlled by server setting
max_prefixes_deserialization_thread_pool_size
.
merge_tree_use_v1_object_and_dynamic_serialization
β
Type
Default value
Type
Bool
Default value
0
When enabled, V1 serialization version of JSON and Dynamic types will be used in MergeTree instead of V2. Changing this setting takes affect only after server restart.
metrics_perf_events_enabled
β
Type
Default value
Type
Bool
Default value
0
If enabled, some of the perf events will be measured throughout queries' execution.
metrics_perf_events_list
β
Comma separated list of perf metrics that will be measured throughout queries' execution. Empty means all events. See PerfEventInfo in sources for the available events.
min_bytes_to_use_direct_io
β
Type
Default value
Type
UInt64
Default value
0
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
β
Type
Default value
Type
UInt64
Default value
0
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.
min_chunk_bytes_for_parallel_parsing
β
Type
Default value
Type
NonZeroUInt64
Default value
10485760
Type: unsigned int
Default value: 1 MiB
The minimum chunk size in bytes, which each thread will parse in parallel.
min_compress_block_size
β
Type
Default value
Type
UInt64
Default value
65536
For
MergeTree
tables. In order to reduce latency when processing queries, a block is compressed when writing the next mark if its size is at least
min_compress_block_size
. By default, 65,536.
The actual size of the block, if the uncompressed data is less than
max_compress_block_size
, is no less than this value and no less than the volume of data for one mark.
Let's look at an example. Assume that
index_granularity
was set to 8192 during table creation.
We are writing a UInt32-type column (4 bytes per value). When writing 8192 rows, the total will be 32 KB of data. Since min_compress_block_size = 65,536, a compressed block will be formed for every two marks.
We are writing a URL column with the String type (average size of 60 bytes per value). When writing 8192 rows, the average will be slightly less than 500 KB of data. Since this is more than 65,536, a compressed block will be formed for each mark. In this case, when reading data from the disk in the range of a single mark, extra data won't be decompressed.
Note
This is an expert-level setting, and you shouldn't change it if you're just getting started with ClickHouse.
min_count_to_compile_aggregate_expression
β
Type
Default value
Type
UInt64
Default value
3
The minimum number of identical aggregate expressions to start JIT-compilation. Works only if the
compile_aggregate_expressions
setting is enabled.
Possible values:
Positive integer.
0 β Identical aggregate expressions are always JIT-compiled.
min_count_to_compile_expression
β
Type
Default value
Type
UInt64
Default value
3
Minimum count of executing same expression before it is get compiled.
min_count_to_compile_sort_description
β
Type
Default value
Type
UInt64
Default value
3
The number of identical sort descriptions before they are JIT-compiled
min_execution_speed
β
Type
Default value
Type
UInt64
Default value
0
Minimal execution speed in rows per second. Checked on every data block when
timeout_before_checking_execution_speed
expires. If the execution speed is lower, an exception is thrown.
min_execution_speed_bytes
β
Type
Default value
Type
UInt64
Default value
0
The minimum number of execution bytes per second. Checked on every data block when
timeout_before_checking_execution_speed
expires. If the execution speed is lower, an exception is thrown.
min_external_table_block_size_bytes
β
Type
Default value
Type
UInt64
Default value
268402944
Squash blocks passed to the external table to a specified size in bytes, if blocks are not big enough.
min_external_table_block_size_rows
β
Type
Default value
Type
UInt64
Default value
1048449
Squash blocks passed to external table to specified size in rows, if blocks are not big enough.
min_free_disk_bytes_to_perform_insert
β
Type
Default value
Type
UInt64
Default value
0
Minimum free disk space bytes to perform an insert.
min_free_disk_ratio_to_perform_insert
β
Type
Default value
Type
Float
Default value
0
Minimum free disk space ratio to perform an insert.
min_free_disk_space_for_temporary_data
β
Type
Default value
Type
UInt64
Default value
0
The minimum disk space to keep while writing temporary data used in external sorting and aggregation.
min_hit_rate_to_use_consecutive_keys_optimization
β
Type
Default value
Type
Float
Default value
0.5
Minimal hit rate of a cache which is used for consecutive keys optimization in aggregation to keep it enabled
min_insert_block_size_bytes
β
Type
Default value
Type
UInt64
Default value
268402944
The minimum size of blocks (in bytes) to form for insertion into a table.
This setting works together with min_insert_block_size_rows and controls block formation in the same contexts (format parsing and INSERT operations). See min_insert_block_size_rows for detailed information about when and how these settings are applied.
Possible values:
Positive integer.
0 β setting does not participate in block formation.
min_insert_block_size_bytes_for_materialized_views
β
Type
Default value
Type
UInt64
Default value
0
Sets the minimum number of bytes in the block which can be inserted into a table by an
INSERT
query. Smaller-sized blocks are squashed into bigger ones. This setting is applied only for blocks inserted into
materialized view
. By adjusting this setting, you control blocks squashing while pushing to materialized view and avoid excessive memory usage.
Possible values:
Any positive integer.
0 β Squashing disabled.
See also
min_insert_block_size_bytes
min_insert_block_size_rows
β
Type
Default value
Type
UInt64
Default value
1048449
The minimum size of blocks (in rows) to form for insertion into a table.
This setting controls block formation in two contexts:
Format parsing: When the server parses row-based input formats (CSV, TSV, JSONEachRow, etc.) from any interface (HTTP, clickhouse-client with inline data, gRPC, PostgreSQL wire protocol), blocks are emitted when:
Both min_insert_block_size_rows AND min_insert_block_size_bytes are reached, OR
Either max_insert_block_size_rows OR max_insert_block_size_bytes is reached
Note: When using clickhouse-client or clickhouse-local to read from a file, the client itself parses the data and this setting applies on the client side.
INSERT operations: During INSERT queries and when data flows through materialized views, this setting's behavior depends on
use_strict_insert_block_limits
:
When enabled: Blocks are emitted when:
Min thresholds (AND): Both min_insert_block_size_rows AND min_insert_block_size_bytes are reached
Max thresholds (OR): Either max_insert_block_size_rows OR max_insert_block_size_bytes is reached
When disabled (default): Blocks are emitted when min_insert_block_size_rows OR min_insert_block_size_bytes is reached. The max_insert_block_size settings are not enforced.
Possible values:
Positive integer.
0 β setting does not participate in block formation.
min_insert_block_size_rows_for_materialized_views
β
Type
Default value
Type
UInt64
Default value
0
Sets the minimum number of rows in the block which can be inserted into a table by an
INSERT
query. Smaller-sized blocks are squashed into bigger ones. This setting is applied only for blocks inserted into
materialized view
. By adjusting this setting, you control blocks squashing while pushing to materialized view and avoid excessive memory usage.
Possible values:
Any positive integer.
0 β Squashing disabled.
See Also
min_insert_block_size_rows
min_joined_block_size_bytes
β
Type
Default value
Type
UInt64
Default value
524288
Minimum block size in bytes for JOIN input and output blocks (if join algorithm supports it). Small blocks will be squashed. 0 means unlimited.
min_joined_block_size_rows
β
Type
Default value
Type
UInt64
Default value
65409
Minimum block size in rows for JOIN input and output blocks (if join algorithm supports it). Small blocks will be squashed. 0 means unlimited.
min_os_cpu_wait_time_ratio_to_throw
β
Type
Default value
Type
Float
Default value
0
Min ratio between OS CPU wait (OSCPUWaitMicroseconds metric) and busy (OSCPUVirtualTimeMicroseconds metric) times to consider rejecting queries. Linear interpolation between min and max ratio is used to calculate the probability, the probability is 0 at this point.
min_outstreams_per_resize_after_split
β
Type
Default value
Type
UInt64
Default value
24
Specifies the minimum number of output streams of a
Resize
or
StrictResize
processor after the split is performed during pipeline generation. If the resulting number of streams is less than this value, the split operation will not occur.
What is a Resize Node
β
A
Resize
node is a processor in the query pipeline that adjusts the number of data streams flowing through the pipeline. It can either increase or decrease the number of streams to balance the workload across multiple threads or processors. For example, if a query requires more parallelism, the
Resize
node can split a single stream into multiple streams. Conversely, it can merge multiple streams into fewer streams to consolidate data processing.
The
Resize
node ensures that data is evenly distributed across streams, maintaining the structure of the data blocks. This helps optimize resource utilization and improve query performance.
Why the Resize Node Needs to Be Split
β
During pipeline execution, ExecutingGraph::Node::status_mutex of the centrally-hubbed
Resize
node is heavily contended especially in high-core-count environments, and this contention leads to:
Increased latency for ExecutingGraph::updateNode, directly impacting query performance.
Excessive CPU cycles are wasted in spin-lock contention (native_queued_spin_lock_slowpath), degrading efficiency.
Reduced CPU utilization, limiting parallelism and throughput.
How the Resize Node Gets Split
β
The number of output streams is checked to ensure the split could be performed: the output streams of each split processor meet or exceed the
min_outstreams_per_resize_after_split
threshold.
The
Resize
node is divided into smaller
Resize
nodes with equal count of ports, each handling a subset of input and output streams.
Each group is processed independently, reducing the lock contention.
Splitting Resize Node with Arbitrary Inputs/Outputs
β
In some cases, where the inputs/outputs are indivisible by the number of split
Resize
nodes, some inputs are connected to
NullSource
s and some outputs are connected to
NullSink
s. This allows the split to occur without affecting the overall data flow.
Purpose of the Setting
β
The
min_outstreams_per_resize_after_split
setting ensures that the splitting of
Resize
nodes is meaningful and avoids creating too few streams, which could lead to inefficient parallel processing. By enforcing a minimum number of output streams, this setting helps maintain a balance between parallelism and overhead, optimizing query execution in scenarios involving stream splitting and merging.
Disabling the Setting
β
To disable the split of
Resize
nodes, set this setting to 0. This will prevent the splitting of
Resize
nodes during pipeline generation, allowing them to retain their original structure without division into smaller nodes.
min_table_rows_to_use_projection_index
β
Type
Default value
Type
UInt64
Default value
1000000
If the estimated number of rows to read from the table is greater than or equal to this threshold, ClickHouse will try to use the projection index during query execution.
mongodb_throw_on_unsupported_query
β
Type
Default value
Type
Bool
Default value
1
If enabled, MongoDB tables will return an error when a MongoDB query cannot be built. Otherwise, ClickHouse reads the full table and processes it locally. This option does not apply when 'allow_experimental_analyzer=0'.
move_all_conditions_to_prewhere
β
Type
Default value
Type
Bool
Default value
1
Move all viable conditions from WHERE to PREWHERE
move_primary_key_columns_to_end_of_prewhere
β
Type
Default value
Type
Bool
Default value
1
Move PREWHERE conditions containing primary key columns to the end of AND chain. It is likely that these conditions are taken into account during primary key analysis and thus will not contribute a lot to PREWHERE filtering.
multiple_joins_try_to_keep_original_names
β
Type
Default value
Type
Bool
Default value
0
Do not add aliases to top level expression list on multiple joins rewrite
mutations_execute_nondeterministic_on_initiator
β
Type
Default value
Type
Bool
Default value
0
If true constant nondeterministic functions (e.g. function
now()
) are executed on initiator and replaced to literals in
UPDATE
and
DELETE
queries. It helps to keep data in sync on replicas while executing mutations with constant nondeterministic functions. Default value:
false
.
mutations_execute_subqueries_on_initiator
β
Type
Default value
Type
Bool
Default value
0
If true scalar subqueries are executed on initiator and replaced to literals in
UPDATE
and
DELETE
queries. Default value:
false
.
mutations_max_literal_size_to_replace
β
Type
Default value
Type
UInt64
Default value
16384
The maximum size of serialized literal in bytes to replace in
UPDATE
and
DELETE
queries. Takes effect only if at least one the two settings above is enabled. Default value: 16384 (16 KiB).
mutations_sync
β
Type
Default value
Type
UInt64
Default value
0
Allows to execute
ALTER TABLE ... UPDATE|DELETE|MATERIALIZE INDEX|MATERIALIZE PROJECTION|MATERIALIZE COLUMN|MATERIALIZE STATISTICS
queries (
mutations
) synchronously.
Possible values:
Value
Description
0
Mutations execute asynchronously.
1
The query waits for all mutations to complete on the current server.
2
The query waits for all mutations to complete on all replicas (if they exist).
3
The query waits only for active replicas. Supported only for
SharedMergeTree
. For
ReplicatedMergeTree
it behaves the same as
mutations_sync = 2
.
mysql_datatypes_support_level
β
Type
Default value
Type
MySQLDataTypesSupport
Default value
decimal,datetime64,date2Date32
Defines how MySQL types are converted to corresponding ClickHouse types. A comma separated list in any combination of
decimal
,
datetime64
,
date2Date32
or
date2String
. All modern mappings (
decimal
,
datetime64
,
date2Date32
) are enabled by default.
decimal
: convert
NUMERIC
and
DECIMAL
types to
Decimal
when precision allows it.
datetime64
: convert
DATETIME
and
TIMESTAMP
types to
DateTime64
instead of
DateTime
when precision is not
0
.
date2Date32
: convert
DATE
to
Date32
instead of
Date
. Takes precedence over
date2String
.
date2String
: convert
DATE
to
String
instead of
Date
. Overridden by
datetime64
.
mysql_map_fixed_string_to_text_in_show_columns
β
Type
Default value
Type
Bool
Default value
1
When enabled,
FixedString
ClickHouse data type will be displayed as
TEXT
in
SHOW COLUMNS
.
Has an effect only when the connection is made through the MySQL wire protocol.
0 - Use
BLOB
.
1 - Use
TEXT
.
mysql_map_string_to_text_in_show_columns
β
Type
Default value
Type
Bool
Default value
1
When enabled,
String
ClickHouse data type will be displayed as
TEXT
in
SHOW COLUMNS
.
Has an effect only when the connection is made through the MySQL wire protocol.
0 - Use
BLOB
.
1 - Use
TEXT
.
mysql_max_rows_to_insert
β
Type
Default value
Type
UInt64
Default value
65536
The maximum number of rows in MySQL batch insertion of the MySQL storage engine
network_compression_method
β
Type
Default value
Type
String
Default value
LZ4
The codec for compressing the client/server and server/server communication.
Possible values:
NONE
β no compression.
LZ4
β use the LZ4 codec.
LZ4HC
β use the LZ4HC codec.
ZSTD
β use the ZSTD codec.
See Also
network_zstd_compression_level
network_zstd_compression_level
β
Type
Default value
Type
Int64
Default value
1
Adjusts the level of ZSTD compression. Used only when
network_compression_method
is set to
ZSTD
.
Possible values:
Positive integer from 1 to 15.
normalize_function_names
β
Type
Default value
Type
Bool
Default value
1
Normalize function names to their canonical names
number_of_mutations_to_delay
β
Type
Default value
Type
UInt64
Default value
0
If the mutated table contains at least that many unfinished mutations, artificially slow down mutations of table. 0 - disabled
number_of_mutations_to_throw
β
Type
Default value
Type
UInt64
Default value
0
If the mutated table contains at least that many unfinished mutations, throw 'Too many mutations ...' exception. 0 - disabled
odbc_bridge_connection_pool_size
β
Type
Default value
Type
UInt64
Default value
16
Connection pool size for each connection settings string in ODBC bridge.
odbc_bridge_use_connection_pooling
β
Type
Default value
Type
Bool
Default value
1
Use connection pooling in ODBC bridge. If set to false, a new connection is created every time.
offset
β
Type
Default value
Type
UInt64
Default value
0
Sets the number of rows to skip before starting to return rows from the query. It adjusts the offset set by the
OFFSET
clause, so that these two values are summarized.
Possible values:
0 β No rows are skipped .
Positive integer.
Example
Input table:
CREATE TABLE test (i UInt64) ENGINE = MergeTree() ORDER BY i;
INSERT INTO test SELECT number FROM numbers(500);
Query:
SET limit = 5;
SET offset = 7;
SELECT * FROM test LIMIT 10 OFFSET 100;
Result:
ββββiββ
β 107 β
β 108 β
β 109 β
βββββββ
opentelemetry_start_keeper_trace_probability
β
Type
Default value
Type
FloatAuto
Default value
auto
Probability to start a trace for ZooKeeper request - whether there is a parent trace or not.
Possible values:
'auto' - Equals the opentelemetry_start_trace_probability setting
0 β Tracing is disabled
0 to 1 β Probability (e.g., 1.0 = always enable)
opentelemetry_start_trace_probability
β
Type
Default value
Type
Float
Default value
0
Sets the probability that the ClickHouse can start a trace for executed queries (if no parent
trace context
is supplied).
Possible values:
0 β The trace for all executed queries is disabled (if no parent trace context is supplied).
Positive floating-point number in the range [0..1]. For example, if the setting value is
0,5
, ClickHouse can start a trace on average for half of the queries.
1 β The trace for all executed queries is enabled.
opentelemetry_trace_cpu_scheduling
β
Type
Default value
Type
Bool
Default value
0
Collect OpenTelemetry spans for workload preemptive CPU scheduling.
opentelemetry_trace_processors
β
Type
Default value
Type
Bool
Default value
0
Collect OpenTelemetry spans for processors.
optimize_aggregation_in_order
β
Type
Default value
Type
Bool
Default value
0
Enables
GROUP BY
optimization in
SELECT
queries for aggregating data in corresponding order in
MergeTree
tables.
Possible values:
0 β
GROUP BY
optimization is disabled.
1 β
GROUP BY
optimization is enabled.
See Also
GROUP BY optimization
optimize_aggregators_of_group_by_keys
β
Type
Default value
Type
Bool
Default value
1
Eliminates min/max/any/anyLast aggregators of GROUP BY keys in SELECT sectio
optimize_and_compare_chain
β
Type
Default value
Type
Bool
Default value
1
Populate constant comparison in AND chains to enhance filtering ability. Support operators
<
,
<=
,
>
,
>=
,
=
and mix of them. For example,
(a < b) AND (b < c) AND (c < 5)
would be
(a < b) AND (b < c) AND (c < 5) AND (b < 5) AND (a < 5)
.
optimize_append_index
β
Type
Default value
Type
Bool
Default value
0
Use
constraints
in order to append index condition. The default is
false
.
Possible values:
true, false
optimize_arithmetic_operations_in_aggregate_functions
β
Type
Default value
Type
Bool
Default value
1
Move arithmetic operations out of aggregation functions
optimize_const_name_size
β
Type
Default value
Type
Int64
Default value
256
Replace with scalar and use hash as a name for large constants (size is estimated by the name length).
Possible values:
positive integer - max length of the name,
0 β always,
negative integer - never.
optimize_count_from_files
β
Type
Default value
Type
Bool
Default value
1
Enables or disables the optimization of counting number of rows from files in different input formats. It applies to table functions/engines
file
/
s3
/
url
/
hdfs
/
azureBlobStorage
.
Possible values:
0 β Optimization disabled.
1 β Optimization enabled.
optimize_distinct_in_order
β
Type
Default value
Type
Bool
Default value
1
Enable DISTINCT optimization if some columns in DISTINCT form a prefix of sorting. For example, prefix of sorting key in merge tree or ORDER BY statement
optimize_distributed_group_by_sharding_key
β
Type
Default value
Type
Bool
Default value
1
Optimize
GROUP BY sharding_key
queries, by avoiding costly aggregation on the initiator server (which will reduce memory usage for the query on the initiator server).
The following types of queries are supported (and all combinations of them):
SELECT DISTINCT [..., ]sharding_key[, ...] FROM dist
SELECT ... FROM dist GROUP BY sharding_key[, ...]
SELECT ... FROM dist GROUP BY sharding_key[, ...] ORDER BY x
SELECT ... FROM dist GROUP BY sharding_key[, ...] LIMIT 1
SELECT ... FROM dist GROUP BY sharding_key[, ...] LIMIT 1 BY x
The following types of queries are not supported (support for some of them may be added later):
SELECT ... GROUP BY sharding_key[, ...] WITH TOTALS
SELECT ... GROUP BY sharding_key[, ...] WITH ROLLUP
SELECT ... GROUP BY sharding_key[, ...] WITH CUBE
SELECT ... GROUP BY sharding_key[, ...] SETTINGS extremes=1
Possible values:
0 β Disabled.
1 β Enabled.
See also:
distributed_group_by_no_merge
distributed_push_down_limit
optimize_skip_unused_shards
Note
Right now it requires
optimize_skip_unused_shards
(the reason behind this is that one day it may be enabled by default, and it will work correctly only if data was inserted via Distributed table, i.e. data is distributed according to sharding_key).
optimize_dry_run_check_part
β
Type
Default value
Type
Bool
Default value
1
When enabled,
OPTIMIZE ... DRY RUN
validates the resulting merged part using
checkDataPart
. If the check fails, an exception is thrown.
optimize_empty_string_comparisons
β
Type
Default value
Type
Bool
Default value
1
Convert expressions like col = '' or '' = col into empty(col), and col != '' or '' != col into notEmpty(col),
only when col is of String or FixedString type.
Type
Default value
Type
Bool
Default value
1
Allow extracting common expressions from disjunctions in WHERE, PREWHERE, ON, HAVING and QUALIFY expressions. A logical expression like
(A AND B) OR (A AND C)
can be rewritten to
A AND (B OR C)
, which might help to utilize:
indices in simple filtering expressions
cross to inner join optimizatio
optimize_functions_to_subcolumns
β
Type
Default value
Type
Bool
Default value
1
Enables or disables optimization by transforming some functions to reading subcolumns. This reduces the amount of data to read.
These functions can be transformed:
length
to read the
size0
subcolumn.
empty
to read the
size0
subcolumn.
notEmpty
to read the
size0
subcolumn.
isNull
to read the
null
subcolumn.
isNotNull
to read the
null
subcolumn.
count
to read the
null
subcolumn.
mapKeys
to read the
keys
subcolumn.
mapValues
to read the
values
subcolumn.
Possible values:
0 β Optimization disabled.
1 β Optimization enabled.
optimize_group_by_constant_keys
β
Type
Default value
Type
Bool
Default value
1
Optimize GROUP BY when all keys in block are constant
optimize_group_by_function_keys
β
Type
Default value
Type
Bool
Default value
1
Eliminates functions of other keys in GROUP BY sectio
optimize_if_chain_to_multiif
β
Type
Default value
Type
Bool
Default value
0
Replace if(cond1, then1, if(cond2, ...)) chains to multiIf. Currently it's not beneficial for numeric types.
optimize_if_transform_strings_to_enum
β
Type
Default value
Type
Bool
Default value
0
Replaces string-type arguments in If and Transform to enum. Disabled by default cause it could make inconsistent change in distributed query that would lead to its fail.
optimize_injective_functions_in_group_by
β
Type
Default value
Type
Bool
Default value
1
Replaces injective functions by it's arguments in GROUP BY sectio
optimize_injective_functions_inside_uniq
β
Type
Default value
Type
Bool
Default value
1
Delete injective functions of one argument inside uniq*() functions.
optimize_inverse_dictionary_lookup
β
Type
Default value
Type
Bool
Default value
1
Avoid repeated inverse dictionary lookup by doing faster lookups into a precomputed set of possible key values.
optimize_min_equality_disjunction_chain_length
β
Type
Default value
Type
UInt64
Default value
3
The minimum length of the expression
expr = x1 OR ... expr = xN
for optimizatio
optimize_min_inequality_conjunction_chain_length
β
Type
Default value
Type
UInt64
Default value
3
The minimum length of the expression
expr <> x1 AND ... expr <> xN
for optimizatio
optimize_move_to_prewhere
β
Type
Default value
Type
Bool
Default value
1
Enables or disables automatic
PREWHERE
optimization in
SELECT
queries.
Works only for
*MergeTree
tables.
Possible values:
0 β Automatic
PREWHERE
optimization is disabled.
1 β Automatic
PREWHERE
optimization is enabled.
optimize_move_to_prewhere_if_final
β
Type
Default value
Type
Bool
Default value
0
Enables or disables automatic
PREWHERE
optimization in
SELECT
queries with
FINAL
modifier.
Works only for
*MergeTree
tables.
Possible values:
0 β Automatic
PREWHERE
optimization in
SELECT
queries with
FINAL
modifier is disabled.
1 β Automatic
PREWHERE
optimization in
SELECT
queries with
FINAL
modifier is enabled.
See Also
optimize_move_to_prewhere
setting
optimize_multiif_to_if
β
Type
Default value
Type
Bool
Default value
1
Replace 'multiIf' with only one condition to 'if'.
optimize_normalize_count_variants
β
Type
Default value
Type
Bool
Default value
1
Rewrite aggregate functions that semantically equals to count() as count().
optimize_on_insert
β
Type
Default value
Type
Bool
Default value
1
Enables or disables data transformation before the insertion, as if merge was done on this block (according to table engine).
Possible values:
0 β Disabled.
1 β Enabled.
Example
The difference between enabled and disabled:
Query:
SET optimize_on_insert = 1;
CREATE TABLE test1 (`FirstTable` UInt32) ENGINE = ReplacingMergeTree ORDER BY FirstTable;
INSERT INTO test1 SELECT number % 2 FROM numbers(5);
SELECT * FROM test1;
SET optimize_on_insert = 0;
CREATE TABLE test2 (`SecondTable` UInt32) ENGINE = ReplacingMergeTree ORDER BY SecondTable;
INSERT INTO test2 SELECT number % 2 FROM numbers(5);
SELECT * FROM test2;
Result:
ββFirstTableββ
β 0 β
β 1 β
ββββββββββββββ
ββSecondTableββ
β 0 β
β 0 β
β 0 β
β 1 β
β 1 β
βββββββββββββββ
Note that this setting influences
Materialized view
behaviour.
optimize_or_like_chain
β
Type
Default value
Type
Bool
Default value
0
Optimize multiple OR LIKE into multiMatchAny. This optimization should not be enabled by default, because it defies index analysis in some cases.
optimize_qbit_distance_function_reads
β
Type
Default value
Type
Bool
Default value
1
Replace distance functions on
QBit
data type with equivalent ones that only read the columns necessary for the calculation from the storage.
optimize_read_in_order
β
Type
Default value
Type
Bool
Default value
1
Enables
ORDER BY
optimization in
SELECT
queries for reading data from
MergeTree
tables.
Possible values:
0 β
ORDER BY
optimization is disabled.
1 β
ORDER BY
optimization is enabled.
See Also
ORDER BY Clause
optimize_redundant_functions_in_order_by
β
Type
Default value
Type
Bool
Default value
1
Remove functions from ORDER BY if its argument is also in ORDER BY
optimize_respect_aliases
β
Type
Default value
Type
Bool
Default value
1
If it is set to true, it will respect aliases in WHERE/GROUP BY/ORDER BY, that will help with partition pruning/secondary indexes/optimize_aggregation_in_order/optimize_read_in_order/optimize_trivial_count
optimize_rewrite_aggregate_function_with_if
β
Type
Default value
Type
Bool
Default value
1
Rewrite aggregate functions with if expression as argument when logically equivalent.
For example,
avg(if(cond, col, null))
can be rewritten to
avgOrNullIf(cond, col)
. It may improve performance.
Note
Supported only with the analyzer (
enable_analyzer = 1
).
optimize_rewrite_array_exists_to_has
β
Type
Default value
Type
Bool
Default value
0
Rewrite arrayExists() functions to has() when logically equivalent. For example, arrayExists(x -> x = 1, arr) can be rewritten to has(arr, 1)
optimize_rewrite_like_perfect_affix
β
Type
Default value
Type
Bool
Default value
1
Rewrite LIKE expressions with perfect prefix or suffix (e.g.
col LIKE 'ClickHouse%'
) to startsWith or endsWith functions (e.g.
startsWith(col, 'ClickHouse')
).
optimize_rewrite_regexp_functions
β
Type
Default value
Type
Bool
Default value
1
Rewrite regular expression related functions into simpler and more efficient forms
optimize_rewrite_sum_if_to_count_if
β
Type
Default value
Type
Bool
Default value
1
Rewrite sumIf() and sum(if()) function countIf() function when logically equivalent
optimize_skip_merged_partitions
β
Type
Default value
Type
Bool
Default value
0
Enables or disables optimization for
OPTIMIZE TABLE ... FINAL
query if there is only one part with level > 0 and it doesn't have expired TTL.
OPTIMIZE TABLE ... FINAL SETTINGS optimize_skip_merged_partitions=1
By default,
OPTIMIZE TABLE ... FINAL
query rewrites the one part even if there is only a single part.
Possible values:
1 - Enable optimization.
0 - Disable optimization.
optimize_skip_unused_shards
β
Type
Default value
Type
Bool
Default value
0
Enables or disables skipping of unused shards for
SELECT
queries that have sharding key condition in
WHERE/PREWHERE
, and activates related optimizations for distributed queries (e.g. aggregation by sharding key).
Note
Assumes that the data is distributed by sharding key, otherwise a query yields incorrect result.
Possible values:
0 β Disabled.
1 β Enabled.
optimize_skip_unused_shards_limit
β
Type
Default value
Type
UInt64
Default value
1000
Limit for number of sharding key values, turns off
optimize_skip_unused_shards
if the limit is reached.
Too many values may require significant amount for processing, while the benefit is doubtful, since if you have huge number of values in
IN (...)
, then most likely the query will be sent to all shards anyway.
optimize_skip_unused_shards_nesting
β
Type
Default value
Type
UInt64
Default value
0
Controls
optimize_skip_unused_shards
(hence still requires
optimize_skip_unused_shards
) depends on the nesting level of the distributed query (case when you have
Distributed
table that look into another
Distributed
table).
Possible values:
0 β Disabled,
optimize_skip_unused_shards
works always.
1 β Enables
optimize_skip_unused_shards
only for the first level.
2 β Enables
optimize_skip_unused_shards
up to the second level.
optimize_skip_unused_shards_rewrite_in
β
Type
Default value
Type
Bool
Default value
1
Rewrite IN in query for remote shards to exclude values that does not belong to the shard (requires optimize_skip_unused_shards).
Possible values:
0 β Disabled.
1 β Enabled.
optimize_sorting_by_input_stream_properties
β
Type
Default value
Type
Bool
Default value
1
Optimize sorting by sorting properties of input stream
optimize_substitute_columns
β
Type
Default value
Type
Bool
Default value
0
Use
constraints
for column substitution. The default is
false
.
Possible values:
true, false
optimize_syntax_fuse_functions
β
Type
Default value
Type
Bool
Default value
1
Enables to fuse aggregate functions with identical argument. It rewrites query contains at least two aggregate functions from
sum
,
count
or
avg
with identical argument to
sumCount
.
Possible values:
0 β Functions with identical argument are not fused.
1 β Functions with identical argument are fused.
Example
Query:
CREATE TABLE fuse_tbl(a Int8, b Int8) Engine = Log;
SET optimize_syntax_fuse_functions = 1;
EXPLAIN SYNTAX run_query_tree_passes = 1 SELECT sum(a), sum(b), count(b), avg(b) from fuse_tbl FORMAT TSV;
Result:
SELECT
sum(__table1.a) AS `sum(a)`,
tupleElement(sumCount(__table1.b), 1) AS `sum(b)`,
tupleElement(sumCount(__table1.b), 2) AS `count(b)`,
divide(tupleElement(sumCount(__table1.b), 1), toFloat64(tupleElement(sumCount(__table1.b), 2))) AS `avg(b)`
FROM default.fuse_tbl AS __table1
optimize_throw_if_noop
β
Type
Default value
Type
Bool
Default value
0
Enables or disables throwing an exception if an
OPTIMIZE
query didn't perform a merge.
By default,
OPTIMIZE
returns successfully even if it didn't do anything. This setting lets you differentiate these situations and get the reason in an exception message.
Possible values:
1 β Throwing an exception is enabled.
0 β Throwing an exception is disabled.
optimize_time_filter_with_preimage
β
Type
Default value
Type
Bool
Default value
1
Optimize Date and DateTime predicates by converting functions into equivalent comparisons without conversions (e.g.
toYear(col) = 2023 -> col >= '2023-01-01' AND col <= '2023-12-31'
)
optimize_trivial_approximate_count_query
β
Type
Default value
Type
Bool
Default value
0
Use an approximate value for trivial count optimization of storages that support such estimation, for example, EmbeddedRocksDB.
Possible values:
0 β Optimization disabled.
1 β Optimization enabled.
optimize_trivial_count_query
β
Type
Default value
Type
Bool
Default value
1
Enables or disables the optimization to trivial query
SELECT count() FROM table
using metadata from MergeTree. If you need to use row-level security, disable this setting.
Possible values:
0 β Optimization disabled.
1 β Optimization enabled.
See also:
optimize_functions_to_subcolumns
optimize_trivial_insert_select
β
Type
Default value
Type
Bool
Default value
0
Optimize trivial 'INSERT INTO table SELECT ... FROM TABLES' query
optimize_truncate_order_by_after_group_by_keys
β
Type
Default value
Type
Bool
Default value
1
Remove trailing ORDER BY elements once all GROUP BY keys are covered in the ORDER BY prefix.
optimize_uniq_to_count
β
Type
Default value
Type
Bool
Default value
1
Rewrite uniq and its variants(except uniqUpTo) to count if subquery has distinct or group by clause.
optimize_use_implicit_projections
β
Type
Default value
Type
Bool
Default value
1
Automatically choose implicit projections to perform SELECT query
optimize_use_projection_filtering
β
Type
Default value
Type
Bool
Default value
1
Enables using projections to filter part ranges even when projections are not selected to perform SELECT query.
optimize_use_projections
β
Aliases
:
allow_experimental_projection_optimization
Type
Default value
Type
Bool
Default value
1
Enables or disables
projection
optimization when processing
SELECT
queries.
Possible values:
0 β Projection optimization disabled.
1 β Projection optimization enabled.
optimize_using_constraints
β
Type
Default value
Type
Bool
Default value
0
Use
constraints
for query optimization. The default is
false
.
Possible values:
true, false
os_threads_nice_value_materialized_view
β
Type
Default value
Type
Int32
Default value
0
Linux nice value for materialized view threads. Lower values mean higher CPU priority.
Requires CAP_SYS_NICE capability, otherwise no-op.
Possible values: -20 to 19.
os_threads_nice_value_query
β
Aliases
:
os_thread_priority
Type
Default value
Type
Int32
Default value
0
Linux nice value for query processing threads. Lower values mean higher CPU priority.
Requires CAP_SYS_NICE capability, otherwise no-op.
Possible values: -20 to 19.
page_cache_block_size
β
Type
Default value
Type
UInt64
Default value
1048576
Size of file chunks to store in the userspace page cache, in bytes. All reads that go through the cache will be rounded up to a multiple of this size.
This setting can be adjusted on a per-query level basis, but cache entries with different block sizes cannot be reused. Changing this setting effectively invalidates existing entries in the cache.
A higher value, like 1 MiB is good for high-throughput queries, and a lower value, like 64 KiB is good for low-latency point queries.
page_cache_inject_eviction
β
Type
Default value
Type
Bool
Default value
0
Userspace page cache will sometimes invalidate some pages at random. Intended for testing.
page_cache_lookahead_blocks
β
Type
Default value
Type
UInt64
Default value
16
On userspace page cache miss, read up to this many consecutive blocks at once from the underlying storage, if they're also not in the cache. Each block is page_cache_block_size bytes.
A higher value is good for high-throughput queries, while low-latency point queries will work better without readahead.
parallel_distributed_insert_select
β
Type
Default value
Type
UInt64
Default value
2
Enables parallel distributed
INSERT ... SELECT
query.
If we execute
INSERT INTO distributed_table_a SELECT ... FROM distributed_table_b
queries and both tables use the same cluster, and both tables are either
replicated
or non-replicated, then this query is processed locally on every shard.
Possible values:
0
β Disabled.
1
β
SELECT
will be executed on each shard from the underlying table of the distributed engine.
2
β
SELECT
and
INSERT
will be executed on each shard from/to the underlying table of the distributed engine.
Setting
enable_parallel_replicas = 1
is needed when using this setting.
parallel_hash_join_threshold
β
Type
Default value
Type
UInt64
Default value
100000
When hash-based join algorithm is applied, this threshold helps to decide between using
hash
and
parallel_hash
(only if estimation of the right table size is available).
The former is used when we know that the right table size is below the threshold.
parallel_non_joined_rows_processing
β
Type
Default value
Type
Bool
Default value
1
Allow multiple threads to process non-joined rows from the right table in parallel during RIGHT and FULL JOINs.
This can speed up the non-joined phase when using the
parallel_hash
join algorithm with large tables.
When disabled, non-joined rows are processed by a single thread.
parallel_replica_offset
β
Type
Default value
Type
UInt64
Default value
0
This is internal setting that should not be used directly and represents an implementation detail of the 'parallel replicas' mode. This setting will be automatically set up by the initiator server for distributed queries to the index of the replica participating in query processing among parallel replicas.
parallel_replicas_allow_in_with_subquery
β
Type
Default value
Type
Bool
Default value
1
If true, subquery for IN will be executed on every follower replica.
parallel_replicas_allow_materialized_views
β
Type
Default value
Type
Bool
Default value
1
Allow usage of materialized views with parallel replicas
parallel_replicas_connect_timeout_ms
β
Type
Default value
Type
Milliseconds
Default value
300
The timeout in milliseconds for connecting to a remote replica during query execution with parallel replicas. If the timeout is expired, the corresponding replicas is not used for query executio
parallel_replicas_count
β
Type
Default value
Type
UInt64
Default value
0
This is internal setting that should not be used directly and represents an implementation detail of the 'parallel replicas' mode. This setting will be automatically set up by the initiator server for distributed queries to the number of parallel replicas participating in query processing.
parallel_replicas_custom_key
β
An arbitrary integer expression that can be used to split work between replicas for a specific table.
The value can be any integer expression.
Simple expressions using primary keys are preferred.
If the setting is used on a cluster that consists of a single shard with multiple replicas, those replicas will be converted into virtual shards.
Otherwise, it will behave same as for
SAMPLE
key, it will use multiple replicas of each shard.
parallel_replicas_custom_key_range_lower
β
Type
Default value
Type
UInt64
Default value
0
Allows the filter type
range
to split the work evenly between replicas based on the custom range
[parallel_replicas_custom_key_range_lower, INT_MAX]
.
When used in conjunction with
parallel_replicas_custom_key_range_upper
, it lets the filter evenly split the work over replicas for the range
[parallel_replicas_custom_key_range_lower, parallel_replicas_custom_key_range_upper]
.
Note: This setting will not cause any additional data to be filtered during query processing, rather it changes the points at which the range filter breaks up the range
[0, INT_MAX]
for parallel processing.
parallel_replicas_custom_key_range_upper
β
Type
Default value
Type
UInt64
Default value
0
Allows the filter type
range
to split the work evenly between replicas based on the custom range
[0, parallel_replicas_custom_key_range_upper]
. A value of 0 disables the upper bound, setting it the max value of the custom key expression.
When used in conjunction with
parallel_replicas_custom_key_range_lower
, it lets the filter evenly split the work over replicas for the range
[parallel_replicas_custom_key_range_lower, parallel_replicas_custom_key_range_upper]
.
Note: This setting will not cause any additional data to be filtered during query processing, rather it changes the points at which the range filter breaks up the range
[0, INT_MAX]
for parallel processing
parallel_replicas_filter_pushdown
β
Type
Default value
Type
Bool
Default value
0
Allow pushing down filters to part of query which parallel replicas choose to execute
parallel_replicas_for_cluster_engines
β
Type
Default value
Type
Bool
Default value
1
Replace table function engines with their -Cluster alternatives
parallel_replicas_for_non_replicated_merge_tree
β
Type
Default value
Type
Bool
Default value
0
If true, ClickHouse will use parallel replicas algorithm also for non-replicated MergeTree tables
parallel_replicas_index_analysis_only_on_coordinator
β
Type
Default value
Type
Bool
Default value
1
Index analysis done only on replica-coordinator and skipped on other replicas. Effective only with enabled parallel_replicas_local_pla
parallel_replicas_insert_select_local_pipeline
β
Type
Default value
Type
Bool
Default value
1
Use local pipeline during distributed INSERT SELECT with parallel replicas
parallel_replicas_local_plan
β
Type
Default value
Type
Bool
Default value
1
Build local plan for local replica
parallel_replicas_mark_segment_size
β
Type
Default value
Type
UInt64
Default value
0
Parts virtually divided into segments to be distributed between replicas for parallel reading. This setting controls the size of these segments. Not recommended to change until you're absolutely sure in what you're doing. Value should be in range [128; 16384]
parallel_replicas_min_number_of_rows_per_replica
β
Type
Default value
Type
UInt64
Default value
0
Limit the number of replicas used in a query to (estimated rows to read / min_number_of_rows_per_replica). The max is still limited by 'max_parallel_replicas'
parallel_replicas_mode
β
Type
Default value
Type
ParallelReplicasMode
Default value
read_tasks
Type of filter to use with custom key for parallel replicas. default - use modulo operation on the custom key, range - use range filter on custom key using all possible values for the value type of custom key.
parallel_replicas_only_with_analyzer
β
Type
Default value
Type
Bool
Default value
1
The analyzer should be enabled to use parallel replicas. With disabled analyzer query execution fallbacks to local execution, even if parallel reading from replicas is enabled. Using parallel replicas without the analyzer enabled is not supported
parallel_replicas_prefer_local_join
β
Type
Default value
Type
Bool
Default value
1
If true, and JOIN can be executed with parallel replicas algorithm, and all storages of right JOIN part are *MergeTree, local JOIN will be used instead of GLOBAL JOIN.
parallel_replicas_support_projection
β
Type
Default value
Type
Bool
Default value
1
Optimization of projections can be applied in parallel replicas. Effective only with enabled parallel_replicas_local_plan and aggregation_in_order is inactive.
parallel_view_processing
β
Type
Default value
Type
Bool
Default value
0
Enables pushing to attached views concurrently instead of sequentially.
parallelize_output_from_storages
β
Type
Default value
Type
Bool
Default value
1
Parallelize output for reading step from storage. It allows parallelization of query processing right after reading from storage if possible
parsedatetime_e_requires_space_padding
β
Type
Default value
Type
Bool
Default value
0
Formatter '%e' in function 'parseDateTime' expects that single-digit days are space-padded, e.g., ' 2' is accepted but '2' raises an error.
parsedatetime_parse_without_leading_zeros
β
Type
Default value
Type
Bool
Default value
1
Formatters '%c', '%l' and '%k' in function 'parseDateTime' parse months and hours without leading zeros.
partial_merge_join_left_table_buffer_bytes
β
Type
Default value
Type
UInt64
Default value
0
If not 0 group left table blocks in bigger ones for left-side table in partial merge join. It uses up to 2x of specified memory per joining thread.
partial_merge_join_rows_in_right_blocks
β
Type
Default value
Type
UInt64
Default value
65536
Limits sizes of right-hand join data blocks in partial merge join algorithm for
JOIN
queries.
ClickHouse server:
Splits right-hand join data into blocks with up to the specified number of rows.
Indexes each block with its minimum and maximum values.
Unloads prepared blocks to disk if it is possible.
Possible values:
Any positive integer. Recommended range of values: [1000, 100000].
partial_result_on_first_cancel
β
Type
Default value
Type
Bool
Default value
0
Allows query to return a partial result after cancel.
parts_to_delay_insert
β
Type
Default value
Type
UInt64
Default value
0
If the destination table contains at least that many active parts in a single partition, artificially slow down insert into table.
parts_to_throw_insert
β
Type
Default value
Type
UInt64
Default value
0
If more than this number active parts in a single partition of the destination table, throw 'Too many parts ...' exception.
per_part_index_stats
β
Type
Default value
Type
Bool
Default value
0
Logs index statistics per part
poll_interval
β
Type
Default value
Type
UInt64
Default value
10
Block at the query wait loop on the server for the specified number of seconds.
polyglot_dialect
β
Source SQL dialect for the polyglot transpiler (e.g. 'sqlite', 'mysql', 'postgresql', 'snowflake', 'duckdb').
postgresql_connection_attempt_timeout
β
Type
Default value
Type
UInt64
Default value
2
Connection timeout in seconds of a single attempt to connect PostgreSQL end-point.
The value is passed as a
connect_timeout
parameter of the connection URL.
postgresql_connection_pool_auto_close_connection
β
Type
Default value
Type
Bool
Default value
0
Close connection before returning connection to the pool.
postgresql_connection_pool_retries
β
Type
Default value
Type
UInt64
Default value
2
Connection pool push/pop retries number for PostgreSQL table engine and database engine.
postgresql_connection_pool_size
β
Type
Default value
Type
UInt64
Default value
16
Connection pool size for PostgreSQL table engine and database engine.
postgresql_connection_pool_wait_timeout
β
Type
Default value
Type
UInt64
Default value
5000
Connection pool push/pop timeout on empty pool for PostgreSQL table engine and database engine. By default it will block on empty pool.
postgresql_fault_injection_probability
β
Type
Default value
Type
Float
Default value
0
Approximate probability of failing internal (for replication) PostgreSQL queries. Valid value is in interval [0.0f, 1.0f]
prefer_column_name_to_alias
β
Type
Default value
Type
Bool
Default value
0
Enables or disables using the original column names instead of aliases in query expressions and clauses. It especially matters when alias is the same as the column name, see
Expression Aliases
. Enable this setting to make aliases syntax rules in ClickHouse more compatible with most other database engines.
Possible values:
0 β The column name is substituted with the alias.
1 β The column name is not substituted with the alias.
Example
The difference between enabled and disabled:
Query:
SET prefer_column_name_to_alias = 0;
SELECT avg(number) AS number, max(number) FROM numbers(10);
Result:
Received exception from server (version 21.5.1):
Code: 184. DB::Exception: Received from localhost:9000. DB::Exception: Aggregate function avg(number) is found inside another aggregate function in query: While processing avg(number) AS number.
Query:
SET prefer_column_name_to_alias = 1;
SELECT avg(number) AS number, max(number) FROM numbers(10);
Result:
ββnumberββ¬βmax(number)ββ
β 4.5 β 9 β
ββββββββββ΄ββββββββββββββ
prefer_external_sort_block_bytes
β
Type
Default value
Type
UInt64
Default value
16744704
Prefer maximum block bytes for external sort, reduce the memory usage during merging.
prefer_global_in_and_join
β
Type
Default value
Type
Bool
Default value
0
Enables the replacement of
IN
/
JOIN
operators with
GLOBAL IN
/
GLOBAL JOIN
.
Possible values:
0 β Disabled.
IN
/
JOIN
operators are not replaced with
GLOBAL IN
/
GLOBAL JOIN
.
1 β Enabled.
IN
/
JOIN
operators are replaced with
GLOBAL IN
/
GLOBAL JOIN
.
Usage
Although
SET distributed_product_mode=global
Β can change the queries behavior for the distributed tables, it's not suitable for local tables or tables from external resources. Here is when the
prefer_global_in_and_join
setting comes into play.
For example, we have query serving nodes that contain local tables, which are not suitable for distribution. We need to scatter their data on the fly during distributed processing with the
GLOBAL
keyword β
GLOBAL IN
/
GLOBAL JOIN
.
Another use case of
prefer_global_in_and_join
Β is accessing tables created by external engines. This setting helps to reduce the number of calls to external sources while joining such tables: only one call per query.
See also:
Distributed subqueries
for more information on how to use
GLOBAL IN
/
GLOBAL JOIN
prefer_localhost_replica
β
Type
Default value
Type
Bool
Default value
1
Enables/disables preferable using the localhost replica when processing distributed queries.
Possible values:
1 β ClickHouse always sends a query to the localhost replica if it exists.
0 β ClickHouse uses the balancing strategy specified by the
load_balancing
setting.
Note
Disable this setting if you use
max_parallel_replicas
without
parallel_replicas_custom_key
.
If
parallel_replicas_custom_key
is set, disable this setting only if it's used on a cluster with multiple shards containing multiple replicas.
If it's used on a cluster with a single shard and multiple replicas, disabling this setting will have negative effects.
prefer_warmed_unmerged_parts_seconds
β
ClickHouse Cloud only
Type
Default value
Type
Int64
Default value
0
Only has an effect in ClickHouse Cloud. If a merged part is less than this many seconds old and is not pre-warmed (see
cache_populated_by_fetch
), but all its source parts are available and pre-warmed, SELECT queries will read from those parts instead. Only for Replicated-/SharedMergeTree. Note that this only checks whether CacheWarmer processed the part; if the part was fetched into cache by something else, it'll still be considered cold until CacheWarmer gets to it; if it was warmed, then evicted from cache, it'll still be considered warm.
preferred_block_size_bytes
β
Type
Default value
Type
UInt64
Default value
1000000
This setting adjusts the data block size for query processing and represents additional fine-tuning to the more rough 'max_block_size' setting. If the columns are large and with 'max_block_size' rows the block size is likely to be larger than the specified amount of bytes, its size will be lowered for better CPU cache locality.
preferred_max_column_in_block_size_bytes
β
Type
Default value
Type
UInt64
Default value
0
Limit on max column size in block while reading. Helps to decrease cache misses count. Should be close to L2 cache size.
preferred_optimize_projection_name
β
If it is set to a non-empty string, ClickHouse will try to apply specified projection in query.
Possible values:
string: name of preferred projectio
prefetch_buffer_size
β
Type
Default value
Type
UInt64
Default value
1048576
The maximum size of the prefetch buffer to read from the filesystem.
print_pretty_type_names
β
Type
Default value
Type
Bool
Default value
1
Allows to print deep-nested type names in a pretty way with indents in
DESCRIBE
query and in
toTypeName()
function.
Example:
CREATE TABLE test (a Tuple(b String, c Tuple(d Nullable(UInt64), e Array(UInt32), f Array(Tuple(g String, h Map(String, Array(Tuple(i String, j UInt64))))), k Date), l Nullable(String))) ENGINE=Memory;
DESCRIBE TABLE test FORMAT TSVRaw SETTINGS print_pretty_type_names=1;
a Tuple(
b String,
c Tuple(
d Nullable(UInt64),
e Array(UInt32),
f Array(Tuple(
g String,
h Map(
String,
Array(Tuple(
i String,
j UInt64
))
)
)),
k Date
),
l Nullable(String)
)
priority
β
Type
Default value
Type
UInt64
Default value
0
Priority of the query. 1 - the highest, higher value - lower priority; 0 - do not use priorities.
promql_database
β
Specifies the database name used by the 'promql' dialect. Empty string means the current database.
promql_evaluation_time
β
Aliases
:
evaluation_time
Type
Default value
Type
FloatAuto
Default value
auto
Sets the evaluation time to be used with promql dialect. 'auto' means the current time.
promql_table
β
Specifies the name of a TimeSeries table used by the 'promql' dialect.
push_external_roles_in_interserver_queries
β
Type
Default value
Type
Bool
Default value
1
Enable pushing user roles from originator to other nodes while performing a query.
query_cache_compress_entries
β
Type
Default value
Type
Bool
Default value
1
Compress entries in the
query cache
. Lessens the memory consumption of the query cache at the cost of slower inserts into / reads from it.
Possible values:
0 - Disabled
1 - Enabled
query_cache_max_entries
β
Type
Default value
Type
UInt64
Default value
0
The maximum number of query results the current user may store in the
query cache
. 0 means unlimited.
Possible values:
Positive integer >= 0.
query_cache_max_size_in_bytes
β
Type
Default value
Type
UInt64
Default value
0
The maximum amount of memory (in bytes) the current user may allocate in the
query cache
. 0 means unlimited.
Possible values:
Positive integer >= 0.
query_cache_min_query_duration
β
Type
Default value
Type
Milliseconds
Default value
0
Minimum duration in milliseconds a query needs to run for its result to be stored in the
query cache
.
Possible values:
Positive integer >= 0.
query_cache_min_query_runs
β
Type
Default value
Type
UInt64
Default value
0
Minimum number of times a
SELECT
query must run before its result is stored in the
query cache
.
Possible values:
Positive integer >= 0.
query_cache_nondeterministic_function_handling
β
Type
Default value
Type
QueryResultCacheNondeterministicFunctionHandling
Default value
throw
Controls how the
query cache
handles
SELECT
queries with non-deterministic functions like
rand()
or
now()
.
Possible values:
'throw'
- Throw an exception and don't cache the query result.
'save'
- Cache the query result.
'ignore'
- Don't cache the query result and don't throw an exception.
Type
Default value
Type
Bool
Default value
0
If turned on, the result of
SELECT
queries cached in the
query cache
can be read by other users.
It is not recommended to enable this setting due to security reasons.
Possible values:
0 - Disabled
1 - Enabled
query_cache_squash_partial_results
β
Type
Default value
Type
Bool
Default value
1
Squash partial result blocks to blocks of size
max_block_size
. Reduces performance of inserts into the
query cache
but improves the compressability of cache entries (see
query_cache_compress-entries
).
Possible values:
0 - Disabled
1 - Enabled
query_cache_system_table_handling
β
Type
Default value
Type
QueryResultCacheSystemTableHandling
Default value
throw
Controls how the
query cache
handles
SELECT
queries against system tables, i.e. tables in databases
system.*
and
information_schema.*
.
Possible values:
'throw'
- Throw an exception and don't cache the query result.
'save'
- Cache the query result.
'ignore'
- Don't cache the query result and don't throw an exception.
query_cache_tag
β
A string which acts as a label for
query cache
entries.
The same queries with different tags are considered different by the query cache.
Possible values:
Any string
query_cache_ttl
β
Type
Default value
Type
Seconds
Default value
60
After this time in seconds entries in the
query cache
become stale.
Possible values:
Positive integer >= 0.
query_metric_log_interval
β
Type
Default value
Type
Int64
Default value
-1
The interval in milliseconds at which the
query_metric_log
for individual queries is collected.
If set to any negative value, it will take the value
collect_interval_milliseconds
from the
query_metric_log setting
or default to 1000 if not present.
To disable the collection of a single query, set
query_metric_log_interval
to 0.
Default value: -1
query_plan_aggregation_in_order
β
Type
Default value
Type
Bool
Default value
1
Toggles the aggregation in-order query-plan-level optimization.
Only takes effect if setting
query_plan_enable_optimizations
is 1.
Note
This is an expert-level setting which should only be used for debugging by developers. The setting may change in future in backward-incompatible ways or be removed.
Possible values:
0 - Disable
1 - Enable
query_plan_convert_any_join_to_semi_or_anti_join
β
Type
Default value
Type
Bool
Default value
1
Allow to convert ANY JOIN to SEMI or ANTI JOIN if filter after JOIN always evaluates to false for not-matched or matched rows
query_plan_convert_join_to_in
β
Type
Default value
Type
Bool
Default value
0
Allow to convert
JOIN
to subquery with
IN
if output columns tied to only left table. May cause wrong results with non-ANY JOINs (e.g. ALL JOINs which is the default).
query_plan_convert_outer_join_to_inner_join
β
Type
Default value
Type
Bool
Default value
1
Allow to convert
OUTER JOIN
to
INNER JOIN
if filter after
JOIN
always filters default values
query_plan_direct_read_from_text_index
β
Type
Default value
Type
Bool
Default value
1
Allow to perform full text search filtering using only the inverted text index in query plan.
query_plan_display_internal_aliases
β
Type
Default value
Type
Bool
Default value
0
Show internal aliases (such as __table1) in EXPLAIN PLAN instead of those specified in the original query.
query_plan_enable_multithreading_after_window_functions
β
Type
Default value
Type
Bool
Default value
1
Enable multithreading after evaluating window functions to allow parallel stream processing
query_plan_enable_optimizations
β
Type
Default value
Type
Bool
Default value
1
Toggles query optimization at the query plan level.
Note
This is an expert-level setting which should only be used for debugging by developers. The setting may change in future in backward-incompatible ways or be removed.
Possible values:
0 - Disable all optimizations at the query plan level
1 - Enable optimizations at the query plan level (but individual optimizations may still be disabled via their individual settings)
query_plan_execute_functions_after_sorting
β
Type
Default value
Type
Bool
Default value
1
Toggles a query-plan-level optimization which moves expressions after sorting steps.
Only takes effect if setting
query_plan_enable_optimizations
is 1.
Note
This is an expert-level setting which should only be used for debugging by developers. The setting may change in future in backward-incompatible ways or be removed.
Possible values:
0 - Disable
1 - Enable
query_plan_filter_push_down
β
Type
Default value
Type
Bool
Default value
1
Toggles a query-plan-level optimization which moves filters down in the execution plan.
Only takes effect if setting
query_plan_enable_optimizations
is 1.
Note
This is an expert-level setting which should only be used for debugging by developers. The setting may change in future in backward-incompatible ways or be removed.
Possible values:
0 - Disable
1 - Enable
query_plan_join_shard_by_pk_ranges
β
Type
Default value
Type
Bool
Default value
0
Apply sharding for JOIN if join keys contain a prefix of PRIMARY KEY for both tables. Supported for hash, parallel_hash and full_sorting_merge algorithms. Usually does not speed up queries but may lower memory consumption.
query_plan_join_swap_table
β
Type
Default value
Type
BoolAuto
Default value
auto
Determine which side of the join should be the build table (also called inner, the one inserted into the hash table for a hash join) in the query plan. This setting is supported only for
ALL
join strictness with the
JOIN ON
clause. Possible values are:
'auto': Let the planner decide which table to use as the build table.
'false': Never swap tables (the right table is the build table).
'true': Always swap tables (the left table is the build table).
query_plan_lift_up_array_join
β
Type
Default value
Type
Bool
Default value
1
Toggles a query-plan-level optimization which moves ARRAY JOINs up in the execution plan.
Only takes effect if setting
query_plan_enable_optimizations
is 1.
Note
This is an expert-level setting which should only be used for debugging by developers. The setting may change in future in backward-incompatible ways or be removed.
Possible values:
0 - Disable
1 - Enable
query_plan_lift_up_union
β
Type
Default value
Type
Bool
Default value
1
Toggles a query-plan-level optimization which moves larger subtrees of the query plan into union to enable further optimizations.
Only takes effect if setting
query_plan_enable_optimizations
is 1.
Note
This is an expert-level setting which should only be used for debugging by developers. The setting may change in future in backward-incompatible ways or be removed.
Possible values:
0 - Disable
1 - Enable
query_plan_max_limit_for_lazy_materialization
β
Type
Default value
Type
UInt64
Default value
10000
Control maximum limit value that allows to use query plan for lazy materialization optimization. If zero, there is no limit.
query_plan_max_limit_for_top_k_optimization
β
Type
Default value
Type
UInt64
Default value
1000
Control maximum limit value that allows to evaluate query plan for TopK optimization by using minmax skip index and dynamic threshold filtering. If zero, there is no limit.
query_plan_max_optimizations_to_apply
β
Type
Default value
Type
UInt64
Default value
10000
Limits the total number of optimizations applied to query plan, see setting
query_plan_enable_optimizations
.
Useful to avoid long optimization times for complex queries.
In the EXPLAIN PLAN query, stop applying optimizations after this limit is reached and return the plan as is.
For regular query execution if the actual number of optimizations exceeds this setting, an exception is thrown.
Note
This is an expert-level setting which should only be used for debugging by developers. The setting may change in future in backward-incompatible ways or be removed.
query_plan_max_step_description_length
β
Type
Default value
Type
UInt64
Default value
500
Maximum length of step description in EXPLAIN PLAN.
query_plan_merge_expressions
β
Type
Default value
Type
Bool
Default value
1
Toggles a query-plan-level optimization which merges consecutive filters.
Only takes effect if setting
query_plan_enable_optimizations
is 1.
Note
This is an expert-level setting which should only be used for debugging by developers. The setting may change in future in backward-incompatible ways or be removed.
Possible values:
0 - Disable
1 - Enable
query_plan_merge_filter_into_join_condition
β
Type
Default value
Type
Bool
Default value
1
Allow to merge filter into
JOIN
condition and convert
CROSS JOIN
to
INNER
.
query_plan_merge_filters
β
Type
Default value
Type
Bool
Default value
1
Allow to merge filters in the query plan.
query_plan_optimize_join_order_algorithm
β
Type
Default value
Type
JoinOrderAlgorithm
Default value
greedy
Specifies which JOIN order algorithms to attempt during query plan optimization. The following algorithms are available:
'greedy' - basic greedy algorithm - works fast but might not produce the best join order
'dpsize' - implements DPsize algorithm currently only for Inner joins - considers all possible join orders and finds the most optimal one but might be slow for queries with many tables and join predicates.
Multiple algorithms can be specified, e.g. 'dpsize,greedy'.
query_plan_optimize_join_order_limit
β
Type
Default value
Type
UInt64
Default value
10
Optimize the order of joins within the same subquery. Currently only supported for very limited cases.
Value is the maximum number of tables to optimize.
query_plan_optimize_join_order_randomize
β
Type
Default value
Type
UInt64
Default value
0
When non-zero, the join order optimizer uses randomly generated cardinalities and NDVs instead of real statistics.
When set to 1, a random seed is generated, when set to a value > 1, that value is used as the seed directly.
This is intended for testing to find errors caused by different join orderings.
query_plan_optimize_lazy_materialization
β
Type
Default value
Type
Bool
Default value
1
Use query plan for lazy materialization optimization.
query_plan_optimize_prewhere
β
Type
Default value
Type
Bool
Default value
1
Allow to push down filter to PREWHERE expression for supported storages
query_plan_push_down_limit
β
Type
Default value
Type
Bool
Default value
1
Toggles a query-plan-level optimization which moves LIMITs down in the execution plan.
Only takes effect if setting
query_plan_enable_optimizations
is 1.
Note
This is an expert-level setting which should only be used for debugging by developers. The setting may change in future in backward-incompatible ways or be removed.
Possible values:
0 - Disable
1 - Enable
query_plan_read_in_order
β
Type
Default value
Type
Bool
Default value
1
Toggles the read in-order optimization query-plan-level optimization.
Only takes effect if setting
query_plan_enable_optimizations
is 1.
Note
This is an expert-level setting which should only be used for debugging by developers. The setting may change in future in backward-incompatible ways or be removed.
Possible values:
0 - Disable
1 - Enable
query_plan_read_in_order_through_join
β
Type
Default value
Type
Bool
Default value
1
Keep reading in order from the left table in JOIN operations, which can be utilized by subsequent steps.
query_plan_remove_redundant_distinct
β
Type
Default value
Type
Bool
Default value
1
Toggles a query-plan-level optimization which removes redundant DISTINCT steps.
Only takes effect if setting
query_plan_enable_optimizations
is 1.
Note
This is an expert-level setting which should only be used for debugging by developers. The setting may change in future in backward-incompatible ways or be removed.
Possible values:
0 - Disable
1 - Enable
query_plan_remove_redundant_sorting
β
Type
Default value
Type
Bool
Default value
1
Toggles a query-plan-level optimization which removes redundant sorting steps, e.g. in subqueries.
Only takes effect if setting
query_plan_enable_optimizations
is 1.
Note
This is an expert-level setting which should only be used for debugging by developers. The setting may change in future in backward-incompatible ways or be removed.
Possible values:
0 - Disable
1 - Enable
query_plan_remove_unused_columns
β
Type
Default value
Type
Bool
Default value
1
Toggles a query-plan-level optimization which tries to remove unused columns (both input and output columns) from query plan steps.
Only takes effect if setting
query_plan_enable_optimizations
is 1.
Note
This is an expert-level setting which should only be used for debugging by developers. The setting may change in future in backward-incompatible ways or be removed.
Possible values:
0 - Disable
1 - Enable
query_plan_reuse_storage_ordering_for_window_functions
β
Aliases
:
optimize_read_in_window_order
Type
Default value
Type
Bool
Default value
0
Toggles a query-plan-level optimization which uses storage sorting when sorting for window functions.
Only takes effect if setting
query_plan_enable_optimizations
is 1.
Note
This is an expert-level setting which should only be used for debugging by developers. The setting may change in future in backward-incompatible ways or be removed.
Possible values:
0 - Disable
1 - Enable
query_plan_split_filter
β
Type
Default value
Type
Bool
Default value
1
Note
This is an expert-level setting which should only be used for debugging by developers. The setting may change in future in backward-incompatible ways or be removed.
Toggles a query-plan-level optimization which splits filters into expressions.
Only takes effect if setting
query_plan_enable_optimizations
is 1.
Possible values:
0 - Disable
1 - Enable
query_plan_text_index_add_hint
β
Type
Default value
Type
Bool
Default value
1
Allow to add hint (additional predicate) for filtering built from the inverted text index in query plan.
query_plan_try_use_vector_search
β
Type
Default value
Type
Bool
Default value
1
Toggles a query-plan-level optimization which tries to use the vector similarity index.
Only takes effect if setting
query_plan_enable_optimizations
is 1.
Note
This is an expert-level setting which should only be used for debugging by developers. The setting may change in future in backward-incompatible ways or be removed.
Possible values:
0 - Disable
1 - Enable
query_plan_use_new_logical_join_step
β
Aliases
:
query_plan_use_logical_join_step
Type
Default value
Type
Bool
Default value
1
Use logical join step in query plan.
Note: setting
query_plan_use_new_logical_join_step
is deprecated, use
query_plan_use_logical_join_step
instead.
query_profiler_cpu_time_period_ns
β
Type
Default value
Type
UInt64
Default value
1000000000
Sets the period for a CPU clock timer of the
query profiler
. This timer counts only CPU time.
Possible values:
A positive integer number of nanoseconds.
Recommended values:
10000000 (100 times a second) nanoseconds and more for single queries.
1000000000 (once a second) for cluster-wide profiling.
0 for turning off the timer.
See also:
System table
trace_log
query_profiler_real_time_period_ns
β
Type
Default value
Type
UInt64
Default value
1000000000
Sets the period for a real clock timer of the
query profiler
. Real clock timer counts wall-clock time.
Possible values:
Positive integer number, in nanoseconds.
Recommended values:
10000000 (100 times a second) nanoseconds and less for single queries.
1000000000 (once a second) for cluster-wide profiling.
0 for turning off the timer.
See also:
System table
trace_log
Cloud default value:
3000000000
.
queue_max_wait_ms
β
Type
Default value
Type
Milliseconds
Default value
0
The wait time in the request queue, if the number of concurrent requests exceeds the maximum.
rabbitmq_max_wait_ms
β
Type
Default value
Type
Milliseconds
Default value
5000
The wait time for reading from RabbitMQ before retry.
read_backoff_max_throughput
β
Type
Default value
Type
UInt64
Default value
1048576
Settings to reduce the number of threads in case of slow reads. Count events when the read bandwidth is less than that many bytes per second.
read_backoff_min_concurrency
β
Type
Default value
Type
UInt64
Default value
1
Settings to try keeping the minimal number of threads in case of slow reads.
read_backoff_min_events
β
Type
Default value
Type
UInt64
Default value
2
Settings to reduce the number of threads in case of slow reads. The number of events after which the number of threads will be reduced.
read_backoff_min_interval_between_events_ms
β
Type
Default value
Type
Milliseconds
Default value
1000
Settings to reduce the number of threads in case of slow reads. Do not pay attention to the event, if the previous one has passed less than a certain amount of time.
read_backoff_min_latency_ms
β
Type
Default value
Type
Milliseconds
Default value
1000
Setting to reduce the number of threads in case of slow reads. Pay attention only to reads that took at least that much time.
read_from_distributed_cache_if_exists_otherwise_bypass_cache
β
ClickHouse Cloud only
Type
Default value
Type
Bool
Default value
0
Only has an effect in ClickHouse Cloud. Same as read_from_filesystem_cache_if_exists_otherwise_bypass_cache, but for distributed cache.
read_from_filesystem_cache_if_exists_otherwise_bypass_cache
β
Type
Default value
Type
Bool
Default value
0
Allow to use the filesystem cache in passive mode - benefit from the existing cache entries, but don't put more entries into the cache. If you set this setting for heavy ad-hoc queries and leave it disabled for short real-time queries, this will allows to avoid cache threshing by too heavy queries and to improve the overall system efficiency.
read_from_page_cache_if_exists_otherwise_bypass_cache
β
Type
Default value
Type
Bool
Default value
0
Use userspace page cache in passive mode, similar to read_from_filesystem_cache_if_exists_otherwise_bypass_cache.
read_in_order_two_level_merge_threshold
β
Type
Default value
Type
UInt64
Default value
100
Minimal number of parts to read to run preliminary merge step during multithread reading in order of primary key.
read_in_order_use_buffering
β
Type
Default value
Type
Bool
Default value
1
Use buffering before merging while reading in order of primary key. It increases the parallelism of query executio
read_in_order_use_virtual_row
β
Type
Default value
Type
Bool
Default value
0
Use virtual row while reading in order of primary key or its monotonic function fashion. It is useful when searching over multiple parts as only relevant ones are touched.
read_overflow_mode
β
Type
Default value
Type
OverflowMode
Default value
throw
What to do when the limit is exceeded.
read_overflow_mode_leaf
β
Type
Default value
Type
OverflowMode
Default value
throw
Sets what happens when the volume of data read exceeds one of the leaf limits.
Possible options:
throw
: throw an exception (default).
break
: stop executing the query and return the partial result.
read_priority
β
Type
Default value
Type
Int64
Default value
0
Priority to read data from local filesystem or remote filesystem. Only supported for 'pread_threadpool' method for local filesystem and for
threadpool
method for remote filesystem.
read_through_distributed_cache
β
ClickHouse Cloud only
Type
Default value
Type
Bool
Default value
0
Only has an effect in ClickHouse Cloud. Allow reading from distributed cache
readonly
β
Type
Default value
Type
UInt64
Default value
0
0 - no read-only restrictions. 1 - only read requests, as well as changing explicitly allowed settings. 2 - only read requests, as well as changing settings, except for the 'readonly' setting.
receive_data_timeout_ms
β
Type
Default value
Type
Milliseconds
Default value
2000
Connection timeout for receiving first packet of data or packet with positive progress from replica
receive_timeout
β
Type
Default value
Type
Seconds
Default value
300
Timeout for receiving data from the network, in seconds. If no bytes were received in this interval, the exception is thrown. If you set this setting on the client, the 'send_timeout' for the socket will also be set on the corresponding connection end on the server.
regexp_dict_allow_hyperscan
β
Type
Default value
Type
Bool
Default value
1
Allow regexp_tree dictionary using Hyperscan library.
regexp_dict_flag_case_insensitive
β
Type
Default value
Type
Bool
Default value
0
Use case-insensitive matching for a regexp_tree dictionary. Can be overridden in individual expressions with (?i) and (?-i).
regexp_dict_flag_dotall
β
Type
Default value
Type
Bool
Default value
0
Allow '.' to match newline characters for a regexp_tree dictionary.
regexp_max_matches_per_row
β
Type
Default value
Type
UInt64
Default value
1000
Sets the maximum number of matches for a single regular expression per row. Use it to protect against memory overload when using greedy regular expression in the
extractAllGroupsHorizontal
function.
Possible values:
Positive integer.
reject_expensive_hyperscan_regexps
β
Type
Default value
Type
Bool
Default value
1
Reject patterns which will likely be expensive to evaluate with hyperscan (due to NFA state explosion)
remerge_sort_lowered_memory_bytes_ratio
β
Type
Default value
Type
Float
Default value
2
If memory usage after remerge does not reduced by this ratio, remerge will be disabled.
remote_filesystem_read_method
β
Type
Default value
Type
String
Default value
threadpool
Method of reading data from remote filesystem, one of: read, threadpool.
remote_filesystem_read_prefetch
β
Type
Default value
Type
Bool
Default value
1
Should use prefetching when reading data from remote filesystem.
remote_fs_read_backoff_max_tries
β
Type
Default value
Type
UInt64
Default value
5
Max attempts to read with backoff
remote_fs_read_max_backoff_ms
β
Type
Default value
Type
UInt64
Default value
10000
Max wait time when trying to read data for remote disk
remote_read_min_bytes_for_seek
β
Type
Default value
Type
UInt64
Default value
4194304
Min bytes required for remote read (url, s3) to do seek, instead of read with ignore.
rename_files_after_processing
β
Type:
String
Default value:
Empty string
This setting allows to specify renaming pattern for files processed by
file
table function. When option is set, all files read by
file
table function will be renamed according to specified pattern with placeholders, only if files processing was successful.
Placeholders
β
%a
β Full original filename (e.g., "sample.csv").
%f
β Original filename without extension (e.g., "sample").
%e
β Original file extension with dot (e.g., ".csv").
%t
β Timestamp (in microseconds).
%%
β Percentage sign ("%").
Example
β
Option:
--rename_files_after_processing="processed_%f_%t%e"
Query:
SELECT * FROM file('sample.csv')
If reading
sample.csv
is successful, file will be renamed to
processed_sample_1683473210851438.csv
replace_running_query
β
Type
Default value
Type
Bool
Default value
0
When using the HTTP interface, the 'query_id' parameter can be passed. This is any string that serves as the query identifier.
If a query from the same user with the same 'query_id' already exists at this time, the behaviour depends on the 'replace_running_query' parameter.
0
(default) β Throw an exception (do not allow the query to run if a query with the same 'query_id' is already running).
1
β Cancel the old query and start running the new one.
Set this parameter to 1 for implementing suggestions for segmentation conditions. After entering the next character, if the old query hasn't finished yet, it should be cancelled.
replace_running_query_max_wait_ms
β
Type
Default value
Type
Milliseconds
Default value
5000
The wait time for running the query with the same
query_id
to finish, when the
replace_running_query
setting is active.
Possible values:
Positive integer.
0 β Throwing an exception that does not allow to run a new query if the server already executes a query with the same
query_id
.
replication_wait_for_inactive_replica_timeout
β
Type
Default value
Type
Int64
Default value
120
Specifies how long (in seconds) to wait for inactive replicas to execute
ALTER
,
OPTIMIZE
or
TRUNCATE
queries.
Possible values:
0
β Do not wait.
Negative integer β Wait for unlimited time.
Positive integer β The number of seconds to wait.
restore_replace_external_dictionary_source_to_null
β
Type
Default value
Type
Bool
Default value
0
Replace external dictionary sources to Null on restore. Useful for testing purposes
restore_replace_external_engines_to_null
β
Type
Default value
Type
Bool
Default value
0
For testing purposes. Replaces all external engines to Null to not initiate external connections.
restore_replace_external_table_functions_to_null
β
Type
Default value
Type
Bool
Default value
0
For testing purposes. Replaces all external table functions to Null to not initiate external connections.
Type
Default value
Type
Bool
Default value
0
Replace table engine from Replicated
MergeTree -> Shared
MergeTree during RESTORE.
Cloud default value:
1
.
result_overflow_mode
β
Type
Default value
Type
OverflowMode
Default value
throw
Cloud default value:
throw
Sets what to do if the volume of the result exceeds one of the limits.
Possible values:
throw
: throw an exception (default).
break
: stop executing the query and return the partial result, as if the
source data ran out.
Using 'break' is similar to using LIMIT.
Break
interrupts execution only at the
block level. This means that amount of returned rows is greater than
max_result_rows
, multiple of
max_block_size
and depends on
max_threads
.
Example
SET max_threads = 3, max_block_size = 3333;
SET max_result_rows = 3334, result_overflow_mode = 'break';
SELECT *
FROM numbers_mt(100000)
FORMAT Null;
6666 rows in set. ...
rewrite_count_distinct_if_with_count_distinct_implementation
β
Type
Default value
Type
Bool
Default value
0
Allows you to rewrite
countDistcintIf
with
count_distinct_implementation
setting.
Possible values:
true β Allow.
false β Disallow.
rewrite_in_to_join
β
Type
Default value
Type
Bool
Default value
0
Rewrite expressions like 'x IN subquery' to JOIN. This might be useful for optimizing the whole query with join reordering.
rows_before_aggregation
β
Type
Default value
Type
Bool
Default value
0
When enabled, ClickHouse will provide exact value for rows_before_aggregation statistic, represents the number of rows read before aggregatio
s3_allow_multipart_copy
β
Type
Default value
Type
Bool
Default value
1
Allow multipart copy in S3.
s3_allow_parallel_part_upload
β
Type
Default value
Type
Bool
Default value
1
Use multiple threads for s3 multipart upload. It may lead to slightly higher memory usage
s3_check_objects_after_upload
β
Type
Default value
Type
Bool
Default value
0
Check each uploaded object to s3 with head request to be sure that upload was successful
s3_connect_timeout_ms
β
Type
Default value
Type
UInt64
Default value
1000
Connection timeout for host from s3 disks.
s3_create_new_file_on_insert
β
Type
Default value
Type
Bool
Default value
0
Enables or disables creating a new file on each insert in s3 engine tables. If enabled, on each insert a new S3 object will be created with the key, similar to this pattern:
initial:
data.Parquet.gz
->
data.1.Parquet.gz
->
data.2.Parquet.gz
, etc.
Possible values:
0 β
INSERT
query creates a new file or fail if file exists and s3_truncate_on_insert is not set.
1 β
INSERT
query creates a new file on each insert using suffix (from the second one) if s3_truncate_on_insert is not set.
See more details
here
.
s3_disable_checksum
β
Type
Default value
Type
Bool
Default value
0
Do not calculate a checksum when sending a file to S3. This speeds up writes by avoiding excessive processing passes on a file. It is mostly safe as the data of MergeTree tables is checksummed by ClickHouse anyway, and when S3 is accessed with HTTPS, the TLS layer already provides integrity while transferring through the network. While additional checksums on S3 give defense in depth.
s3_ignore_file_doesnt_exist
β
Type
Default value
Type
Bool
Default value
0
Ignore absence of file if it does not exist when reading certain keys.
Possible values:
1 β
SELECT
returns empty result.
0 β
SELECT
throws an exception.
s3_list_object_keys_size
β
Type
Default value
Type
UInt64
Default value
1000
Maximum number of files that could be returned in batch by ListObject request
s3_max_connections
β
Type
Default value
Type
UInt64
Default value
1024
The maximum number of connections per server.
s3_max_get_burst
β
Type
Default value
Type
UInt64
Default value
0
Max number of requests that can be issued simultaneously before hitting request per second limit. By default (0) equals to
s3_max_get_rps
s3_max_get_rps
β
Type
Default value
Type
UInt64
Default value
0
Limit on S3 GET request per second rate before throttling. Zero means unlimited.
s3_max_inflight_parts_for_one_file
β
Type
Default value
Type
UInt64
Default value
20
The maximum number of a concurrent loaded parts in multipart upload request. 0 means unlimited.
s3_max_part_number
β
Type
Default value
Type
UInt64
Default value
10000
Maximum part number number for s3 upload part.
s3_max_put_burst
β
Type
Default value
Type
UInt64
Default value
0
Max number of requests that can be issued simultaneously before hitting request per second limit. By default (0) equals to
s3_max_put_rps
s3_max_put_rps
β
Type
Default value
Type
UInt64
Default value
0
Limit on S3 PUT request per second rate before throttling. Zero means unlimited.
s3_max_single_operation_copy_size
β
Type
Default value
Type
UInt64
Default value
33554432
Maximum size for single-operation copy in s3. This setting is used only if s3_allow_multipart_copy is true.
s3_max_single_part_upload_size
β
Type
Default value
Type
UInt64
Default value
33554432
The maximum size of object to upload using singlepart upload to S3.
s3_max_single_read_retries
β
Type
Default value
Type
UInt64
Default value
4
The maximum number of retries during single S3 read.
s3_max_unexpected_write_error_retries
β
Type
Default value
Type
UInt64
Default value
4
The maximum number of retries in case of unexpected errors during S3 write.
s3_max_upload_part_size
β
Type
Default value
Type
UInt64
Default value
5368709120
The maximum size of part to upload during multipart upload to S3.
s3_min_upload_part_size
β
Type
Default value
Type
UInt64
Default value
16777216
The minimum size of part to upload during multipart upload to S3.
s3_path_filter_limit
β
Type
Default value
Type
UInt64
Default value
1000
Maximum number of
_path
values that can be extracted from query filters to use for file iteration
instead of glob listing. 0 means disabled.
s3_request_timeout_ms
β
Type
Default value
Type
UInt64
Default value
30000
Idleness timeout for sending and receiving data to/from S3. Fail if a single TCP read or write call blocks for this long.
s3_skip_empty_files
β
Type
Default value
Type
Bool
Default value
1
Enables or disables skipping empty files in
S3
engine tables.
Possible values:
0 β
SELECT
throws an exception if empty file is not compatible with requested format.
1 β
SELECT
returns empty result for empty file.
s3_slow_all_threads_after_network_error
β
Type
Default value
Type
Bool
Default value
1
When set to
true
, all threads executing S3 requests to the same backup endpoint are slowed down
after any single s3 request encounters a retryable network error, such as socket timeout.
When set to
false
, each thread handles S3 request backoff independently of the others.
s3_strict_upload_part_size
β
Type
Default value
Type
UInt64
Default value
0
The exact size of part to upload during multipart upload to S3 (some implementations does not supports variable size parts).
s3_throw_on_zero_files_match
β
Type
Default value
Type
Bool
Default value
0
Throw an error, when ListObjects request cannot match any files
s3_truncate_on_insert
β
Type
Default value
Type
Bool
Default value
0
Enables or disables truncate before inserts in s3 engine tables. If disabled, an exception will be thrown on insert attempts if an S3 object already exists.
Possible values:
0 β
INSERT
query creates a new file or fail if file exists and s3_create_new_file_on_insert is not set.
1 β
INSERT
query replaces existing content of the file with the new data.
See more details
here
.
s3_upload_part_size_multiply_factor
β
Type
Default value
Type
UInt64
Default value
2
Multiply s3_min_upload_part_size by this factor each time s3_multiply_parts_count_threshold parts were uploaded from a single write to S3.
s3_upload_part_size_multiply_parts_count_threshold
β
Type
Default value
Type
UInt64
Default value
500
Each time this number of parts was uploaded to S3, s3_min_upload_part_size is multiplied by s3_upload_part_size_multiply_factor.
s3_use_adaptive_timeouts
β
Type
Default value
Type
Bool
Default value
1
When set to
true
than for all s3 requests first two attempts are made with low send and receive timeouts.
When set to
false
than all attempts are made with identical timeouts.
s3_validate_request_settings
β
Type
Default value
Type
Bool
Default value
1
Enables s3 request settings validation.
Possible values:
1 β validate settings.
0 β do not validate settings.
s3queue_default_zookeeper_path
β
Type
Default value
Type
String
Default value
/clickhouse/s3queue/
Default zookeeper path prefix for S3Queue engine
s3queue_enable_logging_to_s3queue_log
β
Type
Default value
Type
Bool
Default value
0
Enable writing to system.s3queue_log. The value can be overwritten per table with table settings
s3queue_keeper_fault_injection_probability
β
Type
Default value
Type
Float
Default value
0
Keeper fault injection probability for S3Queue.
Type
Default value
Type
Bool
Default value
0
Migrate old metadata structure of S3Queue table to a new one
schema_inference_cache_require_modification_time_for_url
β
Type
Default value
Type
Bool
Default value
1
Use schema from cache for URL with last modification time validation (for URLs with Last-Modified header)
schema_inference_use_cache_for_azure
β
Type
Default value
Type
Bool
Default value
1
Use cache in schema inference while using azure table functio
schema_inference_use_cache_for_file
β
Type
Default value
Type
Bool
Default value
1
Use cache in schema inference while using file table functio
schema_inference_use_cache_for_hdfs
β
Type
Default value
Type
Bool
Default value
1
Use cache in schema inference while using hdfs table functio
schema_inference_use_cache_for_s3
β
Type
Default value
Type
Bool
Default value
1
Use cache in schema inference while using s3 table functio
schema_inference_use_cache_for_url
β
Type
Default value
Type
Bool
Default value
1
Use cache in schema inference while using url table functio
secondary_indices_enable_bulk_filtering
β
Type
Default value
Type
Bool
Default value
1
Enable the bulk filtering algorithm for indices. It is expected to be always better, but we have this setting for compatibility and control.
select_sequential_consistency
β
Type
Default value
Type
UInt64
Default value
0
Note
This setting differ in behavior between SharedMergeTree and ReplicatedMergeTree, see
SharedMergeTree consistency
for more information about the behavior of
select_sequential_consistency
in SharedMergeTree.
Enables or disables sequential consistency for
SELECT
queries. Requires
insert_quorum_parallel
to be disabled (enabled by default).
Possible values:
0 β Disabled.
1 β Enabled.
Usage
When sequential consistency is enabled, ClickHouse allows the client to execute the
SELECT
query only for those replicas that contain data from all previous
INSERT
queries executed with
insert_quorum
. If the client refers to a partial replica, ClickHouse will generate an exception. The SELECT query will not include data that has not yet been written to the quorum of replicas.
When
insert_quorum_parallel
is enabled (the default), then
select_sequential_consistency
does not work. This is because parallel
INSERT
queries can be written to different sets of quorum replicas so there is no guarantee a single replica will have received all writes.
See also:
insert_quorum
insert_quorum_timeout
insert_quorum_parallel
send_logs_level
β
Type
Default value
Type
LogsLevel
Default value
fatal
Send server text logs with specified minimum level to client. Valid values: 'trace', 'debug', 'information', 'warning', 'error', 'fatal', 'none'
send_logs_source_regexp
β
Send server text logs with specified regexp to match log source name. Empty means all sources.
send_profile_events
β
Type
Default value
Type
Bool
Default value
1
Enables or disables sending of
ProfileEvents
packets to the client.
This can be disabled to reduce network traffic for clients that do not require profile events.
Possible values:
0 β Disabled.
1 β Enabled.
Type
Default value
Type
Bool
Default value
0
Enables or disables
X-ClickHouse-Progress
HTTP response headers in
clickhouse-server
responses.
For more information, read the
HTTP interface description
.
Possible values:
0 β Disabled.
1 β Enabled.
send_timeout
β
Type
Default value
Type
Seconds
Default value
300
Timeout for sending data to the network, in seconds. If a client needs to send some data but is not able to send any bytes in this interval, the exception is thrown. If you set this setting on the client, the 'receive_timeout' for the socket will also be set on the corresponding connection end on the server.
serialize_query_plan
β
Type
Default value
Type
Bool
Default value
0
Serialize query plan for distributed processing
serialize_string_in_memory_with_zero_byte
β
Type
Default value
Type
Bool
Default value
1
Serialize String values during aggregation with zero byte at the end. Enable to keep compatibility when querying cluster of incompatible versions.
session_timezone
β
Sets the implicit time zone of the current session or query.
The implicit time zone is the time zone applied to values of type DateTime/DateTime64 which have no explicitly specified time zone.
The setting takes precedence over the globally configured (server-level) implicit time zone.
A value of '' (empty string) means that the implicit time zone of the current session or query is equal to the
server time zone
.
You can use functions
timeZone()
and
serverTimeZone()
to get the session time zone and server time zone.
Possible values:
Any time zone name from
system.time_zones
, e.g.
Europe/Berlin
,
UTC
or
Zulu
Examples:
SELECT timeZone(), serverTimeZone() FORMAT CSV
"Europe/Berlin","Europe/Berlin"
SELECT timeZone(), serverTimeZone() SETTINGS session_timezone = 'Asia/Novosibirsk' FORMAT CSV
"Asia/Novosibirsk","Europe/Berlin"
Assign session time zone 'America/Denver' to the inner DateTime without explicitly specified time zone:
SELECT toDateTime64(toDateTime64('1999-12-12 23:23:23.123', 3), 3, 'Europe/Zurich') SETTINGS session_timezone = 'America/Denver' FORMAT TSV
1999-12-13 07:23:23.123
Note
Not all functions that parse DateTime/DateTime64 respect
session_timezone
. This can lead to subtle errors.
See the following example and explanation.
CREATE TABLE test_tz (`d` DateTime('UTC')) ENGINE = Memory AS SELECT toDateTime('2000-01-01 00:00:00', 'UTC');
SELECT *, timeZone() FROM test_tz WHERE d = toDateTime('2000-01-01 00:00:00') SETTINGS session_timezone = 'Asia/Novosibirsk'
0 rows in set.
SELECT *, timeZone() FROM test_tz WHERE d = '2000-01-01 00:00:00' SETTINGS session_timezone = 'Asia/Novosibirsk'
ββββββββββββββββββββdββ¬βtimeZone()ββββββββ
β 2000-01-01 00:00:00 β Asia/Novosibirsk β
βββββββββββββββββββββββ΄βββββββββββββββββββ
This happens due to different parsing pipelines:
toDateTime()
without explicitly given time zone used in the first
SELECT
query honors setting
session_timezone
and the global time zone.
In the second query, a DateTime is parsed from a String, and inherits the type and time zone of the existing column
d
. Thus, setting
session_timezone
and the global time zone are not honored.
See also
timezone
set_overflow_mode
β
Type
Default value
Type
OverflowMode
Default value
throw
Sets what happens when the amount of data exceeds one of the limits.
Possible values:
throw
: throw an exception (default).
break
: stop executing the query and return the partial result, as if the
source data ran out.
Type
Default value
Type
Bool
Default value
1
Automatically synchronize set of data parts after MOVE|REPLACE|ATTACH partition operations in SMT tables. Cloud only
short_circuit_function_evaluation
β
Type
Default value
Type
ShortCircuitFunctionEvaluation
Default value
enable
Allows calculating the
if
,
multiIf
,
and
, and
or
functions according to a
short scheme
. This helps optimize the execution of complex expressions in these functions and prevent possible exceptions (such as division by zero when it is not expected).
Possible values:
enable
β Enables short-circuit function evaluation for functions that are suitable for it (can throw an exception or computationally heavy).
force_enable
β Enables short-circuit function evaluation for all functions.
disable
β Disables short-circuit function evaluation.
short_circuit_function_evaluation_for_nulls
β
Type
Default value
Type
Bool
Default value
1
Optimizes evaluation of functions that return NULL when any argument is NULL. When the percentage of NULL values in the function's arguments exceeds the short_circuit_function_evaluation_for_nulls_threshold, the system skips evaluating the function row-by-row. Instead, it immediately returns NULL for all rows, avoiding unnecessary computation.
short_circuit_function_evaluation_for_nulls_threshold
β
Type
Default value
Type
Double
Default value
1
Ratio threshold of NULL values to execute functions with Nullable arguments only on rows with non-NULL values in all arguments. Applies when setting short_circuit_function_evaluation_for_nulls is enabled.
When the ratio of rows containing NULL values to the total number of rows exceeds this threshold, these rows containing NULL values will not be evaluated.
show_data_lake_catalogs_in_system_tables
β
Type
Default value
Type
Bool
Default value
0
Enables showing data lake catalogs in system tables.
show_processlist_include_internal
β
Type
Default value
Type
Bool
Default value
1
Show internal auxiliary processes in the
SHOW PROCESSLIST
query output.
Internal processes include dictionary reloads, refreshable materialized view reloads, auxiliary
SELECT
s executed in
SHOW ...
queries, auxiliary
CREATE DATABASE ...
queries executed internally to accommodate broken tables and more.
show_table_uuid_in_table_create_query_if_not_nil
β
Type
Default value
Type
Bool
Default value
0
Sets the
SHOW TABLE
query display.
Possible values:
0 β The query will be displayed without table UUID.
1 β The query will be displayed with table UUID.
single_join_prefer_left_table
β
Type
Default value
Type
Bool
Default value
1
For single JOIN in case of identifier ambiguity prefer left table
skip_redundant_aliases_in_udf
β
Type
Default value
Type
Bool
Default value
0
Redundant aliases are not used (substituted) in user-defined functions in order to simplify it's usage.
Possible values:
1 β The aliases are skipped (substituted) in UDFs.
0 β The aliases are not skipped (substituted) in UDFs.
Example
The difference between enabled and disabled:
Query:
SET skip_redundant_aliases_in_udf = 0;
CREATE FUNCTION IF NOT EXISTS test_03274 AS ( x ) -> ((x + 1 as y, y + 2));
EXPLAIN SYNTAX SELECT test_03274(4 + 2);
Result:
SELECT ((4 + 2) + 1 AS y, y + 2)
Query:
SET skip_redundant_aliases_in_udf = 1;
CREATE FUNCTION IF NOT EXISTS test_03274 AS ( x ) -> ((x + 1 as y, y + 2));
EXPLAIN SYNTAX SELECT test_03274(4 + 2);
Result:
SELECT ((4 + 2) + 1, ((4 + 2) + 1) + 2)
skip_unavailable_shards
β
Type
Default value
Type
Bool
Default value
0
Enables or disables silently skipping of unavailable shards.
Shard is considered unavailable if all its replicas are unavailable. A replica is unavailable in the following cases:
ClickHouse can't connect to replica for any reason.
When connecting to a replica, ClickHouse performs several attempts. If all these attempts fail, the replica is considered unavailable.
Replica can't be resolved through DNS.
If replica's hostname can't be resolved through DNS, it can indicate the following situations:
Replica's host has no DNS record. It can occur in systems with dynamic DNS, for example,
Kubernetes
, where nodes can be unresolvable during downtime, and this is not an error.
Configuration error. ClickHouse configuration file contains a wrong hostname.
Possible values:
1 β skipping enabled.
If a shard is unavailable, ClickHouse returns a result based on partial data and does not report node availability issues.
0 β skipping disabled.
If a shard is unavailable, ClickHouse throws an exception.
sleep_after_receiving_query_ms
β
Type
Default value
Type
Milliseconds
Default value
0
Time to sleep after receiving query in TCPHandler
sleep_in_send_data_ms
β
Type
Default value
Type
Milliseconds
Default value
0
Time to sleep in sending data in TCPHandler
sleep_in_send_tables_status_ms
β
Type
Default value
Type
Milliseconds
Default value
0
Time to sleep in sending tables status response in TCPHandler
sort_overflow_mode
β
Type
Default value
Type
OverflowMode
Default value
throw
Sets what happens if the number of rows received before sorting exceeds one of the limits.
Possible values:
throw
: throw an exception.
break
: stop executing the query and return the partial result.
split_intersecting_parts_ranges_into_layers_final
β
Type
Default value
Type
Bool
Default value
1
Split intersecting parts ranges into layers during FINAL optimizatio
split_parts_ranges_into_intersecting_and_non_intersecting_final
β
Type
Default value
Type
Bool
Default value
1
Split parts ranges into intersecting and non intersecting during FINAL optimizatio
splitby_max_substrings_includes_remaining_string
β
Type
Default value
Type
Bool
Default value
0
Controls whether function
splitBy*()
with argument
max_substrings
> 0 will include the remaining string in the last element of the result array.
Possible values:
0
- The remaining string will not be included in the last element of the result array.
1
- The remaining string will be included in the last element of the result array. This is the behavior of Spark's
split()
function and Python's
'string.split()'
method.
stop_refreshable_materialized_views_on_startup
β
Type
Default value
Type
Bool
Default value
0
On server startup, prevent scheduling of refreshable materialized views, as if with SYSTEM STOP VIEWS. You can manually start them with
SYSTEM START VIEWS
or
SYSTEM START VIEW <name>
afterwards. Also applies to newly created views. Has no effect on non-refreshable materialized views.
storage_file_read_method
β
Type
Default value
Type
LocalFSReadMethod
Default value
pread
Method of reading data from storage file, one of:
read
,
pread
,
mmap
. The mmap method does not apply to clickhouse-server (it's intended for clickhouse-local).
storage_system_stack_trace_pipe_read_timeout_ms
β
Type
Default value
Type
Milliseconds
Default value
100
Maximum time to read from a pipe for receiving information from the threads when querying the
system.stack_trace
table. This setting is used for testing purposes and not meant to be changed by users.
stream_flush_interval_ms
β
Type
Default value
Type
Milliseconds
Default value
7500
Works for tables with streaming in the case of a timeout, or when a thread generates
max_insert_block_size
rows.
The default value is 7500.
The smaller the value, the more often data is flushed into the table. Setting the value too low leads to poor performance.
stream_like_engine_allow_direct_select
β
Type
Default value
Type
Bool
Default value
0
Allow direct SELECT query for Kafka, RabbitMQ, FileLog, Redis Streams, S3Queue, AzureQueue and NATS engines. In case there are attached materialized views, SELECT query is not allowed even if this setting is enabled.
If there are no attached materialized views, enabling this setting allows to read data. Be aware that usually the read data is removed from the queue. In order to avoid removing read data the related engine settings should be configured properly.
stream_like_engine_insert_queue
β
When stream-like engine reads from multiple queues, the user will need to select one queue to insert into when writing. Used by Redis Streams and NATS.
stream_poll_timeout_ms
β
Type
Default value
Type
Milliseconds
Default value
500
Timeout for polling data from/to streaming storages.
system_events_show_zero_values
β
Type
Default value
Type
Bool
Default value
0
Allows to select zero-valued events from
system.events
.
Some monitoring systems require passing all the metrics values to them for each checkpoint, even if the metric value is zero.
Possible values:
0 β Disabled.
1 β Enabled.
Examples
Query
SELECT * FROM system.events WHERE event='QueryMemoryLimitExceeded';
Result
Ok.
Query
SET system_events_show_zero_values = 1;
SELECT * FROM system.events WHERE event='QueryMemoryLimitExceeded';
Result
ββeventβββββββββββββββββββββ¬βvalueββ¬βdescriptionββββββββββββββββββββββββββββββββββββββββββββ
β QueryMemoryLimitExceeded β 0 β Number of times when memory limit exceeded for query. β
ββββββββββββββββββββββββββββ΄ββββββββ΄ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
table_engine_read_through_distributed_cache
β
ClickHouse Cloud only
Type
Default value
Type
Bool
Default value
0
Only has an effect in ClickHouse Cloud. Allow reading from distributed cache via table engines / table functions (s3, azure, etc)
table_function_remote_max_addresses
β
Type
Default value
Type
UInt64
Default value
1000
Sets the maximum number of addresses generated from patterns for the
remote
function.
Possible values:
Positive integer.
tcp_keep_alive_timeout
β
Type
Default value
Type
Seconds
Default value
290
The time in seconds the connection needs to remain idle before TCP starts sending keepalive probes
temporary_data_in_cache_reserve_space_wait_lock_timeout_milliseconds
β
Type
Default value
Type
UInt64
Default value
600000
Wait time to lock cache for space reservation for temporary data in filesystem cache
temporary_files_buffer_size
β
Type
Default value
Type
NonZeroUInt64
Default value
1048576
Size of the buffer for temporary files writers. Larger buffer size means less system calls, but more memory consumption.
temporary_files_codec
β
Type
Default value
Type
String
Default value
LZ4
Sets compression codec for temporary files used in sorting and joining operations on disk.
Possible values:
LZ4 β
LZ4
compression is applied.
NONE β No compression is applied.
text_index_hint_max_selectivity
β
Type
Default value
Type
Float
Default value
0.2
Maximal selectivity of the filter to use the hint built from the inverted text index.
text_index_like_max_postings_to_read
β
Type
Default value
Type
UInt64
Default value
50
Maximum number of large postings to read when text index LIKE evaluation by the dictionary scan is enabled.
Requires
use_text_index_like_evaluation_by_dictionary_scan
to be enabled.
text_index_like_min_pattern_length
β
Type
Default value
Type
UInt64
Default value
4
Minimum length of the alphanumeric needle in a LIKE/ILIKE pattern required to use the text index LIKE evaluation by the dictionary scan.
Patterns shorter than this threshold match too many dictionary tokens and are skipped to avoid expensive scans.
Requires
use_text_index_like_evaluation_by_dictionary_scan
to be enabled.
throw_if_no_data_to_insert
β
Type
Default value
Type
Bool
Default value
1
Allows or forbids empty INSERTs, enabled by default (throws an error on an empty insert). Only applies to INSERTs using
clickhouse-client
or using the
gRPC interface
.
throw_on_error_from_cache_on_write_operations
β
Type
Default value
Type
Bool
Default value
0
Ignore error from cache when caching on write operations (INSERT, merges)
throw_on_max_partitions_per_insert_block
β
Type
Default value
Type
Bool
Default value
1
Allows you to control the behaviour when
max_partitions_per_insert_block
is reached.
Possible values:
true
- When an insert block reaches
max_partitions_per_insert_block
, an exception is raised.
false
- Logs a warning when
max_partitions_per_insert_block
is reached.
throw_on_unsupported_query_inside_transaction
β
Type
Default value
Type
Bool
Default value
1
Throw exception if unsupported query is used inside transactio
timeout_before_checking_execution_speed
β
Type
Default value
Type
Seconds
Default value
10
Checks that execution speed is not too slow (no less than
min_execution_speed
),
after the specified time in seconds has expired.
timeout_overflow_mode
β
Type
Default value
Type
OverflowMode
Default value
throw
Sets what to do if the query is run longer than the
max_execution_time
or the
estimated running time is longer than
max_estimated_execution_time
.
Possible values:
throw
: throw an exception (default).
break
: stop executing the query and return the partial result, as if the
source data ran out.
timeout_overflow_mode_leaf
β
Type
Default value
Type
OverflowMode
Default value
throw
Sets what happens when the query in leaf node run longer than
max_execution_time_leaf
.
Possible values:
throw
: throw an exception (default).
break
: stop executing the query and return the partial result, as if the
source data ran out.
totals_auto_threshold
β
Type
Default value
Type
Float
Default value
0.5
The threshold for
totals_mode = 'auto'
.
See the section "WITH TOTALS modifier".
totals_mode
β
Type
Default value
Type
TotalsMode
Default value
after_having_exclusive
How to calculate TOTALS when HAVING is present, as well as when max_rows_to_group_by and group_by_overflow_mode = 'any' are present.
See the section "WITH TOTALS modifier".
trace_profile_events
β
Type
Default value
Type
Bool
Default value
0
Enables or disables collecting stacktraces on each update of profile events along with the name of profile event and the value of increment and sending them into
trace_log
.
Possible values:
1 β Tracing of profile events enabled.
0 β Tracing of profile events disabled.
trace_profile_events_list
β
When the setting
trace_profile_events
is enabled, limit the traced events to the specified list of comma-separated names.
If the
trace_profile_events_list
is an empty string (by default), trace all profile events.
Example value: 'DiskS3ReadMicroseconds,DiskS3ReadRequestsCount,SelectQueryTimeMicroseconds,ReadBufferFromS3Bytes'
Using this setting allows more precise collection of data for a large number of queries, because otherwise the vast amount of events can overflow the internal system log queue and some portion of them will be dropped.
transfer_overflow_mode
β
Type
Default value
Type
OverflowMode
Default value
throw
Sets what happens when the amount of data exceeds one of the limits.
Possible values:
throw
: throw an exception (default).
break
: stop executing the query and return the partial result, as if the
source data ran out.
transform_null_in
β
Type
Default value
Type
Bool
Default value
0
Enables equality of
NULL
values for
IN
operator.
By default,
NULL
values can't be compared because
NULL
means undefined value. Thus, comparison
expr = NULL
must always return
false
. With this setting
NULL = NULL
returns
true
for
IN
operator.
Possible values:
0 β Comparison of
NULL
values in
IN
operator returns
false
.
1 β Comparison of
NULL
values in
IN
operator returns
true
.
Example
Consider the
null_in
table:
βββidxββ¬βββββiββ
β 1 β 1 β
β 2 β NULL β
β 3 β 3 β
ββββββββ΄ββββββββ
Query:
SELECT idx, i FROM null_in WHERE i IN (1, NULL) SETTINGS transform_null_in = 0;
Result:
βββidxββ¬ββββiββ
β 1 β 1 β
ββββββββ΄βββββββ
Query:
SELECT idx, i FROM null_in WHERE i IN (1, NULL) SETTINGS transform_null_in = 1;
Result:
βββidxββ¬βββββiββ
β 1 β 1 β
β 2 β NULL β
ββββββββ΄ββββββββ
See Also
NULL Processing in IN Operators
traverse_shadow_remote_data_paths
β
Type
Default value
Type
Bool
Default value
0
Traverse frozen data (shadow directory) in addition to actual table data when query system.remote_data_paths
union_default_mode
β
Sets a mode for combining
SELECT
query results. The setting is only used when shared with
UNION
without explicitly specifying the
UNION ALL
or
UNION DISTINCT
.
Possible values:
'DISTINCT'
β ClickHouse outputs rows as a result of combining queries removing duplicate rows.
'ALL'
β ClickHouse outputs all rows as a result of combining queries including duplicate rows.
''
β ClickHouse generates an exception when used with
UNION
.
See examples in
UNION
.
unknown_packet_in_send_data
β
Type
Default value
Type
UInt64
Default value
0
Send unknown packet instead of data Nth data packet
update_parallel_mode
β
Type
Default value
Type
UpdateParallelMode
Default value
auto
Determines the behavior of concurrent update queries.
Possible values:
sync
- run sequentially all
UPDATE
queries.
auto
- run sequentially only
UPDATE
queries with dependencies between columns updated in one query and columns used in expressions of another query.
async
- do not synchronize update queries.
update_sequential_consistency
β
Type
Default value
Type
Bool
Default value
1
If true set of parts is updated to the latest version before execution of update.
use_async_executor_for_materialized_views
β
Type
Default value
Type
Bool
Default value
0
Use async and potentially multithreaded execution of materialized view query, can speedup views processing during INSERT, but also consume more memory.
use_cache_for_count_from_files
β
Type
Default value
Type
Bool
Default value
1
Enables caching of rows number during count from files in table functions
file
/
s3
/
url
/
hdfs
/
azureBlobStorage
.
Enabled by default.
use_client_time_zone
β
Type
Default value
Type
Bool
Default value
0
Use client timezone for interpreting DateTime string values, instead of adopting server timezone.
use_compact_format_in_distributed_parts_names
β
Type
Default value
Type
Bool
Default value
1
Uses compact format for storing blocks for background (
distributed_foreground_insert
) INSERT into tables with
Distributed
engine.
Possible values:
0 β Uses
user[:password]@host:port#default_database
directory format.
1 β Uses
[shard{shard_index}[_replica{replica_index}]]
directory format.
Note
with
use_compact_format_in_distributed_parts_names=0
changes from cluster definition will not be applied for background INSERT.
with
use_compact_format_in_distributed_parts_names=1
changing the order of the nodes in the cluster definition, will change the
shard_index
/
replica_index
so be aware.
use_concurrency_control
β
Type
Default value
Type
Bool
Default value
1
Respect the server's concurrency control (see the
concurrent_threads_soft_limit_num
and
concurrent_threads_soft_limit_ratio_to_cores
global server settings). If disabled, it allows using a larger number of threads even if the server is overloaded (not recommended for normal usage, and needed mostly for tests).
Cloud default value:
0
.
use_hash_table_stats_for_join_reordering
β
Type
Default value
Type
Bool
Default value
1
Enable using collected hash table statistics for cardinality estimation during join reordering
use_hedged_requests
β
Type
Default value
Type
Bool
Default value
1
Enables hedged requests logic for remote queries. It allows to establish many connections with different replicas for query.
New connection is enabled in case existent connection(s) with replica(s) were not established within
hedged_connection_timeout
or no data was received within
receive_data_timeout
. Query uses the first connection which send non empty progress packet (or data packet, if
allow_changing_replica_until_first_data_packet
);
other connections are cancelled. Queries with
max_parallel_replicas > 1
are supported.
Enabled by default.
Cloud default value:
0
.
use_hive_partitioning
β
Type
Default value
Type
Bool
Default value
1
When enabled, ClickHouse will detect Hive-style partitioning in path (
/name=value/
) in file-like table engines
File
/
S3
/
URL
/
HDFS
/
AzureBlobStorage
and will allow to use partition columns as virtual columns in the query. These virtual columns will have the same names as in the partitioned path, but starting with
_
.
Type
Default value
Type
Bool
Default value
1
If turned on, iceberg table function and iceberg storage may utilize the iceberg metadata files cache.
Possible values:
0 - Disabled
1 - Enabled
use_iceberg_partition_pruning
β
Type
Default value
Type
Bool
Default value
1
Use Iceberg partition pruning for Iceberg tables
use_index_for_in_with_subqueries
β
Type
Default value
Type
Bool
Default value
1
Try using an index if there is a subquery or a table expression on the right side of the IN operator.
use_index_for_in_with_subqueries_max_values
β
Type
Default value
Type
UInt64
Default value
0
The maximum size of the set in the right-hand side of the IN operator to use table index for filtering. It allows to avoid performance degradation and higher memory usage due to the preparation of additional data structures for large queries. Zero means no limit.
use_join_disjunctions_push_down
β
Type
Default value
Type
Bool
Default value
1
Enable pushing OR-connected parts of JOIN conditions down to the corresponding input sides ("partial pushdown").
This allows storage engines to filter earlier, which can reduce data read.
The optimization is semantics-preserving and is applied only when each top-level OR branch contributes at least one deterministic
predicate for the target side.
use_legacy_to_time
β
Type
Default value
Type
Bool
Default value
1
When enabled, allows to use legacy toTime function, which converts a date with time to a certain fixed date, while preserving the time.
Otherwise, uses a new toTime function, that converts different type of data into the Time type.
The old legacy function is also unconditionally accessible as toTimeWithFixedDate.
use_page_cache_for_disks_without_file_cache
β
Type
Default value
Type
Bool
Default value
0
Use userspace page cache for remote disks that don't have filesystem cache enabled.
use_page_cache_for_local_disks
β
Type
Default value
Type
Bool
Default value
0
Use userspace page cache when reading from local disks. Used for testing, unlikely to improve performance in practice. Requires local_filesystem_read_method = 'pread' or 'read'. Doesn't disable the OS page cache; min_bytes_to_use_direct_io can be used for that. Only affects regular tables, not file() table function or File() table engine.
use_page_cache_for_object_storage
β
Type
Default value
Type
Bool
Default value
0
Use userspace page cache when reading from object storage table functions (s3, azure, hdfs) and table engines (S3, Azure, HDFS).
use_page_cache_with_distributed_cache
β
Type
Default value
Type
Bool
Default value
0
Use userspace page cache when distributed cache is used.
use_paimon_partition_pruning
β
Type
Default value
Type
Bool
Default value
0
Use Paimon partition pruning for Paimon table functions
Type
Default value
Type
Bool
Default value
1
If turned on, parquet format may utilize the parquet metadata cache.
Possible values:
0 - Disabled
1 - Enabled
use_partition_pruning
β
Aliases
:
use_partition_key
Type
Default value
Type
Bool
Default value
1
Use partition key to prune partitions during query execution for MergeTree tables.
Possible values:
0 β Disabled.
1 β Enabled.
use_primary_key
β
Type
Default value
Type
Bool
Default value
1
Use the primary key to prune granules during query execution for MergeTree tables.
Possible values:
0 β Disabled.
1 β Enabled.
use_query_cache
β
Type
Default value
Type
Bool
Default value
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
Default value
Type
Bool
Default value
1
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_roaring_bitmap_iceberg_positional_deletes
β
Type
Default value
Type
Bool
Default value
0
Use roaring bitmap for iceberg positional deletes.
use_skip_indexes
β
Type
Default value
Type
Bool
Default value
1
Use data skipping indexes during query execution.
Possible values:
0 β Disabled.
1 β Enabled.
use_skip_indexes_for_disjunctions
β
Type
Default value
Type
Bool
Default value
1
Evaluate WHERE filters with mixed AND and OR conditions using skip indexes. Example: WHERE A = 5 AND (B = 5 OR C = 5).
If disabled, skip indexes are still used to evaluate WHERE conditions but they must only contain AND-ed clauses.
Possible values:
0 β Disabled.
1 β Enabled.
use_skip_indexes_for_top_k
β
Type
Default value
Type
Bool
Default value
0
Enable using data skipping indexes for TopK filtering.
When enabled, if a minmax skip index exists on the column in
ORDER BY <column> LIMIT n
query, optimizer will attempt to use the minmax index to skip granules that are not relevant for the final result . This can reduce query latency.
Possible values:
0 β Disabled.
1 β Enabled.
use_skip_indexes_if_final
β
Type
Default value
Type
Bool
Default value
1
Controls whether skipping indexes are used when executing a query with the FINAL modifier.
Skip indexes may exclude rows (granules) containing the latest data, which could lead to incorrect results from a query with the FINAL modifier. When this setting is enabled, skipping indexes are applied even with the FINAL modifier, potentially improving performance but with the risk of missing recent updates. This setting should be enabled in sync with the setting use_skip_indexes_if_final_exact_mode (default is enabled).
Possible values:
0 β Disabled.
1 β Enabled.
use_skip_indexes_if_final_exact_mode
β
Type
Default value
Type
Bool
Default value
1
Controls whether granules returned by a skipping index are expanded in newer parts to return correct results when executing a query with the FINAL modifier.
Using skip indexes may exclude rows (granules) containing the latest data which could lead to incorrect results. This setting can ensure that correct results are returned by scanning newer parts that have overlap with the ranges returned by the skip index. This setting should be disabled only if approximate results based on looking up the skip index are okay for an application.
Possible values:
0 β Disabled.
1 β Enabled.
use_skip_indexes_on_data_read
β
Type
Default value
Type
Bool
Default value
1
Enable using data skipping indexes during data reading.
When enabled, skip indexes are evaluated dynamically at the time each data granule is being read, rather than being analyzed in advance before query execution begins. This can reduce query startup latency.
Possible values:
0 β Disabled.
1 β Enabled.
use_statistics
β
Type
Default value
Type
Bool
Default value
1
/// preferred over 'allow_statistics_optimize' because of consistency with 'use_primary_key' and 'use_skip_indexes'
Allows using statistics to optimize queries
use_statistics_cache
β
Type
Default value
Type
Bool
Default value
1
Use statistics cache in a query to avoid the overhead of loading statistics of every parts
use_statistics_for_part_pruning
β
Type
Default value
Type
Bool
Default value
1
Use statistics to filter out parts during query execution.
When enabled, pruning in SELECT queries will use column statistics (e.g. MinMax statistics) to eliminate parts that cannot contain matching data before reading any data.
Possible values:
0 β Disabled.
1 β Enabled.
use_strict_insert_block_limits
β
Type
Default value
Type
Bool
Default value
0
When enabled, strictly enforces both minimum and maximum insert block size limits.
A block is emitted when:
Min thresholds (AND): Both min_insert_block_size_rows AND min_insert_block_size_bytes are reached.
Max thresholds (OR): Either max_insert_block_size_rows OR max_insert_block_size_bytes is reached.
When disabled, a block is emitted when:
Min thresholds (OR): min_insert_block_size_rows OR min_insert_block_size_bytes is reached.
Note
: If max settings are smaller than min settings, the max limits take precedence and blocks will be emitted before min thresholds are reached.
Note
: This setting is automatically disabled for async inserts, because async inserts attach per-entry deduplication tokens that are incompatible with block splitting that is needed for enforcement of strict limits.
Disabled by default.
use_structure_from_insertion_table_in_table_functions
β
Type
Default value
Type
UInt64
Default value
2
Use structure from insertion table instead of schema inference from data. Possible values: 0 - disabled, 1 - enabled, 2 - auto
Type
Default value
Type
Bool
Default value
0
Whether to use a cache of deserialized text index header.
Using the text index header cache can significantly reduce latency and increase throughput when working with a large number of text index queries.
use_text_index_like_evaluation_by_dictionary_scan
β
Type
Default value
Type
Bool
Default value
1
Enable evaluation of LIKE/ILIKE queries by scanning the inverted text index dictionary.
use_text_index_postings_cache
β
Type
Default value
Type
Bool
Default value
0
Whether to use a cache of deserialized text index posting lists.
Using the text index postings cache can significantly reduce latency and increase throughput when working with a large number of text index queries.
use_text_index_tokens_cache
β
Type
Default value
Type
Bool
Default value
0
Whether to use a cache of deserialized text index token infos.
Using the text index tokens cache can significantly reduce latency and increase throughput when working with a large number of text index queries.
use_top_k_dynamic_filtering
β
Type
Default value
Type
Bool
Default value
0
Enable dynamic filtering optimization when executing a
ORDER BY <column> LIMIT n
query.
When enabled, the query executor will try to skip granules and rows that will not be part of the final
top N
rows in the resultset. This optimization is dynamic in nature and latency improvements depends on data distribution and presence of other predicates in the query.
Possible values:
0 β Disabled.
1 β Enabled.
use_uncompressed_cache
β
Type
Default value
Type
Bool
Default value
0
Whether to use a cache of uncompressed blocks. Accepts 0 or 1. By default, 0 (disabled).
Using the uncompressed cache (only for tables in the MergeTree family) can significantly reduce latency and increase throughput when working with a large number of short queries. Enable this setting for users who send frequent short requests. Also pay attention to the
uncompressed_cache_size
configuration parameter (only set in the config file) β the size of uncompressed cache blocks. By default, it is 8 GiB. The uncompressed cache is filled in as needed and the least-used data is automatically deleted.
For queries that read at least a somewhat large volume of data (one million rows or more), the uncompressed cache is disabled automatically to save space for truly small queries. This means that you can keep the 'use_uncompressed_cache' setting always set to 1.
use_variant_as_common_type
β
Type
Default value
Type
Bool
Default value
1
Allows to use
Variant
type as a result type for
if
/
multiIf
/
array
/
map
functions when there is no common type for argument types.
Example:
SET use_variant_as_common_type = 1;
SELECT toTypeName(if(number % 2, number, range(number))) as variant_type FROM numbers(1);
SELECT if(number % 2, number, range(number)) as variant FROM numbers(5);
ββvariant_typeββββββββββββββββββββ
β Variant(Array(UInt64), UInt64) β
ββββββββββββββββββββββββββββββββββ
ββvariantββββ
β [] β
β 1 β
β [0,1] β
β 3 β
β [0,1,2,3] β
βββββββββββββ
SET use_variant_as_common_type = 1;
SELECT toTypeName(multiIf((number % 4) = 0, 42, (number % 4) = 1, [1, 2, 3], (number % 4) = 2, 'Hello, World!', NULL)) AS variant_type FROM numbers(1);
SELECT multiIf((number % 4) = 0, 42, (number % 4) = 1, [1, 2, 3], (number % 4) = 2, 'Hello, World!', NULL) AS variant FROM numbers(4);
βvariant_typeββββββββββββββββββββββββββ
β Variant(Array(UInt8), String, UInt8) β
ββββββββββββββββββββββββββββββββββββββββ
ββvariantββββββββ
β 42 β
β [1,2,3] β
β Hello, World! β
β α΄Ία΅α΄Έα΄Έ β
βββββββββββββββββ
SET use_variant_as_common_type = 1;
SELECT toTypeName(array(range(number), number, 'str_' || toString(number))) as array_of_variants_type from numbers(1);
SELECT array(range(number), number, 'str_' || toString(number)) as array_of_variants FROM numbers(3);
ββarray_of_variants_typeβββββββββββββββββββββββββ
β Array(Variant(Array(UInt64), String, UInt64)) β
βββββββββββββββββββββββββββββββββββββββββββββββββ
ββarray_of_variantsββ
β [[],0,'str_0'] β
β [[0],1,'str_1'] β
β [[0,1],2,'str_2'] β
βββββββββββββββββββββ
SET use_variant_as_common_type = 1;
SELECT toTypeName(map('a', range(number), 'b', number, 'c', 'str_' || toString(number))) as map_of_variants_type from numbers(1);
SELECT map('a', range(number), 'b', number, 'c', 'str_' || toString(number)) as map_of_variants FROM numbers(3);
ββmap_of_variants_typeβββββββββββββββββββββββββββββββββ
β Map(String, Variant(Array(UInt64), String, UInt64)) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
ββmap_of_variantsββββββββββββββββ
β {'a':[],'b':0,'c':'str_0'} β
β {'a':[0],'b':1,'c':'str_1'} β
β {'a':[0,1],'b':2,'c':'str_2'} β
βββββββββββββββββββββββββββββββββ
use_variant_default_implementation_for_comparisons
β
Type
Default value
Type
Bool
Default value
1
Enables or disables default implementation for Variant type in comparison functions.
use_with_fill_by_sorting_prefix
β
Type
Default value
Type
Bool
Default value
1
Columns preceding WITH FILL columns in ORDER BY clause form sorting prefix. Rows with different values in sorting prefix are filled independently
validate_enum_literals_in_operators
β
Type
Default value
Type
Bool
Default value
0
If enabled, validate enum literals in operators like
IN
,
NOT IN
,
==
,
!=
against the enum type and throw an exception if the literal is not a valid enum value.
validate_mutation_query
β
Type
Default value
Type
Bool
Default value
1
Validate mutation queries before accepting them. Mutations are executed in the background, and running an invalid query will cause mutations to get stuck, requiring manual intervention.
Only change this setting if you encounter a backward-incompatible bug.
validate_polygons
β
Type
Default value
Type
Bool
Default value
1
Enables or disables throwing an exception in the
pointInPolygon
function, if the polygon is self-intersecting or self-tangent.
Possible values:
0 β Throwing an exception is disabled.
pointInPolygon
accepts invalid polygons and returns possibly incorrect results for them.
1 β Throwing an exception is enabled.
vector_search_filter_strategy
β
Type
Default value
Type
VectorSearchFilterStrategy
Default value
auto
If a vector search query has a WHERE clause, this setting determines if it is evaluated first (pre-filtering) OR if the vector similarity index is checked first (post-filtering). Possible values:
'auto' - Postfiltering (the exact semantics may change in future).
'postfilter' - Use vector similarity index to identify the nearest neighbours, then apply other filters
'prefilter' - Evaluate other filters first, then perform brute-force search to identify neighbours.
vector_search_index_fetch_multiplier
β
Aliases
:
vector_search_postfilter_multiplier
Type
Default value
Type
Float
Default value
1
Multiply the number of fetched nearest neighbors from the vector similarity index by this number. Only applied for post-filtering with other predicates or if setting 'vector_search_with_rescoring = 1'.
vector_search_with_rescoring
β
Type
Default value
Type
Bool
Default value
0
If ClickHouse performs rescoring for queries that use the vector similarity index.
Without rescoring, the vector similarity index returns the rows containing the best matches directly.
With rescoring, the rows are extrapolated to granule level and all rows in the granule are checked again.
In most situations, rescoring helps only marginally with accuracy but it deteriorates performance of vector search queries significantly.
Note: A query run without rescoring and with parallel replicas enabled may fall back to rescoring.
wait_changes_become_visible_after_commit_mode
β
Type
Default value
Type
TransactionsWaitCSNMode
Default value
wait_unknown
Wait for committed changes to become actually visible in the latest snapshot
wait_for_async_insert
β
Type
Default value
Type
Bool
Default value
1
If true wait for processing of asynchronous insertio
wait_for_async_insert_timeout
β
Type
Default value
Type
Seconds
Default value
120
Timeout for waiting for processing asynchronous insertio
wait_for_window_view_fire_signal_timeout
β
Type
Default value
Type
Seconds
Default value
10
Timeout for waiting for window view fire signal in event time processing
webassembly_udf_max_fuel
β
Type
Default value
Type
UInt64
Default value
100000
Fuel limit per WebAssembly UDF instance execution. Each WebAssembly instruction consumes some amount of fuel.
Set to 0 for no limit.
webassembly_udf_max_input_block_size
β
Type
Default value
Type
UInt64
Default value
0
Maximum number of rows passed to a WebAssembly UDF in a single block. Set to 0 to process all rows at once.
webassembly_udf_max_instances
β
Type
Default value
Type
UInt64
Default value
32
Maximum number of WebAssembly UDF instances that can run in parallel per function.
webassembly_udf_max_memory
β
Type
Default value
Type
UInt64
Default value
134217728
Memory limit in bytes per WebAssembly UDF instance.
window_view_clean_interval
β
Type
Default value
Type
Seconds
Default value
60
The clean interval of window view in seconds to free outdated data.
window_view_heartbeat_interval
β
Type
Default value
Type
Seconds
Default value
15
The heartbeat interval in seconds to indicate watch query is alive.
workload
β
Type
Default value
Type
String
Default value
default
Name of workload to be used to access resources
Type
Default value
Type
Bool
Default value
0
Write full paths (including s3://) into iceberg metadata files.
write_through_distributed_cache
β
ClickHouse Cloud only
Type
Default value
Type
Bool
Default value
0
Only has an effect in ClickHouse Cloud. Allow writing to distributed cache (writing to s3 will also be done by distributed cache)
write_through_distributed_cache_buffer_size
β
ClickHouse Cloud only
Type
Default value
Type
UInt64
Default value
0
Only has an effect in ClickHouse Cloud. Set buffer size for write-through distributed cache. If 0, will use buffer size which would have been used if there was not distributed cache.
zstd_window_log_max
β
Type
Default value
Type
Int64
Default value
0
Allows you to select the max window log of ZSTD (it will not be used for MergeTree family) |
| Markdown | [Skip to main content](https://clickhouse.com/docs/operations/settings/settings#__docusaurus_skipToContent_fallback)
[](https://clickhouse.com/)
- [Products](https://clickhouse.com/docs/operations/settings/settings)
- [ClickHouse Cloud Best way to use ClickHouse. Available on AWS, GCP, and Azure.](https://clickhouse.com/cloud)
- [BYOC (Bring Your Own Cloud) The fully managed ClickHouse Cloud service, Can be deployed in your AWS account.](https://clickhouse.com/cloud/bring-your-own-cloud)
- [ClickHouse Set up a database with open-source ClickHouse. ClickHouse](https://clickhouse.com/clickhouse)
- [Discover more than 100 integrations.](https://clickhouse.com/integrations)
[Discover more than 100 integrations.](https://clickhouse.com/integrations)
- [Use cases](https://clickhouse.com/docs/operations/settings/settings)
- [Real-time analytics](https://clickhouse.com/use-cases/real-time-analytics)
- [Machine Learning & Generative AI](https://clickhouse.com/use-cases/machine-learning-and-data-science)
- [Business Intelligence](https://clickhouse.com/use-cases/data-warehousing)
- [Logs, Events, Traces](https://clickhouse.com/use-cases/observability)
- [All use cases](https://clickhouse.com/use-cases)
[All use cases](https://clickhouse.com/use-cases)
- [Documentation](https://clickhouse.com/docs)
- [Resources](https://clickhouse.com/docs/operations/settings/settings)
- [User stories](https://clickhouse.com/user-stories)
- [Blog](https://clickhouse.com/blog)
- [Events](https://clickhouse.com/company/events)
- [Learning and certification](https://clickhouse.com/learn)
- [Comparison](https://clickhouse.com/docs/operations/settings/settings)
- [BigQuery](https://clickhouse.com/comparison/bigquery)
- [PostgreSQL](https://clickhouse.com/comparison/postgresql)
- [Redshift](https://clickhouse.com/comparison/redshift)
- [Rockset](https://clickhouse.com/comparison/rockset)
- [Snowflake](https://clickhouse.com/comparison/snowflake)
- [Video](https://clickhouse.com/videos)
- [Demo](https://clickhouse.com/demos)
- [Pricing](https://clickhouse.com/pricing)
- [Contact](https://clickhouse.com/company/contact?loc=nav)
[46\.8k](https://github.com/ClickHouse/ClickHouse?utm_source=clickhouse&utm_medium=website&utm_campaign=website-nav)
[Search`Ctrl``K`](https://clickhouse.com/docs/search)
[Sign in](https://console.clickhouse.cloud/signIn?loc=docs-nav-signIn-cta&glxid=835388a6-b0a4-45b1-adf9-62c7c3ab88fd&pagePath=%2Fdocs%2Foperations%2Fsettings%2Fsettings&origPath=%2Fdocs%2Foperations%2Fsettings%2Fsettings&utm_ga=GA1.1.1511935395.1775990561)
[Get started](https://console.clickhouse.cloud/signUp?loc=docs-nav-signUp-cta&glxid=835388a6-b0a4-45b1-adf9-62c7c3ab88fd&pagePath=%2Fdocs%2Foperations%2Fsettings%2Fsettings&origPath=%2Fdocs%2Foperations%2Fsettings%2Fsettings&utm_ga=GA1.1.1511935395.1775990561)
[Get started](https://clickhouse.com/docs/introduction-clickhouse)
[Cloud](https://clickhouse.com/docs/cloud/overview)
[Manage data](https://clickhouse.com/docs/updating-data)
[Server admin](https://clickhouse.com/docs/guides/manage-and-deploy-index)
[Reference](https://clickhouse.com/docs/sql-reference)
[Integrations](https://clickhouse.com/docs/integrations)
[ClickStack](https://clickhouse.com/docs/use-cases/observability/clickstack/overview)
[chDB](https://clickhouse.com/docs/chdb)
[About](https://clickhouse.com/docs/about)
[Knowledge Base](https://clickhouse.com/docs/knowledgebase)
[English](https://clickhouse.com/docs/operations/settings/settings)
- [English](https://clickhouse.com/docs/operations/settings/settings)
- [ζ₯ζ¬θͺ](https://clickhouse.com/docs/jp/operations/settings/settings)
- [δΈζ](https://clickhouse.com/docs/zh/operations/settings/settings)
- [Π ΡΡΡΠΊΠΈΠΉ](https://clickhouse.com/docs/ru/operations/settings/settings)
- [νκ΅μ΄](https://clickhouse.com/docs/ko/operations/settings/settings)
[Skip to main content](https://clickhouse.com/docs/operations/settings/settings#__docusaurus_skipToContent_fallback)
[](https://clickhouse.com/)
- [Products](https://clickhouse.com/docs/operations/settings/settings)
- [ClickHouse Cloud Best way to use ClickHouse. Available on AWS, GCP, and Azure.](https://clickhouse.com/cloud)
- [BYOC (Bring Your Own Cloud) The fully managed ClickHouse Cloud service, Can be deployed in your AWS account.](https://clickhouse.com/cloud/bring-your-own-cloud)
- [ClickHouse Set up a database with open-source ClickHouse. ClickHouse](https://clickhouse.com/clickhouse)
- [Discover more than 100 integrations.](https://clickhouse.com/integrations)
[Discover more than 100 integrations.](https://clickhouse.com/integrations)
- [Use cases](https://clickhouse.com/docs/operations/settings/settings)
- [Real-time analytics](https://clickhouse.com/use-cases/real-time-analytics)
- [Machine Learning & Generative AI](https://clickhouse.com/use-cases/machine-learning-and-data-science)
- [Business Intelligence](https://clickhouse.com/use-cases/data-warehousing)
- [Logs, Events, Traces](https://clickhouse.com/use-cases/observability)
- [All use cases](https://clickhouse.com/use-cases)
[All use cases](https://clickhouse.com/use-cases)
- [Documentation](https://clickhouse.com/docs)
- [Resources](https://clickhouse.com/docs/operations/settings/settings)
- [User stories](https://clickhouse.com/user-stories)
- [Blog](https://clickhouse.com/blog)
- [Events](https://clickhouse.com/company/events)
- [Learning and certification](https://clickhouse.com/learn)
- [Comparison](https://clickhouse.com/docs/operations/settings/settings)
- [BigQuery](https://clickhouse.com/comparison/bigquery)
- [PostgreSQL](https://clickhouse.com/comparison/postgresql)
- [Redshift](https://clickhouse.com/comparison/redshift)
- [Rockset](https://clickhouse.com/comparison/rockset)
- [Snowflake](https://clickhouse.com/comparison/snowflake)
- [Video](https://clickhouse.com/videos)
- [Demo](https://clickhouse.com/demos)
- [Pricing](https://clickhouse.com/pricing)
- [Contact](https://clickhouse.com/company/contact?loc=nav)
[46\.8k](https://github.com/ClickHouse/ClickHouse?utm_source=clickhouse&utm_medium=website&utm_campaign=website-nav)
[Search`Ctrl``K`](https://clickhouse.com/docs/search)
[Sign in](https://console.clickhouse.cloud/signIn?loc=docs-nav-signIn-cta&glxid=835388a6-b0a4-45b1-adf9-62c7c3ab88fd&pagePath=%2Fdocs%2Foperations%2Fsettings%2Fsettings&origPath=%2Fdocs%2Foperations%2Fsettings%2Fsettings&utm_ga=GA1.1.1511935395.1775990561)
[Get started](https://console.clickhouse.cloud/signUp?loc=docs-nav-signUp-cta&glxid=835388a6-b0a4-45b1-adf9-62c7c3ab88fd&pagePath=%2Fdocs%2Foperations%2Fsettings%2Fsettings&origPath=%2Fdocs%2Foperations%2Fsettings%2Fsettings&utm_ga=GA1.1.1511935395.1775990561)
[Get started](https://clickhouse.com/docs/introduction-clickhouse)
[Cloud](https://clickhouse.com/docs/cloud/overview)
[Manage data](https://clickhouse.com/docs/updating-data)
[Server admin](https://clickhouse.com/docs/guides/manage-and-deploy-index)
[Reference](https://clickhouse.com/docs/sql-reference)
[Integrations](https://clickhouse.com/docs/integrations)
[ClickStack](https://clickhouse.com/docs/use-cases/observability/clickstack/overview)
[chDB](https://clickhouse.com/docs/chdb)
[About](https://clickhouse.com/docs/about)
[Knowledge Base](https://clickhouse.com/docs/knowledgebase)
[English](https://clickhouse.com/docs/operations/settings/settings)
- [English](https://clickhouse.com/docs/operations/settings/settings)
- [ζ₯ζ¬θͺ](https://clickhouse.com/docs/jp/operations/settings/settings)
- [δΈζ](https://clickhouse.com/docs/zh/operations/settings/settings)
- [Π ΡΡΡΠΊΠΈΠΉ](https://clickhouse.com/docs/ru/operations/settings/settings)
- [νκ΅μ΄](https://clickhouse.com/docs/ko/operations/settings/settings)
[Search`Ctrl``K`](https://clickhouse.com/docs/search)
- [Manage and deploy](https://clickhouse.com/docs/guides/manage-and-deploy-index)
- [Deployment and scaling](https://clickhouse.com/docs/deployment-guides/index)
- [ClickHouse Operator](https://clickhouse.com/docs/operations/settings/settings)
- [Separation of storage and compute](https://clickhouse.com/docs/guides/separation-storage-compute)
- [Configuring ClickHouse Keeper](https://clickhouse.com/docs/guides/sre/keeper/clickhouse-keeper)
- [Network ports](https://clickhouse.com/docs/guides/sre/network-ports)
- [Rebalancing shards](https://clickhouse.com/docs/guides/sre/scaling-clusters)
- [Does ClickHouse support multi-region replication?](https://clickhouse.com/docs/faq/operations/multi-region-replication)
- [Which ClickHouse version to use in production?](https://clickhouse.com/docs/faq/operations/production)
- [Cluster discovery](https://clickhouse.com/docs/operations/cluster-discovery)
- [Monitoring](https://clickhouse.com/docs/operations/monitoring)
- [Tracing ClickHouse with OpenTelemetry](https://clickhouse.com/docs/operations/opentelemetry)
- [Quotas](https://clickhouse.com/docs/operations/quotas)
- [Secured Communication with Zookeeper](https://clickhouse.com/docs/operations/ssl-zookeeper)
- [Startup scripts](https://clickhouse.com/docs/operations/startup-scripts)
- [External disks for storing data](https://clickhouse.com/docs/operations/storing-data)
- [Allocation profiling](https://clickhouse.com/docs/operations/allocation-profiling)
- [Backup/Restore](https://clickhouse.com/docs/operations/settings/settings)
- [Allocation profiling](https://clickhouse.com/docs/operations/allocation-profiling)
- [Caches](https://clickhouse.com/docs/operations/caches)
- [Workload scheduling](https://clickhouse.com/docs/operations/workload-scheduling)
- [Self-managed Upgrade](https://clickhouse.com/docs/operations/update)
- [Troubleshooting](https://clickhouse.com/docs/guides/troubleshooting)
- [OSS usage recommendations](https://clickhouse.com/docs/operations/tips)
- [Distributed DDL](https://clickhouse.com/docs/sql-reference/distributed-ddl)
- [Settings](https://clickhouse.com/docs/operations/settings)
- [Settings Overview](https://clickhouse.com/docs/operations/settings/overview)
- [Server Settings](https://clickhouse.com/docs/operations/server-configuration-parameters/settings)
- [Session Settings](https://clickhouse.com/docs/operations/settings/settings)
- [MergeTree tables settings](https://clickhouse.com/docs/operations/settings/merge-tree-settings)
- [Format Settings](https://clickhouse.com/docs/operations/settings/formats)
- [Composable protocols](https://clickhouse.com/docs/operations/settings/composable-protocols)
- [Constraints on settings](https://clickhouse.com/docs/operations/settings/constraints-on-settings)
- [Memory overcommit](https://clickhouse.com/docs/operations/settings/memory-overcommit)
- [Permissions for queries](https://clickhouse.com/docs/operations/settings/permissions-for-queries)
- [Restrictions on query complexity](https://clickhouse.com/docs/operations/settings/query-complexity)
- [Server overload](https://clickhouse.com/docs/operations/settings/server-overload)
- [Query-level Session Settings](https://clickhouse.com/docs/operations/settings/query-level)
- [Settings profiles](https://clickhouse.com/docs/operations/settings/settings-profiles)
- [User Settings](https://clickhouse.com/docs/operations/settings/settings-users)
- [Named collections](https://clickhouse.com/docs/operations/named-collections)
- [Configuration Files](https://clickhouse.com/docs/operations/configuration-files)
- [TCP connection limits](https://clickhouse.com/docs/operations/settings/tcp-connection-limits)
- [System tables](https://clickhouse.com/docs/operations/system-tables)
- [Security and authentication](https://clickhouse.com/docs/security-and-authentication)
- [TLS](https://clickhouse.com/docs/guides/sre/tls)
- [Users and roles](https://clickhouse.com/docs/operations/access-rights)
- [External authenticators](https://clickhouse.com/docs/operations/external-authenticators)
- [Tools and utilities](https://clickhouse.com/docs/operations/utilities)
- [clickhouse\_backupview](https://clickhouse.com/docs/operations/utilities/backupview)
- [clickhouse-benchmark](https://clickhouse.com/docs/operations/utilities/clickhouse-benchmark)
- [clickhouse-compressor](https://clickhouse.com/docs/operations/utilities/clickhouse-compressor)
- [clickhouse-disks](https://clickhouse.com/docs/operations/utilities/clickhouse-disks)
- [clickhouse-format](https://clickhouse.com/docs/operations/utilities/clickhouse-format)
- [clickhouse-keeper-client](https://clickhouse.com/docs/operations/utilities/clickhouse-keeper-client)
- [clickhouse-local](https://clickhouse.com/docs/operations/utilities/clickhouse-local)
- [clickhouse-obfuscator](https://clickhouse.com/docs/operations/utilities/clickhouse-obfuscator)
- [clickhouse-odbc-bridge](https://clickhouse.com/docs/operations/utilities/odbc-bridge)
- [clickhouse-static-files-disk-uploader](https://clickhouse.com/docs/operations/utilities/static-files-disk-uploader)
- [ClickHouse playground](https://clickhouse.com/docs/getting-started/playground)
- [Settings](https://clickhouse.com/docs/operations/settings)
- Session Settings
[Edit this page](https://github.com/ClickHouse/ClickHouse/tree/master/docs/en/operations/settings/settings.md)
# Session Settings
All below settings are also available in table [system.settings](https://clickhouse.com/docs/operations/system-tables/settings). These settings are autogenerated from [source](https://github.com/ClickHouse/ClickHouse/blob/master/src/Core/Settings.cpp).
## add\_http\_cors\_header[β](https://clickhouse.com/docs/operations/settings/settings#add_http_cors_header "Direct link to add_http_cors_header")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Write add http CORS header.
## additional\_result\_filter[β](https://clickhouse.com/docs/operations/settings/settings#additional_result_filter "Direct link to additional_result_filter")
An additional filter expression to apply to the result of `SELECT` query. This setting is not applied to any subquery.
**Example**
```
INSERT INTO table_1 VALUES (1, 'a'), (2, 'bb'), (3, 'ccc'), (4, 'dddd');
SElECT * FROM table_1;
```
```
ββxββ¬βyβββββ
β 1 β a β
β 2 β bb β
β 3 β ccc β
β 4 β dddd β
βββββ΄βββββββ
```
```
SELECT *
FROM table_1
SETTINGS additional_result_filter = 'x != 2'
```
```
ββxββ¬βyβββββ
β 1 β a β
β 3 β ccc β
β 4 β dddd β
βββββ΄βββββββ
```
## additional\_table\_filters[β](https://clickhouse.com/docs/operations/settings/settings#additional_table_filters "Direct link to additional_table_filters")
| Type | Default value |
|---|---|
| TypeMap | Default value{} |
An additional filter expression that is applied after reading from the specified table.
**Example**
```
INSERT INTO table_1 VALUES (1, 'a'), (2, 'bb'), (3, 'ccc'), (4, 'dddd');
SELECT * FROM table_1;
```
```
ββxββ¬βyβββββ
β 1 β a β
β 2 β bb β
β 3 β ccc β
β 4 β dddd β
βββββ΄βββββββ
```
```
SELECT *
FROM table_1
SETTINGS additional_table_filters = {'table_1': 'x != 2'}
```
```
ββxββ¬βyβββββ
β 1 β a β
β 3 β ccc β
β 4 β dddd β
βββββ΄βββββββ
```
## aggregate\_function\_input\_format[β](https://clickhouse.com/docs/operations/settings/settings#aggregate_function_input_format "Direct link to aggregate_function_input_format")
| Type | Default value |
|---|---|
| TypeAggregateFunctionInputFormat | Default valuestate |
Version history
Format for AggregateFunction input during INSERT operations.
Possible values:
- `state` β Binary string with the serialized state (the default). This is the default behavior where AggregateFunction values are expected as binary data.
- `value` β The format expects a single value of the argument of the aggregate function, or in the case of multiple arguments, a tuple of them. They will be deserialized using the corresponding IDataType or DataTypeTuple and then aggregated to form the state.
- `array` β The format expects an Array of values, as described in the `value` option above. All elements of the array will be aggregated to form the state.
**Examples**
For a table with structure:
```
CREATE TABLE example (
user_id UInt64,
avg_session_length AggregateFunction(avg, UInt32)
);
```
With `aggregate_function_input_format = 'value'`:
```
INSERT INTO example FORMAT CSV
123,456
```
With `aggregate_function_input_format = 'array'`:
```
INSERT INTO example FORMAT CSV
123,"[456,789,101]"
```
Note: The `value` and `array` formats are slower than the default `state` format as they require creating and aggregating values during insertion.
## aggregate\_functions\_null\_for\_empty[β](https://clickhouse.com/docs/operations/settings/settings#aggregate_functions_null_for_empty "Direct link to aggregate_functions_null_for_empty")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Enables or disables rewriting all aggregate functions in a query, adding [\-OrNull](https://clickhouse.com/docs/sql-reference/aggregate-functions/combinators#-ornull) suffix to them. Enable it for SQL standard compatibility. It is implemented via query rewrite (similar to [count\_distinct\_implementation](https://clickhouse.com/docs/operations/settings/settings#count_distinct_implementation) setting) to get consistent results for distributed queries.
Possible values:
- 0 β Disabled.
- 1 β Enabled.
**Example**
Consider the following query with aggregate functions:
```
SELECT SUM(-1), MAX(0) FROM system.one WHERE 0;
```
With `aggregate_functions_null_for_empty = 0` it would produce:
```
ββSUM(-1)ββ¬βMAX(0)ββ
β 0 β 0 β
βββββββββββ΄βββββββββ
```
With `aggregate_functions_null_for_empty = 1` the result would be:
```
ββSUMOrNull(-1)ββ¬βMAXOrNull(0)ββ
β NULL β NULL β
βββββββββββββββββ΄βββββββββββββββ
```
## aggregation\_in\_order\_max\_block\_bytes[β](https://clickhouse.com/docs/operations/settings/settings#aggregation_in_order_max_block_bytes "Direct link to aggregation_in_order_max_block_bytes")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value50000000 |
Maximal size of block in bytes accumulated during aggregation in order of primary key. Lower block size allows to parallelize more final merge stage of aggregation.
## aggregation\_memory\_efficient\_merge\_threads[β](https://clickhouse.com/docs/operations/settings/settings#aggregation_memory_efficient_merge_threads "Direct link to aggregation_memory_efficient_merge_threads")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Number of threads to use for merge intermediate aggregation results in memory efficient mode. When bigger, then more memory is consumed. 0 means - same as 'max\_threads'.
## allow\_aggregate\_partitions\_independently[β](https://clickhouse.com/docs/operations/settings/settings#allow_aggregate_partitions_independently "Direct link to allow_aggregate_partitions_independently")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Enable independent aggregation of partitions on separate threads when partition key suits group by key. Beneficial when number of partitions close to number of cores and partitions have roughly the same size
## allow\_archive\_path\_syntax[β](https://clickhouse.com/docs/operations/settings/settings#allow_archive_path_syntax "Direct link to allow_archive_path_syntax")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
File/S3 engines/table function will parse paths with '::' as `<archive> :: <file>` if the archive has correct extension.
## allow\_asynchronous\_read\_from\_io\_pool\_for\_merge\_tree[β](https://clickhouse.com/docs/operations/settings/settings#allow_asynchronous_read_from_io_pool_for_merge_tree "Direct link to allow_asynchronous_read_from_io_pool_for_merge_tree")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Use background I/O pool to read from MergeTree tables. This setting may increase performance for I/O bound queries
## allow\_calculating\_subcolumns\_sizes\_for\_merge\_tree\_reading[β](https://clickhouse.com/docs/operations/settings/settings#allow_calculating_subcolumns_sizes_for_merge_tree_reading "Direct link to allow_calculating_subcolumns_sizes_for_merge_tree_reading")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
When enabled, ClickHouse will calculate the size of files required for each subcolumn reading for better task and block sizes calculation.
## allow\_changing\_replica\_until\_first\_data\_packet[β](https://clickhouse.com/docs/operations/settings/settings#allow_changing_replica_until_first_data_packet "Direct link to allow_changing_replica_until_first_data_packet")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
If it's enabled, in hedged requests we can start new connection until receiving first data packet even if we have already made some progress (but progress haven't updated for `receive_data_timeout` timeout), otherwise we disable changing replica after the first time we made progress.
## allow\_create\_index\_without\_type[β](https://clickhouse.com/docs/operations/settings/settings#allow_create_index_without_type "Direct link to allow_create_index_without_type")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Allow CREATE INDEX query without TYPE. Query will be ignored. Made for SQL compatibility tests.
## allow\_custom\_error\_code\_in\_throwif[β](https://clickhouse.com/docs/operations/settings/settings#allow_custom_error_code_in_throwif "Direct link to allow_custom_error_code_in_throwif")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Enable custom error code in function throwIf(). If true, thrown exceptions may have unexpected error codes.
## allow\_ddl[β](https://clickhouse.com/docs/operations/settings/settings#allow_ddl "Direct link to allow_ddl")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
If it is set to true, then a user is allowed to executed DDL queries.
## allow\_deprecated\_database\_ordinary[β](https://clickhouse.com/docs/operations/settings/settings#allow_deprecated_database_ordinary "Direct link to allow_deprecated_database_ordinary")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Allow to create databases with deprecated Ordinary engine
## allow\_deprecated\_error\_prone\_window\_functions[β](https://clickhouse.com/docs/operations/settings/settings#allow_deprecated_error_prone_window_functions "Direct link to allow_deprecated_error_prone_window_functions")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
Allow usage of deprecated error prone window functions (neighbor, runningAccumulate, runningDifferenceStartingWithFirstValue, runningDifference)
## allow\_deprecated\_snowflake\_conversion\_functions[β](https://clickhouse.com/docs/operations/settings/settings#allow_deprecated_snowflake_conversion_functions "Direct link to allow_deprecated_snowflake_conversion_functions")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
Functions `snowflakeToDateTime`, `snowflakeToDateTime64`, `dateTimeToSnowflake`, and `dateTime64ToSnowflake` are deprecated and disabled by default. Please use functions `snowflakeIDToDateTime`, `snowflakeIDToDateTime64`, `dateTimeToSnowflakeID`, and `dateTime64ToSnowflakeID` instead.
To re-enable the deprecated functions (e.g., during a transition period), please set this setting to `true`.
## allow\_deprecated\_syntax\_for\_merge\_tree[β](https://clickhouse.com/docs/operations/settings/settings#allow_deprecated_syntax_for_merge_tree "Direct link to allow_deprecated_syntax_for_merge_tree")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Allow to create \*MergeTree tables with deprecated engine definition syntax
## allow\_distributed\_ddl[β](https://clickhouse.com/docs/operations/settings/settings#allow_distributed_ddl "Direct link to allow_distributed_ddl")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
If it is set to true, then a user is allowed to executed distributed DDL queries.
## allow\_drop\_detached[β](https://clickhouse.com/docs/operations/settings/settings#allow_drop_detached "Direct link to allow_drop_detached")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Allow ALTER TABLE ... DROP DETACHED PART\[ITION\] ... queries
## allow\_dynamic\_type\_in\_join\_keys[β](https://clickhouse.com/docs/operations/settings/settings#allow_dynamic_type_in_join_keys "Direct link to allow_dynamic_type_in_join_keys")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
Allows using Dynamic type in JOIN keys. Added for compatibility. It's not recommended to use Dynamic type in JOIN keys because comparison with other types may lead to unexpected results.
## allow\_execute\_multiif\_columnar[β](https://clickhouse.com/docs/operations/settings/settings#allow_execute_multiif_columnar "Direct link to allow_execute_multiif_columnar")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Allow execute multiIf function columnar
## allow\_experimental\_alias\_table\_engine[β](https://clickhouse.com/docs/operations/settings/settings#allow_experimental_alias_table_engine "Direct link to allow_experimental_alias_table_engine")
Experimental feature.
[Learn more.](https://clickhouse.com/docs/beta-and-experimental-features#experimental-features)
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
Allow to create table with the Alias engine.
## allow\_experimental\_analyzer[β](https://clickhouse.com/docs/operations/settings/settings#allow_experimental_analyzer "Direct link to allow_experimental_analyzer")
**Aliases**: `enable_analyzer`
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Allow new query analyzer.
## allow\_experimental\_codecs[β](https://clickhouse.com/docs/operations/settings/settings#allow_experimental_codecs "Direct link to allow_experimental_codecs")
Experimental feature.
[Learn more.](https://clickhouse.com/docs/beta-and-experimental-features#experimental-features)
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
If it is set to true, allow to specify experimental compression codecs (but we don't have those yet and this option does nothing).
## allow\_experimental\_correlated\_subqueries[β](https://clickhouse.com/docs/operations/settings/settings#allow_experimental_correlated_subqueries "Direct link to allow_experimental_correlated_subqueries")
Beta feature.
[Learn more.](https://clickhouse.com/docs/beta-and-experimental-features#beta-features)
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Allow to execute correlated subqueries.
## allow\_experimental\_database\_glue\_catalog[β](https://clickhouse.com/docs/operations/settings/settings#allow_experimental_database_glue_catalog "Direct link to allow_experimental_database_glue_catalog")
Beta feature.
[Learn more.](https://clickhouse.com/docs/beta-and-experimental-features#beta-features)
**Aliases**: `allow_database_glue_catalog`
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
Allow experimental database engine DataLakeCatalog with catalog\_type = 'glue'
Cloud default value: `1`.
## allow\_experimental\_database\_hms\_catalog[β](https://clickhouse.com/docs/operations/settings/settings#allow_experimental_database_hms_catalog "Direct link to allow_experimental_database_hms_catalog")
Experimental feature.
[Learn more.](https://clickhouse.com/docs/beta-and-experimental-features#experimental-features)
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
Allow experimental database engine DataLakeCatalog with catalog\_type = 'hms'
## allow\_experimental\_database\_iceberg[β](https://clickhouse.com/docs/operations/settings/settings#allow_experimental_database_iceberg "Direct link to allow_experimental_database_iceberg")
Beta feature.
[Learn more.](https://clickhouse.com/docs/beta-and-experimental-features#beta-features)
**Aliases**: `allow_database_iceberg`
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
Allow experimental database engine DataLakeCatalog with catalog\_type = 'iceberg'
Cloud default value: `1`.
## allow\_experimental\_database\_materialized\_postgresql[β](https://clickhouse.com/docs/operations/settings/settings#allow_experimental_database_materialized_postgresql "Direct link to allow_experimental_database_materialized_postgresql")
Experimental feature.
[Learn more.](https://clickhouse.com/docs/beta-and-experimental-features#experimental-features)
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Allow to create database with Engine=MaterializedPostgreSQL(...).
## allow\_experimental\_database\_paimon\_rest\_catalog[β](https://clickhouse.com/docs/operations/settings/settings#allow_experimental_database_paimon_rest_catalog "Direct link to allow_experimental_database_paimon_rest_catalog")
Experimental feature.
[Learn more.](https://clickhouse.com/docs/beta-and-experimental-features#experimental-features)
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
Allow experimental database engine DataLakeCatalog with catalog\_type = 'paimon\_rest'
## allow\_experimental\_database\_unity\_catalog[β](https://clickhouse.com/docs/operations/settings/settings#allow_experimental_database_unity_catalog "Direct link to allow_experimental_database_unity_catalog")
Beta feature.
[Learn more.](https://clickhouse.com/docs/beta-and-experimental-features#beta-features)
**Aliases**: `allow_database_unity_catalog`
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
Allow experimental database engine DataLakeCatalog with catalog\_type = 'unity'
Cloud default value: `1`.
## allow\_experimental\_delta\_kernel\_rs[β](https://clickhouse.com/docs/operations/settings/settings#allow_experimental_delta_kernel_rs "Direct link to allow_experimental_delta_kernel_rs")
Beta feature.
[Learn more.](https://clickhouse.com/docs/beta-and-experimental-features#beta-features)
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Allow experimental delta-kernel-rs implementation.
## allow\_experimental\_delta\_lake\_writes[β](https://clickhouse.com/docs/operations/settings/settings#allow_experimental_delta_lake_writes "Direct link to allow_experimental_delta_lake_writes")
Experimental feature.
[Learn more.](https://clickhouse.com/docs/beta-and-experimental-features#experimental-features)
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
Enables delta-kernel writes feature.
## allow\_experimental\_expire\_snapshots[β](https://clickhouse.com/docs/operations/settings/settings#allow_experimental_expire_snapshots "Direct link to allow_experimental_expire_snapshots")
Experimental feature.
[Learn more.](https://clickhouse.com/docs/beta-and-experimental-features#experimental-features)
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
Allow to execute experimental Iceberg command `ALTER TABLE ... EXECUTE expire_snapshots`.
## allow\_experimental\_funnel\_functions[β](https://clickhouse.com/docs/operations/settings/settings#allow_experimental_funnel_functions "Direct link to allow_experimental_funnel_functions")
Experimental feature.
[Learn more.](https://clickhouse.com/docs/beta-and-experimental-features#experimental-features)
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Enable experimental functions for funnel analysis.
## allow\_experimental\_hash\_functions[β](https://clickhouse.com/docs/operations/settings/settings#allow_experimental_hash_functions "Direct link to allow_experimental_hash_functions")
Experimental feature.
[Learn more.](https://clickhouse.com/docs/beta-and-experimental-features#experimental-features)
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Enable experimental hash functions
## allow\_experimental\_iceberg\_compaction[β](https://clickhouse.com/docs/operations/settings/settings#allow_experimental_iceberg_compaction "Direct link to allow_experimental_iceberg_compaction")
Experimental feature.
[Learn more.](https://clickhouse.com/docs/beta-and-experimental-features#experimental-features)
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
Allow to explicitly use 'OPTIMIZE' for iceberg tables.
## allow\_experimental\_join\_right\_table\_sorting[β](https://clickhouse.com/docs/operations/settings/settings#allow_experimental_join_right_table_sorting "Direct link to allow_experimental_join_right_table_sorting")
Experimental feature.
[Learn more.](https://clickhouse.com/docs/beta-and-experimental-features#experimental-features)
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
If it is set to true, and the conditions of `join_to_sort_minimum_perkey_rows` and `join_to_sort_maximum_table_rows` are met, rerange the right table by key to improve the performance in left or inner hash join.
## allow\_experimental\_json\_lazy\_type\_hints[β](https://clickhouse.com/docs/operations/settings/settings#allow_experimental_json_lazy_type_hints "Direct link to allow_experimental_json_lazy_type_hints")
Experimental feature.
[Learn more.](https://clickhouse.com/docs/beta-and-experimental-features#experimental-features)
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
Enable experimental lazy type hints for JSON type. This feature allows optimizing JSON type conversions by deferring type hint evaluation.
## allow\_experimental\_kafka\_offsets\_storage\_in\_keeper[β](https://clickhouse.com/docs/operations/settings/settings#allow_experimental_kafka_offsets_storage_in_keeper "Direct link to allow_experimental_kafka_offsets_storage_in_keeper")
Experimental feature.
[Learn more.](https://clickhouse.com/docs/beta-and-experimental-features#experimental-features)
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
Allow experimental feature to store Kafka related offsets in ClickHouse Keeper. When enabled a ClickHouse Keeper path and replica name can be specified to the Kafka table engine. As a result instead of the regular Kafka engine, a new type of storage engine will be used that stores the committed offsets primarily in ClickHouse Keeper
## allow\_experimental\_kusto\_dialect[β](https://clickhouse.com/docs/operations/settings/settings#allow_experimental_kusto_dialect "Direct link to allow_experimental_kusto_dialect")
Experimental feature.
[Learn more.](https://clickhouse.com/docs/beta-and-experimental-features#experimental-features)
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
Enable Kusto Query Language (KQL) - an alternative to SQL.
## allow\_experimental\_materialized\_postgresql\_table[β](https://clickhouse.com/docs/operations/settings/settings#allow_experimental_materialized_postgresql_table "Direct link to allow_experimental_materialized_postgresql_table")
Experimental feature.
[Learn more.](https://clickhouse.com/docs/beta-and-experimental-features#experimental-features)
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Allows to use the MaterializedPostgreSQL table engine. Disabled by default, because this feature is experimental
## allow\_experimental\_nlp\_functions[β](https://clickhouse.com/docs/operations/settings/settings#allow_experimental_nlp_functions "Direct link to allow_experimental_nlp_functions")
Experimental feature.
[Learn more.](https://clickhouse.com/docs/beta-and-experimental-features#experimental-features)
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Enable experimental functions for natural language processing.
## allow\_experimental\_nullable\_tuple\_type[β](https://clickhouse.com/docs/operations/settings/settings#allow_experimental_nullable_tuple_type "Direct link to allow_experimental_nullable_tuple_type")
Experimental feature.
[Learn more.](https://clickhouse.com/docs/beta-and-experimental-features#experimental-features)
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
Allows creation of [Nullable](https://clickhouse.com/docs/sql-reference/data-types/nullable) [Tuple](https://clickhouse.com/docs/sql-reference/data-types/tuple) columns in tables.
This setting does not control whether extracted tuple subcolumns can be `Nullable` (for example, from Dynamic, Variant, JSON, or Tuple columns). Use `allow_nullable_tuple_in_extracted_subcolumns` to control whether extracted tuple subcolumns can be `Nullable`.
## allow\_experimental\_object\_storage\_queue\_hive\_partitioning[β](https://clickhouse.com/docs/operations/settings/settings#allow_experimental_object_storage_queue_hive_partitioning "Direct link to allow_experimental_object_storage_queue_hive_partitioning")
Experimental feature.
[Learn more.](https://clickhouse.com/docs/beta-and-experimental-features#experimental-features)
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
Allow to use hive partitioning with S3Queue/AzureQueue engines
## allow\_experimental\_parallel\_reading\_from\_replicas[β](https://clickhouse.com/docs/operations/settings/settings#allow_experimental_parallel_reading_from_replicas "Direct link to allow_experimental_parallel_reading_from_replicas")
**Aliases**: `enable_parallel_replicas`
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Use up to `max_parallel_replicas` the number of replicas from each shard for SELECT query execution. Reading is parallelized and coordinated dynamically. 0 - disabled, 1 - enabled, silently disable them in case of failure, 2 - enabled, throw an exception in case of failure
## allow\_experimental\_polyglot\_dialect[β](https://clickhouse.com/docs/operations/settings/settings#allow_experimental_polyglot_dialect "Direct link to allow_experimental_polyglot_dialect")
Experimental feature.
[Learn more.](https://clickhouse.com/docs/beta-and-experimental-features#experimental-features)
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
Enable polyglot SQL transpiler - transpiles SQL from 30+ dialects (MySQL, PostgreSQL, SQLite, Snowflake, DuckDB, etc.) into ClickHouse SQL.
## allow\_experimental\_prql\_dialect[β](https://clickhouse.com/docs/operations/settings/settings#allow_experimental_prql_dialect "Direct link to allow_experimental_prql_dialect")
Experimental feature.
[Learn more.](https://clickhouse.com/docs/beta-and-experimental-features#experimental-features)
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
Enable PRQL - an alternative to SQL.
## allow\_experimental\_query\_deduplication[β](https://clickhouse.com/docs/operations/settings/settings#allow_experimental_query_deduplication "Direct link to allow_experimental_query_deduplication")
Experimental feature.
[Learn more.](https://clickhouse.com/docs/beta-and-experimental-features#experimental-features)
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Experimental data deduplication for SELECT queries based on part UUIDs
## allow\_experimental\_time\_series\_aggregate\_functions[β](https://clickhouse.com/docs/operations/settings/settings#allow_experimental_time_series_aggregate_functions "Direct link to allow_experimental_time_series_aggregate_functions")
Experimental feature.
[Learn more.](https://clickhouse.com/docs/beta-and-experimental-features#experimental-features)
**Aliases**: `allow_experimental_ts_to_grid_aggregate_function`
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
Experimental timeSeries\* aggregate functions for Prometheus-like timeseries resampling, rate, delta calculation.
## allow\_experimental\_time\_series\_table[β](https://clickhouse.com/docs/operations/settings/settings#allow_experimental_time_series_table "Direct link to allow_experimental_time_series_table")
Experimental feature.
[Learn more.](https://clickhouse.com/docs/beta-and-experimental-features#experimental-features)
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
Allows creation of tables with the [TimeSeries](https://clickhouse.com/docs/engines/table-engines/special/time_series) table engine. Possible values:
- 0 β the [TimeSeries](https://clickhouse.com/docs/engines/table-engines/special/time_series) table engine is disabled.
- 1 β the [TimeSeries](https://clickhouse.com/docs/engines/table-engines/special/time_series) table engine is enabled.
## allow\_experimental\_window\_view[β](https://clickhouse.com/docs/operations/settings/settings#allow_experimental_window_view "Direct link to allow_experimental_window_view")
Experimental feature.
[Learn more.](https://clickhouse.com/docs/beta-and-experimental-features#experimental-features)
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Enable WINDOW VIEW. Not mature enough.
## allow\_experimental\_ytsaurus\_dictionary\_source[β](https://clickhouse.com/docs/operations/settings/settings#allow_experimental_ytsaurus_dictionary_source "Direct link to allow_experimental_ytsaurus_dictionary_source")
Experimental feature.
[Learn more.](https://clickhouse.com/docs/beta-and-experimental-features#experimental-features)
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
Experimental dictionary source for integration with YTsaurus.
## allow\_experimental\_ytsaurus\_table\_engine[β](https://clickhouse.com/docs/operations/settings/settings#allow_experimental_ytsaurus_table_engine "Direct link to allow_experimental_ytsaurus_table_engine")
Experimental feature.
[Learn more.](https://clickhouse.com/docs/beta-and-experimental-features#experimental-features)
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
Experimental table engine for integration with YTsaurus.
## allow\_experimental\_ytsaurus\_table\_function[β](https://clickhouse.com/docs/operations/settings/settings#allow_experimental_ytsaurus_table_function "Direct link to allow_experimental_ytsaurus_table_function")
Experimental feature.
[Learn more.](https://clickhouse.com/docs/beta-and-experimental-features#experimental-features)
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
Experimental table engine for integration with YTsaurus.
## allow\_fuzz\_query\_functions[β](https://clickhouse.com/docs/operations/settings/settings#allow_fuzz_query_functions "Direct link to allow_fuzz_query_functions")
Experimental feature.
[Learn more.](https://clickhouse.com/docs/beta-and-experimental-features#experimental-features)
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
Enables the `fuzzQuery` function that applies random AST mutations to a query string.
## allow\_general\_join\_planning[β](https://clickhouse.com/docs/operations/settings/settings#allow_general_join_planning "Direct link to allow_general_join_planning")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Allows a more general join planning algorithm that can handle more complex conditions, but only works with hash join. If hash join is not enabled, then the usual join planning algorithm is used regardless of the value of this setting.
## allow\_get\_client\_http\_header[β](https://clickhouse.com/docs/operations/settings/settings#allow_get_client_http_header "Direct link to allow_get_client_http_header")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
Allow to use the function `getClientHTTPHeader` which lets to obtain a value of an the current HTTP request's header. It is not enabled by default for security reasons, because some headers, such as `Cookie`, could contain sensitive info. Note that the `X-ClickHouse-*` and `Authentication` headers are always restricted and cannot be obtained with this function.
## allow\_hyperscan[β](https://clickhouse.com/docs/operations/settings/settings#allow_hyperscan "Direct link to allow_hyperscan")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Allow functions that use Hyperscan library. Disable to avoid potentially long compilation times and excessive resource usage.
## allow\_insert\_into\_iceberg[β](https://clickhouse.com/docs/operations/settings/settings#allow_insert_into_iceberg "Direct link to allow_insert_into_iceberg")
Beta feature.
[Learn more.](https://clickhouse.com/docs/beta-and-experimental-features#beta-features)
**Aliases**: `allow_experimental_insert_into_iceberg`
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
Allow to execute `insert` queries into iceberg.
## allow\_introspection\_functions[β](https://clickhouse.com/docs/operations/settings/settings#allow_introspection_functions "Direct link to allow_introspection_functions")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Enables or disables [introspection functions](https://clickhouse.com/docs/sql-reference/functions/introspection) for query profiling.
Possible values:
- 1 β Introspection functions enabled.
- 0 β Introspection functions disabled.
**See Also**
- [Sampling Query Profiler](https://clickhouse.com/docs/operations/optimizing-performance/sampling-query-profiler)
- System table [trace\_log](https://clickhouse.com/docs/operations/system-tables/trace_log)
## allow\_materialized\_view\_with\_bad\_select[β](https://clickhouse.com/docs/operations/settings/settings#allow_materialized_view_with_bad_select "Direct link to allow_materialized_view_with_bad_select")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
Allow CREATE MATERIALIZED VIEW with SELECT query that references nonexistent tables or columns. It must still be syntactically valid. Doesn't apply to refreshable MVs. Doesn't apply if the MV schema needs to be inferred from the SELECT query (i.e. if the CREATE has no column list and no TO table). Can be used for creating MV before its source table.
## allow\_named\_collection\_override\_by\_default[β](https://clickhouse.com/docs/operations/settings/settings#allow_named_collection_override_by_default "Direct link to allow_named_collection_override_by_default")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Allow named collections' fields override by default.
## allow\_non\_metadata\_alters[β](https://clickhouse.com/docs/operations/settings/settings#allow_non_metadata_alters "Direct link to allow_non_metadata_alters")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Allow to execute alters which affects not only tables metadata, but also data on disk
## allow\_nonconst\_timezone\_arguments[β](https://clickhouse.com/docs/operations/settings/settings#allow_nonconst_timezone_arguments "Direct link to allow_nonconst_timezone_arguments")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
Allow non-const timezone arguments in certain time-related functions like toTimeZone(), fromUnixTimestamp\*(), snowflakeToDateTime\*(). This setting exists only for compatibility reasons. In ClickHouse, the time zone is a property of the data type, respectively of the column. Enabling this setting gives the wrong impression that different values within a column can have different timezones. Therefore, please do not enable this setting.
## allow\_nondeterministic\_mutations[β](https://clickhouse.com/docs/operations/settings/settings#allow_nondeterministic_mutations "Direct link to allow_nondeterministic_mutations")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
User-level setting that allows mutations on replicated tables to make use of non-deterministic functions such as `dictGet`.
Given that, for example, dictionaries, can be out of sync across nodes, mutations that pull values from them are disallowed on replicated tables by default. Enabling this setting allows this behavior, making it the user's responsibility to ensure that the data used is in sync across all nodes.
**Example**
```
<profiles>
<default>
<allow_nondeterministic_mutations>1</allow_nondeterministic_mutations>
<!-- ... -->
</default>
<!-- ... -->
</profiles>
```
## allow\_nondeterministic\_optimize\_skip\_unused\_shards[β](https://clickhouse.com/docs/operations/settings/settings#allow_nondeterministic_optimize_skip_unused_shards "Direct link to allow_nondeterministic_optimize_skip_unused_shards")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Allow nondeterministic (like `rand` or `dictGet`, since later has some caveats with updates) functions in sharding key.
Possible values:
- 0 β Disallowed.
- 1 β Allowed.
## allow\_nullable\_tuple\_in\_extracted\_subcolumns[β](https://clickhouse.com/docs/operations/settings/settings#allow_nullable_tuple_in_extracted_subcolumns "Direct link to allow_nullable_tuple_in_extracted_subcolumns")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
Controls whether extracted subcolumns of type `Tuple(...)` can be typed as `Nullable(Tuple(...))`.
- `false`: Return `Tuple(...)` and use default tuple values for rows where the subcolumn is missing.
- `true`: Return `Nullable(Tuple(...))` and use `NULL` for rows where the subcolumn is missing.
This setting controls extracted subcolumn behavior only. It does not control whether `Nullable(Tuple(...))` columns can be created in tables; that is controlled by `allow_experimental_nullable_tuple_type`.
ClickHouse uses the value for this setting loaded at server startup. Changes made with `SET` or query-level `SETTINGS` do not change extracted subcolumn behavior. To change extracted subcolumn behavior, update `allow_nullable_tuple_in_extracted_subcolumns` in startup profile configuration (for example, users.xml) and restart the server.
## allow\_prefetched\_read\_pool\_for\_local\_filesystem[β](https://clickhouse.com/docs/operations/settings/settings#allow_prefetched_read_pool_for_local_filesystem "Direct link to allow_prefetched_read_pool_for_local_filesystem")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Prefer prefetched threadpool if all parts are on local filesystem
## allow\_prefetched\_read\_pool\_for\_remote\_filesystem[β](https://clickhouse.com/docs/operations/settings/settings#allow_prefetched_read_pool_for_remote_filesystem "Direct link to allow_prefetched_read_pool_for_remote_filesystem")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Prefer prefetched threadpool if all parts are on remote filesystem
## allow\_push\_predicate\_ast\_for\_distributed\_subqueries[β](https://clickhouse.com/docs/operations/settings/settings#allow_push_predicate_ast_for_distributed_subqueries "Direct link to allow_push_predicate_ast_for_distributed_subqueries")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Allows push predicate on AST level for distributed subqueries with enabled anlyzer
## allow\_push\_predicate\_when\_subquery\_contains\_with[β](https://clickhouse.com/docs/operations/settings/settings#allow_push_predicate_when_subquery_contains_with "Direct link to allow_push_predicate_when_subquery_contains_with")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Allows push predicate when subquery contains WITH clause
## allow\_reorder\_prewhere\_conditions[β](https://clickhouse.com/docs/operations/settings/settings#allow_reorder_prewhere_conditions "Direct link to allow_reorder_prewhere_conditions")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
When moving conditions from WHERE to PREWHERE, allow reordering them to optimize filtering
## allow\_settings\_after\_format\_in\_insert[β](https://clickhouse.com/docs/operations/settings/settings#allow_settings_after_format_in_insert "Direct link to allow_settings_after_format_in_insert")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
Control whether `SETTINGS` after `FORMAT` in `INSERT` queries is allowed or not. It is not recommended to use this, since this may interpret part of `SETTINGS` as values.
Example:
```
INSERT INTO FUNCTION null('foo String') SETTINGS max_threads=1 VALUES ('bar');
```
But the following query will work only with `allow_settings_after_format_in_insert`:
```
SET allow_settings_after_format_in_insert=1;
INSERT INTO FUNCTION null('foo String') VALUES ('bar') SETTINGS max_threads=1;
```
Possible values:
- 0 β Disallow.
- 1 β Allow.
Note
Use this setting only for backward compatibility if your use cases depend on old syntax.
## allow\_simdjson[β](https://clickhouse.com/docs/operations/settings/settings#allow_simdjson "Direct link to allow_simdjson")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Allow using simdjson library in 'JSON\*' functions if AVX2 instructions are available. If disabled rapidjson will be used.
## allow\_special\_serialization\_kinds\_in\_output\_formats[β](https://clickhouse.com/docs/operations/settings/settings#allow_special_serialization_kinds_in_output_formats "Direct link to allow_special_serialization_kinds_in_output_formats")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Allows to output columns with special serialization kinds like Sparse and Replicated without converting them to full column representation. It helps to avoid unnecessary data copy during formatting.
## allow\_statistics[β](https://clickhouse.com/docs/operations/settings/settings#allow_statistics "Direct link to allow_statistics")
**Aliases**: `allow_experimental_statistics`
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Allows defining columns with [statistics](https://clickhouse.com/docs/engines/table-engines/mergetree-family/mergetree#table_engine-mergetree-creating-a-table) and [manipulate statistics](https://clickhouse.com/docs/engines/table-engines/mergetree-family/mergetree#column-statistics).
## allow\_statistics\_optimize[β](https://clickhouse.com/docs/operations/settings/settings#allow_statistics_optimize "Direct link to allow_statistics_optimize")
**Aliases**: `allow_statistic_optimize`
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Allows using statistics to optimize queries
## allow\_suspicious\_codecs[β](https://clickhouse.com/docs/operations/settings/settings#allow_suspicious_codecs "Direct link to allow_suspicious_codecs")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
If it is set to true, allow to specify meaningless compression codecs.
## allow\_suspicious\_fixed\_string\_types[β](https://clickhouse.com/docs/operations/settings/settings#allow_suspicious_fixed_string_types "Direct link to allow_suspicious_fixed_string_types")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
In CREATE TABLE statement allows creating columns of type FixedString(n) with n \> 256. FixedString with length \>= 256 is suspicious and most likely indicates a misuse
## allow\_suspicious\_indices[β](https://clickhouse.com/docs/operations/settings/settings#allow_suspicious_indices "Direct link to allow_suspicious_indices")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
Reject primary/secondary indexes and sorting keys with identical expressions
## allow\_suspicious\_low\_cardinality\_types[β](https://clickhouse.com/docs/operations/settings/settings#allow_suspicious_low_cardinality_types "Direct link to allow_suspicious_low_cardinality_types")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Allows or restricts using [LowCardinality](https://clickhouse.com/docs/sql-reference/data-types/lowcardinality) with data types with fixed size of 8 bytes or less: numeric data types and `FixedString(8_bytes_or_less)`.
For small fixed values using of `LowCardinality` is usually inefficient, because ClickHouse stores a numeric index for each row. As a result:
- Disk space usage can rise.
- RAM consumption can be higher, depending on a dictionary size.
- Some functions can work slower due to extra coding/encoding operations.
Merge times in [MergeTree](https://clickhouse.com/docs/engines/table-engines/mergetree-family/mergetree)\-engine tables can grow due to all the reasons described above.
Possible values:
- 1 β Usage of `LowCardinality` is not restricted.
- 0 β Usage of `LowCardinality` is restricted.
## allow\_suspicious\_primary\_key[β](https://clickhouse.com/docs/operations/settings/settings#allow_suspicious_primary_key "Direct link to allow_suspicious_primary_key")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
Allow suspicious `PRIMARY KEY`/`ORDER BY` for MergeTree (i.e. SimpleAggregateFunction).
## allow\_suspicious\_ttl\_expressions[β](https://clickhouse.com/docs/operations/settings/settings#allow_suspicious_ttl_expressions "Direct link to allow_suspicious_ttl_expressions")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
Reject TTL expressions that don't depend on any of table's columns. It indicates a user error most of the time.
## allow\_suspicious\_types\_in\_group\_by[β](https://clickhouse.com/docs/operations/settings/settings#allow_suspicious_types_in_group_by "Direct link to allow_suspicious_types_in_group_by")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
Allows or restricts using [Variant](https://clickhouse.com/docs/sql-reference/data-types/variant) and [Dynamic](https://clickhouse.com/docs/sql-reference/data-types/dynamic) types in GROUP BY keys.
## allow\_suspicious\_types\_in\_order\_by[β](https://clickhouse.com/docs/operations/settings/settings#allow_suspicious_types_in_order_by "Direct link to allow_suspicious_types_in_order_by")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
Allows or restricts using [Variant](https://clickhouse.com/docs/sql-reference/data-types/variant) and [Dynamic](https://clickhouse.com/docs/sql-reference/data-types/dynamic) types in ORDER BY keys.
## allow\_suspicious\_variant\_types[β](https://clickhouse.com/docs/operations/settings/settings#allow_suspicious_variant_types "Direct link to allow_suspicious_variant_types")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
In CREATE TABLE statement allows specifying Variant type with similar variant types (for example, with different numeric or date types). Enabling this setting may introduce some ambiguity when working with values with similar types.
## allow\_unrestricted\_reads\_from\_keeper[β](https://clickhouse.com/docs/operations/settings/settings#allow_unrestricted_reads_from_keeper "Direct link to allow_unrestricted_reads_from_keeper")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Allow unrestricted (without condition on path) reads from system.zookeeper table, can be handy, but is not safe for zookeeper
## alter\_move\_to\_space\_execute\_async[β](https://clickhouse.com/docs/operations/settings/settings#alter_move_to_space_execute_async "Direct link to alter_move_to_space_execute_async")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Execute ALTER TABLE MOVE ... TO \[DISK\|VOLUME\] asynchronously
## alter\_partition\_verbose\_result[β](https://clickhouse.com/docs/operations/settings/settings#alter_partition_verbose_result "Direct link to alter_partition_verbose_result")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Enables or disables the display of information about the parts to which the manipulation operations with partitions and parts have been successfully applied. Applicable to [ATTACH PARTITION\|PART](https://clickhouse.com/docs/sql-reference/statements/alter/partition#attach-partitionpart) and to [FREEZE PARTITION](https://clickhouse.com/docs/sql-reference/statements/alter/partition#freeze-partition).
Possible values:
- 0 β disable verbosity.
- 1 β enable verbosity.
**Example**
```
CREATE TABLE test(a Int64, d Date, s String) ENGINE = MergeTree PARTITION BY toYYYYMDECLARE(d) ORDER BY a;
INSERT INTO test VALUES(1, '2021-01-01', '');
INSERT INTO test VALUES(1, '2021-01-01', '');
ALTER TABLE test DETACH PARTITION ID '202101';
ALTER TABLE test ATTACH PARTITION ID '202101' SETTINGS alter_partition_verbose_result = 1;
ββcommand_typeββββββ¬βpartition_idββ¬βpart_nameβββββ¬βold_part_nameββ
β ATTACH PARTITION β 202101 β 202101_7_7_0 β 202101_5_5_0 β
β ATTACH PARTITION β 202101 β 202101_8_8_0 β 202101_6_6_0 β
ββββββββββββββββββββ΄βββββββββββββββ΄βββββββββββββββ΄ββββββββββββββββ
ALTER TABLE test FREEZE SETTINGS alter_partition_verbose_result = 1;
ββcommand_typeββ¬βpartition_idββ¬βpart_nameβββββ¬βbackup_nameββ¬βbackup_pathββββββββββββββββββββ¬βpart_backup_pathβββββββββββββββββββββββββββββββββββββββββββββ
β FREEZE ALL β 202101 β 202101_7_7_0 β 8 β /var/lib/clickhouse/shadow/8/ β /var/lib/clickhouse/shadow/8/data/default/test/202101_7_7_0 β
β FREEZE ALL β 202101 β 202101_8_8_0 β 8 β /var/lib/clickhouse/shadow/8/ β /var/lib/clickhouse/shadow/8/data/default/test/202101_8_8_0 β
ββββββββββββββββ΄βββββββββββββββ΄βββββββββββββββ΄ββββββββββββββ΄ββββββββββββββββββββββββββββββββ΄ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
```
## alter\_sync[β](https://clickhouse.com/docs/operations/settings/settings#alter_sync "Direct link to alter_sync")
**Aliases**: `replication_alter_partitions_sync`
| Type | Default value |
|---|---|
| TypeUInt64 | Default value1 |
Allows you to specify the wait behavior for actions that are to be executed on replicas by [`ALTER`](https://clickhouse.com/docs/sql-reference/statements/alter), [`OPTIMIZE`](https://clickhouse.com/docs/sql-reference/statements/optimize) or [`TRUNCATE`](https://clickhouse.com/docs/sql-reference/statements/truncate) queries.
Possible values:
- `0` β Do not wait.
- `1` β Wait for own execution.
- `2` β Wait for everyone.
- `3` - Only wait for active replicas.
Cloud default value: `0`.
Note
`alter_sync` is applicable to `Replicated` and `SharedMergeTree` tables only, it does nothing to alter non `Replicated` or `Shared` tables.
## alter\_update\_mode[β](https://clickhouse.com/docs/operations/settings/settings#alter_update_mode "Direct link to alter_update_mode")
| Type | Default value |
|---|---|
| TypeAlterUpdateMode | Default valueheavy |
Version history
A mode for `ALTER` queries that have the `UPDATE` commands.
Possible values:
- `heavy` - run regular mutation.
- `lightweight` - run lightweight update if possible, run regular mutation otherwise.
- `lightweight_force` - run lightweight update if possible, throw otherwise.
## analyze\_index\_with\_space\_filling\_curves[β](https://clickhouse.com/docs/operations/settings/settings#analyze_index_with_space_filling_curves "Direct link to analyze_index_with_space_filling_curves")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
If a table has a space-filling curve in its index, e.g. `ORDER BY mortonEncode(x, y)` or `ORDER BY hilbertEncode(x, y)`, and the query has conditions on its arguments, e.g. `x >= 10 AND x <= 20 AND y >= 20 AND y <= 30`, use the space-filling curve for index analysis.
## analyzer\_compatibility\_allow\_compound\_identifiers\_in\_unflatten\_nested[β](https://clickhouse.com/docs/operations/settings/settings#analyzer_compatibility_allow_compound_identifiers_in_unflatten_nested "Direct link to analyzer_compatibility_allow_compound_identifiers_in_unflatten_nested")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Allow to add compound identifiers to nested. This is a compatibility setting because it changes the query result. When disabled, `SELECT a.b.c FROM table ARRAY JOIN a` does not work, and `SELECT a FROM table` does not include `a.b.c` column into `Nested a` result.
## analyzer\_compatibility\_join\_using\_top\_level\_identifier[β](https://clickhouse.com/docs/operations/settings/settings#analyzer_compatibility_join_using_top_level_identifier "Direct link to analyzer_compatibility_join_using_top_level_identifier")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
Force to resolve identifier in JOIN USING from projection (for example, in `SELECT a + 1 AS b FROM t1 JOIN t2 USING (b)` join will be performed by `t1.a + 1 = t2.b`, rather then `t1.b = t2.b`).
## analyzer\_inline\_views[β](https://clickhouse.com/docs/operations/settings/settings#analyzer_inline_views "Direct link to analyzer_inline_views")
Experimental feature.
[Learn more.](https://clickhouse.com/docs/beta-and-experimental-features#experimental-features)
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
When enabled, the analyzer substitutes ordinary (non-materialized, non-parameterized) views with their defining subqueries, enabling cross-boundary optimizations such as predicate pushdown and column pruning.
## any\_join\_distinct\_right\_table\_keys[β](https://clickhouse.com/docs/operations/settings/settings#any_join_distinct_right_table_keys "Direct link to any_join_distinct_right_table_keys")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
Enables legacy ClickHouse server behaviour in `ANY INNER|LEFT JOIN` operations.
Note
Use this setting only for backward compatibility if your use cases depend on legacy `JOIN` behaviour.
When the legacy behaviour is enabled:
- Results of `t1 ANY LEFT JOIN t2` and `t2 ANY RIGHT JOIN t1` operations are not equal because ClickHouse uses the logic with many-to-one left-to-right table keys mapping.
- Results of `ANY INNER JOIN` operations contain all rows from the left table like the `SEMI LEFT JOIN` operations do.
When the legacy behaviour is disabled:
- Results of `t1 ANY LEFT JOIN t2` and `t2 ANY RIGHT JOIN t1` operations are equal because ClickHouse uses the logic which provides one-to-many keys mapping in `ANY RIGHT JOIN` operations.
- Results of `ANY INNER JOIN` operations contain one row per key from both the left and right tables.
Possible values:
- 0 β Legacy behaviour is disabled.
- 1 β Legacy behaviour is enabled.
See also:
- [JOIN strictness](https://clickhouse.com/docs/sql-reference/statements/select/join#settings)
## apply\_deleted\_mask[β](https://clickhouse.com/docs/operations/settings/settings#apply_deleted_mask "Direct link to apply_deleted_mask")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Enables filtering out rows deleted with lightweight DELETE. If disabled, a query will be able to read those rows. This is useful for debugging and "undelete" scenarios
## apply\_mutations\_on\_fly[β](https://clickhouse.com/docs/operations/settings/settings#apply_mutations_on_fly "Direct link to apply_mutations_on_fly")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
If true, mutations (UPDATEs and DELETEs) which are not materialized in data part will be applied on SELECTs.
## apply\_patch\_parts[β](https://clickhouse.com/docs/operations/settings/settings#apply_patch_parts "Direct link to apply_patch_parts")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
If true, patch parts (that represent lightweight updates) are applied on SELECTs.
## apply\_patch\_parts\_join\_cache\_buckets[β](https://clickhouse.com/docs/operations/settings/settings#apply_patch_parts_join_cache_buckets "Direct link to apply_patch_parts_join_cache_buckets")
| Type | Default value |
|---|---|
| TypeNonZeroUInt64 | Default value8 |
Version history
The number of buckets in the temporary cache for applying patch parts in Join mode.
## apply\_prewhere\_after\_final[β](https://clickhouse.com/docs/operations/settings/settings#apply_prewhere_after_final "Direct link to apply_prewhere_after_final")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
When enabled, PREWHERE conditions are applied after FINAL processing for ReplacingMergeTree and similar engines. This can be useful when PREWHERE references columns that may have different values across duplicate rows, and you want FINAL to select the winning row before filtering. When disabled, PREWHERE is applied during reading. Note: If apply\_row\_level\_security\_after\_final is enabled and row policy uses non-sorting-key columns, PREWHERE will also be deferred to maintain correct execution order (row policy must be applied before PREWHERE).
## apply\_row\_policy\_after\_final[β](https://clickhouse.com/docs/operations/settings/settings#apply_row_policy_after_final "Direct link to apply_row_policy_after_final")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
When enabled, row policies and PREWHERE are applied after FINAL processing for \*MergeTree tables. (Especially for ReplacingMergeTree) When disabled, row policies are applied before FINAL, which can cause different results when the policy filters out rows that should be used for deduplication in ReplacingMergeTree or similar engines.
If the row policy expression depends only on columns in ORDER BY, it will still be applied before FINAL as an optimization, since such filtering cannot affect the deduplication result.
Possible values:
- 0 β Row policy and PREWHERE are applied before FINAL (default).
- 1 β Row policy and PREWHERE are applied after FINAL.
## apply\_settings\_from\_server[β](https://clickhouse.com/docs/operations/settings/settings#apply_settings_from_server "Direct link to apply_settings_from_server")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Whether the client should accept settings from server.
This only affects operations performed on the client side, in particular parsing the INSERT input data and formatting the query result. Most of query execution happens on the server and is not affected by this setting.
Normally this setting should be set in user profile (users.xml or queries like `ALTER USER`), not through the client (client command line arguments, `SET` query, or `SETTINGS` section of `SELECT` query). Through the client it can be changed to false, but can't be changed to true (because the server won't send the settings if user profile has `apply_settings_from_server = false`).
Note that initially (24.12) there was a server setting (`send_settings_to_client`), but latter it got replaced with this client setting, for better usability.
## archive\_adaptive\_buffer\_max\_size\_bytes[β](https://clickhouse.com/docs/operations/settings/settings#archive_adaptive_buffer_max_size_bytes "Direct link to archive_adaptive_buffer_max_size_bytes")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value8388608 |
Version history
Limits the maximum size of the adaptive buffer used when writing to archive files (for example, tar archives
## arrow\_flight\_request\_descriptor\_type[β](https://clickhouse.com/docs/operations/settings/settings#arrow_flight_request_descriptor_type "Direct link to arrow_flight_request_descriptor_type")
| Type | Default value |
|---|---|
| TypeArrowFlightDescriptorType | Default valuepath |
Version history
Type of descriptor to use for Arrow Flight requests. 'path' sends the dataset name as a path descriptor. 'command' sends a SQL query as a command descriptor (required for Dremio).
Possible values:
- 'path' β Use FlightDescriptor::Path (default, works with most Arrow Flight servers)
- 'command' β Use FlightDescriptor::Command with a SELECT query (required for Dremio)
## ast\_fuzzer\_any\_query[β](https://clickhouse.com/docs/operations/settings/settings#ast_fuzzer_any_query "Direct link to ast_fuzzer_any_query")
Experimental feature.
[Learn more.](https://clickhouse.com/docs/beta-and-experimental-features#experimental-features)
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
When false (default), the server-side AST fuzzer (controlled by `ast_fuzzer_runs`) only fuzzes read-only queries (SELECT, EXPLAIN, SHOW, DESCRIBE, EXISTS). When true, all query types including DDL and INSERT are fuzzed.
## ast\_fuzzer\_runs[β](https://clickhouse.com/docs/operations/settings/settings#ast_fuzzer_runs "Direct link to ast_fuzzer_runs")
Experimental feature.
[Learn more.](https://clickhouse.com/docs/beta-and-experimental-features#experimental-features)
| Type | Default value |
|---|---|
| TypeFloat | Default value0 |
Version history
Enables the server-side AST fuzzer that runs randomized queries after each normal query, discarding their results.
- 0: disabled (default).
- A value between 0 and 1 (exclusive): probability of running a single fuzzed query.
- A value \>= 1: the number of fuzzed queries to run per normal query.
The fuzzer accumulates AST fragments from all queries across all sessions, producing increasingly interesting mutations over time. Fuzzed queries that fail are silently discarded; results are never returned to the client.
## asterisk\_include\_alias\_columns[β](https://clickhouse.com/docs/operations/settings/settings#asterisk_include_alias_columns "Direct link to asterisk_include_alias_columns")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Include [ALIAS](https://clickhouse.com/docs/sql-reference/statements/create/table#alias) columns for wildcard query (`SELECT *`).
Possible values:
- 0 - disabled
- 1 - enabled
## asterisk\_include\_materialized\_columns[β](https://clickhouse.com/docs/operations/settings/settings#asterisk_include_materialized_columns "Direct link to asterisk_include_materialized_columns")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Include [MATERIALIZED](https://clickhouse.com/docs/sql-reference/statements/create/view#materialized-view) columns for wildcard query (`SELECT *`).
Possible values:
- 0 - disabled
- 1 - enabled
## async\_insert[β](https://clickhouse.com/docs/operations/settings/settings#async_insert "Direct link to async_insert")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
If true, data from INSERT query is stored in queue and later flushed to table in background. If wait\_for\_async\_insert is false, INSERT query is processed almost instantly, otherwise client will wait until data will be flushed to table
## async\_insert\_busy\_timeout\_decrease\_rate[β](https://clickhouse.com/docs/operations/settings/settings#async_insert_busy_timeout_decrease_rate "Direct link to async_insert_busy_timeout_decrease_rate")
| Type | Default value |
|---|---|
| TypeDouble | Default value0\.2 |
Version history
The exponential growth rate at which the adaptive asynchronous insert timeout decreases
## async\_insert\_busy\_timeout\_increase\_rate[β](https://clickhouse.com/docs/operations/settings/settings#async_insert_busy_timeout_increase_rate "Direct link to async_insert_busy_timeout_increase_rate")
| Type | Default value |
|---|---|
| TypeDouble | Default value0\.2 |
Version history
The exponential growth rate at which the adaptive asynchronous insert timeout increases
## async\_insert\_busy\_timeout\_max\_ms[β](https://clickhouse.com/docs/operations/settings/settings#async_insert_busy_timeout_max_ms "Direct link to async_insert_busy_timeout_max_ms")
**Aliases**: `async_insert_busy_timeout_ms`
| Type | Default value |
|---|---|
| TypeMilliseconds | Default value200 |
Version history
Maximum time to wait before dumping collected data per query since the first data appeared.
Cloud default value: `1000` (1s).
## async\_insert\_busy\_timeout\_min\_ms[β](https://clickhouse.com/docs/operations/settings/settings#async_insert_busy_timeout_min_ms "Direct link to async_insert_busy_timeout_min_ms")
| Type | Default value |
|---|---|
| TypeMilliseconds | Default value50 |
Version history
If auto-adjusting is enabled through async\_insert\_use\_adaptive\_busy\_timeout, minimum time to wait before dumping collected data per query since the first data appeared. It also serves as the initial value for the adaptive algorithm
## async\_insert\_deduplicate[β](https://clickhouse.com/docs/operations/settings/settings#async_insert_deduplicate "Direct link to async_insert_deduplicate")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
For async INSERT queries in the replicated table, specifies that deduplication of inserting blocks should be performed
## async\_insert\_max\_data\_size[β](https://clickhouse.com/docs/operations/settings/settings#async_insert_max_data_size "Direct link to async_insert_max_data_size")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value10485760 |
Version history
Maximum size in bytes of unparsed data collected per query before being inserted
Cloud default value: `104857600` (100 MiB).
## async\_insert\_max\_query\_number[β](https://clickhouse.com/docs/operations/settings/settings#async_insert_max_query_number "Direct link to async_insert_max_query_number")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value450 |
Maximum number of insert queries before being inserted. Only takes effect if setting [`async_insert_deduplicate`](https://clickhouse.com/docs/operations/settings/settings#async_insert_deduplicate) is 1.
## async\_insert\_poll\_timeout\_ms[β](https://clickhouse.com/docs/operations/settings/settings#async_insert_poll_timeout_ms "Direct link to async_insert_poll_timeout_ms")
| Type | Default value |
|---|---|
| TypeMilliseconds | Default value10 |
Version history
Timeout for polling data from asynchronous insert queue
## async\_insert\_use\_adaptive\_busy\_timeout[β](https://clickhouse.com/docs/operations/settings/settings#async_insert_use_adaptive_busy_timeout "Direct link to async_insert_use_adaptive_busy_timeout")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
If it is set to true, use adaptive busy timeout for asynchronous inserts
## async\_query\_sending\_for\_remote[β](https://clickhouse.com/docs/operations/settings/settings#async_query_sending_for_remote "Direct link to async_query_sending_for_remote")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Enables asynchronous connection creation and query sending while executing remote query.
Enabled by default.
## async\_socket\_for\_remote[β](https://clickhouse.com/docs/operations/settings/settings#async_socket_for_remote "Direct link to async_socket_for_remote")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Enables asynchronous read from socket while executing remote query.
Enabled by default.
## automatic\_parallel\_replicas\_min\_bytes\_per\_replica[β](https://clickhouse.com/docs/operations/settings/settings#automatic_parallel_replicas_min_bytes_per_replica "Direct link to automatic_parallel_replicas_min_bytes_per_replica")
Experimental feature.
[Learn more.](https://clickhouse.com/docs/beta-and-experimental-features#experimental-features)
| Type | Default value |
|---|---|
| TypeUInt64 | Default value1048576 |
Version history
Threshold of bytes to read per replica to enable parallel replicas automatically (applies only when `automatic_parallel_replicas_mode`\=1). 0 means no threshold. The total number of bytes to read is estimated based on the collected statistics.
## automatic\_parallel\_replicas\_mode[β](https://clickhouse.com/docs/operations/settings/settings#automatic_parallel_replicas_mode "Direct link to automatic_parallel_replicas_mode")
Experimental feature.
[Learn more.](https://clickhouse.com/docs/beta-and-experimental-features#experimental-features)
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Version history
Enable automatic switching to execution with parallel replicas based on collected statistics. Requires `enable_analyzer = 1`, `enable_parallel_replicas != 0`, `parallel_replicas_local_plan = 1` and providing `cluster_for_parallel_replicas`. 0 - disabled, 1 - enabled, 2 - only statistics collection is enabled (switching to execution with parallel replicas is disabled).
## azure\_allow\_parallel\_part\_upload[β](https://clickhouse.com/docs/operations/settings/settings#azure_allow_parallel_part_upload "Direct link to azure_allow_parallel_part_upload")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Use multiple threads for azure multipart upload.
## azure\_check\_objects\_after\_upload[β](https://clickhouse.com/docs/operations/settings/settings#azure_check_objects_after_upload "Direct link to azure_check_objects_after_upload")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
Check each uploaded object in azure blob storage to be sure that upload was successful
## azure\_connect\_timeout\_ms[β](https://clickhouse.com/docs/operations/settings/settings#azure_connect_timeout_ms "Direct link to azure_connect_timeout_ms")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value1000 |
Version history
Connection timeout for host from azure disks.
## azure\_create\_new\_file\_on\_insert[β](https://clickhouse.com/docs/operations/settings/settings#azure_create_new_file_on_insert "Direct link to azure_create_new_file_on_insert")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Enables or disables creating a new file on each insert in azure engine tables
## azure\_ignore\_file\_doesnt\_exist[β](https://clickhouse.com/docs/operations/settings/settings#azure_ignore_file_doesnt_exist "Direct link to azure_ignore_file_doesnt_exist")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
Ignore absence of file if it does not exist when reading certain keys.
Possible values:
- 1 β `SELECT` returns empty result.
- 0 β `SELECT` throws an exception.
## azure\_list\_object\_keys\_size[β](https://clickhouse.com/docs/operations/settings/settings#azure_list_object_keys_size "Direct link to azure_list_object_keys_size")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value1000 |
Maximum number of files that could be returned in batch by ListObject request
## azure\_max\_blocks\_in\_multipart\_upload[β](https://clickhouse.com/docs/operations/settings/settings#azure_max_blocks_in_multipart_upload "Direct link to azure_max_blocks_in_multipart_upload")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value50000 |
Version history
Maximum number of blocks in multipart upload for Azure.
## azure\_max\_get\_burst[β](https://clickhouse.com/docs/operations/settings/settings#azure_max_get_burst "Direct link to azure_max_get_burst")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Version history
Max number of requests that can be issued simultaneously before hitting request per second limit. By default (0) equals to `azure_max_get_rps`
## azure\_max\_get\_rps[β](https://clickhouse.com/docs/operations/settings/settings#azure_max_get_rps "Direct link to azure_max_get_rps")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Version history
Limit on Azure GET request per second rate before throttling. Zero means unlimited.
## azure\_max\_inflight\_parts\_for\_one\_file[β](https://clickhouse.com/docs/operations/settings/settings#azure_max_inflight_parts_for_one_file "Direct link to azure_max_inflight_parts_for_one_file")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value20 |
Version history
The maximum number of a concurrent loaded parts in multipart upload request. 0 means unlimited.
## azure\_max\_put\_burst[β](https://clickhouse.com/docs/operations/settings/settings#azure_max_put_burst "Direct link to azure_max_put_burst")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Version history
Max number of requests that can be issued simultaneously before hitting request per second limit. By default (0) equals to `azure_max_put_rps`
## azure\_max\_put\_rps[β](https://clickhouse.com/docs/operations/settings/settings#azure_max_put_rps "Direct link to azure_max_put_rps")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Version history
Limit on Azure PUT request per second rate before throttling. Zero means unlimited.
## azure\_max\_redirects[β](https://clickhouse.com/docs/operations/settings/settings#azure_max_redirects "Direct link to azure_max_redirects")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value10 |
Version history
Max number of azure redirects hops allowed.
## azure\_max\_single\_part\_copy\_size[β](https://clickhouse.com/docs/operations/settings/settings#azure_max_single_part_copy_size "Direct link to azure_max_single_part_copy_size")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value268435456 |
Version history
The maximum size of object to copy using single part copy to Azure blob storage.
## azure\_max\_single\_part\_upload\_size[β](https://clickhouse.com/docs/operations/settings/settings#azure_max_single_part_upload_size "Direct link to azure_max_single_part_upload_size")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value33554432 |
Version history
The maximum size of object to upload using singlepart upload to Azure blob storage.
## azure\_max\_single\_read\_retries[β](https://clickhouse.com/docs/operations/settings/settings#azure_max_single_read_retries "Direct link to azure_max_single_read_retries")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value4 |
The maximum number of retries during single Azure blob storage read.
## azure\_max\_unexpected\_write\_error\_retries[β](https://clickhouse.com/docs/operations/settings/settings#azure_max_unexpected_write_error_retries "Direct link to azure_max_unexpected_write_error_retries")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value4 |
Version history
The maximum number of retries in case of unexpected errors during Azure blob storage write
## azure\_max\_upload\_part\_size[β](https://clickhouse.com/docs/operations/settings/settings#azure_max_upload_part_size "Direct link to azure_max_upload_part_size")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value5368709120 |
Version history
The maximum size of part to upload during multipart upload to Azure blob storage.
## azure\_min\_upload\_part\_size[β](https://clickhouse.com/docs/operations/settings/settings#azure_min_upload_part_size "Direct link to azure_min_upload_part_size")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value16777216 |
Version history
The minimum size of part to upload during multipart upload to Azure blob storage.
## azure\_request\_timeout\_ms[β](https://clickhouse.com/docs/operations/settings/settings#azure_request_timeout_ms "Direct link to azure_request_timeout_ms")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value30000 |
Version history
Idleness timeout for sending and receiving data to/from azure. Fail if a single TCP read or write call blocks for this long.
## azure\_sdk\_max\_retries[β](https://clickhouse.com/docs/operations/settings/settings#azure_sdk_max_retries "Direct link to azure_sdk_max_retries")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value10 |
Version history
Maximum number of retries in azure sdk
## azure\_sdk\_retry\_initial\_backoff\_ms[β](https://clickhouse.com/docs/operations/settings/settings#azure_sdk_retry_initial_backoff_ms "Direct link to azure_sdk_retry_initial_backoff_ms")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value10 |
Version history
Minimal backoff between retries in azure sdk
## azure\_sdk\_retry\_max\_backoff\_ms[β](https://clickhouse.com/docs/operations/settings/settings#azure_sdk_retry_max_backoff_ms "Direct link to azure_sdk_retry_max_backoff_ms")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value1000 |
Version history
Maximal backoff between retries in azure sdk
## azure\_skip\_empty\_files[β](https://clickhouse.com/docs/operations/settings/settings#azure_skip_empty_files "Direct link to azure_skip_empty_files")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
Enables or disables skipping empty files in S3 engine.
Possible values:
- 0 β `SELECT` throws an exception if empty file is not compatible with requested format.
- 1 β `SELECT` returns empty result for empty file.
## azure\_strict\_upload\_part\_size[β](https://clickhouse.com/docs/operations/settings/settings#azure_strict_upload_part_size "Direct link to azure_strict_upload_part_size")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Version history
The exact size of part to upload during multipart upload to Azure blob storage.
## azure\_throw\_on\_zero\_files\_match[β](https://clickhouse.com/docs/operations/settings/settings#azure_throw_on_zero_files_match "Direct link to azure_throw_on_zero_files_match")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
Throw an error if matched zero files according to glob expansion rules.
Possible values:
- 1 β `SELECT` throws an exception.
- 0 β `SELECT` returns empty result.
## azure\_truncate\_on\_insert[β](https://clickhouse.com/docs/operations/settings/settings#azure_truncate_on_insert "Direct link to azure_truncate_on_insert")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Enables or disables truncate before insert in azure engine tables.
## azure\_upload\_part\_size\_multiply\_factor[β](https://clickhouse.com/docs/operations/settings/settings#azure_upload_part_size_multiply_factor "Direct link to azure_upload_part_size_multiply_factor")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value2 |
Version history
Multiply azure\_min\_upload\_part\_size by this factor each time azure\_multiply\_parts\_count\_threshold parts were uploaded from a single write to Azure blob storage.
## azure\_upload\_part\_size\_multiply\_parts\_count\_threshold[β](https://clickhouse.com/docs/operations/settings/settings#azure_upload_part_size_multiply_parts_count_threshold "Direct link to azure_upload_part_size_multiply_parts_count_threshold")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value500 |
Version history
Each time this number of parts was uploaded to Azure blob storage, azure\_min\_upload\_part\_size is multiplied by azure\_upload\_part\_size\_multiply\_factor.
## azure\_use\_adaptive\_timeouts[β](https://clickhouse.com/docs/operations/settings/settings#azure_use_adaptive_timeouts "Direct link to azure_use_adaptive_timeouts")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
When set to `true` than for all azure requests first two attempts are made with low send and receive timeouts. When set to `false` than all attempts are made with identical timeouts.
## backup\_restore\_batch\_size\_for\_keeper\_multi[β](https://clickhouse.com/docs/operations/settings/settings#backup_restore_batch_size_for_keeper_multi "Direct link to backup_restore_batch_size_for_keeper_multi")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value1000 |
Maximum size of batch for multi request to \[Zoo\]Keeper during backup or restore
## backup\_restore\_batch\_size\_for\_keeper\_multiread[β](https://clickhouse.com/docs/operations/settings/settings#backup_restore_batch_size_for_keeper_multiread "Direct link to backup_restore_batch_size_for_keeper_multiread")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value10000 |
Maximum size of batch for multiread request to \[Zoo\]Keeper during backup or restore
## backup\_restore\_failure\_after\_host\_disconnected\_for\_seconds[β](https://clickhouse.com/docs/operations/settings/settings#backup_restore_failure_after_host_disconnected_for_seconds "Direct link to backup_restore_failure_after_host_disconnected_for_seconds")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value3600 |
Version history
If a host during a BACKUP ON CLUSTER or RESTORE ON CLUSTER operation doesn't recreate its ephemeral 'alive' node in ZooKeeper for this amount of time then the whole backup or restore is considered as failed. This value should be bigger than any reasonable time for a host to reconnect to ZooKeeper after a failure. Zero means unlimited.
## backup\_restore\_finish\_timeout\_after\_error\_sec[β](https://clickhouse.com/docs/operations/settings/settings#backup_restore_finish_timeout_after_error_sec "Direct link to backup_restore_finish_timeout_after_error_sec")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value180 |
Version history
How long the initiator should wait for other host to react to the 'error' node and stop their work on the current BACKUP ON CLUSTER or RESTORE ON CLUSTER operation.
## backup\_restore\_keeper\_fault\_injection\_probability[β](https://clickhouse.com/docs/operations/settings/settings#backup_restore_keeper_fault_injection_probability "Direct link to backup_restore_keeper_fault_injection_probability")
| Type | Default value |
|---|---|
| TypeFloat | Default value0 |
Approximate probability of failure for a keeper request during backup or restore. Valid value is in interval \[0.0f, 1.0f\]
## backup\_restore\_keeper\_fault\_injection\_seed[β](https://clickhouse.com/docs/operations/settings/settings#backup_restore_keeper_fault_injection_seed "Direct link to backup_restore_keeper_fault_injection_seed")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
0 - random seed, otherwise the setting value
## backup\_restore\_keeper\_max\_retries[β](https://clickhouse.com/docs/operations/settings/settings#backup_restore_keeper_max_retries "Direct link to backup_restore_keeper_max_retries")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value1000 |
Version history
Max retries for \[Zoo\]Keeper operations in the middle of a BACKUP or RESTORE operation. Should be big enough so the whole operation won't fail because of a temporary \[Zoo\]Keeper failure.
## backup\_restore\_keeper\_max\_retries\_while\_handling\_error[β](https://clickhouse.com/docs/operations/settings/settings#backup_restore_keeper_max_retries_while_handling_error "Direct link to backup_restore_keeper_max_retries_while_handling_error")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value20 |
Version history
Max retries for \[Zoo\]Keeper operations while handling an error of a BACKUP ON CLUSTER or RESTORE ON CLUSTER operation.
## backup\_restore\_keeper\_max\_retries\_while\_initializing[β](https://clickhouse.com/docs/operations/settings/settings#backup_restore_keeper_max_retries_while_initializing "Direct link to backup_restore_keeper_max_retries_while_initializing")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value20 |
Version history
Max retries for \[Zoo\]Keeper operations during the initialization of a BACKUP ON CLUSTER or RESTORE ON CLUSTER operation.
## backup\_restore\_keeper\_retry\_initial\_backoff\_ms[β](https://clickhouse.com/docs/operations/settings/settings#backup_restore_keeper_retry_initial_backoff_ms "Direct link to backup_restore_keeper_retry_initial_backoff_ms")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value100 |
Initial backoff timeout for \[Zoo\]Keeper operations during backup or restore
## backup\_restore\_keeper\_retry\_max\_backoff\_ms[β](https://clickhouse.com/docs/operations/settings/settings#backup_restore_keeper_retry_max_backoff_ms "Direct link to backup_restore_keeper_retry_max_backoff_ms")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value5000 |
Max backoff timeout for \[Zoo\]Keeper operations during backup or restore
Cloud default value: `60000`.
## backup\_restore\_keeper\_value\_max\_size[β](https://clickhouse.com/docs/operations/settings/settings#backup_restore_keeper_value_max_size "Direct link to backup_restore_keeper_value_max_size")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value1048576 |
Maximum size of data of a \[Zoo\]Keeper's node during backup
## backup\_restore\_s3\_retry\_attempts[β](https://clickhouse.com/docs/operations/settings/settings#backup_restore_s3_retry_attempts "Direct link to backup_restore_s3_retry_attempts")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value1000 |
Version history
Setting for Aws::Client::RetryStrategy, Aws::Client does retries itself, 0 means no retries. It takes place only for backup/restore.
## backup\_restore\_s3\_retry\_initial\_backoff\_ms[β](https://clickhouse.com/docs/operations/settings/settings#backup_restore_s3_retry_initial_backoff_ms "Direct link to backup_restore_s3_retry_initial_backoff_ms")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value25 |
Version history
Initial backoff delay in milliseconds before the first retry attempt during backup and restore. Each subsequent retry increases the delay exponentially, up to the maximum specified by `backup_restore_s3_retry_max_backoff_ms`
## backup\_restore\_s3\_retry\_jitter\_factor[β](https://clickhouse.com/docs/operations/settings/settings#backup_restore_s3_retry_jitter_factor "Direct link to backup_restore_s3_retry_jitter_factor")
| Type | Default value |
|---|---|
| TypeFloat | Default value0\.1 |
Version history
Jitter factor applied to the retry backoff delay in Aws::Client::RetryStrategy during backup and restore operations. The computed backoff delay is multiplied by a random factor in the range \[1.0, 1.0 + jitter\], up to the maximum `backup_restore_s3_retry_max_backoff_ms`. Must be in \[0.0, 1.0\] interval
## backup\_restore\_s3\_retry\_max\_backoff\_ms[β](https://clickhouse.com/docs/operations/settings/settings#backup_restore_s3_retry_max_backoff_ms "Direct link to backup_restore_s3_retry_max_backoff_ms")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value5000 |
Version history
Maximum delay in milliseconds between retries during backup and restore operations.
## backup\_slow\_all\_threads\_after\_retryable\_s3\_error[β](https://clickhouse.com/docs/operations/settings/settings#backup_slow_all_threads_after_retryable_s3_error "Direct link to backup_slow_all_threads_after_retryable_s3_error")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
When set to `true`, all threads executing S3 requests to the same backup endpoint are slowed down after any single S3 request encounters a retryable S3 error, such as 'Slow Down'. When set to `false`, each thread handles s3 request backoff independently of the others.
## cache\_warmer\_threads[β](https://clickhouse.com/docs/operations/settings/settings#cache_warmer_threads "Direct link to cache_warmer_threads")
ClickHouse Cloud only
| Type | Default value |
|---|---|
| TypeUInt64 | Default value4 |
Only has an effect in ClickHouse Cloud. Number of background threads for speculatively downloading new data parts into the filesystem cache, when [cache\_populated\_by\_fetch](https://clickhouse.com/docs/operations/settings/merge-tree-settings#cache_populated_by_fetch) is enabled. Zero to disable.
## calculate\_text\_stack\_trace[β](https://clickhouse.com/docs/operations/settings/settings#calculate_text_stack_trace "Direct link to calculate_text_stack_trace")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Calculate text stack trace in case of exceptions during query execution. This is the default. It requires symbol lookups that may slow down fuzzing tests when a huge amount of wrong queries are executed. In normal cases, you should not disable this option.
## cancel\_http\_readonly\_queries\_on\_client\_close[β](https://clickhouse.com/docs/operations/settings/settings#cancel_http_readonly_queries_on_client_close "Direct link to cancel_http_readonly_queries_on_client_close")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Cancels HTTP read-only queries (e.g. SELECT) when a client closes the connection without waiting for the response.
Cloud default value: `1`.
## cast\_ipv4\_ipv6\_default\_on\_conversion\_error[β](https://clickhouse.com/docs/operations/settings/settings#cast_ipv4_ipv6_default_on_conversion_error "Direct link to cast_ipv4_ipv6_default_on_conversion_error")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
CAST operator into IPv4, CAST operator into IPV6 type, toIPv4, toIPv6 functions will return default value instead of throwing exception on conversion error.
## cast\_keep\_nullable[β](https://clickhouse.com/docs/operations/settings/settings#cast_keep_nullable "Direct link to cast_keep_nullable")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Enables or disables keeping of the `Nullable` data type in [CAST](https://clickhouse.com/docs/sql-reference/functions/type-conversion-functions#CAST) operations.
When the setting is enabled and the argument of `CAST` function is `Nullable`, the result is also transformed to `Nullable` type. When the setting is disabled, the result always has the destination type exactly.
Possible values:
- 0 β The `CAST` result has exactly the destination type specified.
- 1 β If the argument type is `Nullable`, the `CAST` result is transformed to `Nullable(DestinationDataType)`.
**Examples**
The following query results in the destination data type exactly:
```
SET cast_keep_nullable = 0;
SELECT CAST(toNullable(toInt32(0)) AS Int32) as x, toTypeName(x);
```
Result:
```
ββxββ¬βtoTypeName(CAST(toNullable(toInt32(0)), 'Int32'))ββ
β 0 β Int32 β
βββββ΄ββββββββββββββββββββββββββββββββββββββββββββββββββββ
```
The following query results in the `Nullable` modification on the destination data type:
```
SET cast_keep_nullable = 1;
SELECT CAST(toNullable(toInt32(0)) AS Int32) as x, toTypeName(x);
```
Result:
```
ββxββ¬βtoTypeName(CAST(toNullable(toInt32(0)), 'Int32'))ββ
β 0 β Nullable(Int32) β
βββββ΄ββββββββββββββββββββββββββββββββββββββββββββββββββββ
```
**See Also**
- [CAST](https://clickhouse.com/docs/sql-reference/functions/type-conversion-functions#CAST) functio
## cast\_string\_to\_date\_time\_mode[β](https://clickhouse.com/docs/operations/settings/settings#cast_string_to_date_time_mode "Direct link to cast_string_to_date_time_mode")
| Type | Default value |
|---|---|
| TypeDateTimeInputFormat | Default valuebasic |
Version history
Allows choosing a parser of the text representation of date and time during cast from String.
Possible values:
- `'best_effort'` β Enables extended parsing.
ClickHouse can parse the basic `YYYY-MM-DD HH:MM:SS` format and all [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time formats. For example, `'2018-06-08T01:02:03.000Z'`.
- `'best_effort_us'` β Similar to `best_effort` (see the difference in [parseDateTimeBestEffortUS](https://clickhouse.com/docs/sql-reference/functions/type-conversion-functions#parseDateTimeBestEffortUS)
- `'basic'` β Use basic parser.
ClickHouse can parse only the basic `YYYY-MM-DD HH:MM:SS` or `YYYY-MM-DD` format. For example, `2019-08-20 10:18:56` or `2019-08-20`.
See also:
- [DateTime data type.](https://clickhouse.com/docs/sql-reference/data-types/datetime)
- [Functions for working with dates and times.](https://clickhouse.com/docs/sql-reference/functions/date-time-functions)
## cast\_string\_to\_dynamic\_use\_inference[β](https://clickhouse.com/docs/operations/settings/settings#cast_string_to_dynamic_use_inference "Direct link to cast_string_to_dynamic_use_inference")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
Use types inference during String to Dynamic conversio
## cast\_string\_to\_variant\_use\_inference[β](https://clickhouse.com/docs/operations/settings/settings#cast_string_to_variant_use_inference "Direct link to cast_string_to_variant_use_inference")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Use types inference during String to Variant conversion.
## check\_named\_collection\_dependencies[β](https://clickhouse.com/docs/operations/settings/settings#check_named_collection_dependencies "Direct link to check_named_collection_dependencies")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Check that DROP NAMED COLLECTION will not break tables that depend on it
## check\_query\_single\_value\_result[β](https://clickhouse.com/docs/operations/settings/settings#check_query_single_value_result "Direct link to check_query_single_value_result")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
Defines the level of detail for the [CHECK TABLE](https://clickhouse.com/docs/sql-reference/statements/check-table) query result for `MergeTree` family engines .
Possible values:
- 0 β the query shows a check status for every individual data part of a table.
- 1 β the query shows the general table check status.
## check\_referential\_table\_dependencies[β](https://clickhouse.com/docs/operations/settings/settings#check_referential_table_dependencies "Direct link to check_referential_table_dependencies")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Check that DDL query (such as DROP TABLE or RENAME) will not break referential dependencies
## check\_table\_dependencies[β](https://clickhouse.com/docs/operations/settings/settings#check_table_dependencies "Direct link to check_table_dependencies")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Check that DDL query (such as DROP TABLE or RENAME) will not break dependencies
## checksum\_on\_read[β](https://clickhouse.com/docs/operations/settings/settings#checksum_on_read "Direct link to checksum_on_read")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Validate checksums on reading. It is enabled by default and should be always enabled in production. Please do not expect any benefits in disabling this setting. It may only be used for experiments and benchmarks. The setting is only applicable for tables of MergeTree family. Checksums are always validated for other table engines and when receiving data over the network.
## cloud\_mode[β](https://clickhouse.com/docs/operations/settings/settings#cloud_mode "Direct link to cloud_mode")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Cloud mode
Cloud default value: `1`.
## cloud\_mode\_database\_engine[β](https://clickhouse.com/docs/operations/settings/settings#cloud_mode_database_engine "Direct link to cloud_mode_database_engine")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value1 |
Version history
The database engine allowed in Cloud. 1 - rewrite DDLs to use Replicated database, 2 - rewrite DDLs to use Shared database
Cloud default value: `2`.
## cloud\_mode\_engine[β](https://clickhouse.com/docs/operations/settings/settings#cloud_mode_engine "Direct link to cloud_mode_engine")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value1 |
The engine family allowed in Cloud.
- 0 - allow everything
- 1 - rewrite DDLs to use \*ReplicatedMergeTree
- 2 - rewrite DDLs to use SharedMergeTree
- 3 - rewrite DDLs to use SharedMergeTree except when explicitly passed remote disk is specified
- 4 - same as 3, plus additionally use Alias instead of Distributed (the Alias table will point to the destination table of the Distributed table, so it will use the corresponding local table)
UInt64 to minimize public part
Cloud default value: `2`.
## cluster\_for\_parallel\_replicas[β](https://clickhouse.com/docs/operations/settings/settings#cluster_for_parallel_replicas "Direct link to cluster_for_parallel_replicas")
Cluster for a shard in which current server is located
Cloud default value: `default`.
## cluster\_function\_process\_archive\_on\_multiple\_nodes[β](https://clickhouse.com/docs/operations/settings/settings#cluster_function_process_archive_on_multiple_nodes "Direct link to cluster_function_process_archive_on_multiple_nodes")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
If set to `true`, increases performance of processing archives in cluster functions. Should be set to `false` for compatibility and to avoid errors during upgrade to 25.7+ if using cluster functions with archives on earlier versions.
## cluster\_table\_function\_buckets\_batch\_size[β](https://clickhouse.com/docs/operations/settings/settings#cluster_table_function_buckets_batch_size "Direct link to cluster_table_function_buckets_batch_size")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Version history
Defines the approximate size of a batch (in bytes) used in distributed processing of tasks in cluster table functions with `bucket` split granularity. The system accumulates data until at least this amount is reached. The actual size may be slightly larger to align with data boundaries.
## cluster\_table\_function\_split\_granularity[β](https://clickhouse.com/docs/operations/settings/settings#cluster_table_function_split_granularity "Direct link to cluster_table_function_split_granularity")
| Type | Default value |
|---|---|
| TypeObjectStorageGranularityLevel | Default valuefile |
Version history
Controls how data is split into tasks when executing a CLUSTER TABLE FUNCTION.
This setting defines the granularity of work distribution across the cluster:
- `file` β each task processes an entire file.
- `bucket` β tasks are created per internal data block within a file (for example, Parquet row groups).
Choosing finer granularity (like `bucket`) can improve parallelism when working with a small number of large files. For instance, if a Parquet file contains multiple row groups, enabling `bucket` granularity allows each group to be processed independently by different workers.
## collect\_hash\_table\_stats\_during\_aggregation[β](https://clickhouse.com/docs/operations/settings/settings#collect_hash_table_stats_during_aggregation "Direct link to collect_hash_table_stats_during_aggregation")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Enable collecting hash table statistics to optimize memory allocatio
## collect\_hash\_table\_stats\_during\_joins[β](https://clickhouse.com/docs/operations/settings/settings#collect_hash_table_stats_during_joins "Direct link to collect_hash_table_stats_during_joins")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Enable collecting hash table statistics to optimize memory allocatio
## compatibility[β](https://clickhouse.com/docs/operations/settings/settings#compatibility "Direct link to compatibility")
The `compatibility` setting causes ClickHouse to use the default settings of a previous version of ClickHouse, where the previous version is provided as the setting.
If settings are set to non-default values, then those settings are honored (only settings that have not been modified are affected by the `compatibility` setting).
This setting takes a ClickHouse version number as a string, like `22.3`, `22.8`. An empty value means that this setting is disabled.
Disabled by default.
Note
In ClickHouse Cloud, the service-level default compatibility setting must be set by ClickHouse Cloud support. Please [open a case](https://clickhouse.cloud/support?glxid=835388a6-b0a4-45b1-adf9-62c7c3ab88fd&pagePath=%2Fdocs%2Foperations%2Fsettings%2Fsettings&origPath=%2Fdocs%2Foperations%2Fsettings%2Fsettings&utm_ga=GA1.1.1511935395.1775990561) to have it set. However, the compatibility setting can be overridden at the user, role, profile, query, or session level using standard ClickHouse setting mechanisms such as `SET compatibility = '22.3'` in a session or `SETTINGS compatibility = '22.3'` in a query.
## compatibility\_ignore\_auto\_increment\_in\_create\_table[β](https://clickhouse.com/docs/operations/settings/settings#compatibility_ignore_auto_increment_in_create_table "Direct link to compatibility_ignore_auto_increment_in_create_table")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Ignore AUTO\_INCREMENT keyword in column declaration if true, otherwise return error. It simplifies migration from MySQL
## compatibility\_ignore\_collation\_in\_create\_table[β](https://clickhouse.com/docs/operations/settings/settings#compatibility_ignore_collation_in_create_table "Direct link to compatibility_ignore_collation_in_create_table")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Compatibility ignore collation in create table
## compatibility\_s3\_presigned\_url\_query\_in\_path[β](https://clickhouse.com/docs/operations/settings/settings#compatibility_s3_presigned_url_query_in_path "Direct link to compatibility_s3_presigned_url_query_in_path")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
Compatibility: when enabled, folds pre-signed URL query parameters (e.g. X-Amz-\*) into the S3 key (legacy behavior), so '?' acts as a wildcard in the path. When disabled (default), pre-signed URL query parameters are kept in the URL query to avoid interpreting '?' as a wildcard.
## compile\_aggregate\_expressions[β](https://clickhouse.com/docs/operations/settings/settings#compile_aggregate_expressions "Direct link to compile_aggregate_expressions")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Enables or disables JIT-compilation of aggregate functions to native code. Enabling this setting can improve the performance.
Possible values:
- 0 β Aggregation is done without JIT compilation.
- 1 β Aggregation is done using JIT compilation.
**See Also**
- [min\_count\_to\_compile\_aggregate\_expression](https://clickhouse.com/docs/operations/settings/settings#min_count_to_compile_aggregate_expression)
## compile\_expressions[β](https://clickhouse.com/docs/operations/settings/settings#compile_expressions "Direct link to compile_expressions")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Compile some scalar functions and operators to native code.
## compile\_sort\_description[β](https://clickhouse.com/docs/operations/settings/settings#compile_sort_description "Direct link to compile_sort_description")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Compile sort description to native code.
## connect\_timeout[β](https://clickhouse.com/docs/operations/settings/settings#connect_timeout "Direct link to connect_timeout")
| Type | Default value |
|---|---|
| TypeSeconds | Default value10 |
Connection timeout if there are no replicas.
## connect\_timeout\_with\_failover\_ms[β](https://clickhouse.com/docs/operations/settings/settings#connect_timeout_with_failover_ms "Direct link to connect_timeout_with_failover_ms")
| Type | Default value |
|---|---|
| TypeMilliseconds | Default value1000 |
Version history
The timeout in milliseconds for connecting to a remote server for a Distributed table engine, if the 'shard' and 'replica' sections are used in the cluster definition. If unsuccessful, several attempts are made to connect to various replicas.
## connect\_timeout\_with\_failover\_secure\_ms[β](https://clickhouse.com/docs/operations/settings/settings#connect_timeout_with_failover_secure_ms "Direct link to connect_timeout_with_failover_secure_ms")
| Type | Default value |
|---|---|
| TypeMilliseconds | Default value1000 |
Version history
Connection timeout for selecting first healthy replica (for secure connections).
## connection\_pool\_max\_wait\_ms[β](https://clickhouse.com/docs/operations/settings/settings#connection_pool_max_wait_ms "Direct link to connection_pool_max_wait_ms")
| Type | Default value |
|---|---|
| TypeMilliseconds | Default value0 |
The wait time in milliseconds for a connection when the connection pool is full.
Possible values:
- Positive integer.
- 0 β Infinite timeout.
## connections\_with\_failover\_max\_tries[β](https://clickhouse.com/docs/operations/settings/settings#connections_with_failover_max_tries "Direct link to connections_with_failover_max_tries")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value3 |
The maximum number of connection attempts with each replica for the Distributed table engine.
## convert\_query\_to\_cnf[β](https://clickhouse.com/docs/operations/settings/settings#convert_query_to_cnf "Direct link to convert_query_to_cnf")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
When set to `true`, a `SELECT` query will be converted to conjuctive normal form (CNF). There are scenarios where rewriting a query in CNF may execute faster (view this [Github issue](https://github.com/ClickHouse/ClickHouse/issues/11749) for an explanation).
For example, notice how the following `SELECT` query is not modified (the default behavior):
```
EXPLAIN SYNTAX
SELECT *
FROM
(
SELECT number AS x
FROM numbers(20)
) AS a
WHERE ((x >= 1) AND (x <= 5)) OR ((x >= 10) AND (x <= 15))
SETTINGS convert_query_to_cnf = false;
```
The result is:
```
ββexplainβββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β SELECT x β
β FROM β
β ( β
β SELECT number AS x β
β FROM numbers(20) β
β WHERE ((x >= 1) AND (x <= 5)) OR ((x >= 10) AND (x <= 15)) β
β ) AS a β
β WHERE ((x >= 1) AND (x <= 5)) OR ((x >= 10) AND (x <= 15)) β
β SETTINGS convert_query_to_cnf = 0 β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
```
Let's set `convert_query_to_cnf` to `true` and see what changes:
```
EXPLAIN SYNTAX
SELECT *
FROM
(
SELECT number AS x
FROM numbers(20)
) AS a
WHERE ((x >= 1) AND (x <= 5)) OR ((x >= 10) AND (x <= 15))
SETTINGS convert_query_to_cnf = true;
```
Notice the `WHERE` clause is rewritten in CNF, but the result set is the identical - the Boolean logic is unchanged:
```
ββexplainββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β SELECT x β
β FROM β
β ( β
β SELECT number AS x β
β FROM numbers(20) β
β WHERE ((x <= 15) OR (x <= 5)) AND ((x <= 15) OR (x >= 1)) AND ((x >= 10) OR (x <= 5)) AND ((x >= 10) OR (x >= 1)) β
β ) AS a β
β WHERE ((x >= 10) OR (x >= 1)) AND ((x >= 10) OR (x <= 5)) AND ((x <= 15) OR (x >= 1)) AND ((x <= 15) OR (x <= 5)) β
β SETTINGS convert_query_to_cnf = 1 β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
```
Possible values: true, false
## correlated\_subqueries\_default\_join\_kind[β](https://clickhouse.com/docs/operations/settings/settings#correlated_subqueries_default_join_kind "Direct link to correlated_subqueries_default_join_kind")
| Type | Default value |
|---|---|
| TypeDecorrelationJoinKind | Default valueright |
Version history
Controls the kind of joins in the decorrelated query plan. The default value is `right`, which means that decorrelated plan will contain RIGHT JOINs with subquery input on the right side.
Possible values:
- `left` - Decorrelation process will produce LEFT JOINs and input table will appear on the left side.
- `right` - Decorrelation process will produce RIGHT JOINs and input table will appear on the right side.
## correlated\_subqueries\_substitute\_equivalent\_expressions[β](https://clickhouse.com/docs/operations/settings/settings#correlated_subqueries_substitute_equivalent_expressions "Direct link to correlated_subqueries_substitute_equivalent_expressions")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Use filter expressions to inference equivalent expressions and substitute them instead of creating a CROSS JOIN.
## correlated\_subqueries\_use\_in\_memory\_buffer[β](https://clickhouse.com/docs/operations/settings/settings#correlated_subqueries_use_in_memory_buffer "Direct link to correlated_subqueries_use_in_memory_buffer")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Use in-memory buffer for correlated subquery input to avoid its repeated evaluation.
## count\_distinct\_implementation[β](https://clickhouse.com/docs/operations/settings/settings#count_distinct_implementation "Direct link to count_distinct_implementation")
| Type | Default value |
|---|---|
| TypeString | Default valueuniqExact |
Specifies which of the `uniq*` functions should be used to perform the [COUNT(DISTINCT ...)](https://clickhouse.com/docs/sql-reference/aggregate-functions/reference/count) construction.
Possible values:
- [uniq](https://clickhouse.com/docs/sql-reference/aggregate-functions/reference/uniq)
- [uniqCombined](https://clickhouse.com/docs/sql-reference/aggregate-functions/reference/uniqcombined)
- [uniqCombined64](https://clickhouse.com/docs/sql-reference/aggregate-functions/reference/uniqcombined64)
- [uniqHLL12](https://clickhouse.com/docs/sql-reference/aggregate-functions/reference/uniqhll12)
- [uniqExact](https://clickhouse.com/docs/sql-reference/aggregate-functions/reference/uniqexact)
## count\_distinct\_optimization[β](https://clickhouse.com/docs/operations/settings/settings#count_distinct_optimization "Direct link to count_distinct_optimization")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Rewrite count distinct to subquery of group by
## count\_matches\_stop\_at\_empty\_match[β](https://clickhouse.com/docs/operations/settings/settings#count_matches_stop_at_empty_match "Direct link to count_matches_stop_at_empty_match")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
Stop counting once a pattern matches zero-length in the `countMatches` function.
## create\_if\_not\_exists[β](https://clickhouse.com/docs/operations/settings/settings#create_if_not_exists "Direct link to create_if_not_exists")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
Enable `IF NOT EXISTS` for `CREATE` statement by default. If either this setting or `IF NOT EXISTS` is specified and a table with the provided name already exists, no exception will be thrown.
## create\_index\_ignore\_unique[β](https://clickhouse.com/docs/operations/settings/settings#create_index_ignore_unique "Direct link to create_index_ignore_unique")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Ignore UNIQUE keyword in CREATE UNIQUE INDEX. Made for SQL compatibility tests.
## create\_replicated\_merge\_tree\_fault\_injection\_probability[β](https://clickhouse.com/docs/operations/settings/settings#create_replicated_merge_tree_fault_injection_probability "Direct link to create_replicated_merge_tree_fault_injection_probability")
| Type | Default value |
|---|---|
| TypeFloat | Default value0 |
The probability of a fault injection during table creation after creating metadata in ZooKeeper
## create\_table\_empty\_primary\_key\_by\_default[β](https://clickhouse.com/docs/operations/settings/settings#create_table_empty_primary_key_by_default "Direct link to create_table_empty_primary_key_by_default")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Allow to create \*MergeTree tables with empty primary key when ORDER BY and PRIMARY KEY not specified
## cross\_join\_min\_bytes\_to\_compress[β](https://clickhouse.com/docs/operations/settings/settings#cross_join_min_bytes_to_compress "Direct link to cross_join_min_bytes_to_compress")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value1073741824 |
Version history
Minimal size of block to compress in CROSS JOIN. Zero value means - disable this threshold. This block is compressed when any of the two thresholds (by rows or by bytes) are reached.
## cross\_join\_min\_rows\_to\_compress[β](https://clickhouse.com/docs/operations/settings/settings#cross_join_min_rows_to_compress "Direct link to cross_join_min_rows_to_compress")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value10000000 |
Version history
Minimal count of rows to compress block in CROSS JOIN. Zero value means - disable this threshold. This block is compressed when any of the two thresholds (by rows or by bytes) are reached.
## cross\_to\_inner\_join\_rewrite[β](https://clickhouse.com/docs/operations/settings/settings#cross_to_inner_join_rewrite "Direct link to cross_to_inner_join_rewrite")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value1 |
Version history
Use inner join instead of comma/cross join if there are joining expressions in the WHERE section. Values: 0 - no rewrite, 1 - apply if possible for comma/cross, 2 - force rewrite all comma joins, cross - if possible
## data\_type\_default\_nullable[β](https://clickhouse.com/docs/operations/settings/settings#data_type_default_nullable "Direct link to data_type_default_nullable")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Allows data types without explicit modifiers [NULL or NOT NULL](https://clickhouse.com/docs/sql-reference/statements/create/table#null-or-not-null-modifiers) in column definition will be [Nullable](https://clickhouse.com/docs/sql-reference/data-types/nullable).
Possible values:
- 1 β The data types in column definitions are set to `Nullable` by default.
- 0 β The data types in column definitions are set to not `Nullable` by default.
## database\_atomic\_wait\_for\_drop\_and\_detach\_synchronously[β](https://clickhouse.com/docs/operations/settings/settings#database_atomic_wait_for_drop_and_detach_synchronously "Direct link to database_atomic_wait_for_drop_and_detach_synchronously")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Adds a modifier `SYNC` to all `DROP` and `DETACH` queries.
Possible values:
- 0 β Queries will be executed with delay.
- 1 β Queries will be executed without delay.
## database\_datalake\_require\_metadata\_access[β](https://clickhouse.com/docs/operations/settings/settings#database_datalake_require_metadata_access "Direct link to database_datalake_require_metadata_access")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Either to throw error or not if we don't have rights to get table's metadata in database engine DataLakeCatalog.
## database\_replicated\_allow\_explicit\_uuid[β](https://clickhouse.com/docs/operations/settings/settings#database_replicated_allow_explicit_uuid "Direct link to database_replicated_allow_explicit_uuid")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Version history
0 - Don't allow to explicitly specify UUIDs for tables in Replicated databases. 1 - Allow. 2 - Allow, but ignore the specified UUID and generate a random one instead.
## database\_replicated\_allow\_heavy\_create[β](https://clickhouse.com/docs/operations/settings/settings#database_replicated_allow_heavy_create "Direct link to database_replicated_allow_heavy_create")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
Allow long-running DDL queries (CREATE AS SELECT and POPULATE) in Replicated database engine. Note that it can block DDL queue for a long time.
## database\_replicated\_allow\_only\_replicated\_engine[β](https://clickhouse.com/docs/operations/settings/settings#database_replicated_allow_only_replicated_engine "Direct link to database_replicated_allow_only_replicated_engine")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Allow to create only Replicated tables in database with engine Replicated
Cloud default value: `1`.
## database\_replicated\_allow\_replicated\_engine\_arguments[β](https://clickhouse.com/docs/operations/settings/settings#database_replicated_allow_replicated_engine_arguments "Direct link to database_replicated_allow_replicated_engine_arguments")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Version history
0 - Don't allow to explicitly specify ZooKeeper path and replica name for \*MergeTree tables in Replicated databases. 1 - Allow. 2 - Allow, but ignore the specified path and use default one instead. 3 - Allow and don't log a warning.
## database\_replicated\_always\_detach\_permanently[β](https://clickhouse.com/docs/operations/settings/settings#database_replicated_always_detach_permanently "Direct link to database_replicated_always_detach_permanently")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Execute DETACH TABLE as DETACH TABLE PERMANENTLY if database engine is Replicated
## database\_replicated\_enforce\_synchronous\_settings[β](https://clickhouse.com/docs/operations/settings/settings#database_replicated_enforce_synchronous_settings "Direct link to database_replicated_enforce_synchronous_settings")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Enforces synchronous waiting for some queries (see also database\_atomic\_wait\_for\_drop\_and\_detach\_synchronously, mutations\_sync, alter\_sync). Not recommended to enable these settings.
## database\_replicated\_initial\_query\_timeout\_sec[β](https://clickhouse.com/docs/operations/settings/settings#database_replicated_initial_query_timeout_sec "Direct link to database_replicated_initial_query_timeout_sec")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value300 |
Sets how long initial DDL query should wait for Replicated database to process previous DDL queue entries in seconds.
Possible values:
- Positive integer.
- 0 β Unlimited.
## database\_shared\_drop\_table\_delay\_seconds[β](https://clickhouse.com/docs/operations/settings/settings#database_shared_drop_table_delay_seconds "Direct link to database_shared_drop_table_delay_seconds")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value28800 |
Version history
The delay in seconds before a dropped table is actually removed from a Shared database. This allows to recover the table within this time using `UNDROP TABLE` statement.
## decimal\_check\_overflow[β](https://clickhouse.com/docs/operations/settings/settings#decimal_check_overflow "Direct link to decimal_check_overflow")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Check overflow of decimal arithmetic/comparison operations
## deduplicate\_blocks\_in\_dependent\_materialized\_views[β](https://clickhouse.com/docs/operations/settings/settings#deduplicate_blocks_in_dependent_materialized_views "Direct link to deduplicate_blocks_in_dependent_materialized_views")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Enables or disables the deduplication check for materialized views that receive data from Replicated\* tables.
Possible values:
0 β Disabled. 1 β Enabled.
When enabled, ClickHouse performs deduplication of blocks in materialized views that depend on Replicated\* tables. This setting is useful for ensuring that materialized views do not contain duplicate data when the insertion operation is being retried due to a failure.
**See Also**
- [NULL Processing in IN Operators](https://clickhouse.com/docs/guides/developer/deduplicating-inserts-on-retries#insert-deduplication-with-materialized-views)
## deduplicate\_insert[β](https://clickhouse.com/docs/operations/settings/settings#deduplicate_insert "Direct link to deduplicate_insert")
| Type | Default value |
|---|---|
| TypeDeduplicateInsertMode | Default valueenable |
Version history
Enables or disables block deduplication of `INSERT INTO` (for Replicated\* tables). The setting overrides `insert_deduplicate` and `async_insert_deduplicate` settings. That setting has three possible values:
- disable β Deduplication is disabled for `INSERT INTO` query.
- enable β Deduplication is enabled for `INSERT INTO` query.
- backward\_compatible\_choice β Deduplication is enabled if `insert_deduplicate` or `async_insert_deduplicate` are enabled for specific insert type.
## deduplicate\_insert\_select[β](https://clickhouse.com/docs/operations/settings/settings#deduplicate_insert_select "Direct link to deduplicate_insert_select")
| Type | Default value |
|---|---|
| TypeDeduplicateInsertSelectMode | Default valueenable\_when\_possible |
Version history
Enables or disables block deduplication of `INSERT SELECT` (for Replicated\* tables). The setting overrids `insert_deduplicate` and `deduplicate_insert` for `INSERT SELECT` queries. That setting has four possible values:
- disable β Deduplication is disabled for `INSERT SELECT` query.
- force\_enable β Deduplication is enabled for `INSERT SELECT` query. If select result is not stable, exception is thrown.
- enable\_when\_possible β Deduplication is enabled if `insert_deduplicate` is enable and select result is stable, otherwise disabled.
- enable\_even\_for\_bad\_queries - Deduplication is enabled if `insert_deduplicate` is enable. If select result is not stable, warning is logged, but query is executed with deduplication. This option is for backward compatibility. Consider to use other options instead as it may lead to unexpected results.
## default\_materialized\_view\_sql\_security[β](https://clickhouse.com/docs/operations/settings/settings#default_materialized_view_sql_security "Direct link to default_materialized_view_sql_security")
| Type | Default value |
|---|---|
| TypeSQLSecurityType | Default valueDEFINER |
Version history
Allows to set a default value for SQL SECURITY option when creating a materialized view. [More about SQL security](https://clickhouse.com/docs/sql-reference/statements/create/view#sql_security).
The default value is `DEFINER`.
## default\_max\_bytes\_in\_join[β](https://clickhouse.com/docs/operations/settings/settings#default_max_bytes_in_join "Direct link to default_max_bytes_in_join")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value1000000000 |
Maximum size of right-side table if limit is required but `max_bytes_in_join` is not set.
## default\_normal\_view\_sql\_security[β](https://clickhouse.com/docs/operations/settings/settings#default_normal_view_sql_security "Direct link to default_normal_view_sql_security")
| Type | Default value |
|---|---|
| TypeSQLSecurityType | Default valueINVOKER |
Version history
Allows to set default `SQL SECURITY` option while creating a normal view. [More about SQL security](https://clickhouse.com/docs/sql-reference/statements/create/view#sql_security).
The default value is `INVOKER`.
## default\_table\_engine[β](https://clickhouse.com/docs/operations/settings/settings#default_table_engine "Direct link to default_table_engine")
| Type | Default value |
|---|---|
| TypeDefaultTableEngine | Default valueMergeTree |
Version history
Default table engine to use when `ENGINE` is not set in a `CREATE` statement.
Possible values:
- a string representing any valid table engine name
Cloud default value: `SharedMergeTree`.
**Example**
Query:
```
SET default_table_engine = 'Log';
SELECT name, value, changed FROM system.settings WHERE name = 'default_table_engine';
```
Result:
```
ββnameββββββββββββββββββ¬βvalueββ¬βchangedββ
β default_table_engine β Log β 1 β
ββββββββββββββββββββββββ΄ββββββββ΄ββββββββββ
```
In this example, any new table that does not specify an `Engine` will use the `Log` table engine:
Query:
```
CREATE TABLE my_table (
x UInt32,
y UInt32
);
SHOW CREATE TABLE my_table;
```
Result:
```
ββstatementβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β CREATE TABLE default.my_table
(
`x` UInt32,
`y` UInt32
)
ENGINE = Log
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
```
## default\_temporary\_table\_engine[β](https://clickhouse.com/docs/operations/settings/settings#default_temporary_table_engine "Direct link to default_temporary_table_engine")
| Type | Default value |
|---|---|
| TypeDefaultTableEngine | Default valueMemory |
Same as [default\_table\_engine](https://clickhouse.com/docs/operations/settings/settings#default_table_engine) but for temporary tables.
In this example, any new temporary table that does not specify an `Engine` will use the `Log` table engine:
Query:
```
SET default_temporary_table_engine = 'Log';
CREATE TEMPORARY TABLE my_table (
x UInt32,
y UInt32
);
SHOW CREATE TEMPORARY TABLE my_table;
```
Result:
```
ββstatementβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β CREATE TEMPORARY TABLE default.my_table
(
`x` UInt32,
`y` UInt32
)
ENGINE = Log
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
```
## default\_view\_definer[β](https://clickhouse.com/docs/operations/settings/settings#default_view_definer "Direct link to default_view_definer")
| Type | Default value |
|---|---|
| TypeString | Default valueCURRENT\_USER |
Version history
Allows to set default `DEFINER` option while creating a view. [More about SQL security](https://clickhouse.com/docs/sql-reference/statements/create/view#sql_security).
The default value is `CURRENT_USER`.
## delta\_lake\_enable\_engine\_predicate[β](https://clickhouse.com/docs/operations/settings/settings#delta_lake_enable_engine_predicate "Direct link to delta_lake_enable_engine_predicate")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Enables delta-kernel internal data pruning.
## delta\_lake\_enable\_expression\_visitor\_logging[β](https://clickhouse.com/docs/operations/settings/settings#delta_lake_enable_expression_visitor_logging "Direct link to delta_lake_enable_expression_visitor_logging")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
Enables Test level logs of DeltaLake expression visitor. These logs can be too verbose even for test logging.
## delta\_lake\_insert\_max\_bytes\_in\_data\_file[β](https://clickhouse.com/docs/operations/settings/settings#delta_lake_insert_max_bytes_in_data_file "Direct link to delta_lake_insert_max_bytes_in_data_file")
| Type | Default value |
|---|---|
| TypeNonZeroUInt64 | Default value1073741824 |
Version history
Defines a bytes limit for a single inserted data file in delta lake.
## delta\_lake\_insert\_max\_rows\_in\_data\_file[β](https://clickhouse.com/docs/operations/settings/settings#delta_lake_insert_max_rows_in_data_file "Direct link to delta_lake_insert_max_rows_in_data_file")
| Type | Default value |
|---|---|
| TypeNonZeroUInt64 | Default value1000000 |
Version history
Defines a rows limit for a single inserted data file in delta lake.
## delta\_lake\_log\_metadata[β](https://clickhouse.com/docs/operations/settings/settings#delta_lake_log_metadata "Direct link to delta_lake_log_metadata")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
Enables logging delta lake metadata files into system table.
## delta\_lake\_reload\_schema\_for\_consistency[β](https://clickhouse.com/docs/operations/settings/settings#delta_lake_reload_schema_for_consistency "Direct link to delta_lake_reload_schema_for_consistency")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
If enabled, schema is reloaded from the DeltaLake metadata before each query execution to ensure consistency between the schema used during query analysis and the schema used during execution.
## delta\_lake\_snapshot\_end\_version[β](https://clickhouse.com/docs/operations/settings/settings#delta_lake_snapshot_end_version "Direct link to delta_lake_snapshot_end_version")
| Type | Default value |
|---|---|
| TypeInt64 | Default value\-1 |
Version history
End version of delta lake snapshot to read. Value -1 means to read latest version (value 0 is a valid snapshot version).
## delta\_lake\_snapshot\_start\_version[β](https://clickhouse.com/docs/operations/settings/settings#delta_lake_snapshot_start_version "Direct link to delta_lake_snapshot_start_version")
| Type | Default value |
|---|---|
| TypeInt64 | Default value\-1 |
Version history
Start version of delta lake snapshot to read. Value -1 means to read latest version (value 0 is a valid snapshot version).
## delta\_lake\_snapshot\_version[β](https://clickhouse.com/docs/operations/settings/settings#delta_lake_snapshot_version "Direct link to delta_lake_snapshot_version")
| Type | Default value |
|---|---|
| TypeInt64 | Default value\-1 |
Version history
Version of delta lake snapshot to read. Value -1 means to read latest version (value 0 is a valid snapshot version).
## delta\_lake\_throw\_on\_engine\_predicate\_error[β](https://clickhouse.com/docs/operations/settings/settings#delta_lake_throw_on_engine_predicate_error "Direct link to delta_lake_throw_on_engine_predicate_error")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
Enables throwing an exception if there was an error when analyzing scan predicate in delta-kernel.
## describe\_compact\_output[β](https://clickhouse.com/docs/operations/settings/settings#describe_compact_output "Direct link to describe_compact_output")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
If true, include only column names and types into result of DESCRIBE query
## describe\_include\_subcolumns[β](https://clickhouse.com/docs/operations/settings/settings#describe_include_subcolumns "Direct link to describe_include_subcolumns")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Enables describing subcolumns for a [DESCRIBE](https://clickhouse.com/docs/sql-reference/statements/describe-table) query. For example, members of a [Tuple](https://clickhouse.com/docs/sql-reference/data-types/tuple) or subcolumns of a [Map](https://clickhouse.com/docs/sql-reference/data-types/map#reading-subcolumns-of-map), [Nullable](https://clickhouse.com/docs/sql-reference/data-types/nullable#finding-null) or an [Array](https://clickhouse.com/docs/sql-reference/data-types/array#array-size) data type.
Possible values:
- 0 β Subcolumns are not included in `DESCRIBE` queries.
- 1 β Subcolumns are included in `DESCRIBE` queries.
**Example**
See an example for the [DESCRIBE](https://clickhouse.com/docs/sql-reference/statements/describe-table) statement.
## describe\_include\_virtual\_columns[β](https://clickhouse.com/docs/operations/settings/settings#describe_include_virtual_columns "Direct link to describe_include_virtual_columns")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
If true, virtual columns of table will be included into result of DESCRIBE query
## dialect[β](https://clickhouse.com/docs/operations/settings/settings#dialect "Direct link to dialect")
| Type | Default value |
|---|---|
| TypeDialect | Default valueclickhouse |
Which dialect will be used to parse query
## dictionary\_use\_async\_executor[β](https://clickhouse.com/docs/operations/settings/settings#dictionary_use_async_executor "Direct link to dictionary_use_async_executor")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Execute a pipeline for reading dictionary source in several threads. It's supported only by dictionaries with local CLICKHOUSE source.
## dictionary\_validate\_primary\_key\_type[β](https://clickhouse.com/docs/operations/settings/settings#dictionary_validate_primary_key_type "Direct link to dictionary_validate_primary_key_type")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
Validate primary key type for dictionaries. By default id type for simple layouts will be implicitly converted to UInt64.
## distinct\_overflow\_mode[β](https://clickhouse.com/docs/operations/settings/settings#distinct_overflow_mode "Direct link to distinct_overflow_mode")
| Type | Default value |
|---|---|
| TypeOverflowMode | Default valuethrow |
Sets what happens when the amount of data exceeds one of the limits.
Possible values:
- `throw`: throw an exception (default).
- `break`: stop executing the query and return the partial result, as if the source data ran out.
## distributed\_aggregation\_memory\_efficient[β](https://clickhouse.com/docs/operations/settings/settings#distributed_aggregation_memory_efficient "Direct link to distributed_aggregation_memory_efficient")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Is the memory-saving mode of distributed aggregation enabled.
## distributed\_background\_insert\_batch[β](https://clickhouse.com/docs/operations/settings/settings#distributed_background_insert_batch "Direct link to distributed_background_insert_batch")
**Aliases**: `distributed_directory_monitor_batch_inserts`
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Enables/disables inserted data sending in batches.
When batch sending is enabled, the [Distributed](https://clickhouse.com/docs/engines/table-engines/special/distributed) table engine tries to send multiple files of inserted data in one operation instead of sending them separately. Batch sending improves cluster performance by better-utilizing server and network resources.
Possible values:
- 1 β Enabled.
- 0 β Disabled.
## distributed\_background\_insert\_max\_sleep\_time\_ms[β](https://clickhouse.com/docs/operations/settings/settings#distributed_background_insert_max_sleep_time_ms "Direct link to distributed_background_insert_max_sleep_time_ms")
**Aliases**: `distributed_directory_monitor_max_sleep_time_ms`
| Type | Default value |
|---|---|
| TypeMilliseconds | Default value30000 |
Maximum interval for the [Distributed](https://clickhouse.com/docs/engines/table-engines/special/distributed) table engine to send data. Limits exponential growth of the interval set in the [distributed\_background\_insert\_sleep\_time\_ms](https://clickhouse.com/docs/operations/settings/settings#distributed_background_insert_sleep_time_ms) setting.
Possible values:
- A positive integer number of milliseconds.
## distributed\_background\_insert\_sleep\_time\_ms[β](https://clickhouse.com/docs/operations/settings/settings#distributed_background_insert_sleep_time_ms "Direct link to distributed_background_insert_sleep_time_ms")
**Aliases**: `distributed_directory_monitor_sleep_time_ms`
| Type | Default value |
|---|---|
| TypeMilliseconds | Default value100 |
Base interval for the [Distributed](https://clickhouse.com/docs/engines/table-engines/special/distributed) table engine to send data. The actual interval grows exponentially in the event of errors.
Possible values:
- A positive integer number of milliseconds.
## distributed\_background\_insert\_split\_batch\_on\_failure[β](https://clickhouse.com/docs/operations/settings/settings#distributed_background_insert_split_batch_on_failure "Direct link to distributed_background_insert_split_batch_on_failure")
**Aliases**: `distributed_directory_monitor_split_batch_on_failure`
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Enables/disables splitting batches on failures.
Sometimes sending particular batch to the remote shard may fail, because of some complex pipeline after (i.e. `MATERIALIZED VIEW` with `GROUP BY`) due to `Memory limit exceeded` or similar errors. In this case, retrying will not help (and this will stuck distributed sends for the table) but sending files from that batch one by one may succeed INSERT.
So installing this setting to `1` will disable batching for such batches (i.e. temporary disables `distributed_background_insert_batch` for failed batches).
Possible values:
- 1 β Enabled.
- 0 β Disabled.
Note
This setting also affects broken batches (that may appears because of abnormal server (machine) termination and no `fsync_after_insert`/`fsync_directories` for [Distributed](https://clickhouse.com/docs/engines/table-engines/special/distributed) table engine).
Note
You should not rely on automatic batch splitting, since this may hurt performance.
## distributed\_background\_insert\_timeout[β](https://clickhouse.com/docs/operations/settings/settings#distributed_background_insert_timeout "Direct link to distributed_background_insert_timeout")
**Aliases**: `insert_distributed_timeout`
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Timeout for insert query into distributed. Setting is used only with insert\_distributed\_sync enabled. Zero value means no timeout.
## distributed\_cache\_alignment[β](https://clickhouse.com/docs/operations/settings/settings#distributed_cache_alignment "Direct link to distributed_cache_alignment")
ClickHouse Cloud only
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Version history
Only has an effect in ClickHouse Cloud. A setting for testing purposes, do not change it
## distributed\_cache\_bypass\_connection\_pool[β](https://clickhouse.com/docs/operations/settings/settings#distributed_cache_bypass_connection_pool "Direct link to distributed_cache_bypass_connection_pool")
ClickHouse Cloud only
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
Only has an effect in ClickHouse Cloud. Allow to bypass distributed cache connection pool
## distributed\_cache\_connect\_backoff\_max\_ms[β](https://clickhouse.com/docs/operations/settings/settings#distributed_cache_connect_backoff_max_ms "Direct link to distributed_cache_connect_backoff_max_ms")
ClickHouse Cloud only
| Type | Default value |
|---|---|
| TypeUInt64 | Default value50 |
Version history
Only has an effect in ClickHouse Cloud. Maximum backoff milliseconds for distributed cache connection creation.
## distributed\_cache\_connect\_backoff\_min\_ms[β](https://clickhouse.com/docs/operations/settings/settings#distributed_cache_connect_backoff_min_ms "Direct link to distributed_cache_connect_backoff_min_ms")
ClickHouse Cloud only
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Version history
Only has an effect in ClickHouse Cloud. Minimum backoff milliseconds for distributed cache connection creation.
## distributed\_cache\_connect\_max\_tries[β](https://clickhouse.com/docs/operations/settings/settings#distributed_cache_connect_max_tries "Direct link to distributed_cache_connect_max_tries")
ClickHouse Cloud only
| Type | Default value |
|---|---|
| TypeUInt64 | Default value5 |
Version history
Only has an effect in ClickHouse Cloud. Number of tries to connect to distributed cache if unsuccessful
## distributed\_cache\_connect\_timeout\_ms[β](https://clickhouse.com/docs/operations/settings/settings#distributed_cache_connect_timeout_ms "Direct link to distributed_cache_connect_timeout_ms")
ClickHouse Cloud only
| Type | Default value |
|---|---|
| TypeUInt64 | Default value50 |
Version history
Only has an effect in ClickHouse Cloud. Connection timeout when connecting to distributed cache server.
## distributed\_cache\_credentials\_refresh\_period\_seconds[β](https://clickhouse.com/docs/operations/settings/settings#distributed_cache_credentials_refresh_period_seconds "Direct link to distributed_cache_credentials_refresh_period_seconds")
ClickHouse Cloud only
| Type | Default value |
|---|---|
| TypeUInt64 | Default value5 |
Version history
Only has an effect in ClickHouse Cloud. A period of credentials refresh.
## distributed\_cache\_data\_packet\_ack\_window[β](https://clickhouse.com/docs/operations/settings/settings#distributed_cache_data_packet_ack_window "Direct link to distributed_cache_data_packet_ack_window")
ClickHouse Cloud only
| Type | Default value |
|---|---|
| TypeUInt64 | Default value5 |
Version history
Only has an effect in ClickHouse Cloud. A window for sending ACK for DataPacket sequence in a single distributed cache read request
## distributed\_cache\_discard\_connection\_if\_unread\_data[β](https://clickhouse.com/docs/operations/settings/settings#distributed_cache_discard_connection_if_unread_data "Direct link to distributed_cache_discard_connection_if_unread_data")
ClickHouse Cloud only
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Only has an effect in ClickHouse Cloud. Discard connection if some data is unread.
## distributed\_cache\_fetch\_metrics\_only\_from\_current\_az[β](https://clickhouse.com/docs/operations/settings/settings#distributed_cache_fetch_metrics_only_from_current_az "Direct link to distributed_cache_fetch_metrics_only_from_current_az")
ClickHouse Cloud only
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Only has an effect in ClickHouse Cloud. Fetch metrics only from current availability zone in system.distributed\_cache\_metrics, system.distributed\_cache\_events
## distributed\_cache\_file\_cache\_name[β](https://clickhouse.com/docs/operations/settings/settings#distributed_cache_file_cache_name "Direct link to distributed_cache_file_cache_name")
ClickHouse Cloud only
Version history
Only has an effect in ClickHouse Cloud. A setting used only for CI tests - filesystem cache name to use on distributed cache.
## distributed\_cache\_log\_mode[β](https://clickhouse.com/docs/operations/settings/settings#distributed_cache_log_mode "Direct link to distributed_cache_log_mode")
ClickHouse Cloud only
| Type | Default value |
|---|---|
| TypeDistributedCacheLogMode | Default valueon\_error |
Version history
Only has an effect in ClickHouse Cloud. Mode for writing to system.distributed\_cache\_log
## distributed\_cache\_max\_unacked\_inflight\_packets[β](https://clickhouse.com/docs/operations/settings/settings#distributed_cache_max_unacked_inflight_packets "Direct link to distributed_cache_max_unacked_inflight_packets")
ClickHouse Cloud only
| Type | Default value |
|---|---|
| TypeUInt64 | Default value10 |
Version history
Only has an effect in ClickHouse Cloud. A maximum number of unacknowledged in-flight packets in a single distributed cache read request
## distributed\_cache\_min\_bytes\_for\_seek[β](https://clickhouse.com/docs/operations/settings/settings#distributed_cache_min_bytes_for_seek "Direct link to distributed_cache_min_bytes_for_seek")
ClickHouse Cloud only
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Version history
Only has an effect in ClickHouse Cloud. Minimum number of bytes to do seek in distributed cache.
## distributed\_cache\_pool\_behaviour\_on\_limit[β](https://clickhouse.com/docs/operations/settings/settings#distributed_cache_pool_behaviour_on_limit "Direct link to distributed_cache_pool_behaviour_on_limit")
ClickHouse Cloud only
| Type | Default value |
|---|---|
| TypeDistributedCachePoolBehaviourOnLimit | Default valuewait |
Version history
Only has an effect in ClickHouse Cloud. Identifies behaviour of distributed cache connection on pool limit reached
## distributed\_cache\_prefer\_bigger\_buffer\_size[β](https://clickhouse.com/docs/operations/settings/settings#distributed_cache_prefer_bigger_buffer_size "Direct link to distributed_cache_prefer_bigger_buffer_size")
ClickHouse Cloud only
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
Only has an effect in ClickHouse Cloud. Same as filesystem\_cache\_prefer\_bigger\_buffer\_size, but for distributed cache.
## distributed\_cache\_read\_only\_from\_current\_az[β](https://clickhouse.com/docs/operations/settings/settings#distributed_cache_read_only_from_current_az "Direct link to distributed_cache_read_only_from_current_az")
ClickHouse Cloud only
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Only has an effect in ClickHouse Cloud. Allow to read only from current availability zone. If disabled, will read from all cache servers in all availability zones.
## distributed\_cache\_read\_request\_max\_tries[β](https://clickhouse.com/docs/operations/settings/settings#distributed_cache_read_request_max_tries "Direct link to distributed_cache_read_request_max_tries")
ClickHouse Cloud only
| Type | Default value |
|---|---|
| TypeUInt64 | Default value10 |
Version history
Only has an effect in ClickHouse Cloud. Number of tries to do distributed cache request if unsuccessful
## distributed\_cache\_receive\_response\_wait\_milliseconds[β](https://clickhouse.com/docs/operations/settings/settings#distributed_cache_receive_response_wait_milliseconds "Direct link to distributed_cache_receive_response_wait_milliseconds")
ClickHouse Cloud only
| Type | Default value |
|---|---|
| TypeUInt64 | Default value60000 |
Version history
Only has an effect in ClickHouse Cloud. Wait time in milliseconds to receive data for request from distributed cache
## distributed\_cache\_receive\_timeout\_milliseconds[β](https://clickhouse.com/docs/operations/settings/settings#distributed_cache_receive_timeout_milliseconds "Direct link to distributed_cache_receive_timeout_milliseconds")
ClickHouse Cloud only
| Type | Default value |
|---|---|
| TypeUInt64 | Default value10000 |
Version history
Only has an effect in ClickHouse Cloud. Wait time in milliseconds to receive any kind of response from distributed cache
Cloud default value: `20000`.
## distributed\_cache\_receive\_timeout\_ms[β](https://clickhouse.com/docs/operations/settings/settings#distributed_cache_receive_timeout_ms "Direct link to distributed_cache_receive_timeout_ms")
ClickHouse Cloud only
| Type | Default value |
|---|---|
| TypeUInt64 | Default value3000 |
Version history
Only has an effect in ClickHouse Cloud. Timeout for receiving data from distributed cache server, in milliseconds. If no bytes were received in this interval, the exception is thrown.
## distributed\_cache\_send\_timeout\_ms[β](https://clickhouse.com/docs/operations/settings/settings#distributed_cache_send_timeout_ms "Direct link to distributed_cache_send_timeout_ms")
ClickHouse Cloud only
| Type | Default value |
|---|---|
| TypeUInt64 | Default value3000 |
Version history
Only has an effect in ClickHouse Cloud. Timeout for sending data to istributed cache server, in milliseconds. If a client needs to send some data but is not able to send any bytes in this interval, the exception is thrown.
## distributed\_cache\_tcp\_keep\_alive\_timeout\_ms[β](https://clickhouse.com/docs/operations/settings/settings#distributed_cache_tcp_keep_alive_timeout_ms "Direct link to distributed_cache_tcp_keep_alive_timeout_ms")
ClickHouse Cloud only
| Type | Default value |
|---|---|
| TypeUInt64 | Default value2900 |
Version history
Only has an effect in ClickHouse Cloud. The time in milliseconds the connection to distributed cache server needs to remain idle before TCP starts sending keepalive probes.
## distributed\_cache\_throw\_on\_error[β](https://clickhouse.com/docs/operations/settings/settings#distributed_cache_throw_on_error "Direct link to distributed_cache_throw_on_error")
ClickHouse Cloud only
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
Only has an effect in ClickHouse Cloud. Rethrow exception happened during communication with distributed cache or exception received from distributed cache. Otherwise fallback to skipping distributed cache on error
## distributed\_cache\_use\_clients\_cache\_for\_read[β](https://clickhouse.com/docs/operations/settings/settings#distributed_cache_use_clients_cache_for_read "Direct link to distributed_cache_use_clients_cache_for_read")
ClickHouse Cloud only
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Only has an effect in ClickHouse Cloud. Use clients cache for read requests.
## distributed\_cache\_use\_clients\_cache\_for\_write[β](https://clickhouse.com/docs/operations/settings/settings#distributed_cache_use_clients_cache_for_write "Direct link to distributed_cache_use_clients_cache_for_write")
ClickHouse Cloud only
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
Only has an effect in ClickHouse Cloud. Use clients cache for write requests.
## distributed\_cache\_wait\_connection\_from\_pool\_milliseconds[β](https://clickhouse.com/docs/operations/settings/settings#distributed_cache_wait_connection_from_pool_milliseconds "Direct link to distributed_cache_wait_connection_from_pool_milliseconds")
ClickHouse Cloud only
| Type | Default value |
|---|---|
| TypeUInt64 | Default value100 |
Version history
Only has an effect in ClickHouse Cloud. Wait time in milliseconds to receive connection from connection pool if distributed\_cache\_pool\_behaviour\_on\_limit is wait
## distributed\_connections\_pool\_size[β](https://clickhouse.com/docs/operations/settings/settings#distributed_connections_pool_size "Direct link to distributed_connections_pool_size")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value1024 |
The maximum number of simultaneous connections with remote servers for distributed processing of all queries to a single Distributed table. We recommend setting a value no less than the number of servers in the cluster.
## distributed\_ddl\_entry\_format\_version[β](https://clickhouse.com/docs/operations/settings/settings#distributed_ddl_entry_format_version "Direct link to distributed_ddl_entry_format_version")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value5 |
Compatibility version of distributed DDL (ON CLUSTER) queries
Cloud default value: `6`.
## distributed\_ddl\_output\_mode[β](https://clickhouse.com/docs/operations/settings/settings#distributed_ddl_output_mode "Direct link to distributed_ddl_output_mode")
| Type | Default value |
|---|---|
| TypeDistributedDDLOutputMode | Default valuethrow |
Sets format of distributed DDL query result.
Possible values:
- `throw` β Returns result set with query execution status for all hosts where query is finished. If query has failed on some hosts, then it will rethrow the first exception. If query is not finished yet on some hosts and [distributed\_ddl\_task\_timeout](https://clickhouse.com/docs/operations/settings/settings#distributed_ddl_task_timeout) exceeded, then it throws `TIMEOUT_EXCEEDED` exception.
- `none` β Is similar to throw, but distributed DDL query returns no result set.
- `null_status_on_timeout` β Returns `NULL` as execution status in some rows of result set instead of throwing `TIMEOUT_EXCEEDED` if query is not finished on the corresponding hosts.
- `never_throw` β Do not throw `TIMEOUT_EXCEEDED` and do not rethrow exceptions if query has failed on some hosts.
- `none_only_active` - similar to `none`, but doesn't wait for inactive replicas of the `Replicated` database. Note: with this mode it's impossible to figure out that the query was not executed on some replica and will be executed in background.
- `null_status_on_timeout_only_active` β similar to `null_status_on_timeout`, but doesn't wait for inactive replicas of the `Replicated` database
- `throw_only_active` β similar to `throw`, but doesn't wait for inactive replicas of the `Replicated` database
Cloud default value: `none_only_active`.
## distributed\_ddl\_task\_timeout[β](https://clickhouse.com/docs/operations/settings/settings#distributed_ddl_task_timeout "Direct link to distributed_ddl_task_timeout")
| Type | Default value |
|---|---|
| TypeInt64 | Default value180 |
Sets timeout for DDL query responses from all hosts in cluster. If a DDL request has not been performed on all hosts, a response will contain a timeout error and a request will be executed in an async mode. Negative value means infinite.
Possible values:
- Positive integer.
- 0 β Async mode.
- Negative integer β infinite timeout.
## distributed\_foreground\_insert[β](https://clickhouse.com/docs/operations/settings/settings#distributed_foreground_insert "Direct link to distributed_foreground_insert")
**Aliases**: `insert_distributed_sync`
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Enables or disables synchronous data insertion into a [Distributed](https://clickhouse.com/docs/engines/table-engines/special/distributed) table.
By default, when inserting data into a `Distributed` table, the ClickHouse server sends data to cluster nodes in background mode. When `distributed_foreground_insert=1`, the data is processed synchronously, and the `INSERT` operation succeeds only after all the data is saved on all shards (at least one replica for each shard if `internal_replication` is true).
Possible values:
- `0` β Data is inserted in background mode.
- `1` β Data is inserted in synchronous mode.
Cloud default value: `1`.
**See Also**
- [Distributed Table Engine](https://clickhouse.com/docs/engines/table-engines/special/distributed)
- [Managing Distributed Tables](https://clickhouse.com/docs/sql-reference/statements/system#managing-distributed-tables)
## distributed\_group\_by\_no\_merge[β](https://clickhouse.com/docs/operations/settings/settings#distributed_group_by_no_merge "Direct link to distributed_group_by_no_merge")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Do not merge aggregation states from different servers for distributed query processing, you can use this in case it is for certain that there are different keys on different shards
Possible values:
- `0` β Disabled (final query processing is done on the initiator node).
- `1` - Do not merge aggregation states from different servers for distributed query processing (query completely processed on the shard, initiator only proxy the data), can be used in case it is for certain that there are different keys on different shards.
- `2` - Same as `1` but applies `ORDER BY` and `LIMIT` (it is not possible when the query processed completely on the remote node, like for `distributed_group_by_no_merge=1`) on the initiator (can be used for queries with `ORDER BY` and/or `LIMIT`).
**Example**
```
SELECT *
FROM remote('127.0.0.{2,3}', system.one)
GROUP BY dummy
LIMIT 1
SETTINGS distributed_group_by_no_merge = 1
FORMAT PrettyCompactMonoBlock
ββdummyββ
β 0 β
β 0 β
βββββββββ
```
```
SELECT *
FROM remote('127.0.0.{2,3}', system.one)
GROUP BY dummy
LIMIT 1
SETTINGS distributed_group_by_no_merge = 2
FORMAT PrettyCompactMonoBlock
ββdummyββ
β 0 β
βββββββββ
```
## distributed\_index\_analysis[β](https://clickhouse.com/docs/operations/settings/settings#distributed_index_analysis "Direct link to distributed_index_analysis")
Experimental feature.
[Learn more.](https://clickhouse.com/docs/beta-and-experimental-features#experimental-features)
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
Index analysis will be distributed across replicas. Beneficial for shared storage and huge amount of data in cluster. Uses replicas from cluster\_for\_parallel\_replicas.
**See also**
- [distributed\_index\_analysis\_for\_non\_shared\_merge\_tree](https://clickhouse.com/docs/operations/settings/settings#distributed_index_analysis_for_non_shared_merge_tree)
- [distributed\_index\_analysis\_min\_parts\_to\_activate](https://clickhouse.com/docs/operations/settings/merge-tree-settings#distributed_index_analysis_min_parts_to_activate)
- [distributed\_index\_analysis\_min\_indexes\_bytes\_to\_activate](https://clickhouse.com/docs/operations/settings/merge-tree-settings#distributed_index_analysis_min_indexes_bytes_to_activate)
## distributed\_index\_analysis\_for\_non\_shared\_merge\_tree[β](https://clickhouse.com/docs/operations/settings/settings#distributed_index_analysis_for_non_shared_merge_tree "Direct link to distributed_index_analysis_for_non_shared_merge_tree")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
Enable distributed index analysis even for non SharedMergeTree (cloud only engine).
## distributed\_index\_analysis\_only\_on\_coordinator[β](https://clickhouse.com/docs/operations/settings/settings#distributed_index_analysis_only_on_coordinator "Direct link to distributed_index_analysis_only_on_coordinator")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
If enabled, distributed index analysis runs only on the coordinator. This prevents O(N^2) spawned queries when the predicate contains subqueries (e.g., `IN (SELECT ...)`), because each follower replica would otherwise independently trigger its own distributed index analysis, but makes distributed index analysis less efficient if large tables are used in the subqueries.
## distributed\_insert\_skip\_read\_only\_replicas[β](https://clickhouse.com/docs/operations/settings/settings#distributed_insert_skip_read_only_replicas "Direct link to distributed_insert_skip_read_only_replicas")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
Enables skipping read-only replicas for INSERT queries into Distributed.
Possible values:
- 0 β INSERT was as usual, if it will go to read-only replica it will fail
- 1 β Initiator will skip read-only replicas before sending data to shards.
## distributed\_plan\_default\_reader\_bucket\_count[β](https://clickhouse.com/docs/operations/settings/settings#distributed_plan_default_reader_bucket_count "Direct link to distributed_plan_default_reader_bucket_count")
Experimental feature.
[Learn more.](https://clickhouse.com/docs/beta-and-experimental-features#experimental-features)
| Type | Default value |
|---|---|
| TypeUInt64 | Default value8 |
Version history
Default number of tasks for parallel reading in distributed query. Tasks are spread across between replicas.
## distributed\_plan\_default\_shuffle\_join\_bucket\_count[β](https://clickhouse.com/docs/operations/settings/settings#distributed_plan_default_shuffle_join_bucket_count "Direct link to distributed_plan_default_shuffle_join_bucket_count")
Experimental feature.
[Learn more.](https://clickhouse.com/docs/beta-and-experimental-features#experimental-features)
| Type | Default value |
|---|---|
| TypeNonZeroUInt64 | Default value8 |
Version history
Default number of buckets for distributed shuffle-hash-join.
## distributed\_plan\_execute\_locally[β](https://clickhouse.com/docs/operations/settings/settings#distributed_plan_execute_locally "Direct link to distributed_plan_execute_locally")
Experimental feature.
[Learn more.](https://clickhouse.com/docs/beta-and-experimental-features#experimental-features)
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
Run all tasks of a distributed query plan locally. Useful for testing and debugging.
## distributed\_plan\_force\_exchange\_kind[β](https://clickhouse.com/docs/operations/settings/settings#distributed_plan_force_exchange_kind "Direct link to distributed_plan_force_exchange_kind")
Experimental feature.
[Learn more.](https://clickhouse.com/docs/beta-and-experimental-features#experimental-features)
Version history
Force specified kind of Exchange operators between distributed query stages.
Possible values:
- '' - do not force any kind of Exchange operators, let the optimizer choose,
- 'Persisted' - use temporary files in object storage,
- 'Streaming' - stream exchange data over network.
## distributed\_plan\_force\_shuffle\_aggregation[β](https://clickhouse.com/docs/operations/settings/settings#distributed_plan_force_shuffle_aggregation "Direct link to distributed_plan_force_shuffle_aggregation")
Experimental feature.
[Learn more.](https://clickhouse.com/docs/beta-and-experimental-features#experimental-features)
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
Use Shuffle aggregation strategy instead of PartialAggregation + Merge in distributed query plan.
## distributed\_plan\_max\_rows\_to\_broadcast[β](https://clickhouse.com/docs/operations/settings/settings#distributed_plan_max_rows_to_broadcast "Direct link to distributed_plan_max_rows_to_broadcast")
Experimental feature.
[Learn more.](https://clickhouse.com/docs/beta-and-experimental-features#experimental-features)
| Type | Default value |
|---|---|
| TypeUInt64 | Default value20000 |
Version history
Maximum rows to use broadcast join instead of shuffle join in distributed query plan.
## distributed\_plan\_optimize\_exchanges[β](https://clickhouse.com/docs/operations/settings/settings#distributed_plan_optimize_exchanges "Direct link to distributed_plan_optimize_exchanges")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Removes unnecessary exchanges in distributed query plan. Disable it for debugging.
## distributed\_plan\_prefer\_replicas\_over\_workers[β](https://clickhouse.com/docs/operations/settings/settings#distributed_plan_prefer_replicas_over_workers "Direct link to distributed_plan_prefer_replicas_over_workers")
Experimental feature.
[Learn more.](https://clickhouse.com/docs/beta-and-experimental-features#experimental-features)
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
Serialize the distributed query plan for execution at replicas.
## distributed\_product\_mode[β](https://clickhouse.com/docs/operations/settings/settings#distributed_product_mode "Direct link to distributed_product_mode")
| Type | Default value |
|---|---|
| TypeDistributedProductMode | Default valuedeny |
Changes the behaviour of [distributed subqueries](https://clickhouse.com/docs/sql-reference/operators/in).
ClickHouse applies this setting when the query contains the product of distributed tables, i.e. when the query for a distributed table contains a non-GLOBAL subquery for the distributed table.
Restrictions:
- Only applied for IN and JOIN subqueries.
- Only if the FROM section uses a distributed table containing more than one shard.
- If the subquery concerns a distributed table containing more than one shard.
- Not used for a table-valued [remote](https://clickhouse.com/docs/sql-reference/table-functions/remote) function.
Possible values:
- `deny` β Default value. Prohibits using these types of subqueries (returns the "Double-distributed in/JOIN subqueries is denied" exception).
- `local` β Replaces the database and table in the subquery with local ones for the destination server (shard), leaving the normal `IN`/`JOIN.`
- `global` β Replaces the `IN`/`JOIN` query with `GLOBAL IN`/`GLOBAL JOIN.`
- `allow` β Allows the use of these types of subqueries.
## distributed\_push\_down\_limit[β](https://clickhouse.com/docs/operations/settings/settings#distributed_push_down_limit "Direct link to distributed_push_down_limit")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value1 |
Enables or disables [LIMIT](https://clickhouse.com/docs/operations/settings/settings#limit) applying on each shard separately.
This will allow to avoid:
- Sending extra rows over network;
- Processing rows behind the limit on the initiator.
Starting from 21.9 version you cannot get inaccurate results anymore, since `distributed_push_down_limit` changes query execution only if at least one of the conditions met:
- [distributed\_group\_by\_no\_merge](https://clickhouse.com/docs/operations/settings/settings#distributed_group_by_no_merge) \> 0.
- Query **does not have** `GROUP BY`/`DISTINCT`/`LIMIT BY`, but it has `ORDER BY`/`LIMIT`.
- Query **has** `GROUP BY`/`DISTINCT`/`LIMIT BY` with `ORDER BY`/`LIMIT` and:
- [optimize\_skip\_unused\_shards](https://clickhouse.com/docs/operations/settings/settings#optimize_skip_unused_shards) is enabled.
- [optimize\_distributed\_group\_by\_sharding\_key](https://clickhouse.com/docs/operations/settings/settings#optimize_distributed_group_by_sharding_key) is enabled.
Possible values:
- 0 β Disabled.
- 1 β Enabled.
See also:
- [distributed\_group\_by\_no\_merge](https://clickhouse.com/docs/operations/settings/settings#distributed_group_by_no_merge)
- [optimize\_skip\_unused\_shards](https://clickhouse.com/docs/operations/settings/settings#optimize_skip_unused_shards)
- [optimize\_distributed\_group\_by\_sharding\_key](https://clickhouse.com/docs/operations/settings/settings#optimize_distributed_group_by_sharding_key)
## distributed\_replica\_error\_cap[β](https://clickhouse.com/docs/operations/settings/settings#distributed_replica_error_cap "Direct link to distributed_replica_error_cap")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value1000 |
- Type: unsigned int
- Default value: 1000
The error count of each replica is capped at this value, preventing a single replica from accumulating too many errors.
See also:
- [load\_balancing](https://clickhouse.com/docs/operations/settings/settings#load_balancing-round_robin)
- [Table engine Distributed](https://clickhouse.com/docs/engines/table-engines/special/distributed)
- [distributed\_replica\_error\_half\_life](https://clickhouse.com/docs/operations/settings/settings#distributed_replica_error_half_life)
- [distributed\_replica\_max\_ignored\_errors](https://clickhouse.com/docs/operations/settings/settings#distributed_replica_max_ignored_errors)
## distributed\_replica\_error\_half\_life[β](https://clickhouse.com/docs/operations/settings/settings#distributed_replica_error_half_life "Direct link to distributed_replica_error_half_life")
| Type | Default value |
|---|---|
| TypeSeconds | Default value60 |
- Type: seconds
- Default value: 60 seconds
Controls how fast errors in distributed tables are zeroed. If a replica is unavailable for some time, accumulates 5 errors, and distributed\_replica\_error\_half\_life is set to 1 second, then the replica is considered normal 3 seconds after the last error.
See also:
- [load\_balancing](https://clickhouse.com/docs/operations/settings/settings#load_balancing-round_robin)
- [Table engine Distributed](https://clickhouse.com/docs/engines/table-engines/special/distributed)
- [distributed\_replica\_error\_cap](https://clickhouse.com/docs/operations/settings/settings#distributed_replica_error_cap)
- [distributed\_replica\_max\_ignored\_errors](https://clickhouse.com/docs/operations/settings/settings#distributed_replica_max_ignored_errors)
## distributed\_replica\_max\_ignored\_errors[β](https://clickhouse.com/docs/operations/settings/settings#distributed_replica_max_ignored_errors "Direct link to distributed_replica_max_ignored_errors")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
- Type: unsigned int
- Default value: 0
The number of errors that will be ignored while choosing replicas (according to `load_balancing` algorithm).
See also:
- [load\_balancing](https://clickhouse.com/docs/operations/settings/settings#load_balancing-round_robin)
- [Table engine Distributed](https://clickhouse.com/docs/engines/table-engines/special/distributed)
- [distributed\_replica\_error\_cap](https://clickhouse.com/docs/operations/settings/settings#distributed_replica_error_cap)
- [distributed\_replica\_error\_half\_life](https://clickhouse.com/docs/operations/settings/settings#distributed_replica_error_half_life)
## do\_not\_merge\_across\_partitions\_select\_final[β](https://clickhouse.com/docs/operations/settings/settings#do_not_merge_across_partitions_select_final "Direct link to do_not_merge_across_partitions_select_final")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Improve FINAL queries by avoiding merges across different partitions.
When enabled, during SELECT FINAL queries, parts from different partitions will not be merged together. Instead, merging will only occur within each partition separately. This can significantly improve query performance when working with partitioned tables.
## empty\_result\_for\_aggregation\_by\_constant\_keys\_on\_empty\_set[β](https://clickhouse.com/docs/operations/settings/settings#empty_result_for_aggregation_by_constant_keys_on_empty_set "Direct link to empty_result_for_aggregation_by_constant_keys_on_empty_set")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Return empty result when aggregating by constant keys on empty set.
## empty\_result\_for\_aggregation\_by\_empty\_set[β](https://clickhouse.com/docs/operations/settings/settings#empty_result_for_aggregation_by_empty_set "Direct link to empty_result_for_aggregation_by_empty_set")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Return empty result when aggregating without keys on empty set.
## enable\_adaptive\_memory\_spill\_scheduler[β](https://clickhouse.com/docs/operations/settings/settings#enable_adaptive_memory_spill_scheduler "Direct link to enable_adaptive_memory_spill_scheduler")
Experimental feature.
[Learn more.](https://clickhouse.com/docs/beta-and-experimental-features#experimental-features)
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
Trigger processor to spill data into external storage adpatively. grace join is supported at present.
## enable\_add\_distinct\_to\_in\_subqueries[β](https://clickhouse.com/docs/operations/settings/settings#enable_add_distinct_to_in_subqueries "Direct link to enable_add_distinct_to_in_subqueries")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
Enable `DISTINCT` in `IN` subqueries. This is a trade-off setting: enabling it can greatly reduce the size of temporary tables transferred for distributed IN subqueries and significantly speed up data transfer between shards, by ensuring only unique values are sent. However, enabling this setting adds extra merging effort on each node, as deduplication (DISTINCT) must be performed. Use this setting when network transfer is a bottleneck and the additional merging cost is acceptable.
## enable\_automatic\_decision\_for\_merging\_across\_partitions\_for\_final[β](https://clickhouse.com/docs/operations/settings/settings#enable_automatic_decision_for_merging_across_partitions_for_final "Direct link to enable_automatic_decision_for_merging_across_partitions_for_final")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
If set, ClickHouse will automatically enable this optimization when the partition key expression is deterministic and all columns used in the partition key expression are included in the primary key. This automatic derivation ensures that rows with the same primary key values will always belong to the same partition, making it safe to avoid cross-partition merges.
## enable\_blob\_storage\_log[β](https://clickhouse.com/docs/operations/settings/settings#enable_blob_storage_log "Direct link to enable_blob_storage_log")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Write information about blob storage operations to system.blob\_storage\_log table
## enable\_early\_constant\_folding[β](https://clickhouse.com/docs/operations/settings/settings#enable_early_constant_folding "Direct link to enable_early_constant_folding")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Enable query optimization where we analyze function and subqueries results and rewrite query if there are constants there
## enable\_extended\_results\_for\_datetime\_functions[β](https://clickhouse.com/docs/operations/settings/settings#enable_extended_results_for_datetime_functions "Direct link to enable_extended_results_for_datetime_functions")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Enables or disables returning results of type `Date32` with extended range (compared to type `Date`) or `DateTime64` with extended range (compared to type `DateTime`).
Possible values:
- `0` β Functions return `Date` or `DateTime` for all types of arguments.
- `1` β Functions return `Date32` or `DateTime64` for `Date32` or `DateTime64` arguments and `Date` or `DateTime` otherwise.
The table below shows the behavior of this setting for various date-time functions.
| Function | `enable_extended_results_for_datetime_functions = 0` | `enable_extended_results_for_datetime_functions = 1` |
|---|---|---|
| `toStartOfYear` | Returns `Date` or `DateTime` | Returns `Date`/`DateTime` for `Date`/`DateTime` input Returns `Date32`/`DateTime64` for `Date32`/`DateTime64` input |
| `toStartOfISOYear` | Returns `Date` or `DateTime` | Returns `Date`/`DateTime` for `Date`/`DateTime` input Returns `Date32`/`DateTime64` for `Date32`/`DateTime64` input |
| `toStartOfQuarter` | Returns `Date` or `DateTime` | Returns `Date`/`DateTime` for `Date`/`DateTime` input Returns `Date32`/`DateTime64` for `Date32`/`DateTime64` input |
| `toStartOfMonth` | Returns `Date` or `DateTime` | Returns `Date`/`DateTime` for `Date`/`DateTime` input Returns `Date32`/`DateTime64` for `Date32`/`DateTime64` input |
| `toStartOfWeek` | Returns `Date` or `DateTime` | Returns `Date`/`DateTime` for `Date`/`DateTime` input Returns `Date32`/`DateTime64` for `Date32`/`DateTime64` input |
| `toLastDayOfWeek` | Returns `Date` or `DateTime` | Returns `Date`/`DateTime` for `Date`/`DateTime` input Returns `Date32`/`DateTime64` for `Date32`/`DateTime64` input |
| `toLastDayOfMonth` | Returns `Date` or `DateTime` | Returns `Date`/`DateTime` for `Date`/`DateTime` input Returns `Date32`/`DateTime64` for `Date32`/`DateTime64` input |
| `toMonday` | Returns `Date` or `DateTime` | Returns `Date`/`DateTime` for `Date`/`DateTime` input Returns `Date32`/`DateTime64` for `Date32`/`DateTime64` input |
| `toStartOfDay` | Returns `DateTime` *Note: Wrong results for values outside 1970-2149 range* | Returns `DateTime` for `Date`/`DateTime` input Returns `DateTime64` for `Date32`/`DateTime64` input |
| `toStartOfHour` | Returns `DateTime` *Note: Wrong results for values outside 1970-2149 range* | Returns `DateTime` for `Date`/`DateTime` input Returns `DateTime64` for `Date32`/`DateTime64` input |
| `toStartOfFifteenMinutes` | Returns `DateTime` *Note: Wrong results for values outside 1970-2149 range* | Returns `DateTime` for `Date`/`DateTime` input Returns `DateTime64` for `Date32`/`DateTime64` input |
| `toStartOfTenMinutes` | Returns `DateTime` *Note: Wrong results for values outside 1970-2149 range* | Returns `DateTime` for `Date`/`DateTime` input Returns `DateTime64` for `Date32`/`DateTime64` input |
| `toStartOfFiveMinutes` | Returns `DateTime` *Note: Wrong results for values outside 1970-2149 range* | Returns `DateTime` for `Date`/`DateTime` input Returns `DateTime64` for `Date32`/`DateTime64` input |
| `toStartOfMinute` | Returns `DateTime` *Note: Wrong results for values outside 1970-2149 range* | Returns `DateTime` for `Date`/`DateTime` input Returns `DateTime64` for `Date32`/`DateTime64` input |
| `timeSlot` | Returns `DateTime` *Note: Wrong results for values outside 1970-2149 range* | Returns `DateTime` for `Date`/`DateTime` input Returns `DateTime64` for `Date32`/`DateTime64` input |
## enable\_filesystem\_cache[β](https://clickhouse.com/docs/operations/settings/settings#enable_filesystem_cache "Direct link to enable_filesystem_cache")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Use cache for remote filesystem. This setting does not turn on/off cache for disks (must be done via disk config), but allows to bypass cache for some queries if intended
## enable\_filesystem\_cache\_log[β](https://clickhouse.com/docs/operations/settings/settings#enable_filesystem_cache_log "Direct link to enable_filesystem_cache_log")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Allows to record the filesystem caching log for each query
## enable\_filesystem\_cache\_on\_write\_operations[β](https://clickhouse.com/docs/operations/settings/settings#enable_filesystem_cache_on_write_operations "Direct link to enable_filesystem_cache_on_write_operations")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Enables or disables `write-through` cache. If set to `false`, the `write-through` cache is disabled for write operations. If set to `true`, `write-through` cache is enabled as long as `cache_on_write_operations` is turned on in the server config's cache disk configuration section. See ["Using local cache"](https://clickhouse.com/docs/operations/storing-data#using-local-cache) for more details.
Cloud default value: `1`.
## enable\_filesystem\_read\_prefetches\_log[β](https://clickhouse.com/docs/operations/settings/settings#enable_filesystem_read_prefetches_log "Direct link to enable_filesystem_read_prefetches_log")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Log to system.filesystem prefetch\_log during query. Should be used only for testing or debugging, not recommended to be turned on by default
## enable\_full\_text\_index[β](https://clickhouse.com/docs/operations/settings/settings#enable_full_text_index "Direct link to enable_full_text_index")
**Aliases**: `allow_experimental_full_text_index`
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
If set to true, allow using the text index.
## enable\_global\_with\_statement[β](https://clickhouse.com/docs/operations/settings/settings#enable_global_with_statement "Direct link to enable_global_with_statement")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Propagate WITH statements to UNION queries and all subqueries
## enable\_hdfs\_pread[β](https://clickhouse.com/docs/operations/settings/settings#enable_hdfs_pread "Direct link to enable_hdfs_pread")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Enable or disables pread for HDFS files. By default, `hdfsPread` is used. If disabled, `hdfsRead` and `hdfsSeek` will be used to read hdfs files.
## enable\_http\_compression[β](https://clickhouse.com/docs/operations/settings/settings#enable_http_compression "Direct link to enable_http_compression")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Enables or disables data compression in the response to an HTTP request.
For more information, read the [HTTP interface description](https://clickhouse.com/docs/interfaces/http).
Possible values:
- 0 β Disabled.
- 1 β Enabled.
## enable\_job\_stack\_trace[β](https://clickhouse.com/docs/operations/settings/settings#enable_job_stack_trace "Direct link to enable_job_stack_trace")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
Output stack trace of a job creator when job results in exception. Disabled by default to avoid performance overhead.
## enable\_join\_runtime\_filters[β](https://clickhouse.com/docs/operations/settings/settings#enable_join_runtime_filters "Direct link to enable_join_runtime_filters")
Beta feature.
[Learn more.](https://clickhouse.com/docs/beta-and-experimental-features#beta-features)
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Filter left side by set of JOIN keys collected from the right side at runtime.
## enable\_join\_transitive\_predicates[β](https://clickhouse.com/docs/operations/settings/settings#enable_join_transitive_predicates "Direct link to enable_join_transitive_predicates")
Experimental feature.
[Learn more.](https://clickhouse.com/docs/beta-and-experimental-features#experimental-features)
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
Infer transitive equi-join predicates from existing join conditions. For example, given `A.x = B.x` and `B.x = C.x`, a synthetic `A.x = C.x` predicate is added so the join order optimizer can consider direct (A JOIN C) plans.
## enable\_lazy\_columns\_replication[β](https://clickhouse.com/docs/operations/settings/settings#enable_lazy_columns_replication "Direct link to enable_lazy_columns_replication")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Enables lazy columns replication in JOIN and ARRAY JOIN, it allows to avoid unnecessary copy of the same rows multiple times in memory.
## enable\_lightweight\_delete[β](https://clickhouse.com/docs/operations/settings/settings#enable_lightweight_delete "Direct link to enable_lightweight_delete")
**Aliases**: `allow_experimental_lightweight_delete`
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Enable lightweight DELETE mutations for mergetree tables.
## enable\_lightweight\_update[β](https://clickhouse.com/docs/operations/settings/settings#enable_lightweight_update "Direct link to enable_lightweight_update")
Beta feature.
[Learn more.](https://clickhouse.com/docs/beta-and-experimental-features#beta-features)
**Aliases**: `allow_experimental_lightweight_update`
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Allow to use lightweight updates.
## enable\_materialized\_cte[β](https://clickhouse.com/docs/operations/settings/settings#enable_materialized_cte "Direct link to enable_materialized_cte")
Experimental feature.
[Learn more.](https://clickhouse.com/docs/beta-and-experimental-features#experimental-features)
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
Enable materialized common table expressions, it will be preferred over enable\_global\_with\_statement
## enable\_memory\_bound\_merging\_of\_aggregation\_results[β](https://clickhouse.com/docs/operations/settings/settings#enable_memory_bound_merging_of_aggregation_results "Direct link to enable_memory_bound_merging_of_aggregation_results")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Enable memory bound merging strategy for aggregation.
## enable\_multiple\_prewhere\_read\_steps[β](https://clickhouse.com/docs/operations/settings/settings#enable_multiple_prewhere_read_steps "Direct link to enable_multiple_prewhere_read_steps")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Move more conditions from WHERE to PREWHERE and do reads from disk and filtering in multiple steps if there are multiple conditions combined with AND
## enable\_named\_columns\_in\_function\_tuple[β](https://clickhouse.com/docs/operations/settings/settings#enable_named_columns_in_function_tuple "Direct link to enable_named_columns_in_function_tuple")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
Generate named tuples in function tuple() when all names are unique and can be treated as unquoted identifiers.
## enable\_optimize\_predicate\_expression[β](https://clickhouse.com/docs/operations/settings/settings#enable_optimize_predicate_expression "Direct link to enable_optimize_predicate_expression")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Turns on predicate pushdown in `SELECT` queries.
Predicate pushdown may significantly reduce network traffic for distributed queries.
Possible values:
- 0 β Disabled.
- 1 β Enabled.
Usage
Consider the following queries:
1. `SELECT count() FROM test_table WHERE date = '2018-10-10'`
2. `SELECT count() FROM (SELECT * FROM test_table) WHERE date = '2018-10-10'`
If `enable_optimize_predicate_expression = 1`, then the execution time of these queries is equal because ClickHouse applies `WHERE` to the subquery when processing it.
If `enable_optimize_predicate_expression = 0`, then the execution time of the second query is much longer because the `WHERE` clause applies to all the data after the subquery finishes.
## enable\_optimize\_predicate\_expression\_to\_final\_subquery[β](https://clickhouse.com/docs/operations/settings/settings#enable_optimize_predicate_expression_to_final_subquery "Direct link to enable_optimize_predicate_expression_to_final_subquery")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Allow push predicate to final subquery.
## enable\_order\_by\_all[β](https://clickhouse.com/docs/operations/settings/settings#enable_order_by_all "Direct link to enable_order_by_all")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Enables or disables sorting with `ORDER BY ALL` syntax, see [ORDER BY](https://clickhouse.com/docs/sql-reference/statements/select/order-by).
Possible values:
- 0 β Disable ORDER BY ALL.
- 1 β Enable ORDER BY ALL.
**Example**
Query:
```
CREATE TABLE TAB(C1 Int, C2 Int, ALL Int) ENGINE=Memory();
INSERT INTO TAB VALUES (10, 20, 30), (20, 20, 10), (30, 10, 20);
SELECT * FROM TAB ORDER BY ALL; -- returns an error that ALL is ambiguous
SELECT * FROM TAB ORDER BY ALL SETTINGS enable_order_by_all = 0;
```
Result:
```
ββC1ββ¬βC2ββ¬βALLββ
β 20 β 20 β 10 β
β 30 β 10 β 20 β
β 10 β 20 β 30 β
ββββββ΄βββββ΄ββββββ
```
## enable\_parallel\_blocks\_marshalling[β](https://clickhouse.com/docs/operations/settings/settings#enable_parallel_blocks_marshalling "Direct link to enable_parallel_blocks_marshalling")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Affects only distributed queries. If enabled, blocks will be (de)serialized and (de)compressed on pipeline threads (i.e. with higher parallelism that what we have by default) before/after sending to the initiator.
## enable\_parsing\_to\_custom\_serialization[β](https://clickhouse.com/docs/operations/settings/settings#enable_parsing_to_custom_serialization "Direct link to enable_parsing_to_custom_serialization")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
If true then data can be parsed directly to columns with custom serialization (e.g. Sparse) according to hints for serialization got from the table.
## enable\_positional\_arguments[β](https://clickhouse.com/docs/operations/settings/settings#enable_positional_arguments "Direct link to enable_positional_arguments")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Enables or disables supporting positional arguments for [GROUP BY](https://clickhouse.com/docs/sql-reference/statements/select/group-by), [LIMIT BY](https://clickhouse.com/docs/sql-reference/statements/select/limit-by), [ORDER BY](https://clickhouse.com/docs/sql-reference/statements/select/order-by) statements.
Possible values:
- 0 β Positional arguments aren't supported.
- 1 β Positional arguments are supported: column numbers can use instead of column names.
**Example**
Query:
```
CREATE TABLE positional_arguments(one Int, two Int, three Int) ENGINE=Memory();
INSERT INTO positional_arguments VALUES (10, 20, 30), (20, 20, 10), (30, 10, 20);
SELECT * FROM positional_arguments ORDER BY 2,3;
```
Result:
```
ββoneββ¬βtwoββ¬βthreeββ
β 30 β 10 β 20 β
β 20 β 20 β 10 β
β 10 β 20 β 30 β
βββββββ΄ββββββ΄ββββββββ
```
## enable\_positional\_arguments\_for\_projections[β](https://clickhouse.com/docs/operations/settings/settings#enable_positional_arguments_for_projections "Direct link to enable_positional_arguments_for_projections")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
Enables or disables supporting positional arguments in PROJECTION definitions. See also [enable\_positional\_arguments](https://clickhouse.com/docs/operations/settings/settings#enable_positional_arguments) setting.
Note
This is an expert-level setting, and you shouldn't change it if you're just getting started with ClickHouse.
Possible values:
- 0 β Positional arguments aren't supported.
- 1 β Positional arguments are supported: column numbers can use instead of column names.
## enable\_producing\_buckets\_out\_of\_order\_in\_aggregation[β](https://clickhouse.com/docs/operations/settings/settings#enable_producing_buckets_out_of_order_in_aggregation "Direct link to enable_producing_buckets_out_of_order_in_aggregation")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Allow memory-efficient aggregation (see `distributed_aggregation_memory_efficient`) to produce buckets out of order. It may improve performance when aggregation bucket sizes are skewed by letting a replica to send buckets with higher id-s to the initiator while it is still processing some heavy buckets with lower id-s. The downside is potentially higher memory usage.
## enable\_reads\_from\_query\_cache[β](https://clickhouse.com/docs/operations/settings/settings#enable_reads_from_query_cache "Direct link to enable_reads_from_query_cache")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
If turned on, results of `SELECT` queries are retrieved from the [query cache](https://clickhouse.com/docs/operations/query-cache).
Possible values:
- 0 - Disabled
- 1 - Enabled
## enable\_s3\_requests\_logging[β](https://clickhouse.com/docs/operations/settings/settings#enable_s3_requests_logging "Direct link to enable_s3_requests_logging")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Enable very explicit logging of S3 requests. Makes sense for debug only.
## enable\_scalar\_subquery\_optimization[β](https://clickhouse.com/docs/operations/settings/settings#enable_scalar_subquery_optimization "Direct link to enable_scalar_subquery_optimization")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
If it is set to true, prevent scalar subqueries from (de)serializing large scalar values and possibly avoid running the same subquery more than once.
## enable\_scopes\_for\_with\_statement[β](https://clickhouse.com/docs/operations/settings/settings#enable_scopes_for_with_statement "Direct link to enable_scopes_for_with_statement")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
If disabled, declarations in parent WITH cluases will behave the same scope as they declared in the current scope.
Note that this is a compatibility setting for the analyzer to allow running some invalid queries that old analyzer could execute.
## enable\_shared\_storage\_snapshot\_in\_query[β](https://clickhouse.com/docs/operations/settings/settings#enable_shared_storage_snapshot_in_query "Direct link to enable_shared_storage_snapshot_in_query")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
If enabled, all subqueries within a single query will share the same StorageSnapshot for each table. This ensures a consistent view of the data across the entire query, even if the same table is accessed multiple times.
This is required for queries where internal consistency of data parts is important. Example:
```
SELECT
count()
FROM events
WHERE (_part, _part_offset) IN (
SELECT _part, _part_offset
FROM events
WHERE user_id = 42
)
```
Without this setting, the outer and inner queries may operate on different data snapshots, leading to incorrect results.
Note
Enabling this setting disables the optimization which removes unnecessary data parts from snapshots once the planning stage is complete. As a result, long-running queries may hold onto obsolete parts for their entire duration, delaying part cleanup and increasing storage pressure.
This setting currently applies only to tables from the MergeTree family.
Possible values:
- 0 - Disabled
- 1 - Enabled
## enable\_sharing\_sets\_for\_mutations[β](https://clickhouse.com/docs/operations/settings/settings#enable_sharing_sets_for_mutations "Direct link to enable_sharing_sets_for_mutations")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Allow sharing set objects build for IN subqueries between different tasks of the same mutation. This reduces memory usage and CPU consumptio
## enable\_software\_prefetch\_in\_aggregation[β](https://clickhouse.com/docs/operations/settings/settings#enable_software_prefetch_in_aggregation "Direct link to enable_software_prefetch_in_aggregation")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Enable use of software prefetch in aggregatio
## enable\_time\_time64\_type[β](https://clickhouse.com/docs/operations/settings/settings#enable_time_time64_type "Direct link to enable_time_time64_type")
**Aliases**: `allow_experimental_time_time64_type`
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Allows creation of [Time](https://clickhouse.com/docs/sql-reference/data-types/time) and [Time64](https://clickhouse.com/docs/sql-reference/data-types/time64) data types.
## enable\_unaligned\_array\_join[β](https://clickhouse.com/docs/operations/settings/settings#enable_unaligned_array_join "Direct link to enable_unaligned_array_join")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Allow ARRAY JOIN with multiple arrays that have different sizes. When this settings is enabled, arrays will be resized to the longest one.
## enable\_url\_encoding[β](https://clickhouse.com/docs/operations/settings/settings#enable_url_encoding "Direct link to enable_url_encoding")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
Allows to enable/disable decoding/encoding path in uri in [URL](https://clickhouse.com/docs/engines/table-engines/special/url) engine tables.
Disabled by default.
## enable\_vertical\_final[β](https://clickhouse.com/docs/operations/settings/settings#enable_vertical_final "Direct link to enable_vertical_final")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
If enable, remove duplicated rows during FINAL by marking rows as deleted and filtering them later instead of merging rows
## enable\_writes\_to\_query\_cache[β](https://clickhouse.com/docs/operations/settings/settings#enable_writes_to_query_cache "Direct link to enable_writes_to_query_cache")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
If turned on, results of `SELECT` queries are stored in the [query cache](https://clickhouse.com/docs/operations/query-cache).
Possible values:
- 0 - Disabled
- 1 - Enabled
## enforce\_strict\_identifier\_format[β](https://clickhouse.com/docs/operations/settings/settings#enforce_strict_identifier_format "Direct link to enforce_strict_identifier_format")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
If enabled, only allow identifiers containing alphanumeric characters and underscores.
## engine\_file\_allow\_create\_multiple\_files[β](https://clickhouse.com/docs/operations/settings/settings#engine_file_allow_create_multiple_files "Direct link to engine_file_allow_create_multiple_files")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Enables or disables creating a new file on each insert in file engine tables if the format has the suffix (`JSON`, `ORC`, `Parquet`, etc.). If enabled, on each insert a new file will be created with a name following this pattern:
`data.Parquet` -\> `data.1.Parquet` -\> `data.2.Parquet`, etc.
Possible values:
- 0 β `INSERT` query appends new data to the end of the file.
- 1 β `INSERT` query creates a new file.
## engine\_file\_empty\_if\_not\_exists[β](https://clickhouse.com/docs/operations/settings/settings#engine_file_empty_if_not_exists "Direct link to engine_file_empty_if_not_exists")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Allows to select data from a file engine table without file.
Possible values:
- 0 β `SELECT` throws exception.
- 1 β `SELECT` returns empty result.
## engine\_file\_skip\_empty\_files[β](https://clickhouse.com/docs/operations/settings/settings#engine_file_skip_empty_files "Direct link to engine_file_skip_empty_files")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Enables or disables skipping empty files in [File](https://clickhouse.com/docs/engines/table-engines/special/file) engine tables.
Possible values:
- 0 β `SELECT` throws an exception if empty file is not compatible with requested format.
- 1 β `SELECT` returns empty result for empty file.
## engine\_file\_truncate\_on\_insert[β](https://clickhouse.com/docs/operations/settings/settings#engine_file_truncate_on_insert "Direct link to engine_file_truncate_on_insert")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Enables or disables truncate before insert in [File](https://clickhouse.com/docs/engines/table-engines/special/file) engine tables.
Possible values:
- 0 β `INSERT` query appends new data to the end of the file.
- 1 β `INSERT` query replaces existing content of the file with the new data.
## engine\_url\_skip\_empty\_files[β](https://clickhouse.com/docs/operations/settings/settings#engine_url_skip_empty_files "Direct link to engine_url_skip_empty_files")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Enables or disables skipping empty files in [URL](https://clickhouse.com/docs/engines/table-engines/special/url) engine tables.
Possible values:
- 0 β `SELECT` throws an exception if empty file is not compatible with requested format.
- 1 β `SELECT` returns empty result for empty file.
## exact\_rows\_before\_limit[β](https://clickhouse.com/docs/operations/settings/settings#exact_rows_before_limit "Direct link to exact_rows_before_limit")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
When enabled, ClickHouse will provide exact value for rows\_before\_limit\_at\_least statistic, but with the cost that the data before limit will have to be read completely
## except\_default\_mode[β](https://clickhouse.com/docs/operations/settings/settings#except_default_mode "Direct link to except_default_mode")
| Type | Default value |
|---|---|
| TypeSetOperationMode | Default valueALL |
Set default mode in EXCEPT query. Possible values: empty string, 'ALL', 'DISTINCT'. If empty, query without mode will throw exception.
## exclude\_materialize\_skip\_indexes\_on\_insert[β](https://clickhouse.com/docs/operations/settings/settings#exclude_materialize_skip_indexes_on_insert "Direct link to exclude_materialize_skip_indexes_on_insert")
Version history
Excludes specified skip indexes from being built and stored during INSERTs. The excluded skip indexes will still be built and stored [during merges](https://clickhouse.com/docs/operations/settings/merge-tree-settings#materialize_skip_indexes_on_merge) or by an explicit [MATERIALIZE INDEX](https://clickhouse.com/docs/sql-reference/statements/alter/skipping-index#materialize-index) query.
Has no effect if [materialize\_skip\_indexes\_on\_insert](https://clickhouse.com/docs/operations/settings/settings#materialize_skip_indexes_on_insert) is false.
Example:
```
CREATE TABLE tab
(
a UInt64,
b UInt64,
INDEX idx_a a TYPE minmax,
INDEX idx_b b TYPE set(3)
)
ENGINE = MergeTree ORDER BY tuple();
SET exclude_materialize_skip_indexes_on_insert='idx_a'; -- idx_a will be not be updated upon insert
--SET exclude_materialize_skip_indexes_on_insert='idx_a, idx_b'; -- neither index would be updated on insert
INSERT INTO tab SELECT number, number / 50 FROM numbers(100); -- only idx_b is updated
-- since it is a session setting it can be set on a per-query level
INSERT INTO tab SELECT number, number / 50 FROM numbers(100, 100) SETTINGS exclude_materialize_skip_indexes_on_insert='idx_b';
ALTER TABLE tab MATERIALIZE INDEX idx_a; -- this query can be used to explicitly materialize the index
SET exclude_materialize_skip_indexes_on_insert = DEFAULT; -- reset setting to default
```
## execute\_exists\_as\_scalar\_subquery[β](https://clickhouse.com/docs/operations/settings/settings#execute_exists_as_scalar_subquery "Direct link to execute_exists_as_scalar_subquery")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Execute non-correlated EXISTS subqueries as scalar subqueries. As for scalar subqueries, the cache is used, and the constant folding applies to the result.
Cloud default value: `0`.
## external\_storage\_connect\_timeout\_sec[β](https://clickhouse.com/docs/operations/settings/settings#external_storage_connect_timeout_sec "Direct link to external_storage_connect_timeout_sec")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value10 |
Connect timeout in seconds. Now supported only for MySQL
## external\_storage\_max\_read\_bytes[β](https://clickhouse.com/docs/operations/settings/settings#external_storage_max_read_bytes "Direct link to external_storage_max_read_bytes")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Limit maximum number of bytes when table with external engine should flush history data. Now supported only for MySQL table engine, database engine, and dictionary. If equal to 0, this setting is disabled
## external\_storage\_max\_read\_rows[β](https://clickhouse.com/docs/operations/settings/settings#external_storage_max_read_rows "Direct link to external_storage_max_read_rows")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Limit maximum number of rows when table with external engine should flush history data. Now supported only for MySQL table engine, database engine, and dictionary. If equal to 0, this setting is disabled
## external\_storage\_rw\_timeout\_sec[β](https://clickhouse.com/docs/operations/settings/settings#external_storage_rw_timeout_sec "Direct link to external_storage_rw_timeout_sec")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value300 |
Read/write timeout in seconds. Now supported only for MySQL
## external\_table\_functions\_use\_nulls[β](https://clickhouse.com/docs/operations/settings/settings#external_table_functions_use_nulls "Direct link to external_table_functions_use_nulls")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Defines how [mysql](https://clickhouse.com/docs/sql-reference/table-functions/mysql), [postgresql](https://clickhouse.com/docs/sql-reference/table-functions/postgresql) and [odbc](https://clickhouse.com/docs/sql-reference/table-functions/odbc) table functions use Nullable columns.
Possible values:
- 0 β The table function explicitly uses Nullable columns.
- 1 β The table function implicitly uses Nullable columns.
**Usage**
If the setting is set to `0`, the table function does not make Nullable columns and inserts default values instead of NULL. This is also applicable for NULL values inside arrays.
## external\_table\_strict\_query[β](https://clickhouse.com/docs/operations/settings/settings#external_table_strict_query "Direct link to external_table_strict_query")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
If it is set to true, transforming expression to local filter is forbidden for queries to external tables.
## extract\_key\_value\_pairs\_max\_pairs\_per\_row[β](https://clickhouse.com/docs/operations/settings/settings#extract_key_value_pairs_max_pairs_per_row "Direct link to extract_key_value_pairs_max_pairs_per_row")
**Aliases**: `extract_kvp_max_pairs_per_row`
| Type | Default value |
|---|---|
| TypeUInt64 | Default value1000 |
Version history
Max number of pairs that can be produced by the `extractKeyValuePairs` function. Used as a safeguard against consuming too much memory.
## extremes[β](https://clickhouse.com/docs/operations/settings/settings#extremes "Direct link to extremes")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Whether to count extreme values (the minimums and maximums in columns of a query result). Accepts 0 or 1. By default, 0 (disabled). For more information, see the section "Extreme values".
## fallback\_to\_stale\_replicas\_for\_distributed\_queries[β](https://clickhouse.com/docs/operations/settings/settings#fallback_to_stale_replicas_for_distributed_queries "Direct link to fallback_to_stale_replicas_for_distributed_queries")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Forces a query to an out-of-date replica if updated data is not available. See [Replication](https://clickhouse.com/docs/engines/table-engines/mergetree-family/replication).
ClickHouse selects the most relevant from the outdated replicas of the table.
Used when performing `SELECT` from a distributed table that points to replicated tables.
By default, 1 (enabled).
## filesystem\_cache\_allow\_background\_download[β](https://clickhouse.com/docs/operations/settings/settings#filesystem_cache_allow_background_download "Direct link to filesystem_cache_allow_background_download")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Allow filesystem cache to enqueue background downloads for data read from remote storage. Disable to keep downloads in the foreground for the current query/session.
## filesystem\_cache\_boundary\_alignment[β](https://clickhouse.com/docs/operations/settings/settings#filesystem_cache_boundary_alignment "Direct link to filesystem_cache_boundary_alignment")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Version history
Filesystem cache boundary alignment. This setting is applied only for non-disk read (e.g. for cache of remote table engines / table functions, but not for storage configuration of MergeTree tables). Value 0 means no alignment.
## filesystem\_cache\_enable\_background\_download\_during\_fetch[β](https://clickhouse.com/docs/operations/settings/settings#filesystem_cache_enable_background_download_during_fetch "Direct link to filesystem_cache_enable_background_download_during_fetch")
ClickHouse Cloud only
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Only has an effect in ClickHouse Cloud. Wait time to lock cache for space reservation in filesystem cache
## filesystem\_cache\_enable\_background\_download\_for\_metadata\_files\_in\_packed\_storage[β](https://clickhouse.com/docs/operations/settings/settings#filesystem_cache_enable_background_download_for_metadata_files_in_packed_storage "Direct link to filesystem_cache_enable_background_download_for_metadata_files_in_packed_storage")
ClickHouse Cloud only
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Only has an effect in ClickHouse Cloud. Wait time to lock cache for space reservation in filesystem cache
## filesystem\_cache\_max\_download\_size[β](https://clickhouse.com/docs/operations/settings/settings#filesystem_cache_max_download_size "Direct link to filesystem_cache_max_download_size")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value137438953472 |
Max remote filesystem cache size that can be downloaded by a single query
## filesystem\_cache\_name[β](https://clickhouse.com/docs/operations/settings/settings#filesystem_cache_name "Direct link to filesystem_cache_name")
Version history
Filesystem cache name to use for stateless table engines or data lakes
## filesystem\_cache\_prefer\_bigger\_buffer\_size[β](https://clickhouse.com/docs/operations/settings/settings#filesystem_cache_prefer_bigger_buffer_size "Direct link to filesystem_cache_prefer_bigger_buffer_size")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Prefer bigger buffer size if filesystem cache is enabled to avoid writing small file segments which deteriorate cache performance. On the other hand, enabling this setting might increase memory usage.
## filesystem\_cache\_reserve\_space\_wait\_lock\_timeout\_milliseconds[β](https://clickhouse.com/docs/operations/settings/settings#filesystem_cache_reserve_space_wait_lock_timeout_milliseconds "Direct link to filesystem_cache_reserve_space_wait_lock_timeout_milliseconds")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value1000 |
Version history
Wait time to lock cache for space reservation in filesystem cache
## filesystem\_cache\_segments\_batch\_size[β](https://clickhouse.com/docs/operations/settings/settings#filesystem_cache_segments_batch_size "Direct link to filesystem_cache_segments_batch_size")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value20 |
Limit on size of a single batch of file segments that a read buffer can request from cache. Too low value will lead to excessive requests to cache, too large may slow down eviction from cache
## filesystem\_cache\_skip\_download\_if\_exceeds\_per\_query\_cache\_write\_limit[β](https://clickhouse.com/docs/operations/settings/settings#filesystem_cache_skip_download_if_exceeds_per_query_cache_write_limit "Direct link to filesystem_cache_skip_download_if_exceeds_per_query_cache_write_limit")
**Aliases**: `skip_download_if_exceeds_query_cache`
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Skip download from remote filesystem if exceeds query cache size
## filesystem\_prefetch\_max\_memory\_usage[β](https://clickhouse.com/docs/operations/settings/settings#filesystem_prefetch_max_memory_usage "Direct link to filesystem_prefetch_max_memory_usage")
| Type | Default value |
|---|---|
| TypeNonZeroUInt64 | Default value1073741824 |
Maximum memory usage for prefetches.
Cloud default value: 10% of total memory.
## filesystem\_prefetch\_step\_bytes[β](https://clickhouse.com/docs/operations/settings/settings#filesystem_prefetch_step_bytes "Direct link to filesystem_prefetch_step_bytes")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Prefetch step in bytes. Zero means `auto` - approximately the best prefetch step will be auto deduced, but might not be 100% the best. The actual value might be different because of setting filesystem\_prefetch\_min\_bytes\_for\_single\_read\_task
## filesystem\_prefetch\_step\_marks[β](https://clickhouse.com/docs/operations/settings/settings#filesystem_prefetch_step_marks "Direct link to filesystem_prefetch_step_marks")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Prefetch step in marks. Zero means `auto` - approximately the best prefetch step will be auto deduced, but might not be 100% the best. The actual value might be different because of setting filesystem\_prefetch\_min\_bytes\_for\_single\_read\_task
## filesystem\_prefetches\_limit[β](https://clickhouse.com/docs/operations/settings/settings#filesystem_prefetches_limit "Direct link to filesystem_prefetches_limit")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value200 |
Maximum number of prefetches. Zero means unlimited. A setting `filesystem_prefetches_max_memory_usage` is more recommended if you want to limit the number of prefetches
## final[β](https://clickhouse.com/docs/operations/settings/settings#final "Direct link to final")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Automatically applies [FINAL](https://clickhouse.com/docs/sql-reference/statements/select/from#final-modifier) modifier to all tables in a query, to tables where [FINAL](https://clickhouse.com/docs/sql-reference/statements/select/from#final-modifier) is applicable, including joined tables and tables in sub-queries, and distributed tables.
Possible values:
- 0 - disabled
- 1 - enabled
Example:
```
CREATE TABLE test
(
key Int64,
some String
)
ENGINE = ReplacingMergeTree
ORDER BY key;
INSERT INTO test FORMAT Values (1, 'first');
INSERT INTO test FORMAT Values (1, 'second');
SELECT * FROM test;
ββkeyββ¬βsomeββββ
β 1 β second β
βββββββ΄βββββββββ
ββkeyββ¬βsomeβββ
β 1 β first β
βββββββ΄ββββββββ
SELECT * FROM test SETTINGS final = 1;
ββkeyββ¬βsomeββββ
β 1 β second β
βββββββ΄βββββββββ
SET final = 1;
SELECT * FROM test;
ββkeyββ¬βsomeββββ
β 1 β second β
βββββββ΄βββββββββ
```
## finalize\_projection\_parts\_synchronously[β](https://clickhouse.com/docs/operations/settings/settings#finalize_projection_parts_synchronously "Direct link to finalize_projection_parts_synchronously")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
When enabled, projection parts are finalized synchronously during INSERT, reducing peak memory usage at the cost of reduced S3 upload parallelism. By default, each projection's output stream is kept alive until the entire part (including all projections) is finalized, which allows overlapping S3 uploads but increases peak memory proportional to the number of projections. This setting only affects the INSERT path; merge and mutation already finalize projections synchronously.
## flatten\_nested[β](https://clickhouse.com/docs/operations/settings/settings#flatten_nested "Direct link to flatten_nested")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Sets the data format of a [nested](https://clickhouse.com/docs/sql-reference/data-types/nested-data-structures/nested) columns.
Possible values:
- 1 β Nested column is flattened to separate arrays.
- 0 β Nested column stays a single array of tuples.
**Usage**
If the setting is set to `0`, it is possible to use an arbitrary level of nesting.
**Examples**
Query:
```
SET flatten_nested = 1;
CREATE TABLE t_nest (`n` Nested(a UInt32, b UInt32)) ENGINE = MergeTree ORDER BY tuple();
SHOW CREATE TABLE t_nest;
```
Result:
```
ββstatementββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β CREATE TABLE default.t_nest
(
`n.a` Array(UInt32),
`n.b` Array(UInt32)
)
ENGINE = MergeTree
ORDER BY tuple()
SETTINGS index_granularity = 8192 β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
```
Query:
```
SET flatten_nested = 0;
CREATE TABLE t_nest (`n` Nested(a UInt32, b UInt32)) ENGINE = MergeTree ORDER BY tuple();
SHOW CREATE TABLE t_nest;
```
Result:
```
ββstatementβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β CREATE TABLE default.t_nest
(
`n` Nested(a UInt32, b UInt32)
)
ENGINE = MergeTree
ORDER BY tuple()
SETTINGS index_granularity = 8192 β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
```
## force\_aggregate\_partitions\_independently[β](https://clickhouse.com/docs/operations/settings/settings#force_aggregate_partitions_independently "Direct link to force_aggregate_partitions_independently")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Force the use of optimization when it is applicable, but heuristics decided not to use it
## force\_aggregation\_in\_order[β](https://clickhouse.com/docs/operations/settings/settings#force_aggregation_in_order "Direct link to force_aggregation_in_order")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
The setting is used by the server itself to support distributed queries. Do not change it manually, because it will break normal operations. (Forces use of aggregation in order on remote nodes during distributed aggregation).
## force\_data\_skipping\_indices[β](https://clickhouse.com/docs/operations/settings/settings#force_data_skipping_indices "Direct link to force_data_skipping_indices")
Disables query execution if passed data skipping indices wasn't used.
Consider the following example:
```
CREATE TABLE data
(
key Int,
d1 Int,
d1_null Nullable(Int),
INDEX d1_idx d1 TYPE minmax GRANULARITY 1,
INDEX d1_null_idx assumeNotNull(d1_null) TYPE minmax GRANULARITY 1
)
Engine=MergeTree()
ORDER BY key;
SELECT * FROM data_01515;
SELECT * FROM data_01515 SETTINGS force_data_skipping_indices=''; -- query will produce CANNOT_PARSE_TEXT error.
SELECT * FROM data_01515 SETTINGS force_data_skipping_indices='d1_idx'; -- query will produce INDEX_NOT_USED error.
SELECT * FROM data_01515 WHERE d1 = 0 SETTINGS force_data_skipping_indices='d1_idx'; -- Ok.
SELECT * FROM data_01515 WHERE d1 = 0 SETTINGS force_data_skipping_indices='`d1_idx`'; -- Ok (example of full featured parser).
SELECT * FROM data_01515 WHERE d1 = 0 SETTINGS force_data_skipping_indices='`d1_idx`, d1_null_idx'; -- query will produce INDEX_NOT_USED error, since d1_null_idx is not used.
SELECT * FROM data_01515 WHERE d1 = 0 AND assumeNotNull(d1_null) = 0 SETTINGS force_data_skipping_indices='`d1_idx`, d1_null_idx'; -- Ok.
```
## force\_grouping\_standard\_compatibility[β](https://clickhouse.com/docs/operations/settings/settings#force_grouping_standard_compatibility "Direct link to force_grouping_standard_compatibility")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Make GROUPING function to return 1 when argument is not used as an aggregation key
## force\_index\_by\_date[β](https://clickhouse.com/docs/operations/settings/settings#force_index_by_date "Direct link to force_index_by_date")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Disables query execution if the index can't be used by date.
Works with tables in the MergeTree family.
If `force_index_by_date=1`, ClickHouse checks whether the query has a date key condition that can be used for restricting data ranges. If there is no suitable condition, it throws an exception. However, it does not check whether the condition reduces the amount of data to read. For example, the condition `Date != ' 2000-01-01 '` is acceptable even when it matches all the data in the table (i.e., running the query requires a full scan). For more information about ranges of data in MergeTree tables, see [MergeTree](https://clickhouse.com/docs/engines/table-engines/mergetree-family/mergetree).
## force\_optimize\_projection[β](https://clickhouse.com/docs/operations/settings/settings#force_optimize_projection "Direct link to force_optimize_projection")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Enables or disables the obligatory use of [projections](https://clickhouse.com/docs/engines/table-engines/mergetree-family/mergetree#projections) in `SELECT` queries, when projection optimization is enabled (see [optimize\_use\_projections](https://clickhouse.com/docs/operations/settings/settings#optimize_use_projections) setting).
Possible values:
- 0 β Projection optimization is not obligatory.
- 1 β Projection optimization is obligatory.
## force\_optimize\_projection\_name[β](https://clickhouse.com/docs/operations/settings/settings#force_optimize_projection_name "Direct link to force_optimize_projection_name")
If it is set to a non-empty string, check that this projection is used in the query at least once.
Possible values:
- string: name of projection that used in a query
## force\_optimize\_skip\_unused\_shards[β](https://clickhouse.com/docs/operations/settings/settings#force_optimize_skip_unused_shards "Direct link to force_optimize_skip_unused_shards")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Enables or disables query execution if [optimize\_skip\_unused\_shards](https://clickhouse.com/docs/operations/settings/settings#optimize_skip_unused_shards) is enabled and skipping of unused shards is not possible. If the skipping is not possible and the setting is enabled, an exception will be thrown.
Possible values:
- 0 β Disabled. ClickHouse does not throw an exception.
- 1 β Enabled. Query execution is disabled only if the table has a sharding key.
- 2 β Enabled. Query execution is disabled regardless of whether a sharding key is defined for the table.
## force\_optimize\_skip\_unused\_shards\_nesting[β](https://clickhouse.com/docs/operations/settings/settings#force_optimize_skip_unused_shards_nesting "Direct link to force_optimize_skip_unused_shards_nesting")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Controls [`force_optimize_skip_unused_shards`](https://clickhouse.com/docs/operations/settings/settings#force_optimize_skip_unused_shards) (hence still requires [`force_optimize_skip_unused_shards`](https://clickhouse.com/docs/operations/settings/settings#force_optimize_skip_unused_shards)) depends on the nesting level of the distributed query (case when you have `Distributed` table that look into another `Distributed` table).
Possible values:
- 0 - Disabled, `force_optimize_skip_unused_shards` works always.
- 1 β Enables `force_optimize_skip_unused_shards` only for the first level.
- 2 β Enables `force_optimize_skip_unused_shards` up to the second level.
## force\_primary\_key[β](https://clickhouse.com/docs/operations/settings/settings#force_primary_key "Direct link to force_primary_key")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Disables query execution if indexing by the primary key is not possible.
Works with tables in the MergeTree family.
If `force_primary_key=1`, ClickHouse checks to see if the query has a primary key condition that can be used for restricting data ranges. If there is no suitable condition, it throws an exception. However, it does not check whether the condition reduces the amount of data to read. For more information about data ranges in MergeTree tables, see [MergeTree](https://clickhouse.com/docs/engines/table-engines/mergetree-family/mergetree).
## force\_remove\_data\_recursively\_on\_drop[β](https://clickhouse.com/docs/operations/settings/settings#force_remove_data_recursively_on_drop "Direct link to force_remove_data_recursively_on_drop")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Recursively remove data on DROP query. Avoids 'Directory not empty' error, but may silently remove detached data
## formatdatetime\_e\_with\_space\_padding[β](https://clickhouse.com/docs/operations/settings/settings#formatdatetime_e_with_space_padding "Direct link to formatdatetime_e_with_space_padding")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
Formatter '%e' in function 'formatDateTime' prints single-digit days with a leading space, e.g. ' 2' instead of '2'.
## formatdatetime\_f\_prints\_scale\_number\_of\_digits[β](https://clickhouse.com/docs/operations/settings/settings#formatdatetime_f_prints_scale_number_of_digits "Direct link to formatdatetime_f_prints_scale_number_of_digits")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
Formatter '%f' in function 'formatDateTime' prints only the scale amount of digits for a DateTime64 instead of fixed 6 digits.
## formatdatetime\_f\_prints\_single\_zero[β](https://clickhouse.com/docs/operations/settings/settings#formatdatetime_f_prints_single_zero "Direct link to formatdatetime_f_prints_single_zero")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
Formatter '%f' in function 'formatDateTime' prints a single zero instead of six zeros if the formatted value has no fractional seconds.
## formatdatetime\_format\_without\_leading\_zeros[β](https://clickhouse.com/docs/operations/settings/settings#formatdatetime_format_without_leading_zeros "Direct link to formatdatetime_format_without_leading_zeros")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Formatters '%c', '%l' and '%k' in function 'formatDateTime' print months and hours without leading zeros.
## formatdatetime\_parsedatetime\_m\_is\_month\_name[β](https://clickhouse.com/docs/operations/settings/settings#formatdatetime_parsedatetime_m_is_month_name "Direct link to formatdatetime_parsedatetime_m_is_month_name")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Formatter '%M' in functions 'formatDateTime' and 'parseDateTime' print/parse the month name instead of minutes.
## fsync\_metadata[β](https://clickhouse.com/docs/operations/settings/settings#fsync_metadata "Direct link to fsync_metadata")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Enables or disables [fsync](http://pubs.opengroup.org/onlinepubs/9699919799/functions/fsync.html) when writing `.sql` files. Enabled by default.
It makes sense to disable it if the server has millions of tiny tables that are constantly being created and destroyed.
## function\_date\_trunc\_return\_type\_behavior[β](https://clickhouse.com/docs/operations/settings/settings#function_date_trunc_return_type_behavior "Direct link to function_date_trunc_return_type_behavior")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Version history
Allows to change the behaviour of the result type of `dateTrunc` function.
Possible values:
- 0 - When the second argument is `DateTime64/Date32` the return type will be `DateTime64/Date32` regardless of the time unit in the first argument.
- 1 - For `Date32` the result is always `Date`. For `DateTime64` the result is `DateTime` for time units `second` and higher.
## function\_implementation[β](https://clickhouse.com/docs/operations/settings/settings#function_implementation "Direct link to function_implementation")
Choose function implementation for specific target or variant (experimental). If empty enable all of them.
## function\_json\_value\_return\_type\_allow\_complex[β](https://clickhouse.com/docs/operations/settings/settings#function_json_value_return_type_allow_complex "Direct link to function_json_value_return_type_allow_complex")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Control whether allow to return complex type (such as: struct, array, map) for json\_value function.
```
SELECT JSON_VALUE('{"hello":{"world":"!"}}', '$.hello') settings function_json_value_return_type_allow_complex=true
ββJSON_VALUE('{"hello":{"world":"!"}}', '$.hello')ββ
β {"world":"!"} β
ββββββββββββββββββββββββββββββββββββββββββββββββββββ
1 row in set. Elapsed: 0.001 sec.
```
Possible values:
- true β Allow.
- false β Disallow.
## function\_json\_value\_return\_type\_allow\_nullable[β](https://clickhouse.com/docs/operations/settings/settings#function_json_value_return_type_allow_nullable "Direct link to function_json_value_return_type_allow_nullable")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Control whether allow to return `NULL` when value is not exist for JSON\_VALUE function.
```
SELECT JSON_VALUE('{"hello":"world"}', '$.b') settings function_json_value_return_type_allow_nullable=true;
ββJSON_VALUE('{"hello":"world"}', '$.b')ββ
β α΄Ία΅α΄Έα΄Έ β
ββββββββββββββββββββββββββββββββββββββββββ
1 row in set. Elapsed: 0.001 sec.
```
Possible values:
- true β Allow.
- false β Disallow.
## function\_locate\_has\_mysql\_compatible\_argument\_order[β](https://clickhouse.com/docs/operations/settings/settings#function_locate_has_mysql_compatible_argument_order "Direct link to function_locate_has_mysql_compatible_argument_order")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Controls the order of arguments in function [locate](https://clickhouse.com/docs/sql-reference/functions/string-search-functions#locate).
Possible values:
- 0 β Function `locate` accepts arguments `(haystack, needle[, start_pos])`.
- 1 β Function `locate` accepts arguments `(needle, haystack, [, start_pos])` (MySQL-compatible behavior)
## function\_range\_max\_elements\_in\_block[β](https://clickhouse.com/docs/operations/settings/settings#function_range_max_elements_in_block "Direct link to function_range_max_elements_in_block")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value500000000 |
Sets the safety threshold for data volume generated by function [range](https://clickhouse.com/docs/sql-reference/functions/array-functions#range). Defines the maximum number of values generated by function per block of data (sum of array sizes for every row in a block).
Possible values:
- Positive integer.
**See Also**
- [`max_block_size`](https://clickhouse.com/docs/operations/settings/settings#max_block_size)
- [`min_insert_block_size_rows`](https://clickhouse.com/docs/operations/settings/settings#min_insert_block_size_rows)
## function\_sleep\_max\_microseconds\_per\_block[β](https://clickhouse.com/docs/operations/settings/settings#function_sleep_max_microseconds_per_block "Direct link to function_sleep_max_microseconds_per_block")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value3000000 |
Version history
Maximum number of microseconds the function `sleep` is allowed to sleep for each block. If a user called it with a larger value, it throws an exception. It is a safety threshold.
## function\_visible\_width\_behavior[β](https://clickhouse.com/docs/operations/settings/settings#function_visible_width_behavior "Direct link to function_visible_width_behavior")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value1 |
Version history
The version of `visibleWidth` behavior. 0 - only count the number of code points; 1 - correctly count zero-width and combining characters, count full-width characters as two, estimate the tab width, count delete characters.
## functions\_h3\_default\_if\_invalid[β](https://clickhouse.com/docs/operations/settings/settings#functions_h3_default_if_invalid "Direct link to functions_h3_default_if_invalid")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
If false, h3 functions, e.g. h3CellAreaM2, throw an exception if input is invalid. If true, they return 0 or default value.
## geo\_distance\_returns\_float64\_on\_float64\_arguments[β](https://clickhouse.com/docs/operations/settings/settings#geo_distance_returns_float64_on_float64_arguments "Direct link to geo_distance_returns_float64_on_float64_arguments")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
If all four arguments to `geoDistance`, `greatCircleDistance`, `greatCircleAngle` functions are Float64, return Float64 and use double precision for internal calculations. In previous ClickHouse versions, the functions always returned Float32.
## geotoh3\_argument\_order[β](https://clickhouse.com/docs/operations/settings/settings#geotoh3_argument_order "Direct link to geotoh3_argument_order")
Beta feature.
[Learn more.](https://clickhouse.com/docs/beta-and-experimental-features#beta-features)
| Type | Default value |
|---|---|
| TypeGeoToH3ArgumentOrder | Default valuelat\_lon |
Version history
Function 'geoToH3' accepts (lon, lat) if set to 'lon\_lat' and (lat, lon) if set to 'lat\_lon'.
## glob\_expansion\_max\_elements[β](https://clickhouse.com/docs/operations/settings/settings#glob_expansion_max_elements "Direct link to glob_expansion_max_elements")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value1000 |
Maximum number of allowed addresses (For external storages, table functions, etc).
## grace\_hash\_join\_initial\_buckets[β](https://clickhouse.com/docs/operations/settings/settings#grace_hash_join_initial_buckets "Direct link to grace_hash_join_initial_buckets")
Experimental feature.
[Learn more.](https://clickhouse.com/docs/beta-and-experimental-features#experimental-features)
| Type | Default value |
|---|---|
| TypeNonZeroUInt64 | Default value1 |
Initial number of grace hash join buckets
## grace\_hash\_join\_max\_buckets[β](https://clickhouse.com/docs/operations/settings/settings#grace_hash_join_max_buckets "Direct link to grace_hash_join_max_buckets")
Experimental feature.
[Learn more.](https://clickhouse.com/docs/beta-and-experimental-features#experimental-features)
| Type | Default value |
|---|---|
| TypeNonZeroUInt64 | Default value1024 |
Limit on the number of grace hash join buckets
## group\_by\_overflow\_mode[β](https://clickhouse.com/docs/operations/settings/settings#group_by_overflow_mode "Direct link to group_by_overflow_mode")
| Type | Default value |
|---|---|
| TypeOverflowModeGroupBy | Default valuethrow |
Sets what happens when the number of unique keys for aggregation exceeds the limit:
- `throw`: throw an exception
- `break`: stop executing the query and return the partial result
- `any`: continue aggregation for the keys that got into the set, but do not add new keys to the set.
Using the 'any' value lets you run an approximation of GROUP BY. The quality of this approximation depends on the statistical nature of the data.
## group\_by\_two\_level\_threshold[β](https://clickhouse.com/docs/operations/settings/settings#group_by_two_level_threshold "Direct link to group_by_two_level_threshold")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value100000 |
From what number of keys, a two-level aggregation starts. 0 - the threshold is not set.
## group\_by\_two\_level\_threshold\_bytes[β](https://clickhouse.com/docs/operations/settings/settings#group_by_two_level_threshold_bytes "Direct link to group_by_two_level_threshold_bytes")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value50000000 |
From what size of the aggregation state in bytes, a two-level aggregation begins to be used. 0 - the threshold is not set. Two-level aggregation is used when at least one of the thresholds is triggered.
## group\_by\_use\_nulls[β](https://clickhouse.com/docs/operations/settings/settings#group_by_use_nulls "Direct link to group_by_use_nulls")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Changes the way the [GROUP BY clause](https://clickhouse.com/docs/sql-reference/statements/select/group-by) treats the types of aggregation keys. When the `ROLLUP`, `CUBE`, or `GROUPING SETS` specifiers are used, some aggregation keys may not be used to produce some result rows. Columns for these keys are filled with either default value or `NULL` in corresponding rows depending on this setting.
Possible values:
- 0 β The default value for the aggregation key type is used to produce missing values.
- 1 β ClickHouse executes `GROUP BY` the same way as the SQL standard says. The types of aggregation keys are converted to [Nullable](https://clickhouse.com/docs/sql-reference/data-types/nullable). Columns for corresponding aggregation keys are filled with [NULL](https://clickhouse.com/docs/sql-reference/syntax#null) for rows that didn't use it.
See also:
- [GROUP BY clause](https://clickhouse.com/docs/sql-reference/statements/select/group-by)
## h3togeo\_lon\_lat\_result\_order[β](https://clickhouse.com/docs/operations/settings/settings#h3togeo_lon_lat_result_order "Direct link to h3togeo_lon_lat_result_order")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
Function 'h3ToGeo' returns (lon, lat) if true, otherwise (lat, lon).
## handshake\_timeout\_ms[β](https://clickhouse.com/docs/operations/settings/settings#handshake_timeout_ms "Direct link to handshake_timeout_ms")
| Type | Default value |
|---|---|
| TypeMilliseconds | Default value10000 |
Timeout in milliseconds for receiving Hello packet from replicas during handshake.
## hdfs\_create\_new\_file\_on\_insert[β](https://clickhouse.com/docs/operations/settings/settings#hdfs_create_new_file_on_insert "Direct link to hdfs_create_new_file_on_insert")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Enables or disables creating a new file on each insert in HDFS engine tables. If enabled, on each insert a new HDFS file will be created with the name, similar to this pattern:
initial: `data.Parquet.gz` -\> `data.1.Parquet.gz` -\> `data.2.Parquet.gz`, etc.
Possible values:
- 0 β `INSERT` query appends new data to the end of the file.
- 1 β `INSERT` query creates a new file.
## hdfs\_ignore\_file\_doesnt\_exist[β](https://clickhouse.com/docs/operations/settings/settings#hdfs_ignore_file_doesnt_exist "Direct link to hdfs_ignore_file_doesnt_exist")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
Ignore absence of file if it does not exist when reading certain keys.
Possible values:
- 1 β `SELECT` returns empty result.
- 0 β `SELECT` throws an exception.
## hdfs\_replication[β](https://clickhouse.com/docs/operations/settings/settings#hdfs_replication "Direct link to hdfs_replication")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
The actual number of replications can be specified when the hdfs file is created.
## hdfs\_skip\_empty\_files[β](https://clickhouse.com/docs/operations/settings/settings#hdfs_skip_empty_files "Direct link to hdfs_skip_empty_files")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Enables or disables skipping empty files in [HDFS](https://clickhouse.com/docs/engines/table-engines/integrations/hdfs) engine tables.
Possible values:
- 0 β `SELECT` throws an exception if empty file is not compatible with requested format.
- 1 β `SELECT` returns empty result for empty file.
## hdfs\_throw\_on\_zero\_files\_match[β](https://clickhouse.com/docs/operations/settings/settings#hdfs_throw_on_zero_files_match "Direct link to hdfs_throw_on_zero_files_match")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
Throw an error if matched zero files according to glob expansion rules.
Possible values:
- 1 β `SELECT` throws an exception.
- 0 β `SELECT` returns empty result.
## hdfs\_truncate\_on\_insert[β](https://clickhouse.com/docs/operations/settings/settings#hdfs_truncate_on_insert "Direct link to hdfs_truncate_on_insert")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Enables or disables truncation before an insert in hdfs engine tables. If disabled, an exception will be thrown on an attempt to insert if a file in HDFS already exists.
Possible values:
- 0 β `INSERT` query appends new data to the end of the file.
- 1 β `INSERT` query replaces existing content of the file with the new data.
## hedged\_connection\_timeout\_ms[β](https://clickhouse.com/docs/operations/settings/settings#hedged_connection_timeout_ms "Direct link to hedged_connection_timeout_ms")
| Type | Default value |
|---|---|
| TypeMilliseconds | Default value50 |
Version history
Connection timeout for establishing connection with replica for Hedged requests
## highlight\_max\_matches\_per\_row[β](https://clickhouse.com/docs/operations/settings/settings#highlight_max_matches_per_row "Direct link to highlight_max_matches_per_row")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value10000 |
Version history
Sets the maximum number of highlight matches per row in the [highlight](https://clickhouse.com/docs/sql-reference/functions/string-search-functions#highlight) function. Use it to protect against excessive memory usage when highlighting highly repetitive patterns in large texts.
Possible values:
- Positive integer.
## hnsw\_candidate\_list\_size\_for\_search[β](https://clickhouse.com/docs/operations/settings/settings#hnsw_candidate_list_size_for_search "Direct link to hnsw_candidate_list_size_for_search")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value256 |
Version history
The size of the dynamic candidate list when searching the vector similarity index, also known as 'ef\_search'.
## hsts\_max\_age[β](https://clickhouse.com/docs/operations/settings/settings#hsts_max_age "Direct link to hsts_max_age")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Expired time for HSTS. 0 means disable HSTS.
## http\_connection\_timeout[β](https://clickhouse.com/docs/operations/settings/settings#http_connection_timeout "Direct link to http_connection_timeout")
| Type | Default value |
|---|---|
| TypeSeconds | Default value1 |
HTTP connection timeout (in seconds).
Possible values:
- Any positive integer.
- 0 - Disabled (infinite timeout).
## http\_headers\_progress\_interval\_ms[β](https://clickhouse.com/docs/operations/settings/settings#http_headers_progress_interval_ms "Direct link to http_headers_progress_interval_ms")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value100 |
Do not send HTTP headers X-ClickHouse-Progress more frequently than at each specified interval.
## http\_make\_head\_request[β](https://clickhouse.com/docs/operations/settings/settings#http_make_head_request "Direct link to http_make_head_request")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
The `http_make_head_request` setting allows the execution of a `HEAD` request while reading data from HTTP to retrieve information about the file to be read, such as its size. Since it's enabled by default, it may be desirable to disable this setting in cases where the server does not support `HEAD` requests.
## http\_max\_field\_name\_size[β](https://clickhouse.com/docs/operations/settings/settings#http_max_field_name_size "Direct link to http_max_field_name_size")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value131072 |
Maximum length of field name in HTTP header
## http\_max\_field\_value\_size[β](https://clickhouse.com/docs/operations/settings/settings#http_max_field_value_size "Direct link to http_max_field_value_size")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value131072 |
Maximum length of field value in HTTP header
## http\_max\_fields[β](https://clickhouse.com/docs/operations/settings/settings#http_max_fields "Direct link to http_max_fields")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value1000000 |
Maximum number of fields in HTTP header
## http\_max\_multipart\_form\_data\_size[β](https://clickhouse.com/docs/operations/settings/settings#http_max_multipart_form_data_size "Direct link to http_max_multipart_form_data_size")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value1073741824 |
Limit on size of multipart/form-data content. This setting cannot be parsed from URL parameters and should be set in a user profile. Note that content is parsed and external tables are created in memory before the start of query execution. And this is the only limit that has an effect on that stage (limits on max memory usage and max execution time have no effect while reading HTTP form data).
## http\_max\_request\_param\_data\_size[β](https://clickhouse.com/docs/operations/settings/settings#http_max_request_param_data_size "Direct link to http_max_request_param_data_size")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value10485760 |
Limit on size of request data used as a query parameter in predefined HTTP requests.
## http\_max\_tries[β](https://clickhouse.com/docs/operations/settings/settings#http_max_tries "Direct link to http_max_tries")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value10 |
Max attempts to read via http.
## http\_max\_uri\_size[β](https://clickhouse.com/docs/operations/settings/settings#http_max_uri_size "Direct link to http_max_uri_size")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value1048576 |
Sets the maximum URI length of an HTTP request.
Possible values:
- Positive integer.
## http\_native\_compression\_disable\_checksumming\_on\_decompress[β](https://clickhouse.com/docs/operations/settings/settings#http_native_compression_disable_checksumming_on_decompress "Direct link to http_native_compression_disable_checksumming_on_decompress")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Enables or disables checksum verification when decompressing the HTTP POST data from the client. Used only for ClickHouse native compression format (not used with `gzip` or `deflate`).
For more information, read the [HTTP interface description](https://clickhouse.com/docs/interfaces/http).
Possible values:
- 0 β Disabled.
- 1 β Enabled.
## http\_receive\_timeout[β](https://clickhouse.com/docs/operations/settings/settings#http_receive_timeout "Direct link to http_receive_timeout")
| Type | Default value |
|---|---|
| TypeSeconds | Default value30 |
Version history
HTTP receive timeout (in seconds).
Possible values:
- Any positive integer.
- 0 - Disabled (infinite timeout).
## http\_response\_buffer\_size[β](https://clickhouse.com/docs/operations/settings/settings#http_response_buffer_size "Direct link to http_response_buffer_size")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
The number of bytes to buffer in the server memory before sending a HTTP response to the client or flushing to disk (when http\_wait\_end\_of\_query is enabled).
## http\_response\_headers[β](https://clickhouse.com/docs/operations/settings/settings#http_response_headers "Direct link to http_response_headers")
| Type | Default value |
|---|---|
| TypeMap | Default value{} |
Version history
Allows to add or override HTTP headers which the server will return in the response with a successful query result. This only affects the HTTP interface.
If the header is already set by default, the provided value will override it. If the header was not set by default, it will be added to the list of headers. Headers that are set by the server by default and not overridden by this setting, will remain.
The setting allows you to set a header to a constant value. Currently there is no way to set a header to a dynamically calculated value.
Neither names or values can contain ASCII control characters.
If you implement a UI application which allows users to modify settings but at the same time makes decisions based on the returned headers, it is recommended to restrict this setting to readonly.
Example: `SET http_response_headers = '{"Content-Type": "image/png"}'`
## http\_retry\_initial\_backoff\_ms[β](https://clickhouse.com/docs/operations/settings/settings#http_retry_initial_backoff_ms "Direct link to http_retry_initial_backoff_ms")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value100 |
Min milliseconds for backoff, when retrying read via http
## http\_retry\_max\_backoff\_ms[β](https://clickhouse.com/docs/operations/settings/settings#http_retry_max_backoff_ms "Direct link to http_retry_max_backoff_ms")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value10000 |
Max milliseconds for backoff, when retrying read via http
## http\_send\_timeout[β](https://clickhouse.com/docs/operations/settings/settings#http_send_timeout "Direct link to http_send_timeout")
| Type | Default value |
|---|---|
| TypeSeconds | Default value30 |
Version history
HTTP send timeout (in seconds).
Possible values:
- Any positive integer.
- 0 - Disabled (infinite timeout).
Note
It's applicable only to the default profile. A server reboot is required for the changes to take effect.
## http\_skip\_not\_found\_url\_for\_globs[β](https://clickhouse.com/docs/operations/settings/settings#http_skip_not_found_url_for_globs "Direct link to http_skip_not_found_url_for_globs")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Skip URLs for globs with HTTP\_NOT\_FOUND error
## http\_wait\_end\_of\_query[β](https://clickhouse.com/docs/operations/settings/settings#http_wait_end_of_query "Direct link to http_wait_end_of_query")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Enable HTTP response buffering on the server-side.
## http\_write\_exception\_in\_output\_format[β](https://clickhouse.com/docs/operations/settings/settings#http_write_exception_in_output_format "Direct link to http_write_exception_in_output_format")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
Write exception in output format to produce valid output. Works with JSON and XML formats.
## http\_zlib\_compression\_level[β](https://clickhouse.com/docs/operations/settings/settings#http_zlib_compression_level "Direct link to http_zlib_compression_level")
| Type | Default value |
|---|---|
| TypeInt64 | Default value3 |
Sets the level of data compression in the response to an HTTP request if [enable\_http\_compression = 1](https://clickhouse.com/docs/operations/settings/settings#enable_http_compression).
Possible values: Numbers from 1 to 9.
## iceberg\_delete\_data\_on\_drop[β](https://clickhouse.com/docs/operations/settings/settings#iceberg_delete_data_on_drop "Direct link to iceberg_delete_data_on_drop")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
Whether to delete all iceberg files on drop or not.
## iceberg\_expire\_default\_max\_ref\_age\_ms[β](https://clickhouse.com/docs/operations/settings/settings#iceberg_expire_default_max_ref_age_ms "Direct link to iceberg_expire_default_max_ref_age_ms")
| Type | Default value |
|---|---|
| TypeInt64 | Default value9223372036854775807 |
Version history
Default value for Iceberg table property `history.expire.max-ref-age-ms` used by `expire_snapshots` when that property is absent.
## iceberg\_expire\_default\_max\_snapshot\_age\_ms[β](https://clickhouse.com/docs/operations/settings/settings#iceberg_expire_default_max_snapshot_age_ms "Direct link to iceberg_expire_default_max_snapshot_age_ms")
| Type | Default value |
|---|---|
| TypeInt64 | Default value432000000 |
Version history
Default value for Iceberg table property `history.expire.max-snapshot-age-ms` used by `expire_snapshots` when that property is absent.
## iceberg\_expire\_default\_min\_snapshots\_to\_keep[β](https://clickhouse.com/docs/operations/settings/settings#iceberg_expire_default_min_snapshots_to_keep "Direct link to iceberg_expire_default_min_snapshots_to_keep")
| Type | Default value |
|---|---|
| TypeInt64 | Default value1 |
Version history
Default value for Iceberg table property `history.expire.min-snapshots-to-keep` used by `expire_snapshots` when that property is absent.
## iceberg\_insert\_max\_bytes\_in\_data\_file[β](https://clickhouse.com/docs/operations/settings/settings#iceberg_insert_max_bytes_in_data_file "Direct link to iceberg_insert_max_bytes_in_data_file")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value1073741824 |
Version history
Max bytes of iceberg parquet data file on insert operation.
## iceberg\_insert\_max\_partitions[β](https://clickhouse.com/docs/operations/settings/settings#iceberg_insert_max_partitions "Direct link to iceberg_insert_max_partitions")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value100 |
Version history
Max allowed partitions count per one insert operation for Iceberg table engine.
## iceberg\_insert\_max\_rows\_in\_data\_file[β](https://clickhouse.com/docs/operations/settings/settings#iceberg_insert_max_rows_in_data_file "Direct link to iceberg_insert_max_rows_in_data_file")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value1000000 |
Version history
Max rows of iceberg parquet data file on insert operation.
## iceberg\_metadata\_compression\_method[β](https://clickhouse.com/docs/operations/settings/settings#iceberg_metadata_compression_method "Direct link to iceberg_metadata_compression_method")
Experimental feature.
[Learn more.](https://clickhouse.com/docs/beta-and-experimental-features#experimental-features)
Version history
Method to compress `.metadata.json` file.
## iceberg\_metadata\_log\_level[β](https://clickhouse.com/docs/operations/settings/settings#iceberg_metadata_log_level "Direct link to iceberg_metadata_log_level")
| Type | Default value |
|---|---|
| TypeIcebergMetadataLogLevel | Default valuenone |
Version history
Controls the level of metadata logging for Iceberg tables to system.iceberg\_metadata\_log. Usually this setting can be modified for debugging purposes.
Possible values:
- none - No metadata log.
- metadata - Root metadata.json file.
- manifest\_list\_metadata - Everything above + metadata from avro manifest list which corresponds to a snapshot.
- manifest\_list\_entry - Everything above + avro manifest list entries.
- manifest\_file\_metadata - Everything above + metadata from traversed avro manifest files.
- manifest\_file\_entry - Everything above + traversed avro manifest files entries.
## iceberg\_metadata\_staleness\_ms[β](https://clickhouse.com/docs/operations/settings/settings#iceberg_metadata_staleness_ms "Direct link to iceberg_metadata_staleness_ms")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Version history
If non-zero, skip fetching iceberg metadata from remote catalog if there is a cached metadata snapshot, more recent than the given staleness window. Zero means to always fetch the latest metadata version from the remote catalog. Setting this a non-zero trades staleness to a lower latency of read operations.
## iceberg\_snapshot\_id[β](https://clickhouse.com/docs/operations/settings/settings#iceberg_snapshot_id "Direct link to iceberg_snapshot_id")
| Type | Default value |
|---|---|
| TypeInt64 | Default value0 |
Version history
Query Iceberg table using the specific snapshot id.
## iceberg\_timestamp\_ms[β](https://clickhouse.com/docs/operations/settings/settings#iceberg_timestamp_ms "Direct link to iceberg_timestamp_ms")
| Type | Default value |
|---|---|
| TypeInt64 | Default value0 |
Version history
Query Iceberg table using the snapshot that was current at a specific timestamp.
## idle\_connection\_timeout[β](https://clickhouse.com/docs/operations/settings/settings#idle_connection_timeout "Direct link to idle_connection_timeout")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value3600 |
Timeout to close idle TCP connections after specified number of seconds.
Possible values:
- Positive integer (0 - close immediately, after 0 seconds).
## ignore\_cold\_parts\_seconds[β](https://clickhouse.com/docs/operations/settings/settings#ignore_cold_parts_seconds "Direct link to ignore_cold_parts_seconds")
ClickHouse Cloud only
| Type | Default value |
|---|---|
| TypeInt64 | Default value0 |
Only has an effect in ClickHouse Cloud. Exclude new data parts from SELECT queries until they're either pre-warmed (see [cache\_populated\_by\_fetch](https://clickhouse.com/docs/operations/settings/merge-tree-settings#cache_populated_by_fetch)) or this many seconds old. Only for Replicated-/SharedMergeTree.
## ignore\_data\_skipping\_indices[β](https://clickhouse.com/docs/operations/settings/settings#ignore_data_skipping_indices "Direct link to ignore_data_skipping_indices")
Ignores the skipping indexes specified if used by the query.
Consider the following example:
```
CREATE TABLE data
(
key Int,
x Int,
y Int,
INDEX x_idx x TYPE minmax GRANULARITY 1,
INDEX y_idx y TYPE minmax GRANULARITY 1,
INDEX xy_idx (x,y) TYPE minmax GRANULARITY 1
)
Engine=MergeTree()
ORDER BY key;
INSERT INTO data VALUES (1, 2, 3);
SELECT * FROM data;
SELECT * FROM data SETTINGS ignore_data_skipping_indices=''; -- query will produce CANNOT_PARSE_TEXT error.
SELECT * FROM data SETTINGS ignore_data_skipping_indices='x_idx'; -- Ok.
SELECT * FROM data SETTINGS ignore_data_skipping_indices='na_idx'; -- Ok.
SELECT * FROM data WHERE x = 1 AND y = 1 SETTINGS ignore_data_skipping_indices='xy_idx',force_data_skipping_indices='xy_idx' ; -- query will produce INDEX_NOT_USED error, since xy_idx is explicitly ignored.
SELECT * FROM data WHERE x = 1 AND y = 2 SETTINGS ignore_data_skipping_indices='xy_idx';
```
The query without ignoring any indexes:
```
EXPLAIN indexes = 1 SELECT * FROM data WHERE x = 1 AND y = 2;
Expression ((Projection + Before ORDER BY))
Filter (WHERE)
ReadFromMergeTree (default.data)
Indexes:
PrimaryKey
Condition: true
Parts: 1/1
Granules: 1/1
Skip
Name: x_idx
Description: minmax GRANULARITY 1
Parts: 0/1
Granules: 0/1
Skip
Name: y_idx
Description: minmax GRANULARITY 1
Parts: 0/0
Granules: 0/0
Skip
Name: xy_idx
Description: minmax GRANULARITY 1
Parts: 0/0
Granules: 0/0
```
Ignoring the `xy_idx` index:
```
EXPLAIN indexes = 1 SELECT * FROM data WHERE x = 1 AND y = 2 SETTINGS ignore_data_skipping_indices='xy_idx';
Expression ((Projection + Before ORDER BY))
Filter (WHERE)
ReadFromMergeTree (default.data)
Indexes:
PrimaryKey
Condition: true
Parts: 1/1
Granules: 1/1
Skip
Name: x_idx
Description: minmax GRANULARITY 1
Parts: 0/1
Granules: 0/1
Skip
Name: y_idx
Description: minmax GRANULARITY 1
Parts: 0/0
Granules: 0/0
```
Works with tables in the MergeTree family.
## ignore\_drop\_queries\_probability[β](https://clickhouse.com/docs/operations/settings/settings#ignore_drop_queries_probability "Direct link to ignore_drop_queries_probability")
| Type | Default value |
|---|---|
| TypeFloat | Default value0 |
Version history
If enabled, server will ignore all DROP table queries with specified probability (for Memory and JOIN engines it will replace DROP to TRUNCATE). Used for testing purposes
## ignore\_format\_null\_for\_explain[β](https://clickhouse.com/docs/operations/settings/settings#ignore_format_null_for_explain "Direct link to ignore_format_null_for_explain")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
If enabled, `FORMAT Null` will be ignored for `EXPLAIN` queries and default output format will be used instead. When disabled, `EXPLAIN` queries with `FORMAT Null` will produce no output (backward compatible behavior).
## ignore\_materialized\_views\_with\_dropped\_target\_table[β](https://clickhouse.com/docs/operations/settings/settings#ignore_materialized_views_with_dropped_target_table "Direct link to ignore_materialized_views_with_dropped_target_table")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
Ignore MVs with dropped target table during pushing to views
## ignore\_on\_cluster\_for\_replicated\_access\_entities\_queries[β](https://clickhouse.com/docs/operations/settings/settings#ignore_on_cluster_for_replicated_access_entities_queries "Direct link to ignore_on_cluster_for_replicated_access_entities_queries")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Ignore ON CLUSTER clause for replicated access entities management queries.
## ignore\_on\_cluster\_for\_replicated\_database[β](https://clickhouse.com/docs/operations/settings/settings#ignore_on_cluster_for_replicated_database "Direct link to ignore_on_cluster_for_replicated_database")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
Always ignore ON CLUSTER clause for DDL queries with replicated databases.
## ignore\_on\_cluster\_for\_replicated\_named\_collections\_queries[β](https://clickhouse.com/docs/operations/settings/settings#ignore_on_cluster_for_replicated_named_collections_queries "Direct link to ignore_on_cluster_for_replicated_named_collections_queries")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
Ignore ON CLUSTER clause for replicated named collections management queries.
## ignore\_on\_cluster\_for\_replicated\_udf\_queries[β](https://clickhouse.com/docs/operations/settings/settings#ignore_on_cluster_for_replicated_udf_queries "Direct link to ignore_on_cluster_for_replicated_udf_queries")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Ignore ON CLUSTER clause for replicated UDF management queries.
## implicit\_select[β](https://clickhouse.com/docs/operations/settings/settings#implicit_select "Direct link to implicit_select")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
Allow writing simple SELECT queries without the leading SELECT keyword, which makes it simple for calculator-style usage, e.g. `1 + 2` becomes a valid query.
In `clickhouse-local` it is enabled by default and can be explicitly disabled.
## implicit\_table\_at\_top\_level[β](https://clickhouse.com/docs/operations/settings/settings#implicit_table_at_top_level "Direct link to implicit_table_at_top_level")
Version history
If not empty, queries without FROM at the top level will read from this table instead of system.one.
This is used in clickhouse-local for input data processing. The setting could be set explicitly by a user but is not intended for this type of usage.
Subqueries are not affected by this setting (neither scalar, FROM, or IN subqueries). SELECTs at the top level of UNION, INTERSECT, EXCEPT chains are treated uniformly and affected by this setting, regardless of their grouping in parentheses. It is unspecified how this setting affects views and distributed queries.
The setting accepts a table name (then the table is resolved from the current database) or a qualified name in the form of 'database.table'. Both database and table names have to be unquoted - only simple identifiers are allowed.
## implicit\_transaction[β](https://clickhouse.com/docs/operations/settings/settings#implicit_transaction "Direct link to implicit_transaction")
Experimental feature.
[Learn more.](https://clickhouse.com/docs/beta-and-experimental-features#experimental-features)
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
If enabled and not already inside a transaction, wraps the query inside a full transaction (begin + commit or rollback)
## inject\_random\_order\_for\_select\_without\_order\_by[β](https://clickhouse.com/docs/operations/settings/settings#inject_random_order_for_select_without_order_by "Direct link to inject_random_order_for_select_without_order_by")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
If enabled, injects 'ORDER BY rand()' into SELECT queries without ORDER BY clause. Applied only for subquery depth = 0. Subqueries and INSERT INTO ... SELECT are not affected. If the top-level construct is UNION, 'ORDER BY rand()' is injected into all children independently. Only useful for testing and development (missing ORDER BY is a source of non-deterministic query results).
## insert\_allow\_materialized\_columns[β](https://clickhouse.com/docs/operations/settings/settings#insert_allow_materialized_columns "Direct link to insert_allow_materialized_columns")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
If setting is enabled, Allow materialized columns in INSERT.
## insert\_deduplicate[β](https://clickhouse.com/docs/operations/settings/settings#insert_deduplicate "Direct link to insert_deduplicate")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Enables or disables block deduplication of `INSERT` (for Replicated\* tables).
Possible values:
- 0 β Disabled.
- 1 β Enabled.
By default, blocks inserted into replicated tables by the `INSERT` statement are deduplicated (see [Data Replication](https://clickhouse.com/docs/engines/table-engines/mergetree-family/replication)). For the replicated tables by default the only 100 of the most recent blocks for each partition are deduplicated (see [replicated\_deduplication\_window](https://clickhouse.com/docs/operations/settings/merge-tree-settings#replicated_deduplication_window), [replicated\_deduplication\_window\_seconds](https://clickhouse.com/docs/operations/settings/merge-tree-settings#replicated_deduplication_window_seconds)). For not replicated tables see [non\_replicated\_deduplication\_window](https://clickhouse.com/docs/operations/settings/merge-tree-settings#non_replicated_deduplication_window).
## insert\_deduplication\_token[β](https://clickhouse.com/docs/operations/settings/settings#insert_deduplication_token "Direct link to insert_deduplication_token")
The setting allows a user to provide own deduplication semantic in MergeTree/ReplicatedMergeTree For example, by providing a unique value for the setting in each INSERT statement, user can avoid the same inserted data being deduplicated.
Possible values:
- Any string
`insert_deduplication_token` is used for deduplication *only* when not empty.
For the replicated tables by default the only 100 of the most recent inserts for each partition are deduplicated (see [replicated\_deduplication\_window](https://clickhouse.com/docs/operations/settings/merge-tree-settings#replicated_deduplication_window), [replicated\_deduplication\_window\_seconds](https://clickhouse.com/docs/operations/settings/merge-tree-settings#replicated_deduplication_window_seconds)). For not replicated tables see [non\_replicated\_deduplication\_window](https://clickhouse.com/docs/operations/settings/merge-tree-settings#non_replicated_deduplication_window).
Note
`insert_deduplication_token` works on a partition level (the same as `insert_deduplication` checksum). Multiple partitions can have the same `insert_deduplication_token`.
Example:
```
CREATE TABLE test_table
( A Int64 )
ENGINE = MergeTree
ORDER BY A
SETTINGS non_replicated_deduplication_window = 100;
INSERT INTO test_table SETTINGS insert_deduplication_token = 'test' VALUES (1);
-- the next insert won't be deduplicated because insert_deduplication_token is different
INSERT INTO test_table SETTINGS insert_deduplication_token = 'test1' VALUES (1);
-- the next insert will be deduplicated because insert_deduplication_token
-- is the same as one of the previous
INSERT INTO test_table SETTINGS insert_deduplication_token = 'test' VALUES (2);
SELECT * FROM test_table
ββAββ
β 1 β
βββββ
ββAββ
β 1 β
βββββ
```
## insert\_keeper\_fault\_injection\_probability[β](https://clickhouse.com/docs/operations/settings/settings#insert_keeper_fault_injection_probability "Direct link to insert_keeper_fault_injection_probability")
| Type | Default value |
|---|---|
| TypeFloat | Default value0 |
Approximate probability of failure for a keeper request during insert. Valid value is in interval \[0.0f, 1.0f\]
## insert\_keeper\_fault\_injection\_seed[β](https://clickhouse.com/docs/operations/settings/settings#insert_keeper_fault_injection_seed "Direct link to insert_keeper_fault_injection_seed")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
0 - random seed, otherwise the setting value
## insert\_keeper\_max\_retries[β](https://clickhouse.com/docs/operations/settings/settings#insert_keeper_max_retries "Direct link to insert_keeper_max_retries")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value20 |
Version history
The setting sets the maximum number of retries for ClickHouse Keeper (or ZooKeeper) requests during insert into replicated MergeTree. Only Keeper requests which failed due to network error, Keeper session timeout, or request timeout are considered for retries.
Possible values:
- Positive integer.
- 0 β Retries are disabled
Cloud default value: `20`.
Keeper request retries are done after some timeout. The timeout is controlled by the following settings: `insert_keeper_retry_initial_backoff_ms`, `insert_keeper_retry_max_backoff_ms`. The first retry is done after `insert_keeper_retry_initial_backoff_ms` timeout. The consequent timeouts will be calculated as follows:
```
timeout = min(insert_keeper_retry_max_backoff_ms, latest_timeout * 2)
```
For example, if `insert_keeper_retry_initial_backoff_ms=100`, `insert_keeper_retry_max_backoff_ms=10000` and `insert_keeper_max_retries=8` then timeouts will be `100, 200, 400, 800, 1600, 3200, 6400, 10000`.
Apart from fault tolerance, the retries aim to provide a better user experience - they allow to avoid returning an error during INSERT execution if Keeper is restarted, for example, due to an upgrade.
## insert\_keeper\_retry\_initial\_backoff\_ms[β](https://clickhouse.com/docs/operations/settings/settings#insert_keeper_retry_initial_backoff_ms "Direct link to insert_keeper_retry_initial_backoff_ms")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value100 |
Initial timeout(in milliseconds) to retry a failed Keeper request during INSERT query execution
Possible values:
- Positive integer.
- 0 β No timeout
## insert\_keeper\_retry\_max\_backoff\_ms[β](https://clickhouse.com/docs/operations/settings/settings#insert_keeper_retry_max_backoff_ms "Direct link to insert_keeper_retry_max_backoff_ms")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value10000 |
Maximum timeout (in milliseconds) to retry a failed Keeper request during INSERT query execution
Possible values:
- Positive integer.
- 0 β Maximum timeout is not limited
## insert\_null\_as\_default[β](https://clickhouse.com/docs/operations/settings/settings#insert_null_as_default "Direct link to insert_null_as_default")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Enables or disables the insertion of [default values](https://clickhouse.com/docs/sql-reference/statements/create/table#default_values) instead of [NULL](https://clickhouse.com/docs/sql-reference/syntax#null) into columns with not [nullable](https://clickhouse.com/docs/sql-reference/data-types/nullable) data type. If column type is not nullable and this setting is disabled, then inserting `NULL` causes an exception. If column type is nullable, then `NULL` values are inserted as is, regardless of this setting.
This setting is applicable to [INSERT ... SELECT](https://clickhouse.com/docs/sql-reference/statements/insert-into#inserting-the-results-of-select) queries. Note that `SELECT` subqueries may be concatenated with `UNION ALL` clause.
Possible values:
- 0 β Inserting `NULL` into a not nullable column causes an exception.
- 1 β Default column value is inserted instead of `NULL`.
## insert\_quorum[β](https://clickhouse.com/docs/operations/settings/settings#insert_quorum "Direct link to insert_quorum")
| Type | Default value |
|---|---|
| TypeUInt64Auto | Default value0 |
Note
This setting is not applicable to SharedMergeTree, see [SharedMergeTree consistency](https://clickhouse.com/docs/cloud/reference/shared-merge-tree#consistency) for more information.
Enables the quorum writes.
- If `insert_quorum < 2`, the quorum writes are disabled.
- If `insert_quorum >= 2`, the quorum writes are enabled.
- If `insert_quorum = 'auto'`, use majority number (`number_of_replicas / 2 + 1`) as quorum number.
Quorum writes
`INSERT` succeeds only when ClickHouse manages to correctly write data to the `insert_quorum` of replicas during the `insert_quorum_timeout`. If for any reason the number of replicas with successful writes does not reach the `insert_quorum`, the write is considered failed and ClickHouse will delete the inserted block from all the replicas where data has already been written.
When `insert_quorum_parallel` is disabled, all replicas in the quorum are consistent, i.e. they contain data from all previous `INSERT` queries (the `INSERT` sequence is linearized). When reading data written using `insert_quorum` and `insert_quorum_parallel` is disabled, you can turn on sequential consistency for `SELECT` queries using [select\_sequential\_consistency](https://clickhouse.com/docs/operations/settings/settings#select_sequential_consistency).
ClickHouse generates an exception:
- If the number of available replicas at the time of the query is less than the `insert_quorum`.
- When `insert_quorum_parallel` is disabled and an attempt to write data is made when the previous block has not yet been inserted in `insert_quorum` of replicas. This situation may occur if the user tries to perform another `INSERT` query to the same table before the previous one with `insert_quorum` is completed.
See also:
- [insert\_quorum\_timeout](https://clickhouse.com/docs/operations/settings/settings#insert_quorum_timeout)
- [insert\_quorum\_parallel](https://clickhouse.com/docs/operations/settings/settings#insert_quorum_parallel)
- [select\_sequential\_consistency](https://clickhouse.com/docs/operations/settings/settings#select_sequential_consistency)
## insert\_quorum\_parallel[β](https://clickhouse.com/docs/operations/settings/settings#insert_quorum_parallel "Direct link to insert_quorum_parallel")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Note
This setting is not applicable to SharedMergeTree, see [SharedMergeTree consistency](https://clickhouse.com/docs/cloud/reference/shared-merge-tree#consistency) for more information.
Enables or disables parallelism for quorum `INSERT` queries. If enabled, additional `INSERT` queries can be sent while previous queries have not yet finished. If disabled, additional writes to the same table will be rejected.
Possible values:
- 0 β Disabled.
- 1 β Enabled.
See also:
- [insert\_quorum](https://clickhouse.com/docs/operations/settings/settings#insert_quorum)
- [insert\_quorum\_timeout](https://clickhouse.com/docs/operations/settings/settings#insert_quorum_timeout)
- [select\_sequential\_consistency](https://clickhouse.com/docs/operations/settings/settings#select_sequential_consistency)
## insert\_quorum\_timeout[β](https://clickhouse.com/docs/operations/settings/settings#insert_quorum_timeout "Direct link to insert_quorum_timeout")
| Type | Default value |
|---|---|
| TypeMilliseconds | Default value600000 |
Write to a quorum timeout in milliseconds. If the timeout has passed and no write has taken place yet, ClickHouse will generate an exception and the client must repeat the query to write the same block to the same or any other replica.
See also:
- [insert\_quorum](https://clickhouse.com/docs/operations/settings/settings#insert_quorum)
- [insert\_quorum\_parallel](https://clickhouse.com/docs/operations/settings/settings#insert_quorum_parallel)
- [select\_sequential\_consistency](https://clickhouse.com/docs/operations/settings/settings#select_sequential_consistency)
## insert\_shard\_id[β](https://clickhouse.com/docs/operations/settings/settings#insert_shard_id "Direct link to insert_shard_id")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
If not `0`, specifies the shard of [Distributed](https://clickhouse.com/docs/engines/table-engines/special/distributed) table into which the data will be inserted synchronously.
If `insert_shard_id` value is incorrect, the server will throw an exception.
To get the number of shards on `requested_cluster`, you can check server config or use this query:
```
SELECT uniq(shard_num) FROM system.clusters WHERE cluster = 'requested_cluster';
```
Possible values:
- 0 β Disabled.
- Any number from `1` to `shards_num` of corresponding [Distributed](https://clickhouse.com/docs/engines/table-engines/special/distributed) table.
**Example**
Query:
```
CREATE TABLE x AS system.numbers ENGINE = MergeTree ORDER BY number;
CREATE TABLE x_dist AS x ENGINE = Distributed('test_cluster_two_shards_localhost', currentDatabase(), x);
INSERT INTO x_dist SELECT * FROM numbers(5) SETTINGS insert_shard_id = 1;
SELECT * FROM x_dist ORDER BY number ASC;
```
Result:
```
ββnumberββ
β 0 β
β 0 β
β 1 β
β 1 β
β 2 β
β 2 β
β 3 β
β 3 β
β 4 β
β 4 β
ββββββββββ
```
## interactive\_delay[β](https://clickhouse.com/docs/operations/settings/settings#interactive_delay "Direct link to interactive_delay")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value100000 |
The interval in microseconds for checking whether request execution has been canceled and sending the progress.
## intersect\_default\_mode[β](https://clickhouse.com/docs/operations/settings/settings#intersect_default_mode "Direct link to intersect_default_mode")
| Type | Default value |
|---|---|
| TypeSetOperationMode | Default valueALL |
Set default mode in INTERSECT query. Possible values: empty string, 'ALL', 'DISTINCT'. If empty, query without mode will throw exception.
## jemalloc\_collect\_profile\_samples\_in\_trace\_log[β](https://clickhouse.com/docs/operations/settings/settings#jemalloc_collect_profile_samples_in_trace_log "Direct link to jemalloc_collect_profile_samples_in_trace_log")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
Collect jemalloc allocation and deallocation samples in trace log.
## jemalloc\_enable\_profiler[β](https://clickhouse.com/docs/operations/settings/settings#jemalloc_enable_profiler "Direct link to jemalloc_enable_profiler")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
Enable jemalloc profiler for the query. Jemalloc will sample allocations and all deallocations for sampled allocations. Profiles can be flushed using SYSTEM JEMALLOC FLUSH PROFILE which can be used for allocation analysis. Samples can also be stored in system.trace\_log using config jemalloc\_collect\_global\_profile\_samples\_in\_trace\_log or with query setting jemalloc\_collect\_profile\_samples\_in\_trace\_log. See [Allocation Profiling](https://clickhouse.com/docs/operations/allocation-profiling)
## jemalloc\_profile\_text\_collapsed\_use\_count[β](https://clickhouse.com/docs/operations/settings/settings#jemalloc_profile_text_collapsed_use_count "Direct link to jemalloc_profile_text_collapsed_use_count")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
When using the 'collapsed' output format for jemalloc heap profile, aggregate by allocation count instead of bytes. When false (default), each stack is weighted by live bytes; when true, by live allocation count.
## jemalloc\_profile\_text\_output\_format[β](https://clickhouse.com/docs/operations/settings/settings#jemalloc_profile_text_output_format "Direct link to jemalloc_profile_text_output_format")
| Type | Default value |
|---|---|
| TypeJemallocProfileFormat | Default valuecollapsed |
Version history
Output format for jemalloc heap profile in system.jemalloc\_profile\_text table. Can be: 'raw' (raw profile), 'symbolized' (jeprof format with symbols), or 'collapsed' (FlameGraph format).
## jemalloc\_profile\_text\_symbolize\_with\_inline[β](https://clickhouse.com/docs/operations/settings/settings#jemalloc_profile_text_symbolize_with_inline "Direct link to jemalloc_profile_text_symbolize_with_inline")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Whether to include inline frames when symbolizing jemalloc heap profile. When enabled, inline frames are included which can slow down symbolization process drastically; when disabled, they are skipped. Only affects 'symbolized' and 'collapsed' output formats.
## join\_algorithm[β](https://clickhouse.com/docs/operations/settings/settings#join_algorithm "Direct link to join_algorithm")
| Type | Default value |
|---|---|
| TypeJoinAlgorithm | Default valuedirect,parallel\_hash,hash |
Version history
Specifies which [JOIN](https://clickhouse.com/docs/sql-reference/statements/select/join) algorithm is used.
Several algorithms can be specified, and an available one would be chosen for a particular query based on kind/strictness and table engine.
Possible values:
- grace\_hash
[Grace hash join](https://en.wikipedia.org/wiki/Hash_join#Grace_hash_join) is used. Grace hash provides an algorithm option that provides performant complex joins while limiting memory use.
The first phase of a grace join reads the right table and splits it into N buckets depending on the hash value of key columns (initially, N is `grace_hash_join_initial_buckets`). This is done in a way to ensure that each bucket can be processed independently. Rows from the first bucket are added to an in-memory hash table while the others are saved to disk. If the hash table grows beyond the memory limit (e.g., as set by [`max_bytes_in_join`](https://clickhouse.com/docs/operations/settings/settings#max_bytes_in_join), the number of buckets is increased and the assigned bucket for each row. Any rows which don't belong to the current bucket are flushed and reassigned.
Supports `INNER/LEFT/RIGHT/FULL ALL/ANY JOIN`.
- hash
[Hash join algorithm](https://en.wikipedia.org/wiki/Hash_join) is used. The most generic implementation that supports all combinations of kind and strictness and multiple join keys that are combined with `OR` in the `JOIN ON` section.
When using the `hash` algorithm, the right part of `JOIN` is uploaded into RAM.
- parallel\_hash
A variation of `hash` join that splits the data into buckets and builds several hashtables instead of one concurrently to speed up this process.
When using the `parallel_hash` algorithm, the right part of `JOIN` is uploaded into RAM.
- partial\_merge
A variation of the [sort-merge algorithm](https://en.wikipedia.org/wiki/Sort-merge_join), where only the right table is fully sorted.
The `RIGHT JOIN` and `FULL JOIN` are supported only with `ALL` strictness (`SEMI`, `ANTI`, `ANY`, and `ASOF` are not supported).
When using the `partial_merge` algorithm, ClickHouse sorts the data and dumps it to the disk. The `partial_merge` algorithm in ClickHouse differs slightly from the classic realization. First, ClickHouse sorts the right table by joining keys in blocks and creates a min-max index for sorted blocks. Then it sorts parts of the left table by the `join key` and joins them over the right table. The min-max index is also used to skip unneeded right table blocks.
- direct
The `direct` (also known as nested loop) algorithm performs a lookup in the right table using rows from the left table as keys. It's supported by special storages such as [Dictionary](https://clickhouse.com/docs/engines/table-engines/special/dictionary), [EmbeddedRocksDB](https://clickhouse.com/docs/engines/table-engines/integrations/embedded-rocksdb), and [MergeTree](https://clickhouse.com/docs/engines/table-engines/mergetree-family/mergetree) tables.
For MergeTree tables, the algorithm pushes join key filters directly to the storage layer. This can be more efficient when the key can use the table's primary key index for lookups, otherwise it performs full scans of the right table for each left table block.
Supports `INNER` and `LEFT` joins and only single-column equality join keys without other conditions.
- auto
When set to `auto`, `hash` join is tried first, and the algorithm is switched on the fly to another algorithm if the memory limit is violated.
- full\_sorting\_merge
[Sort-merge algorithm](https://en.wikipedia.org/wiki/Sort-merge_join) with full sorting of joined tables before joining.
- prefer\_partial\_merge
ClickHouse always tries to use `partial_merge` join if possible, otherwise, it uses `hash`. *Deprecated*, same as `partial_merge,hash`.
- default (deprecated)
Legacy value, please don't use anymore. Same as `direct,hash`, i.e. try to use direct join and hash join (in this order).
## join\_any\_take\_last\_row[β](https://clickhouse.com/docs/operations/settings/settings#join_any_take_last_row "Direct link to join_any_take_last_row")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Changes the behaviour of join operations with `ANY` strictness.
Note
This setting applies only for `JOIN` operations with [Join](https://clickhouse.com/docs/engines/table-engines/special/join) engine tables.
Possible values:
- 0 β If the right table has more than one matching row, only the first one found is joined.
- 1 β If the right table has more than one matching row, only the last one found is joined.
See also:
- [JOIN clause](https://clickhouse.com/docs/sql-reference/statements/select/join)
- [Join table engine](https://clickhouse.com/docs/engines/table-engines/special/join)
- [join\_default\_strictness](https://clickhouse.com/docs/operations/settings/settings#join_default_strictness)
## join\_default\_strictness[β](https://clickhouse.com/docs/operations/settings/settings#join_default_strictness "Direct link to join_default_strictness")
| Type | Default value |
|---|---|
| TypeJoinStrictness | Default valueALL |
Sets default strictness for [JOIN clauses](https://clickhouse.com/docs/sql-reference/statements/select/join).
Possible values:
- `ALL` β If the right table has several matching rows, ClickHouse creates a [Cartesian product](https://en.wikipedia.org/wiki/Cartesian_product) from matching rows. This is the normal `JOIN` behaviour from standard SQL.
- `ANY` β If the right table has several matching rows, only the first one found is joined. If the right table has only one matching row, the results of `ANY` and `ALL` are the same.
- `ASOF` β For joining sequences with an uncertain match.
- `Empty string` β If `ALL` or `ANY` is not specified in the query, ClickHouse throws an exception.
## join\_on\_disk\_max\_files\_to\_merge[β](https://clickhouse.com/docs/operations/settings/settings#join_on_disk_max_files_to_merge "Direct link to join_on_disk_max_files_to_merge")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value64 |
Limits the number of files allowed for parallel sorting in MergeJoin operations when they are executed on disk.
The bigger the value of the setting, the more RAM is used and the less disk I/O is needed.
Possible values:
- Any positive integer, starting from 2.
## join\_output\_by\_rowlist\_perkey\_rows\_threshold[β](https://clickhouse.com/docs/operations/settings/settings#join_output_by_rowlist_perkey_rows_threshold "Direct link to join_output_by_rowlist_perkey_rows_threshold")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value5 |
Version history
The lower limit of per-key average rows in the right table to determine whether to output by row list in hash join.
## join\_overflow\_mode[β](https://clickhouse.com/docs/operations/settings/settings#join_overflow_mode "Direct link to join_overflow_mode")
| Type | Default value |
|---|---|
| TypeOverflowMode | Default valuethrow |
Defines what action ClickHouse performs when any of the following join limits is reached:
- [max\_bytes\_in\_join](https://clickhouse.com/docs/operations/settings/settings#max_bytes_in_join)
- [max\_rows\_in\_join](https://clickhouse.com/docs/operations/settings/settings#max_rows_in_join)
Possible values:
- `THROW` β ClickHouse throws an exception and breaks operation.
- `BREAK` β ClickHouse breaks operation and does not throw an exception.
Default value: `THROW`.
**See Also**
- [JOIN clause](https://clickhouse.com/docs/sql-reference/statements/select/join)
- [Join table engine](https://clickhouse.com/docs/engines/table-engines/special/join)
## join\_runtime\_bloom\_filter\_bytes[β](https://clickhouse.com/docs/operations/settings/settings#join_runtime_bloom_filter_bytes "Direct link to join_runtime_bloom_filter_bytes")
Experimental feature.
[Learn more.](https://clickhouse.com/docs/beta-and-experimental-features#experimental-features)
| Type | Default value |
|---|---|
| TypeUInt64 | Default value524288 |
Version history
Size in bytes of a bloom filter used as JOIN runtime filter (see enable\_join\_runtime\_filters setting).
## join\_runtime\_bloom\_filter\_hash\_functions[β](https://clickhouse.com/docs/operations/settings/settings#join_runtime_bloom_filter_hash_functions "Direct link to join_runtime_bloom_filter_hash_functions")
Experimental feature.
[Learn more.](https://clickhouse.com/docs/beta-and-experimental-features#experimental-features)
| Type | Default value |
|---|---|
| TypeUInt64 | Default value3 |
Version history
Number of hash functions in a bloom filter used as JOIN runtime filter (see enable\_join\_runtime\_filters setting).
## join\_runtime\_bloom\_filter\_max\_ratio\_of\_set\_bits[β](https://clickhouse.com/docs/operations/settings/settings#join_runtime_bloom_filter_max_ratio_of_set_bits "Direct link to join_runtime_bloom_filter_max_ratio_of_set_bits")
Experimental feature.
[Learn more.](https://clickhouse.com/docs/beta-and-experimental-features#experimental-features)
| Type | Default value |
|---|---|
| TypeDouble | Default value0\.7 |
Version history
If the number of set bits in a runtime bloom filter exceeds this ratio the filter is completely disabled to reduce the overhead.
## join\_runtime\_filter\_blocks\_to\_skip\_before\_reenabling[β](https://clickhouse.com/docs/operations/settings/settings#join_runtime_filter_blocks_to_skip_before_reenabling "Direct link to join_runtime_filter_blocks_to_skip_before_reenabling")
Experimental feature.
[Learn more.](https://clickhouse.com/docs/beta-and-experimental-features#experimental-features)
| Type | Default value |
|---|---|
| TypeUInt64 | Default value30 |
Version history
Number of blocks that are skipped before trying to dynamically re-enable a runtime filter that previously was disabled due to poor filtering ratio.
## join\_runtime\_filter\_exact\_values\_limit[β](https://clickhouse.com/docs/operations/settings/settings#join_runtime_filter_exact_values_limit "Direct link to join_runtime_filter_exact_values_limit")
Experimental feature.
[Learn more.](https://clickhouse.com/docs/beta-and-experimental-features#experimental-features)
| Type | Default value |
|---|---|
| TypeUInt64 | Default value10000 |
Version history
Maximum number of elements in runtime filter that are stored as is in a set, when this threshold is exceeded it switches to bloom filter.
## join\_runtime\_filter\_pass\_ratio\_threshold\_for\_disabling[β](https://clickhouse.com/docs/operations/settings/settings#join_runtime_filter_pass_ratio_threshold_for_disabling "Direct link to join_runtime_filter_pass_ratio_threshold_for_disabling")
Experimental feature.
[Learn more.](https://clickhouse.com/docs/beta-and-experimental-features#experimental-features)
| Type | Default value |
|---|---|
| TypeDouble | Default value0\.7 |
Version history
If ratio of passed rows to checked rows is greater than this threshold the runtime filter is considered as poorly performing and is disabled for the next `join_runtime_filter_blocks_to_skip_before_reenabling` blocks to reduce the overhead.
## join\_to\_sort\_maximum\_table\_rows[β](https://clickhouse.com/docs/operations/settings/settings#join_to_sort_maximum_table_rows "Direct link to join_to_sort_maximum_table_rows")
Experimental feature.
[Learn more.](https://clickhouse.com/docs/beta-and-experimental-features#experimental-features)
| Type | Default value |
|---|---|
| TypeUInt64 | Default value10000 |
Version history
The maximum number of rows in the right table to determine whether to rerange the right table by key in left or inner join.
## join\_to\_sort\_minimum\_perkey\_rows[β](https://clickhouse.com/docs/operations/settings/settings#join_to_sort_minimum_perkey_rows "Direct link to join_to_sort_minimum_perkey_rows")
Experimental feature.
[Learn more.](https://clickhouse.com/docs/beta-and-experimental-features#experimental-features)
| Type | Default value |
|---|---|
| TypeUInt64 | Default value40 |
Version history
The lower limit of per-key average rows in the right table to determine whether to rerange the right table by key in left or inner join. This setting ensures that the optimization is not applied for sparse table keys
## join\_use\_nulls[β](https://clickhouse.com/docs/operations/settings/settings#join_use_nulls "Direct link to join_use_nulls")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Sets the type of [JOIN](https://clickhouse.com/docs/sql-reference/statements/select/join) behaviour. When merging tables, empty cells may appear. ClickHouse fills them differently based on this setting.
Possible values:
- 0 β The empty cells are filled with the default value of the corresponding field type.
- 1 β `JOIN` behaves the same way as in standard SQL. The type of the corresponding field is converted to [Nullable](https://clickhouse.com/docs/sql-reference/data-types/nullable), and empty cells are filled with [NULL](https://clickhouse.com/docs/sql-reference/syntax).
## joined\_block\_split\_single\_row[β](https://clickhouse.com/docs/operations/settings/settings#joined_block_split_single_row "Direct link to joined_block_split_single_row")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
Allow to chunk hash join result by rows corresponding to single row from left table. This may reduce memory usage in case of row with many matches in right table, but may increase CPU usage. Note that `max_joined_block_size_rows != 0` is mandatory for this setting to have effect. The `max_joined_block_size_bytes` combined with this setting is helpful to avoid excessive memory usage in case of skewed data with some large rows having many matches in right table.
## joined\_subquery\_requires\_alias[β](https://clickhouse.com/docs/operations/settings/settings#joined_subquery_requires_alias "Direct link to joined_subquery_requires_alias")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Force joined subqueries and table functions to have aliases for correct name qualification.
## kafka\_disable\_num\_consumers\_limit[β](https://clickhouse.com/docs/operations/settings/settings#kafka_disable_num_consumers_limit "Direct link to kafka_disable_num_consumers_limit")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Disable limit on kafka\_num\_consumers that depends on the number of available CPU cores.
## kafka\_max\_wait\_ms[β](https://clickhouse.com/docs/operations/settings/settings#kafka_max_wait_ms "Direct link to kafka_max_wait_ms")
| Type | Default value |
|---|---|
| TypeMilliseconds | Default value5000 |
The wait time in milliseconds for reading messages from [Kafka](https://clickhouse.com/docs/engines/table-engines/integrations/kafka) before retry.
Possible values:
- Positive integer.
- 0 β Infinite timeout.
See also:
- [Apache Kafka](https://kafka.apache.org/)
## keeper\_map\_strict\_mode[β](https://clickhouse.com/docs/operations/settings/settings#keeper_map_strict_mode "Direct link to keeper_map_strict_mode")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Enforce additional checks during operations on KeeperMap. E.g. throw an exception on an insert for already existing key
## keeper\_max\_retries[β](https://clickhouse.com/docs/operations/settings/settings#keeper_max_retries "Direct link to keeper_max_retries")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value10 |
Version history
Max retries for general keeper operations
## keeper\_retry\_initial\_backoff\_ms[β](https://clickhouse.com/docs/operations/settings/settings#keeper_retry_initial_backoff_ms "Direct link to keeper_retry_initial_backoff_ms")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value100 |
Version history
Initial backoff timeout for general keeper operations
## keeper\_retry\_max\_backoff\_ms[β](https://clickhouse.com/docs/operations/settings/settings#keeper_retry_max_backoff_ms "Direct link to keeper_retry_max_backoff_ms")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value5000 |
Version history
Max backoff timeout for general keeper operations
## least\_greatest\_legacy\_null\_behavior[β](https://clickhouse.com/docs/operations/settings/settings#least_greatest_legacy_null_behavior "Direct link to least_greatest_legacy_null_behavior")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
If enabled, functions 'least' and 'greatest' return NULL if one of their arguments is NULL.
## legacy\_column\_name\_of\_tuple\_literal[β](https://clickhouse.com/docs/operations/settings/settings#legacy_column_name_of_tuple_literal "Direct link to legacy_column_name_of_tuple_literal")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
List all names of element of large tuple literals in their column names instead of hash. This settings exists only for compatibility reasons. It makes sense to set to 'true', while doing rolling update of cluster from version lower than 21.7 to higher.
## lightweight\_delete\_mode[β](https://clickhouse.com/docs/operations/settings/settings#lightweight_delete_mode "Direct link to lightweight_delete_mode")
| Type | Default value |
|---|---|
| TypeLightweightDeleteMode | Default valuealter\_update |
Version history
A mode of internal update query that is executed as a part of lightweight delete.
Possible values:
- `alter_update` - run `ALTER UPDATE` query that creates a heavyweight mutation.
- `lightweight_update` - run lightweight update if possible, run `ALTER UPDATE` otherwise.
- `lightweight_update_force` - run lightweight update if possible, throw otherwise.
## lightweight\_deletes\_sync[β](https://clickhouse.com/docs/operations/settings/settings#lightweight_deletes_sync "Direct link to lightweight_deletes_sync")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value2 |
Version history
The same as [`mutations_sync`](https://clickhouse.com/docs/operations/settings/settings#mutations_sync), but controls only execution of lightweight deletes.
Possible values:
| Value | Description |
|---|---|
| `0` | Mutations execute asynchronously. |
| `1` | The query waits for the lightweight deletes to complete on the current server. |
| `2` | The query waits for the lightweight deletes to complete on all replicas (if they exist). |
| `3` | The query waits only for active replicas. Supported only for `SharedMergeTree`. For `ReplicatedMergeTree` it behaves the same as `mutations_sync = 2`. |
**See Also**
- [Synchronicity of ALTER Queries](https://clickhouse.com/docs/sql-reference/statements/alter#synchronicity-of-alter-queries)
- [Mutations](https://clickhouse.com/docs/sql-reference/statements/alter#mutations)
Cloud default value: `1`.
## limit[β](https://clickhouse.com/docs/operations/settings/settings#limit "Direct link to limit")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Sets the maximum number of rows to get from the query result. It adjusts the value set by the [LIMIT](https://clickhouse.com/docs/sql-reference/statements/select/limit) clause, so that the limit, specified in the query, cannot exceed the limit, set by this setting.
Possible values:
- 0 β The number of rows is not limited.
- Positive integer.
## load\_balancing[β](https://clickhouse.com/docs/operations/settings/settings#load_balancing "Direct link to load_balancing")
| Type | Default value |
|---|---|
| TypeLoadBalancing | Default valuerandom |
Specifies the algorithm of replicas selection that is used for distributed query processing.
ClickHouse supports the following algorithms of choosing replicas:
- [Random](https://clickhouse.com/docs/operations/settings/settings#load_balancing-random) (by default)
- [Nearest hostname](https://clickhouse.com/docs/operations/settings/settings#load_balancing-nearest_hostname)
- [Hostname levenshtein distance](https://clickhouse.com/docs/operations/settings/settings#load_balancing-hostname_levenshtein_distance)
- [In order](https://clickhouse.com/docs/operations/settings/settings#load_balancing-in_order)
- [First or random](https://clickhouse.com/docs/operations/settings/settings#load_balancing-first_or_random)
- [Round robin](https://clickhouse.com/docs/operations/settings/settings#load_balancing-round_robin)
See also:
- [distributed\_replica\_max\_ignored\_errors](https://clickhouse.com/docs/operations/settings/settings#distributed_replica_max_ignored_errors)
### Random (by Default)[β](https://clickhouse.com/docs/operations/settings/settings#load_balancing-random "Direct link to Random (by Default)")
```
load_balancing = random
```
The number of errors is counted for each replica. The query is sent to the replica with the fewest errors, and if there are several of these, to anyone of them. Disadvantages: Server proximity is not accounted for; if the replicas have different data, you will also get different data.
### Nearest Hostname[β](https://clickhouse.com/docs/operations/settings/settings#load_balancing-nearest_hostname "Direct link to Nearest Hostname")
```
load_balancing = nearest_hostname
```
The number of errors is counted for each replica. Every 5 minutes, the number of errors is integrally divided by 2. Thus, the number of errors is calculated for a recent time with exponential smoothing. If there is one replica with a minimal number of errors (i.e. errors occurred recently on the other replicas), the query is sent to it. If there are multiple replicas with the same minimal number of errors, the query is sent to the replica with a hostname that is most similar to the server's hostname in the config file (for the number of different characters in identical positions, up to the minimum length of both hostnames).
For instance, example01-01-1 and example01-01-2 are different in one position, while example01-01-1 and example01-02-2 differ in two places. This method might seem primitive, but it does not require external data about network topology, and it does not compare IP addresses, which would be complicated for our IPv6 addresses.
Thus, if there are equivalent replicas, the closest one by name is preferred. We can also assume that when sending a query to the same server, in the absence of failures, a distributed query will also go to the same servers. So even if different data is placed on the replicas, the query will return mostly the same results.
### Hostname levenshtein distance[β](https://clickhouse.com/docs/operations/settings/settings#load_balancing-hostname_levenshtein_distance "Direct link to Hostname levenshtein distance")
```
load_balancing = hostname_levenshtein_distance
```
Just like `nearest_hostname`, but it compares hostname in a [levenshtein distance](https://en.wikipedia.org/wiki/Levenshtein_distance) manner. For example:
```
example-clickhouse-0-0 ample-clickhouse-0-0
1
example-clickhouse-0-0 example-clickhouse-1-10
2
example-clickhouse-0-0 example-clickhouse-12-0
3
```
### In Order[β](https://clickhouse.com/docs/operations/settings/settings#load_balancing-in_order "Direct link to In Order")
```
load_balancing = in_order
```
Replicas with the same number of errors are accessed in the same order as they are specified in the configuration. This method is appropriate when you know exactly which replica is preferable.
### First or Random[β](https://clickhouse.com/docs/operations/settings/settings#load_balancing-first_or_random "Direct link to First or Random")
```
load_balancing = first_or_random
```
This algorithm chooses the first replica in the set or a random replica if the first is unavailable. It's effective in cross-replication topology setups, but useless in other configurations.
The `first_or_random` algorithm solves the problem of the `in_order` algorithm. With `in_order`, if one replica goes down, the next one gets a double load while the remaining replicas handle the usual amount of traffic. When using the `first_or_random` algorithm, the load is evenly distributed among replicas that are still available.
It's possible to explicitly define what the first replica is by using the setting `load_balancing_first_offset`. This gives more control to rebalance query workloads among replicas.
### Round Robin[β](https://clickhouse.com/docs/operations/settings/settings#load_balancing-round_robin "Direct link to Round Robin")
```
load_balancing = round_robin
```
This algorithm uses a round-robin policy across replicas with the same number of errors (only the queries with `round_robin` policy is accounted).
## load\_balancing\_first\_offset[β](https://clickhouse.com/docs/operations/settings/settings#load_balancing_first_offset "Direct link to load_balancing_first_offset")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Which replica to preferably send a query when FIRST\_OR\_RANDOM load balancing strategy is used.
## load\_marks\_asynchronously[β](https://clickhouse.com/docs/operations/settings/settings#load_marks_asynchronously "Direct link to load_marks_asynchronously")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Load MergeTree marks asynchronously
Cloud default value: `1`.
## local\_filesystem\_read\_method[β](https://clickhouse.com/docs/operations/settings/settings#local_filesystem_read_method "Direct link to local_filesystem_read_method")
| Type | Default value |
|---|---|
| TypeString | Default valuepread\_threadpool |
Method of reading data from local filesystem, one of: read, pread, mmap, io\_uring, pread\_threadpool.
The 'io\_uring' method is experimental and does not work for Log, TinyLog, StripeLog, File, Set and Join, and other tables with append-able files in presence of concurrent reads and writes. If you read various articles about 'io\_uring' on the Internet, don't be blinded by them. It is not a better method of reading files, unless the case of a large amount of small IO requests, which is not the case in ClickHouse. There are no reasons to enable 'io\_uring'.
## local\_filesystem\_read\_prefetch[β](https://clickhouse.com/docs/operations/settings/settings#local_filesystem_read_prefetch "Direct link to local_filesystem_read_prefetch")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Should use prefetching when reading data from local filesystem.
## lock\_acquire\_timeout[β](https://clickhouse.com/docs/operations/settings/settings#lock_acquire_timeout "Direct link to lock_acquire_timeout")
| Type | Default value |
|---|---|
| TypeSeconds | Default value120 |
Defines how many seconds a locking request waits before failing.
Locking timeout is used to protect from deadlocks while executing read/write operations with tables. When the timeout expires and the locking request fails, the ClickHouse server throws an exception "Locking attempt timed out! Possible deadlock avoided. Client should retry." with error code `DEADLOCK_AVOIDED`.
Possible values:
- Positive integer (in seconds).
- 0 β No locking timeout.
## log\_comment[β](https://clickhouse.com/docs/operations/settings/settings#log_comment "Direct link to log_comment")
Specifies the value for the `log_comment` field of the [system.query\_log](https://clickhouse.com/docs/operations/system-tables/query_log) table and comment text for the server log.
It can be used to improve the readability of server logs. Additionally, it helps to select queries related to the test from the `system.query_log` after running [clickhouse-test](https://clickhouse.com/docs/development/tests).
Possible values:
- Any string no longer than [max\_query\_size](https://clickhouse.com/docs/operations/settings/settings#max_query_size). If the max\_query\_size is exceeded, the server throws an exception.
**Example**
Query:
```
SET log_comment = 'log_comment test', log_queries = 1;
SELECT 1;
SYSTEM FLUSH LOGS;
SELECT type, query FROM system.query_log WHERE log_comment = 'log_comment test' AND event_date >= yesterday() ORDER BY event_time DESC LIMIT 2;
```
Result:
```
ββtypeβββββββββ¬βqueryββββββ
β QueryStart β SELECT 1; β
β QueryFinish β SELECT 1; β
βββββββββββββββ΄ββββββββββββ
```
## log\_formatted\_queries[β](https://clickhouse.com/docs/operations/settings/settings#log_formatted_queries "Direct link to log_formatted_queries")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Allows to log formatted queries to the [system.query\_log](https://clickhouse.com/docs/operations/system-tables/query_log) system table (populates `formatted_query` column in the [system.query\_log](https://clickhouse.com/docs/operations/system-tables/query_log)).
Possible values:
- 0 β Formatted queries are not logged in the system table.
- 1 β Formatted queries are logged in the system table.
## log\_processors\_profiles[β](https://clickhouse.com/docs/operations/settings/settings#log_processors_profiles "Direct link to log_processors_profiles")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Write time that processor spent during execution/waiting for data to `system.processors_profile_log` table.
See also:
- [`system.processors_profile_log`](https://clickhouse.com/docs/operations/system-tables/processors_profile_log)
- [`EXPLAIN PIPELINE`](https://clickhouse.com/docs/sql-reference/statements/explain#explain-pipeline)
## log\_profile\_events[β](https://clickhouse.com/docs/operations/settings/settings#log_profile_events "Direct link to log_profile_events")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Log query performance statistics into the query\_log, query\_thread\_log and query\_views\_log.
## log\_queries[β](https://clickhouse.com/docs/operations/settings/settings#log_queries "Direct link to log_queries")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Setting up query logging.
Queries sent to ClickHouse with this setup are logged according to the rules in the [query\_log](https://clickhouse.com/docs/operations/server-configuration-parameters/settings#query_log) server configuration parameter.
Example:
```
log_queries=1
```
## log\_queries\_cut\_to\_length[β](https://clickhouse.com/docs/operations/settings/settings#log_queries_cut_to_length "Direct link to log_queries_cut_to_length")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value100000 |
If query length is greater than a specified threshold (in bytes), then cut query when writing to query log. Also limit the length of printed query in ordinary text log.
## log\_queries\_min\_query\_duration\_ms[β](https://clickhouse.com/docs/operations/settings/settings#log_queries_min_query_duration_ms "Direct link to log_queries_min_query_duration_ms")
| Type | Default value |
|---|---|
| TypeMilliseconds | Default value0 |
If enabled (non-zero), queries faster than the value of this setting will not be logged (you can think about this as a `long_query_time` for [MySQL Slow Query Log](https://dev.mysql.com/doc/refman/5.7/slow-query-log.html)), and this basically means that you will not find them in the following tables:
- `system.query_log`
- `system.query_thread_log`
Only the queries with the following type will get to the log:
- `QUERY_FINISH`
- `EXCEPTION_WHILE_PROCESSING`
- Type: milliseconds
- Default value: 0 (any query)
## log\_queries\_min\_type[β](https://clickhouse.com/docs/operations/settings/settings#log_queries_min_type "Direct link to log_queries_min_type")
| Type | Default value |
|---|---|
| TypeLogQueriesType | Default valueQUERY\_START |
`query_log` minimal type to log.
Possible values:
- `QUERY_START` (`=1`)
- `QUERY_FINISH` (`=2`)
- `EXCEPTION_BEFORE_START` (`=3`)
- `EXCEPTION_WHILE_PROCESSING` (`=4`)
Can be used to limit which entities will go to `query_log`, say you are interested only in errors, then you can use `EXCEPTION_WHILE_PROCESSING`:
```
log_queries_min_type='EXCEPTION_WHILE_PROCESSING'
```
## log\_queries\_probability[β](https://clickhouse.com/docs/operations/settings/settings#log_queries_probability "Direct link to log_queries_probability")
| Type | Default value |
|---|---|
| TypeFloat | Default value1 |
Allows a user to write to [query\_log](https://clickhouse.com/docs/operations/system-tables/query_log), [query\_thread\_log](https://clickhouse.com/docs/operations/system-tables/query_thread_log), and [query\_views\_log](https://clickhouse.com/docs/operations/system-tables/query_views_log) system tables only a sample of queries selected randomly with the specified probability. It helps to reduce the load with a large volume of queries in a second.
Possible values:
- 0 β Queries are not logged in the system tables.
- Positive floating-point number in the range \[0..1\]. For example, if the setting value is `0.5`, about half of the queries are logged in the system tables.
- 1 β All queries are logged in the system tables.
## log\_query\_settings[β](https://clickhouse.com/docs/operations/settings/settings#log_query_settings "Direct link to log_query_settings")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Log query settings into the query\_log and OpenTelemetry span log.
## log\_query\_threads[β](https://clickhouse.com/docs/operations/settings/settings#log_query_threads "Direct link to log_query_threads")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Setting up query threads logging.
Query threads log into the [system.query\_thread\_log](https://clickhouse.com/docs/operations/system-tables/query_thread_log) table. This setting has effect only when [log\_queries](https://clickhouse.com/docs/operations/settings/settings#log_queries) is true. Queries' threads run by ClickHouse with this setup are logged according to the rules in the [query\_thread\_log](https://clickhouse.com/docs/operations/server-configuration-parameters/settings#query_thread_log) server configuration parameter.
Possible values:
- 0 β Disabled.
- 1 β Enabled.
**Example**
```
log_query_threads=1
```
## log\_query\_views[β](https://clickhouse.com/docs/operations/settings/settings#log_query_views "Direct link to log_query_views")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Setting up query views logging.
When a query run by ClickHouse with this setting enabled has associated views (materialized or live views), they are logged in the [query\_views\_log](https://clickhouse.com/docs/operations/server-configuration-parameters/settings#query_views_log) server configuration parameter.
Example:
```
log_query_views=1
```
## low\_cardinality\_allow\_in\_native\_format[β](https://clickhouse.com/docs/operations/settings/settings#low_cardinality_allow_in_native_format "Direct link to low_cardinality_allow_in_native_format")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Allows or restricts using the [LowCardinality](https://clickhouse.com/docs/sql-reference/data-types/lowcardinality) data type with the [Native](https://clickhouse.com/docs/interfaces/formats/Native) format.
If usage of `LowCardinality` is restricted, ClickHouse server converts `LowCardinality`\-columns to ordinary ones for `SELECT` queries, and convert ordinary columns to `LowCardinality`\-columns for `INSERT` queries.
This setting is required mainly for third-party clients which do not support `LowCardinality` data type.
Possible values:
- 1 β Usage of `LowCardinality` is not restricted.
- 0 β Usage of `LowCardinality` is restricted.
## low\_cardinality\_max\_dictionary\_size[β](https://clickhouse.com/docs/operations/settings/settings#low_cardinality_max_dictionary_size "Direct link to low_cardinality_max_dictionary_size")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value8192 |
Sets a maximum size in rows of a shared global dictionary for the [LowCardinality](https://clickhouse.com/docs/sql-reference/data-types/lowcardinality) data type that can be written to a storage file system. This setting prevents issues with RAM in case of unlimited dictionary growth. All the data that can't be encoded due to maximum dictionary size limitation ClickHouse writes in an ordinary method.
Possible values:
- Any positive integer.
## low\_cardinality\_use\_single\_dictionary\_for\_part[β](https://clickhouse.com/docs/operations/settings/settings#low_cardinality_use_single_dictionary_for_part "Direct link to low_cardinality_use_single_dictionary_for_part")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Turns on or turns off using of single dictionary for the data part.
By default, the ClickHouse server monitors the size of dictionaries and if a dictionary overflows then the server starts to write the next one. To prohibit creating several dictionaries set `low_cardinality_use_single_dictionary_for_part = 1`.
Possible values:
- 1 β Creating several dictionaries for the data part is prohibited.
- 0 β Creating several dictionaries for the data part is not prohibited.
## low\_priority\_query\_wait\_time\_ms[β](https://clickhouse.com/docs/operations/settings/settings#low_priority_query_wait_time_ms "Direct link to low_priority_query_wait_time_ms")
Beta feature.
[Learn more.](https://clickhouse.com/docs/beta-and-experimental-features#beta-features)
| Type | Default value |
|---|---|
| TypeMilliseconds | Default value1000 |
Version history
When the query prioritization mechanism is employed (see setting `priority`), low-priority queries wait for higher-priority queries to finish. This setting specifies the duration of waiting.
## make\_distributed\_plan[β](https://clickhouse.com/docs/operations/settings/settings#make_distributed_plan "Direct link to make_distributed_plan")
Experimental feature.
[Learn more.](https://clickhouse.com/docs/beta-and-experimental-features#experimental-features)
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
Make distributed query plan.
## materialize\_skip\_indexes\_on\_insert[β](https://clickhouse.com/docs/operations/settings/settings#materialize_skip_indexes_on_insert "Direct link to materialize_skip_indexes_on_insert")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
If INSERTs build and store skip indexes. If disabled, skip indexes will only be built and stored [during merges](https://clickhouse.com/docs/operations/settings/merge-tree-settings#materialize_skip_indexes_on_merge) or by explicit [MATERIALIZE INDEX](https://clickhouse.com/docs/sql-reference/statements/alter/skipping-index#materialize-index).
See also [exclude\_materialize\_skip\_indexes\_on\_insert](https://clickhouse.com/docs/operations/settings/settings#exclude_materialize_skip_indexes_on_insert).
## materialize\_statistics\_on\_insert[β](https://clickhouse.com/docs/operations/settings/settings#materialize_statistics_on_insert "Direct link to materialize_statistics_on_insert")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
If INSERTs build and insert statistics. If disabled, statistics will be build and stored during merges or by explicit MATERIALIZE STATISTICS
## materialize\_ttl\_after\_modify[β](https://clickhouse.com/docs/operations/settings/settings#materialize_ttl_after_modify "Direct link to materialize_ttl_after_modify")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Apply TTL for old data, after ALTER MODIFY TTL query
## materialized\_views\_ignore\_errors[β](https://clickhouse.com/docs/operations/settings/settings#materialized_views_ignore_errors "Direct link to materialized_views_ignore_errors")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Allows to ignore errors for MATERIALIZED VIEW, and deliver original block to the table regardless of MVs
## materialized\_views\_squash\_parallel\_inserts[β](https://clickhouse.com/docs/operations/settings/settings#materialized_views_squash_parallel_inserts "Direct link to materialized_views_squash_parallel_inserts")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Squash inserts to materialized views destination table of a single INSERT query from parallel inserts to reduce amount of generated parts. If set to false and `parallel_view_processing` is enabled, INSERT query will generate part in the destination table for each `max_insert_thread`.
## max\_analyze\_depth[β](https://clickhouse.com/docs/operations/settings/settings#max_analyze_depth "Direct link to max_analyze_depth")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value5000 |
Maximum number of analyses performed by interpreter.
## max\_ast\_depth[β](https://clickhouse.com/docs/operations/settings/settings#max_ast_depth "Direct link to max_ast_depth")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value1000 |
The maximum nesting depth of a query syntactic tree. If exceeded, an exception is thrown.
Note
At this time, it isn't checked during parsing, but only after parsing the query. This means that a syntactic tree that is too deep can be created during parsing, but the query will fail.
## max\_ast\_elements[β](https://clickhouse.com/docs/operations/settings/settings#max_ast_elements "Direct link to max_ast_elements")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value50000 |
The maximum number of elements in a query syntactic tree. If exceeded, an exception is thrown.
Note
At this time, it isn't checked during parsing, but only after parsing the query. This means that a syntactic tree that is too deep can be created during parsing, but the query will fail.
## max\_autoincrement\_series[β](https://clickhouse.com/docs/operations/settings/settings#max_autoincrement_series "Direct link to max_autoincrement_series")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value1000 |
Version history
The limit on the number of series created by the `generateSerialID` function.
As each series represents a node in Keeper, it is recommended to have no more than a couple of millions of them.
## max\_backup\_bandwidth[β](https://clickhouse.com/docs/operations/settings/settings#max_backup_bandwidth "Direct link to max_backup_bandwidth")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
The maximum read speed in bytes per second for particular backup on server. Zero means unlimited.
## max\_block\_size[β](https://clickhouse.com/docs/operations/settings/settings#max_block_size "Direct link to max_block_size")
| Type | Default value |
|---|---|
| TypeNonZeroUInt64 | Default value65409 |
In ClickHouse, data is processed by blocks, which are sets of column parts. The internal processing cycles for a single block are efficient but there are noticeable costs when processing each block.
The `max_block_size` setting indicates the recommended maximum number of rows to include in a single block when loading data from tables. Blocks the size of `max_block_size` are not always loaded from the table: if ClickHouse determines that less data needs to be retrieved, a smaller block is processed.
The block size should not be too small to avoid noticeable costs when processing each block. It should also not be too large to ensure that queries with a LIMIT clause execute quickly after processing the first block. When setting `max_block_size`, the goal should be to avoid consuming too much memory when extracting a large number of columns in multiple threads and to preserve at least some cache locality.
## max\_bytes\_before\_external\_group\_by[β](https://clickhouse.com/docs/operations/settings/settings#max_bytes_before_external_group_by "Direct link to max_bytes_before_external_group_by")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Cloud default value: half the memory amount per replica.
Enables or disables execution of `GROUP BY` clauses in external memory. (See [GROUP BY in external memory](https://clickhouse.com/docs/sql-reference/statements/select/group-by#group-by-in-external-memory))
Possible values:
- Maximum volume of RAM (in bytes) that can be used by the single [GROUP BY](https://clickhouse.com/docs/sql-reference/statements/select/group-by) operation.
- `0` β `GROUP BY` in external memory disabled.
Note
If memory usage during GROUP BY operations is exceeding this threshold in bytes, activate the 'external aggregation' mode (spill data to disk).
The recommended value is half of the available system memory.
## max\_bytes\_before\_external\_sort[β](https://clickhouse.com/docs/operations/settings/settings#max_bytes_before_external_sort "Direct link to max_bytes_before_external_sort")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Cloud default value: half the memory amount per replica.
Enables or disables execution of `ORDER BY` clauses in external memory. See [ORDER BY Implementation Details](https://clickhouse.com/docs/sql-reference/statements/select/order-by#implementation-details) If memory usage during ORDER BY operation exceeds this threshold in bytes, the 'external sorting' mode (spill data to disk) is activated.
Possible values:
- Maximum volume of RAM (in bytes) that can be used by the single [ORDER BY](https://clickhouse.com/docs/sql-reference/statements/select/order-by) operation. The recommended value is half of available system memory
- `0` β `ORDER BY` in external memory disabled.
## max\_bytes\_before\_remerge\_sort[β](https://clickhouse.com/docs/operations/settings/settings#max_bytes_before_remerge_sort "Direct link to max_bytes_before_remerge_sort")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value1000000000 |
In case of ORDER BY with LIMIT, when memory usage is higher than specified threshold, perform additional steps of merging blocks before final merge to keep just top LIMIT rows.
## max\_bytes\_in\_distinct[β](https://clickhouse.com/docs/operations/settings/settings#max_bytes_in_distinct "Direct link to max_bytes_in_distinct")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
The maximum number of bytes of the state (in uncompressed bytes) in memory, which is used by a hash table when using DISTINCT.
## max\_bytes\_in\_join[β](https://clickhouse.com/docs/operations/settings/settings#max_bytes_in_join "Direct link to max_bytes_in_join")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
The maximum size in number of bytes of the hash table used when joining tables.
This setting applies to [SELECT ... JOIN](https://clickhouse.com/docs/sql-reference/statements/select/join) operations and the [Join table engine](https://clickhouse.com/docs/engines/table-engines/special/join).
If the query contains joins, ClickHouse checks this setting for every intermediate result.
ClickHouse can proceed with different actions when the limit is reached. Use the [join\_overflow\_mode](https://clickhouse.com/docs/operations/settings/settings#join_overflow_mode) settings to choose the action.
Possible values:
- Positive integer.
- 0 β Memory control is disabled.
## max\_bytes\_in\_set[β](https://clickhouse.com/docs/operations/settings/settings#max_bytes_in_set "Direct link to max_bytes_in_set")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
The maximum number of bytes (of uncompressed data) used by a set in the IN clause created from a subquery.
## max\_bytes\_ratio\_before\_external\_group\_by[β](https://clickhouse.com/docs/operations/settings/settings#max_bytes_ratio_before_external_group_by "Direct link to max_bytes_ratio_before_external_group_by")
| Type | Default value |
|---|---|
| TypeDouble | Default value0\.5 |
Version history
The ratio of available memory that is allowed for `GROUP BY`. Once reached, external memory is used for aggregation.
For example, if set to `0.6`, `GROUP BY` will allow using 60% of the available memory (to server/user/merges) at the beginning of the execution, after that, it will start using external aggregation.
## max\_bytes\_ratio\_before\_external\_sort[β](https://clickhouse.com/docs/operations/settings/settings#max_bytes_ratio_before_external_sort "Direct link to max_bytes_ratio_before_external_sort")
| Type | Default value |
|---|---|
| TypeDouble | Default value0\.5 |
Version history
The ratio of available memory that is allowed for `ORDER BY`. Once reached, external sort is used.
For example, if set to `0.6`, `ORDER BY` will allow using `60%` of available memory (to server/user/merges) at the beginning of the execution, after that, it will start using external sort.
Note, that `max_bytes_before_external_sort` is still respected, spilling to disk will be done only if the sorting block is bigger then `max_bytes_before_external_sort`.
## max\_bytes\_to\_read[β](https://clickhouse.com/docs/operations/settings/settings#max_bytes_to_read "Direct link to max_bytes_to_read")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
The maximum number of bytes (of uncompressed data) that can be read from a table when running a query. The restriction is checked for each processed chunk of data, applied only to the deepest table expression and when reading from a remote server, checked only on the remote server.
## max\_bytes\_to\_read\_leaf[β](https://clickhouse.com/docs/operations/settings/settings#max_bytes_to_read_leaf "Direct link to max_bytes_to_read_leaf")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
The maximum number of bytes (of uncompressed data) that can be read from a local table on a leaf node when running a distributed query. While distributed queries can issue a multiple sub-queries to each shard (leaf) - this limit will be checked only on the read stage on the leaf nodes and will be ignored on the merging of results stage on the root node.
For example, a cluster consists of 2 shards and each shard contains a table with 100 bytes of data. A distributed query which is supposed to read all the data from both tables with setting `max_bytes_to_read=150` will fail as in total it will be 200 bytes. A query with `max_bytes_to_read_leaf=150` will succeed since leaf nodes will read 100 bytes at max.
The restriction is checked for each processed chunk of data.
Note
This setting is unstable with `prefer_localhost_replica=1`.
## max\_bytes\_to\_sort[β](https://clickhouse.com/docs/operations/settings/settings#max_bytes_to_sort "Direct link to max_bytes_to_sort")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
The maximum number of bytes before sorting. If more than the specified amount of uncompressed bytes have to be processed for ORDER BY operation, the behavior will be determined by the `sort_overflow_mode` which by default is set to `throw`.
## max\_bytes\_to\_transfer[β](https://clickhouse.com/docs/operations/settings/settings#max_bytes_to_transfer "Direct link to max_bytes_to_transfer")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
The maximum number of bytes (uncompressed data) that can be passed to a remote server or saved in a temporary table when the GLOBAL IN/JOIN section is executed.
## max\_columns\_to\_read[β](https://clickhouse.com/docs/operations/settings/settings#max_columns_to_read "Direct link to max_columns_to_read")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
The maximum number of columns that can be read from a table in a single query. If a query requires reading more than the specified number of columns, an exception is thrown.
Tip
This setting is useful for preventing overly complex queries.
`0` value means unlimited.
## max\_compress\_block\_size[β](https://clickhouse.com/docs/operations/settings/settings#max_compress_block_size "Direct link to max_compress_block_size")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value1048576 |
The maximum size of blocks of uncompressed data before compressing for writing to a table. By default, 1,048,576 (1 MiB). Specifying a smaller block size generally leads to slightly reduced compression ratio, the compression and decompression speed increases slightly due to cache locality, and memory consumption is reduced.
Note
This is an expert-level setting, and you shouldn't change it if you're just getting started with ClickHouse.
Don't confuse blocks for compression (a chunk of memory consisting of bytes) with blocks for query processing (a set of rows from a table).
## max\_concurrent\_queries\_for\_all\_users[β](https://clickhouse.com/docs/operations/settings/settings#max_concurrent_queries_for_all_users "Direct link to max_concurrent_queries_for_all_users")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Throw exception if the value of this setting is less or equal than the current number of simultaneously processed queries.
Example: `max_concurrent_queries_for_all_users` can be set to 99 for all users and database administrator can set it to 100 for itself to run queries for investigation even when the server is overloaded.
Modifying the setting for one query or user does not affect other queries.
Possible values:
- Positive integer.
- 0 β No limit.
**Example**
```
<max_concurrent_queries_for_all_users>99</max_concurrent_queries_for_all_users>
```
**See Also**
- [max\_concurrent\_queries](https://clickhouse.com/docs/operations/server-configuration-parameters/settings#max_concurrent_queries)
Cloud default value: `1000`.
## max\_concurrent\_queries\_for\_user[β](https://clickhouse.com/docs/operations/settings/settings#max_concurrent_queries_for_user "Direct link to max_concurrent_queries_for_user")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
The maximum number of simultaneously processed queries per user.
Possible values:
- Positive integer.
- 0 β No limit.
**Example**
```
<max_concurrent_queries_for_user>5</max_concurrent_queries_for_user>
```
## max\_distributed\_connections[β](https://clickhouse.com/docs/operations/settings/settings#max_distributed_connections "Direct link to max_distributed_connections")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value1024 |
The maximum number of simultaneous connections with remote servers for distributed processing of a single query to a single Distributed table. We recommend setting a value no less than the number of servers in the cluster.
The following parameters are only used when creating Distributed tables (and when launching a server), so there is no reason to change them at runtime.
## max\_distributed\_depth[β](https://clickhouse.com/docs/operations/settings/settings#max_distributed_depth "Direct link to max_distributed_depth")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value5 |
Limits the maximum depth of recursive queries for [Distributed](https://clickhouse.com/docs/engines/table-engines/special/distributed) tables.
If the value is exceeded, the server throws an exception.
Possible values:
- Positive integer.
- 0 β Unlimited depth.
## max\_download\_buffer\_size[β](https://clickhouse.com/docs/operations/settings/settings#max_download_buffer_size "Direct link to max_download_buffer_size")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value10485760 |
The maximal size of buffer for parallel downloading (e.g. for URL engine) per each thread.
## max\_download\_threads[β](https://clickhouse.com/docs/operations/settings/settings#max_download_threads "Direct link to max_download_threads")
| Type | Default value |
|---|---|
| TypeMaxThreads | Default value4 |
The maximum number of threads to download data (e.g. for URL engine).
## max\_estimated\_execution\_time[β](https://clickhouse.com/docs/operations/settings/settings#max_estimated_execution_time "Direct link to max_estimated_execution_time")
| Type | Default value |
|---|---|
| TypeSeconds | Default value0 |
Version history
Maximum query estimate execution time in seconds. Checked on every data block when [`timeout_before_checking_execution_speed`](https://clickhouse.com/docs/operations/settings/settings#timeout_before_checking_execution_speed) expires.
## max\_execution\_speed[β](https://clickhouse.com/docs/operations/settings/settings#max_execution_speed "Direct link to max_execution_speed")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
The maximum number of execution rows per second. Checked on every data block when [`timeout_before_checking_execution_speed`](https://clickhouse.com/docs/operations/settings/settings#timeout_before_checking_execution_speed) expires. If the execution speed is high, the execution speed will be reduced.
## max\_execution\_speed\_bytes[β](https://clickhouse.com/docs/operations/settings/settings#max_execution_speed_bytes "Direct link to max_execution_speed_bytes")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
The maximum number of execution bytes per second. Checked on every data block when [`timeout_before_checking_execution_speed`](https://clickhouse.com/docs/operations/settings/settings#timeout_before_checking_execution_speed) expires. If the execution speed is high, the execution speed will be reduced.
## max\_execution\_time[β](https://clickhouse.com/docs/operations/settings/settings#max_execution_time "Direct link to max_execution_time")
| Type | Default value |
|---|---|
| TypeSeconds | Default value0 |
The maximum query execution time in seconds.
The `max_execution_time` parameter can be a bit tricky to understand. It operates based on interpolation relative to the current query execution speed (this behaviour is controlled by [`timeout_before_checking_execution_speed`](https://clickhouse.com/docs/operations/settings/settings#timeout_before_checking_execution_speed)).
ClickHouse will interrupt a query if the projected execution time exceeds the specified `max_execution_time`. By default, the `timeout_before_checking_execution_speed` is set to 10 seconds. This means that after 10 seconds of query execution, ClickHouse will begin estimating the total execution time. If, for example, `max_execution_time` is set to 3600 seconds (1 hour), ClickHouse will terminate the query if the estimated time exceeds this 3600-second limit. If you set `timeout_before_checking_execution_speed` to 0, ClickHouse will use the clock time as the basis for `max_execution_time`.
If query runtime exceeds the specified number of seconds, the behavior will be determined by the 'timeout\_overflow\_mode', which by default is set to `throw`.
Note
The timeout is checked and the query can stop only in designated places during data processing. It currently cannot stop during merging of aggregation states or during query analysis, and the actual run time will be higher than the value of this setting.
## max\_execution\_time\_leaf[β](https://clickhouse.com/docs/operations/settings/settings#max_execution_time_leaf "Direct link to max_execution_time_leaf")
| Type | Default value |
|---|---|
| TypeSeconds | Default value0 |
Similar semantically to [`max_execution_time`](https://clickhouse.com/docs/operations/settings/settings#max_execution_time) but only applied on leaf nodes for distributed or remote queries.
For example, if we want to limit the execution time on a leaf node to `10s` but have no limit on the initial node, instead of having `max_execution_time` in the nested subquery settings:
```
SELECT count()
FROM cluster(cluster, view(SELECT * FROM t SETTINGS max_execution_time = 10));
```
We can use `max_execution_time_leaf` as the query settings:
```
SELECT count()
FROM cluster(cluster, view(SELECT * FROM t)) SETTINGS max_execution_time_leaf = 10;
```
## max\_expanded\_ast\_elements[β](https://clickhouse.com/docs/operations/settings/settings#max_expanded_ast_elements "Direct link to max_expanded_ast_elements")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value500000 |
Maximum size of query syntax tree in number of nodes after expansion of aliases and the asterisk.
## max\_fetch\_partition\_retries\_count[β](https://clickhouse.com/docs/operations/settings/settings#max_fetch_partition_retries_count "Direct link to max_fetch_partition_retries_count")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value5 |
Amount of retries while fetching partition from another host.
## max\_final\_threads[β](https://clickhouse.com/docs/operations/settings/settings#max_final_threads "Direct link to max_final_threads")
| Type | Default value |
|---|---|
| TypeMaxThreads | Default value'auto(N)' |
Sets the maximum number of parallel threads for the `SELECT` query data read phase with the [FINAL](https://clickhouse.com/docs/sql-reference/statements/select/from#final-modifier) modifier.
Possible values:
- Positive integer.
- 0 or 1 β Disabled. `SELECT` queries are executed in a single thread.
## max\_http\_get\_redirects[β](https://clickhouse.com/docs/operations/settings/settings#max_http_get_redirects "Direct link to max_http_get_redirects")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Max number of HTTP GET redirects hops allowed. Ensures additional security measures are in place to prevent a malicious server from redirecting your requests to unexpected services.\\n\\nIt is the case when an external server redirects to another address, but that address appears to be internal to the company's infrastructure, and by sending an HTTP request to an internal server, you could request an internal API from the internal network, bypassing the auth, or even query other services, such as Redis or Memcached. When you don't have an internal infrastructure (including something running on your localhost), or you trust the server, it is safe to allow redirects. Although keep in mind, that if the URL uses HTTP instead of HTTPS, and you will have to trust not only the remote server but also your ISP and every network in the middle.
Cloud default value: `10`.
## max\_hyperscan\_regexp\_length[β](https://clickhouse.com/docs/operations/settings/settings#max_hyperscan_regexp_length "Direct link to max_hyperscan_regexp_length")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Defines the maximum length for each regular expression in the [hyperscan multi-match functions](https://clickhouse.com/docs/sql-reference/functions/string-search-functions#multiMatchAny).
Possible values:
- Positive integer.
- 0 - The length is not limited.
**Example**
Query:
```
SELECT multiMatchAny('abcd', ['ab','bcd','c','d']) SETTINGS max_hyperscan_regexp_length = 3;
```
Result:
```
ββmultiMatchAny('abcd', ['ab', 'bcd', 'c', 'd'])ββ
β 1 β
ββββββββββββββββββββββββββββββββββββββββββββββββββ
```
Query:
```
SELECT multiMatchAny('abcd', ['ab','bcd','c','d']) SETTINGS max_hyperscan_regexp_length = 2;
```
Result:
```
Exception: Regexp length too large.
```
**See Also**
- [max\_hyperscan\_regexp\_total\_length](https://clickhouse.com/docs/operations/settings/settings#max_hyperscan_regexp_total_length)
## max\_hyperscan\_regexp\_total\_length[β](https://clickhouse.com/docs/operations/settings/settings#max_hyperscan_regexp_total_length "Direct link to max_hyperscan_regexp_total_length")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Sets the maximum length total of all regular expressions in each [hyperscan multi-match function](https://clickhouse.com/docs/sql-reference/functions/string-search-functions#multiMatchAny).
Possible values:
- Positive integer.
- 0 - The length is not limited.
**Example**
Query:
```
SELECT multiMatchAny('abcd', ['a','b','c','d']) SETTINGS max_hyperscan_regexp_total_length = 5;
```
Result:
```
ββmultiMatchAny('abcd', ['a', 'b', 'c', 'd'])ββ
β 1 β
βββββββββββββββββββββββββββββββββββββββββββββββ
```
Query:
```
SELECT multiMatchAny('abcd', ['ab','bc','c','d']) SETTINGS max_hyperscan_regexp_total_length = 5;
```
Result:
```
Exception: Total regexp lengths too large.
```
**See Also**
- [max\_hyperscan\_regexp\_length](https://clickhouse.com/docs/operations/settings/settings#max_hyperscan_regexp_length)
## max\_insert\_block\_size[β](https://clickhouse.com/docs/operations/settings/settings#max_insert_block_size "Direct link to max_insert_block_size")
**Aliases**: `max_insert_block_size_rows`
| Type | Default value |
|---|---|
| TypeNonZeroUInt64 | Default value1048449 |
The maximum size of blocks (in a count of rows) to form for insertion into a table.
This setting controls block formation in two contexts:
1. Format parsing: When the server parses row-based input formats (CSV, TSV, JSONEachRow, etc.) from any interface (HTTP, clickhouse-client with inline data, gRPC, PostgreSQL wire protocol), blocks are emitted when:
- Both min\_insert\_block\_size\_rows AND min\_insert\_block\_size\_bytes are reached, OR
- Either max\_insert\_block\_size\_rows OR max\_insert\_block\_size\_bytes is reached
Note: When using clickhouse-client or clickhouse-local to read from a file, the client itself parses the data and this setting applies on the client side.
2. INSERT operations: During INSERT queries and when data flows through materialized views, this setting's behavior depends on `use_strict_insert_block_limits`:
- When enabled: Blocks are emitted when:
- Min thresholds (AND): Both min\_insert\_block\_size\_rows AND min\_insert\_block\_size\_bytes are reached
- Max thresholds (OR): Either max\_insert\_block\_size\_rows OR max\_insert\_block\_size\_bytes is reached
- When disabled: Blocks are emitted when min\_insert\_block\_size\_rows OR min\_insert\_block\_size\_bytes is reached. The max\_insert\_block\_size settings are not enforced.
Possible values:
- Positive integer.
## max\_insert\_block\_size\_bytes[β](https://clickhouse.com/docs/operations/settings/settings#max_insert_block_size_bytes "Direct link to max_insert_block_size_bytes")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Version history
The maximum size of blocks (in bytes) to form for insertion into a table.
This setting works together with max\_insert\_block\_size\_rows and controls block formation in the same context. See max\_insert\_block\_size\_rows for detailed information about when and how these settings are applied.
Possible values:
- Positive integer.
- 0 β setting does not participate in block formation.
## max\_insert\_delayed\_streams\_for\_parallel\_write[β](https://clickhouse.com/docs/operations/settings/settings#max_insert_delayed_streams_for_parallel_write "Direct link to max_insert_delayed_streams_for_parallel_write")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
The maximum number of streams (columns) to delay final part flush. Default - auto (100 in case of underlying storage supports parallel write, for example S3 and disabled otherwise)
Cloud default value: `50`.
## max\_insert\_threads[β](https://clickhouse.com/docs/operations/settings/settings#max_insert_threads "Direct link to max_insert_threads")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
The maximum number of threads to execute the `INSERT SELECT` query.
Possible values:
- 0 (or 1) β `INSERT SELECT` no parallel execution.
- Positive integer. Bigger than 1.
Cloud default value:
- `1` for nodes with 8 GiB memory
- `2` for nodes with 16 GiB memory
- `4` for larger nodes
Parallel `INSERT SELECT` has effect only if the `SELECT` part is executed in parallel, see [`max_threads`](https://clickhouse.com/docs/operations/settings/settings#max_threads) setting. Higher values will lead to higher memory usage.
## max\_joined\_block\_size\_bytes[β](https://clickhouse.com/docs/operations/settings/settings#max_joined_block_size_bytes "Direct link to max_joined_block_size_bytes")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value4194304 |
Version history
Maximum block size in bytes for JOIN result (if join algorithm supports it). 0 means unlimited.
## max\_joined\_block\_size\_rows[β](https://clickhouse.com/docs/operations/settings/settings#max_joined_block_size_rows "Direct link to max_joined_block_size_rows")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value65409 |
Maximum block size for JOIN result (if join algorithm supports it). 0 means unlimited.
## max\_limit\_for\_vector\_search\_queries[β](https://clickhouse.com/docs/operations/settings/settings#max_limit_for_vector_search_queries "Direct link to max_limit_for_vector_search_queries")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value1000 |
Version history
SELECT queries with LIMIT bigger than this setting cannot use vector similarity indices. Helps to prevent memory overflows in vector similarity indices.
## max\_local\_read\_bandwidth[β](https://clickhouse.com/docs/operations/settings/settings#max_local_read_bandwidth "Direct link to max_local_read_bandwidth")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
The maximum speed of local reads in bytes per second.
## max\_local\_write\_bandwidth[β](https://clickhouse.com/docs/operations/settings/settings#max_local_write_bandwidth "Direct link to max_local_write_bandwidth")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
The maximum speed of local writes in bytes per second.
## max\_memory\_usage[β](https://clickhouse.com/docs/operations/settings/settings#max_memory_usage "Direct link to max_memory_usage")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Cloud default value: depends on the amount of RAM on the replica.
The maximum amount of RAM to use for running a query on a single server. A value of `0` means unlimited.
This setting does not consider the volume of available memory or the total volume of memory on the machine. The restriction applies to a single query within a single server.
You can use `SHOW PROCESSLIST` to see the current memory consumption for each query. Peak memory consumption is tracked for each query and written to the log.
Memory usage is not fully tracked for states of the following aggregate functions from `String` and `Array` arguments:
- `min`
- `max`
- `any`
- `anyLast`
- `argMin`
- `argMax`
Memory consumption is also restricted by the parameters [`max_memory_usage_for_user`](https://clickhouse.com/docs/operations/settings/settings#max_memory_usage_for_user) and [`max_server_memory_usage`](https://clickhouse.com/docs/operations/server-configuration-parameters/settings#max_server_memory_usage).
## max\_memory\_usage\_for\_user[β](https://clickhouse.com/docs/operations/settings/settings#max_memory_usage_for_user "Direct link to max_memory_usage_for_user")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
The maximum amount of RAM to use for running a user's queries on a single server. Zero means unlimited.
By default, the amount is not restricted (`max_memory_usage_for_user = 0`).
Also see the description of [`max_memory_usage`](https://clickhouse.com/docs/operations/settings/settings#max_memory_usage).
For example if you want to set `max_memory_usage_for_user` to 1000 bytes for a user named `clickhouse_read`, you can use the statement
```
ALTER USER clickhouse_read SETTINGS max_memory_usage_for_user = 1000;
```
You can verify it worked by logging out of your client, logging back in, then use the `getSetting` function:
```
SELECT getSetting('max_memory_usage_for_user');
```
## max\_network\_bandwidth[β](https://clickhouse.com/docs/operations/settings/settings#max_network_bandwidth "Direct link to max_network_bandwidth")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Limits the speed of the data exchange over the network in bytes per second. This setting applies to every query.
Possible values:
- Positive integer.
- 0 β Bandwidth control is disabled.
## max\_network\_bandwidth\_for\_all\_users[β](https://clickhouse.com/docs/operations/settings/settings#max_network_bandwidth_for_all_users "Direct link to max_network_bandwidth_for_all_users")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Limits the speed that data is exchanged at over the network in bytes per second. This setting applies to all concurrently running queries on the server.
Possible values:
- Positive integer.
- 0 β Control of the data speed is disabled.
## max\_network\_bandwidth\_for\_user[β](https://clickhouse.com/docs/operations/settings/settings#max_network_bandwidth_for_user "Direct link to max_network_bandwidth_for_user")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Limits the speed of the data exchange over the network in bytes per second. This setting applies to all concurrently running queries performed by a single user.
Possible values:
- Positive integer.
- 0 β Control of the data speed is disabled.
## max\_network\_bytes[β](https://clickhouse.com/docs/operations/settings/settings#max_network_bytes "Direct link to max_network_bytes")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Limits the data volume (in bytes) that is received or transmitted over the network when executing a query. This setting applies to every individual query.
Possible values:
- Positive integer.
- 0 β Data volume control is disabled.
## max\_number\_of\_partitions\_for\_independent\_aggregation[β](https://clickhouse.com/docs/operations/settings/settings#max_number_of_partitions_for_independent_aggregation "Direct link to max_number_of_partitions_for_independent_aggregation")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value128 |
Maximal number of partitions in table to apply optimizatio
## max\_os\_cpu\_wait\_time\_ratio\_to\_throw[β](https://clickhouse.com/docs/operations/settings/settings#max_os_cpu_wait_time_ratio_to_throw "Direct link to max_os_cpu_wait_time_ratio_to_throw")
| Type | Default value |
|---|---|
| TypeFloat | Default value0 |
Version history
Max ratio between OS CPU wait (OSCPUWaitMicroseconds metric) and busy (OSCPUVirtualTimeMicroseconds metric) times to consider rejecting queries. Linear interpolation between min and max ratio is used to calculate the probability, the probability is 1 at this point.
## max\_parallel\_replicas[β](https://clickhouse.com/docs/operations/settings/settings#max_parallel_replicas "Direct link to max_parallel_replicas")
| Type | Default value |
|---|---|
| TypeNonZeroUInt64 | Default value1000 |
Version history
The maximum number of replicas for each shard when executing a query.
Possible values:
- Positive integer.
**Additional Info**
This options will produce different results depending on the settings used.
Note
This setting will produce incorrect results when joins or subqueries are involved, and all tables don't meet certain requirements. See [Distributed Subqueries and max\_parallel\_replicas](https://clickhouse.com/docs/operations/settings/settings#max_parallel_replicas) for more details.
### Parallel processing using `SAMPLE` key[β](https://clickhouse.com/docs/operations/settings/settings#parallel-processing-using-sample-key "Direct link to parallel-processing-using-sample-key")
A query may be processed faster if it is executed on several servers in parallel. But the query performance may degrade in the following cases:
- The position of the sampling key in the partitioning key does not allow efficient range scans.
- Adding a sampling key to the table makes filtering by other columns less efficient.
- The sampling key is an expression that is expensive to calculate.
- The cluster latency distribution has a long tail, so that querying more servers increases the query overall latency.
### Parallel processing using [parallel\_replicas\_custom\_key](https://clickhouse.com/docs/operations/settings/settings#parallel_replicas_custom_key)[β](https://clickhouse.com/docs/operations/settings/settings#parallel-processing-using-parallel_replicas_custom_key "Direct link to parallel-processing-using-parallel_replicas_custom_key")
This setting is useful for any replicated table.
## max\_parser\_backtracks[β](https://clickhouse.com/docs/operations/settings/settings#max_parser_backtracks "Direct link to max_parser_backtracks")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value1000000 |
Version history
Maximum parser backtracking (how many times it tries different alternatives in the recursive descend parsing process).
## max\_parser\_depth[β](https://clickhouse.com/docs/operations/settings/settings#max_parser_depth "Direct link to max_parser_depth")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value1000 |
Limits maximum recursion depth in the recursive descent parser. Allows controlling the stack size.
Possible values:
- Positive integer.
- 0 β Recursion depth is unlimited.
## max\_parsing\_threads[β](https://clickhouse.com/docs/operations/settings/settings#max_parsing_threads "Direct link to max_parsing_threads")
| Type | Default value |
|---|---|
| TypeMaxThreads | Default value'auto(N)' |
Version history
The maximum number of threads to parse data in input formats that support parallel parsing. By default, it is determined automatically.
## max\_partition\_size\_to\_drop[β](https://clickhouse.com/docs/operations/settings/settings#max_partition_size_to_drop "Direct link to max_partition_size_to_drop")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value50000000000 |
Restriction on dropping partitions in query time. The value `0` means that you can drop partitions without any restrictions.
Cloud default value: 1 TB.
Note
This query setting overwrites its server setting equivalent, see [max\_partition\_size\_to\_drop](https://clickhouse.com/docs/operations/server-configuration-parameters/settings#max_partition_size_to_drop)
## max\_partitions\_per\_insert\_block[β](https://clickhouse.com/docs/operations/settings/settings#max_partitions_per_insert_block "Direct link to max_partitions_per_insert_block")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value100 |
Version history
Limits the maximum number of partitions in a single inserted block and an exception is thrown if the block contains too many partitions.
- Positive integer.
- `0` β Unlimited number of partitions.
**Details**
When inserting data, ClickHouse calculates the number of partitions in the inserted block. If the number of partitions is more than `max_partitions_per_insert_block`, ClickHouse either logs a warning or throws an exception based on `throw_on_max_partitions_per_insert_block`. Exceptions have the following text:
> "Too many partitions for a single INSERT block (`partitions_count` partitions, limit is " + toString(max\_partitions) + "). The limit is controlled by the 'max\_partitions\_per\_insert\_block' setting. A large number of partitions is a common misconception. It will lead to severe negative performance impact, including slow server startup, slow INSERT queries and slow SELECT queries. Recommended total number of partitions for a table is under 1000..10000. Please note, that partitioning is not intended to speed up SELECT queries (ORDER BY key is sufficient to make range queries fast). Partitions are intended for data manipulation (DROP PARTITION, etc)."
Note
This setting is a safety threshold because using a large number of partitions is a common misconception.
## max\_partitions\_to\_read[β](https://clickhouse.com/docs/operations/settings/settings#max_partitions_to_read "Direct link to max_partitions_to_read")
| Type | Default value |
|---|---|
| TypeInt64 | Default value\-1 |
Limits the maximum number of partitions that can be accessed in a single query.
The setting value specified when the table is created can be overridden via query-level setting.
Possible values:
- Positive integer
- `-1` - unlimited (default)
Note
You can also specify the MergeTree setting [`max_partitions_to_read`](https://clickhouse.com/docs/operations/settings/settings#max_partitions_to_read) in tables' setting.
## max\_parts\_to\_move[β](https://clickhouse.com/docs/operations/settings/settings#max_parts_to_move "Direct link to max_parts_to_move")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value1000 |
Version history
Limit the number of parts that can be moved in one query. Zero means unlimited.
## max\_projection\_rows\_to\_use\_projection\_index[β](https://clickhouse.com/docs/operations/settings/settings#max_projection_rows_to_use_projection_index "Direct link to max_projection_rows_to_use_projection_index")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value1000000 |
Version history
If the number of rows to read from the projection index is less than or equal to this threshold, ClickHouse will try to apply the projection index during query execution.
## max\_query\_size[β](https://clickhouse.com/docs/operations/settings/settings#max_query_size "Direct link to max_query_size")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value262144 |
The maximum number of bytes of a query string parsed by the SQL parser. Data in the VALUES clause of INSERT queries is processed by a separate stream parser (that consumes O(1) RAM) and not affected by this restriction.
Note
`max_query_size` cannot be set within an SQL query (e.g., `SELECT now() SETTINGS max_query_size=10000`) because ClickHouse needs to allocate a buffer to parse the query, and this buffer size is determined by the `max_query_size` setting, which must be configured before the query is executed.
## max\_rand\_distribution\_parameter[β](https://clickhouse.com/docs/operations/settings/settings#max_rand_distribution_parameter "Direct link to max_rand_distribution_parameter")
| Type | Default value |
|---|---|
| TypeFloat | Default value1000000 |
Version history
Maximum value for distribution shape parameters in random distribution functions such as `randChiSquared`, `randStudentT`, and `randFisherF`. This prevents extremely long computation times with extreme parameter values.
## max\_rand\_distribution\_trials[β](https://clickhouse.com/docs/operations/settings/settings#max_rand_distribution_trials "Direct link to max_rand_distribution_trials")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value1000000000 |
Version history
Maximum number of trials allowed for random distribution functions such as `randBinomial` and `randNegativeBinomial`. This prevents extremely long computation times with large trial counts.
## max\_read\_buffer\_size[β](https://clickhouse.com/docs/operations/settings/settings#max_read_buffer_size "Direct link to max_read_buffer_size")
| Type | Default value |
|---|---|
| TypeNonZeroUInt64 | Default value1048576 |
The maximum size of the buffer to read from the filesystem.
## max\_read\_buffer\_size\_local\_fs[β](https://clickhouse.com/docs/operations/settings/settings#max_read_buffer_size_local_fs "Direct link to max_read_buffer_size_local_fs")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value131072 |
The maximum size of the buffer to read from local filesystem. If set to 0 then max\_read\_buffer\_size will be used.
## max\_read\_buffer\_size\_remote\_fs[β](https://clickhouse.com/docs/operations/settings/settings#max_read_buffer_size_remote_fs "Direct link to max_read_buffer_size_remote_fs")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
The maximum size of the buffer to read from remote filesystem. If set to 0 then max\_read\_buffer\_size will be used.
## max\_recursive\_cte\_evaluation\_depth[β](https://clickhouse.com/docs/operations/settings/settings#max_recursive_cte_evaluation_depth "Direct link to max_recursive_cte_evaluation_depth")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value1000 |
Version history
Maximum limit on recursive CTE evaluation depth
## max\_remote\_read\_network\_bandwidth[β](https://clickhouse.com/docs/operations/settings/settings#max_remote_read_network_bandwidth "Direct link to max_remote_read_network_bandwidth")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
The maximum speed of data exchange over the network in bytes per second for read.
## max\_remote\_write\_network\_bandwidth[β](https://clickhouse.com/docs/operations/settings/settings#max_remote_write_network_bandwidth "Direct link to max_remote_write_network_bandwidth")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
The maximum speed of data exchange over the network in bytes per second for write.
## max\_replica\_delay\_for\_distributed\_queries[β](https://clickhouse.com/docs/operations/settings/settings#max_replica_delay_for_distributed_queries "Direct link to max_replica_delay_for_distributed_queries")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value300 |
Disables lagging replicas for distributed queries. See [Replication](https://clickhouse.com/docs/engines/table-engines/mergetree-family/replication).
Sets the time in seconds. If a replica's lag is greater than or equal to the set value, this replica is not used.
Possible values:
- Positive integer.
- 0 β Replica lags are not checked.
To prevent the use of any replica with a non-zero lag, set this parameter to 1.
Used when performing `SELECT` from a distributed table that points to replicated tables.
## max\_result\_bytes[β](https://clickhouse.com/docs/operations/settings/settings#max_result_bytes "Direct link to max_result_bytes")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Limits the result size in bytes (uncompressed). The query will stop after processing a block of data if the threshold is met, but it will not cut the last block of the result, therefore the result size can be larger than the threshold.
**Caveats**
The result size in memory is taken into account for this threshold. Even if the result size is small, it can reference larger data structures in memory, representing dictionaries of LowCardinality columns, and Arenas of AggregateFunction columns, so the threshold can be exceeded despite the small result size.
Note
The setting is fairly low level and should be used with caution
## max\_result\_rows[β](https://clickhouse.com/docs/operations/settings/settings#max_result_rows "Direct link to max_result_rows")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Cloud default value: `0`.
Limits the number of rows in the result. Also checked for subqueries, and on remote servers when running parts of a distributed query. No limit is applied when the value is `0`.
The query will stop after processing a block of data if the threshold is met, but it will not cut the last block of the result, therefore the result size can be larger than the threshold.
## max\_reverse\_dictionary\_lookup\_cache\_size\_bytes[β](https://clickhouse.com/docs/operations/settings/settings#max_reverse_dictionary_lookup_cache_size_bytes "Direct link to max_reverse_dictionary_lookup_cache_size_bytes")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value104857600 |
Version history
Maximum size in bytes of the per-query reverse dictionary lookup cache used by the function `dictGetKeys`. The cache stores serialized key tuples per attribute value to avoid re-scanning the dictionary within the same query. When the limit is reached, entries are evicted using LRU. Set to 0 to disable caching.
## max\_rows\_in\_distinct[β](https://clickhouse.com/docs/operations/settings/settings#max_rows_in_distinct "Direct link to max_rows_in_distinct")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
The maximum number of different rows when using DISTINCT.
## max\_rows\_in\_join[β](https://clickhouse.com/docs/operations/settings/settings#max_rows_in_join "Direct link to max_rows_in_join")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Limits the number of rows in the hash table that is used when joining tables.
This settings applies to [SELECT ... JOIN](https://clickhouse.com/docs/sql-reference/statements/select/join) operations and the [Join](https://clickhouse.com/docs/engines/table-engines/special/join) table engine.
If a query contains multiple joins, ClickHouse checks this setting for every intermediate result.
ClickHouse can proceed with different actions when the limit is reached. Use the [`join_overflow_mode`](https://clickhouse.com/docs/operations/settings/settings#join_overflow_mode) setting to choose the action.
Possible values:
- Positive integer.
- `0` β Unlimited number of rows.
## max\_rows\_in\_set[β](https://clickhouse.com/docs/operations/settings/settings#max_rows_in_set "Direct link to max_rows_in_set")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
The maximum number of rows for a data set in the IN clause created from a subquery.
## max\_rows\_in\_set\_to\_optimize\_join[β](https://clickhouse.com/docs/operations/settings/settings#max_rows_in_set_to_optimize_join "Direct link to max_rows_in_set_to_optimize_join")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Version history
Maximal size of the set to filter joined tables by each other's row sets before joining.
Possible values:
- 0 β Disable.
- Any positive integer.
## max\_rows\_to\_group\_by[β](https://clickhouse.com/docs/operations/settings/settings#max_rows_to_group_by "Direct link to max_rows_to_group_by")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
The maximum number of unique keys received from aggregation. This setting lets you limit memory consumption when aggregating.
If aggregation during GROUP BY is generating more than the specified number of rows (unique GROUP BY keys), the behavior will be determined by the 'group\_by\_overflow\_mode' which by default is `throw`, but can be also switched to an approximate GROUP BY mode.
## max\_rows\_to\_read[β](https://clickhouse.com/docs/operations/settings/settings#max_rows_to_read "Direct link to max_rows_to_read")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
The maximum number of rows that can be read from a table when running a query. The restriction is checked for each processed chunk of data, applied only to the deepest table expression and when reading from a remote server, checked only on the remote server.
## max\_rows\_to\_read\_leaf[β](https://clickhouse.com/docs/operations/settings/settings#max_rows_to_read_leaf "Direct link to max_rows_to_read_leaf")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
The maximum number of rows that can be read from a local table on a leaf node when running a distributed query. While distributed queries can issue multiple sub-queries to each shard (leaf) - this limit will be checked only on the read stage on the leaf nodes and ignored on the merging of results stage on the root node.
For example, a cluster consists of 2 shards and each shard contains a table with 100 rows. The distributed query which is supposed to read all the data from both tables with setting `max_rows_to_read=150` will fail, as in total there will be 200 rows. A query with `max_rows_to_read_leaf=150` will succeed, since leaf nodes will read at max 100 rows.
The restriction is checked for each processed chunk of data.
Note
This setting is unstable with `prefer_localhost_replica=1`.
## max\_rows\_to\_sort[β](https://clickhouse.com/docs/operations/settings/settings#max_rows_to_sort "Direct link to max_rows_to_sort")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
The maximum number of rows before sorting. This allows you to limit memory consumption when sorting. If more than the specified amount of records have to be processed for the ORDER BY operation, the behavior will be determined by the `sort_overflow_mode` which by default is set to `throw`.
## max\_rows\_to\_transfer[β](https://clickhouse.com/docs/operations/settings/settings#max_rows_to_transfer "Direct link to max_rows_to_transfer")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Maximum size (in rows) that can be passed to a remote server or saved in a temporary table when the GLOBAL IN/JOIN section is executed.
## max\_sessions\_for\_user[β](https://clickhouse.com/docs/operations/settings/settings#max_sessions_for_user "Direct link to max_sessions_for_user")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Maximum number of simultaneous sessions per authenticated user to the ClickHouse server.
Example:
```
<profiles>
<single_session_profile>
<max_sessions_for_user>1</max_sessions_for_user>
</single_session_profile>
<two_sessions_profile>
<max_sessions_for_user>2</max_sessions_for_user>
</two_sessions_profile>
<unlimited_sessions_profile>
<max_sessions_for_user>0</max_sessions_for_user>
</unlimited_sessions_profile>
</profiles>
<users>
<!-- User Alice can connect to a ClickHouse server no more than once at a time. -->
<Alice>
<profile>single_session_user</profile>
</Alice>
<!-- User Bob can use 2 simultaneous sessions. -->
<Bob>
<profile>two_sessions_profile</profile>
</Bob>
<!-- User Charles can use arbitrarily many of simultaneous sessions. -->
<Charles>
<profile>unlimited_sessions_profile</profile>
</Charles>
</users>
```
Possible values:
- Positive integer
- `0` - infinite count of simultaneous sessions (default)
## max\_size\_to\_preallocate\_for\_aggregation[β](https://clickhouse.com/docs/operations/settings/settings#max_size_to_preallocate_for_aggregation "Direct link to max_size_to_preallocate_for_aggregation")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value1000000000000 |
Version history
For how many elements it is allowed to preallocate space in all hash tables in total before aggregatio
## max\_size\_to\_preallocate\_for\_joins[β](https://clickhouse.com/docs/operations/settings/settings#max_size_to_preallocate_for_joins "Direct link to max_size_to_preallocate_for_joins")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value1000000000000 |
Version history
For how many elements it is allowed to preallocate space in all hash tables in total before joi
## max\_skip\_unavailable\_shards\_num[β](https://clickhouse.com/docs/operations/settings/settings#max_skip_unavailable_shards_num "Direct link to max_skip_unavailable_shards_num")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Version history
When `skip_unavailable_shards` is enabled, limits the maximum number of shards that can be silently skipped. If the number of unavailable shards exceeds this value, an exception is thrown instead of silently skipping.
A value of 0 means no limit (default behavior β all unavailable shards can be skipped).
## max\_skip\_unavailable\_shards\_ratio[β](https://clickhouse.com/docs/operations/settings/settings#max_skip_unavailable_shards_ratio "Direct link to max_skip_unavailable_shards_ratio")
| Type | Default value |
|---|---|
| TypeFloat | Default value0 |
Version history
When `skip_unavailable_shards` is enabled, limits the maximum ratio (0 to 1) of shards that can be silently skipped. If the ratio of unavailable shards to total shards exceeds this value, an exception is thrown instead of silently skipping.
A value of 0 means no limit (default behavior β all unavailable shards can be skipped).
## max\_streams\_for\_files\_processing\_in\_cluster\_functions[β](https://clickhouse.com/docs/operations/settings/settings#max_streams_for_files_processing_in_cluster_functions "Direct link to max_streams_for_files_processing_in_cluster_functions")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Version history
If is not zero, limit the number of threads reading data from files in \*Cluster table functions.
## max\_streams\_for\_merge\_tree\_reading[β](https://clickhouse.com/docs/operations/settings/settings#max_streams_for_merge_tree_reading "Direct link to max_streams_for_merge_tree_reading")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
If is not zero, limit the number of reading streams for MergeTree table.
## max\_streams\_multiplier\_for\_merge\_tables[β](https://clickhouse.com/docs/operations/settings/settings#max_streams_multiplier_for_merge_tables "Direct link to max_streams_multiplier_for_merge_tables")
| Type | Default value |
|---|---|
| TypeFloat | Default value5 |
Ask more streams when reading from Merge table. Streams will be spread across tables that Merge table will use. This allows more even distribution of work across threads and is especially helpful when merged tables differ in size.
## max\_streams\_to\_max\_threads\_ratio[β](https://clickhouse.com/docs/operations/settings/settings#max_streams_to_max_threads_ratio "Direct link to max_streams_to_max_threads_ratio")
| Type | Default value |
|---|---|
| TypeFloat | Default value1 |
Allows you to use more sources than the number of threads - to more evenly distribute work across threads. It is assumed that this is a temporary solution since it will be possible in the future to make the number of sources equal to the number of threads, but for each source to dynamically select available work for itself.
## max\_subquery\_depth[β](https://clickhouse.com/docs/operations/settings/settings#max_subquery_depth "Direct link to max_subquery_depth")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value100 |
If a query has more than the specified number of nested subqueries, throws an exception.
Tip
This allows you to have a sanity check to protect against the users of your cluster from writing overly complex queries.
## max\_table\_size\_to\_drop[β](https://clickhouse.com/docs/operations/settings/settings#max_table_size_to_drop "Direct link to max_table_size_to_drop")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value50000000000 |
Restriction on deleting tables in query time. The value `0` means that you can delete all tables without any restrictions.
Cloud default value: 1 TB.
Note
This query setting overwrites its server setting equivalent, see [max\_table\_size\_to\_drop](https://clickhouse.com/docs/operations/server-configuration-parameters/settings#max_table_size_to_drop)
## max\_temporary\_columns[β](https://clickhouse.com/docs/operations/settings/settings#max_temporary_columns "Direct link to max_temporary_columns")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
The maximum number of temporary columns that must be kept in RAM simultaneously when running a query, including constant columns. If a query generates more than the specified number of temporary columns in memory as a result of intermediate calculation, then an exception is thrown.
Tip
This setting is useful for preventing overly complex queries.
`0` value means unlimited.
## max\_temporary\_data\_on\_disk\_size\_for\_query[β](https://clickhouse.com/docs/operations/settings/settings#max_temporary_data_on_disk_size_for_query "Direct link to max_temporary_data_on_disk_size_for_query")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
The maximum amount of data consumed by temporary files on disk in bytes for all concurrently running queries.
Possible values:
- Positive integer.
- `0` β unlimited (default)
## max\_temporary\_data\_on\_disk\_size\_for\_user[β](https://clickhouse.com/docs/operations/settings/settings#max_temporary_data_on_disk_size_for_user "Direct link to max_temporary_data_on_disk_size_for_user")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
The maximum amount of data consumed by temporary files on disk in bytes for all concurrently running user queries.
Possible values:
- Positive integer.
- `0` β unlimited (default)
## max\_temporary\_non\_const\_columns[β](https://clickhouse.com/docs/operations/settings/settings#max_temporary_non_const_columns "Direct link to max_temporary_non_const_columns")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Like `max_temporary_columns`, the maximum number of temporary columns that must be kept in RAM simultaneously when running a query, but without counting constant columns.
Note
Constant columns are formed fairly often when running a query, but they require approximately zero computing resources.
## max\_threads[β](https://clickhouse.com/docs/operations/settings/settings#max_threads "Direct link to max_threads")
| Type | Default value |
|---|---|
| TypeMaxThreads | Default value'auto(N)' |
The maximum number of query processing threads, excluding threads for retrieving data from remote servers (see the ['max\_distributed\_connections'](https://clickhouse.com/docs/operations/settings/settings#max_distributed_connections) parameter).
This parameter applies to threads that perform the same stages of the query processing pipeline in parallel. For example, when reading from a table, if it is possible to evaluate expressions with functions, filter with `WHERE` and pre-aggregate for `GROUP BY` in parallel using at least 'max\_threads' number of threads, then 'max\_threads' are used.
For queries that are completed quickly because of a LIMIT, you can set a lower 'max\_threads'. For example, if the necessary number of entries are located in every block and max\_threads = 8, then 8 blocks are retrieved, although it would have been enough to read just one. The smaller the `max_threads` value, the less memory is consumed.
The `max_threads` setting by default matches the number of hardware threads (number of CPU cores) available to ClickHouse. As a special case, for x86 processors with less than 32 CPU cores and SMT (e.g. Intel HyperThreading), ClickHouse uses the number of logical cores (= 2 x physical core count) by default.
Without SMT (e.g. Intel HyperThreading), this corresponds to the number of CPU cores.
For ClickHouse Cloud users, the default value will display as `auto(N)` where N matches the vCPU size of your service e.g. 2vCPU/8GiB, 4vCPU/16GiB etc. See the settings tab in the Cloud console for a list of all service sizes.
## max\_threads\_for\_indexes[β](https://clickhouse.com/docs/operations/settings/settings#max_threads_for_indexes "Direct link to max_threads_for_indexes")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
The maximum number of threads process indices.
## max\_untracked\_memory[β](https://clickhouse.com/docs/operations/settings/settings#max_untracked_memory "Direct link to max_untracked_memory")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value4194304 |
Small allocations and deallocations are grouped in thread local variable and tracked or profiled only when an amount (in absolute value) becomes larger than the specified value. If the value is higher than 'memory\_profiler\_step' it will be effectively lowered to 'memory\_profiler\_step'.
## max\_wkb\_geometry\_elements[β](https://clickhouse.com/docs/operations/settings/settings#max_wkb_geometry_elements "Direct link to max_wkb_geometry_elements")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value1000000 |
Version history
Maximum number of points, rings, or polygons allowed in a single WKB geometry element during parsing by `readWKB` and related functions. This protects against excessive memory allocations from malformed WKB data. Set to 0 to use the hard-coded limit (100 million).
## memory\_overcommit\_ratio\_denominator[β](https://clickhouse.com/docs/operations/settings/settings#memory_overcommit_ratio_denominator "Direct link to memory_overcommit_ratio_denominator")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value1073741824 |
Version history
It represents the soft memory limit when the hard limit is reached on the global level. This value is used to compute the overcommit ratio for the query. Zero means skip the query. Read more about [memory overcommit](https://clickhouse.com/docs/operations/settings/memory-overcommit).
## memory\_overcommit\_ratio\_denominator\_for\_user[β](https://clickhouse.com/docs/operations/settings/settings#memory_overcommit_ratio_denominator_for_user "Direct link to memory_overcommit_ratio_denominator_for_user")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value1073741824 |
Version history
It represents the soft memory limit when the hard limit is reached on the user level. This value is used to compute the overcommit ratio for the query. Zero means skip the query. Read more about [memory overcommit](https://clickhouse.com/docs/operations/settings/memory-overcommit).
## memory\_profiler\_sample\_max\_allocation\_size[β](https://clickhouse.com/docs/operations/settings/settings#memory_profiler_sample_max_allocation_size "Direct link to memory_profiler_sample_max_allocation_size")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Collect random allocations of size less or equal than the specified value with probability equal to `memory_profiler_sample_probability`. 0 means disabled. You may want to set 'max\_untracked\_memory' to 0 to make this threshold work as expected.
## memory\_profiler\_sample\_min\_allocation\_size[β](https://clickhouse.com/docs/operations/settings/settings#memory_profiler_sample_min_allocation_size "Direct link to memory_profiler_sample_min_allocation_size")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Collect random allocations of size greater or equal than the specified value with probability equal to `memory_profiler_sample_probability`. 0 means disabled. You may want to set 'max\_untracked\_memory' to 0 to make this threshold work as expected.
## memory\_profiler\_sample\_probability[β](https://clickhouse.com/docs/operations/settings/settings#memory_profiler_sample_probability "Direct link to memory_profiler_sample_probability")
| Type | Default value |
|---|---|
| TypeFloat | Default value0 |
Collect random allocations and deallocations and write them into system.trace\_log with 'MemorySample' trace\_type. The probability is for every alloc/free regardless of the size of the allocation (can be changed with `memory_profiler_sample_min_allocation_size` and `memory_profiler_sample_max_allocation_size`). Note that sampling happens only when the amount of untracked memory exceeds 'max\_untracked\_memory'. You may want to set 'max\_untracked\_memory' to 0 for extra fine-grained sampling.
## memory\_profiler\_step[β](https://clickhouse.com/docs/operations/settings/settings#memory_profiler_step "Direct link to memory_profiler_step")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value4194304 |
Sets the step of memory profiler. Whenever query memory usage becomes larger than every next step in number of bytes the memory profiler will collect the allocating stacktrace and will write it into [trace\_log](https://clickhouse.com/docs/operations/system-tables/trace_log).
Possible values:
- A positive integer number of bytes.
- 0 for turning off the memory profiler.
## memory\_tracker\_fault\_probability[β](https://clickhouse.com/docs/operations/settings/settings#memory_tracker_fault_probability "Direct link to memory_tracker_fault_probability")
| Type | Default value |
|---|---|
| TypeFloat | Default value0 |
For testing of `exception safety` - throw an exception every time you allocate memory with the specified probability.
## memory\_usage\_overcommit\_max\_wait\_microseconds[β](https://clickhouse.com/docs/operations/settings/settings#memory_usage_overcommit_max_wait_microseconds "Direct link to memory_usage_overcommit_max_wait_microseconds")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value5000000 |
Maximum time thread will wait for memory to be freed in the case of memory overcommit on a user level. If the timeout is reached and memory is not freed, an exception is thrown. Read more about [memory overcommit](https://clickhouse.com/docs/operations/settings/memory-overcommit).
## merge\_table\_max\_tables\_to\_look\_for\_schema\_inference[β](https://clickhouse.com/docs/operations/settings/settings#merge_table_max_tables_to_look_for_schema_inference "Direct link to merge_table_max_tables_to_look_for_schema_inference")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value1000 |
Version history
When creating a `Merge` table without an explicit schema or when using the `merge` table function, infer schema as a union of not more than the specified number of matching tables. If there is a larger number of tables, the schema will be inferred from the first specified number of tables.
## merge\_tree\_coarse\_index\_granularity[β](https://clickhouse.com/docs/operations/settings/settings#merge_tree_coarse_index_granularity "Direct link to merge_tree_coarse_index_granularity")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value8 |
When searching for data, ClickHouse checks the data marks in the index file. If ClickHouse finds that required keys are in some range, it divides this range into `merge_tree_coarse_index_granularity` subranges and searches the required keys there recursively.
Possible values:
- Any positive even integer.
## merge\_tree\_compact\_parts\_min\_granules\_to\_multibuffer\_read[β](https://clickhouse.com/docs/operations/settings/settings#merge_tree_compact_parts_min_granules_to_multibuffer_read "Direct link to merge_tree_compact_parts_min_granules_to_multibuffer_read")
ClickHouse Cloud only
| Type | Default value |
|---|---|
| TypeUInt64 | Default value16 |
Only has an effect in ClickHouse Cloud. Number of granules in stripe of compact part of MergeTree tables to use multibuffer reader, which supports parallel reading and prefetch. In case of reading from remote fs using of multibuffer reader increases number of read request.
## merge\_tree\_determine\_task\_size\_by\_prewhere\_columns[β](https://clickhouse.com/docs/operations/settings/settings#merge_tree_determine_task_size_by_prewhere_columns "Direct link to merge_tree_determine_task_size_by_prewhere_columns")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Whether to use only prewhere columns size to determine reading task size.
## merge\_tree\_max\_bytes\_to\_use\_cache[β](https://clickhouse.com/docs/operations/settings/settings#merge_tree_max_bytes_to_use_cache "Direct link to merge_tree_max_bytes_to_use_cache")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value2013265920 |
If ClickHouse should read more than `merge_tree_max_bytes_to_use_cache` bytes in one query, it does not use the cache of uncompressed blocks.
The cache of uncompressed blocks stores data extracted for queries. ClickHouse uses this cache to speed up responses to repeated small queries. This setting protects the cache from trashing by queries that read a large amount of data. The [uncompressed\_cache\_size](https://clickhouse.com/docs/operations/server-configuration-parameters/settings#uncompressed_cache_size) server setting defines the size of the cache of uncompressed blocks.
Possible values:
- Any positive integer.
## merge\_tree\_max\_rows\_to\_use\_cache[β](https://clickhouse.com/docs/operations/settings/settings#merge_tree_max_rows_to_use_cache "Direct link to merge_tree_max_rows_to_use_cache")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value1048576 |
If ClickHouse should read more than `merge_tree_max_rows_to_use_cache` rows in one query, it does not use the cache of uncompressed blocks.
The cache of uncompressed blocks stores data extracted for queries. ClickHouse uses this cache to speed up responses to repeated small queries. This setting protects the cache from trashing by queries that read a large amount of data. The [uncompressed\_cache\_size](https://clickhouse.com/docs/operations/server-configuration-parameters/settings#uncompressed_cache_size) server setting defines the size of the cache of uncompressed blocks.
Possible values:
- Any positive integer.
## merge\_tree\_min\_bytes\_for\_concurrent\_read[β](https://clickhouse.com/docs/operations/settings/settings#merge_tree_min_bytes_for_concurrent_read "Direct link to merge_tree_min_bytes_for_concurrent_read")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value251658240 |
If the number of bytes to read from one file of a [MergeTree](https://clickhouse.com/docs/engines/table-engines/mergetree-family/mergetree)\-engine table exceeds `merge_tree_min_bytes_for_concurrent_read`, then ClickHouse tries to concurrently read from this file in several threads.
Possible value:
- Positive integer.
## merge\_tree\_min\_bytes\_for\_concurrent\_read\_for\_remote\_filesystem[β](https://clickhouse.com/docs/operations/settings/settings#merge_tree_min_bytes_for_concurrent_read_for_remote_filesystem "Direct link to merge_tree_min_bytes_for_concurrent_read_for_remote_filesystem")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Version history
The minimum number of bytes to read from one file before [MergeTree](https://clickhouse.com/docs/engines/table-engines/mergetree-family/mergetree) engine can parallelize reading, when reading from remote filesystem. We do not recommend using this setting.
Possible values:
- Positive integer.
## merge\_tree\_min\_bytes\_for\_seek[β](https://clickhouse.com/docs/operations/settings/settings#merge_tree_min_bytes_for_seek "Direct link to merge_tree_min_bytes_for_seek")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
If the distance between two data blocks to be read in one file is less than `merge_tree_min_bytes_for_seek` bytes, then ClickHouse sequentially reads a range of file that contains both blocks, thus avoiding extra seek.
Possible values:
- Any positive integer.
## merge\_tree\_min\_bytes\_per\_task\_for\_remote\_reading[β](https://clickhouse.com/docs/operations/settings/settings#merge_tree_min_bytes_per_task_for_remote_reading "Direct link to merge_tree_min_bytes_per_task_for_remote_reading")
**Aliases**: `filesystem_prefetch_min_bytes_for_single_read_task`
| Type | Default value |
|---|---|
| TypeUInt64 | Default value2097152 |
Version history
Min bytes to read per task.
## merge\_tree\_min\_read\_task\_size[β](https://clickhouse.com/docs/operations/settings/settings#merge_tree_min_read_task_size "Direct link to merge_tree_min_read_task_size")
| Type | Default value |
|---|---|
| TypeNonZeroUInt64 | Default value8 |
Version history
Hard lower limit on the task size (even when the number of granules is low and the number of available threads is high we won't allocate smaller tasks
## merge\_tree\_min\_rows\_for\_concurrent\_read[β](https://clickhouse.com/docs/operations/settings/settings#merge_tree_min_rows_for_concurrent_read "Direct link to merge_tree_min_rows_for_concurrent_read")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value163840 |
If the number of rows to be read from a file of a [MergeTree](https://clickhouse.com/docs/engines/table-engines/mergetree-family/mergetree) table exceeds `merge_tree_min_rows_for_concurrent_read` then ClickHouse tries to perform a concurrent reading from this file on several threads.
Possible values:
- Positive integer.
## merge\_tree\_min\_rows\_for\_concurrent\_read\_for\_remote\_filesystem[β](https://clickhouse.com/docs/operations/settings/settings#merge_tree_min_rows_for_concurrent_read_for_remote_filesystem "Direct link to merge_tree_min_rows_for_concurrent_read_for_remote_filesystem")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Version history
The minimum number of lines to read from one file before the [MergeTree](https://clickhouse.com/docs/engines/table-engines/mergetree-family/mergetree) engine can parallelize reading, when reading from remote filesystem. We do not recommend using this setting.
Possible values:
- Positive integer.
## merge\_tree\_min\_rows\_for\_seek[β](https://clickhouse.com/docs/operations/settings/settings#merge_tree_min_rows_for_seek "Direct link to merge_tree_min_rows_for_seek")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
If the distance between two data blocks to be read in one file is less than `merge_tree_min_rows_for_seek` rows, then ClickHouse does not seek through the file but reads the data sequentially.
Possible values:
- Any positive integer.
## merge\_tree\_read\_split\_ranges\_into\_intersecting\_and\_non\_intersecting\_injection\_probability[β](https://clickhouse.com/docs/operations/settings/settings#merge_tree_read_split_ranges_into_intersecting_and_non_intersecting_injection_probability "Direct link to merge_tree_read_split_ranges_into_intersecting_and_non_intersecting_injection_probability")
| Type | Default value |
|---|---|
| TypeFloat | Default value0 |
Version history
For testing of `PartsSplitter` - split read ranges into intersecting and non intersecting every time you read from MergeTree with the specified probability.
## merge\_tree\_storage\_snapshot\_sleep\_ms[β](https://clickhouse.com/docs/operations/settings/settings#merge_tree_storage_snapshot_sleep_ms "Direct link to merge_tree_storage_snapshot_sleep_ms")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Version history
Inject artificial delay (in milliseconds) when creating a storage snapshot for MergeTree tables. Used for testing and debugging purposes only.
Possible values:
- 0 - No delay (default)
- N - Delay in milliseconds
## merge\_tree\_use\_const\_size\_tasks\_for\_remote\_reading[β](https://clickhouse.com/docs/operations/settings/settings#merge_tree_use_const_size_tasks_for_remote_reading "Direct link to merge_tree_use_const_size_tasks_for_remote_reading")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Whether to use constant size tasks for reading from a remote table.
## merge\_tree\_use\_deserialization\_prefixes\_cache[β](https://clickhouse.com/docs/operations/settings/settings#merge_tree_use_deserialization_prefixes_cache "Direct link to merge_tree_use_deserialization_prefixes_cache")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Enables caching of columns metadata from the file prefixes during reading from remote disks in MergeTree.
## merge\_tree\_use\_prefixes\_deserialization\_thread\_pool[β](https://clickhouse.com/docs/operations/settings/settings#merge_tree_use_prefixes_deserialization_thread_pool "Direct link to merge_tree_use_prefixes_deserialization_thread_pool")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Enables usage of the thread pool for parallel prefixes reading in Wide parts in MergeTree. Size of that thread pool is controlled by server setting `max_prefixes_deserialization_thread_pool_size`.
## merge\_tree\_use\_v1\_object\_and\_dynamic\_serialization[β](https://clickhouse.com/docs/operations/settings/settings#merge_tree_use_v1_object_and_dynamic_serialization "Direct link to merge_tree_use_v1_object_and_dynamic_serialization")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
When enabled, V1 serialization version of JSON and Dynamic types will be used in MergeTree instead of V2. Changing this setting takes affect only after server restart.
## metrics\_perf\_events\_enabled[β](https://clickhouse.com/docs/operations/settings/settings#metrics_perf_events_enabled "Direct link to metrics_perf_events_enabled")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
If enabled, some of the perf events will be measured throughout queries' execution.
## metrics\_perf\_events\_list[β](https://clickhouse.com/docs/operations/settings/settings#metrics_perf_events_list "Direct link to metrics_perf_events_list")
Comma separated list of perf metrics that will be measured throughout queries' execution. Empty means all events. See PerfEventInfo in sources for the available events.
## min\_bytes\_to\_use\_direct\_io[β](https://clickhouse.com/docs/operations/settings/settings#min_bytes_to_use_direct_io "Direct link to min_bytes_to_use_direct_io")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
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[β](https://clickhouse.com/docs/operations/settings/settings#min_bytes_to_use_mmap_io "Direct link to min_bytes_to_use_mmap_io")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
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](https://en.wikipedia.org/wiki/Mmap) 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.
## min\_chunk\_bytes\_for\_parallel\_parsing[β](https://clickhouse.com/docs/operations/settings/settings#min_chunk_bytes_for_parallel_parsing "Direct link to min_chunk_bytes_for_parallel_parsing")
| Type | Default value |
|---|---|
| TypeNonZeroUInt64 | Default value10485760 |
- Type: unsigned int
- Default value: 1 MiB
The minimum chunk size in bytes, which each thread will parse in parallel.
## min\_compress\_block\_size[β](https://clickhouse.com/docs/operations/settings/settings#min_compress_block_size "Direct link to min_compress_block_size")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value65536 |
For [MergeTree](https://clickhouse.com/docs/engines/table-engines/mergetree-family/mergetree) tables. In order to reduce latency when processing queries, a block is compressed when writing the next mark if its size is at least `min_compress_block_size`. By default, 65,536.
The actual size of the block, if the uncompressed data is less than `max_compress_block_size`, is no less than this value and no less than the volume of data for one mark.
Let's look at an example. Assume that `index_granularity` was set to 8192 during table creation.
We are writing a UInt32-type column (4 bytes per value). When writing 8192 rows, the total will be 32 KB of data. Since min\_compress\_block\_size = 65,536, a compressed block will be formed for every two marks.
We are writing a URL column with the String type (average size of 60 bytes per value). When writing 8192 rows, the average will be slightly less than 500 KB of data. Since this is more than 65,536, a compressed block will be formed for each mark. In this case, when reading data from the disk in the range of a single mark, extra data won't be decompressed.
Note
This is an expert-level setting, and you shouldn't change it if you're just getting started with ClickHouse.
## min\_count\_to\_compile\_aggregate\_expression[β](https://clickhouse.com/docs/operations/settings/settings#min_count_to_compile_aggregate_expression "Direct link to min_count_to_compile_aggregate_expression")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value3 |
The minimum number of identical aggregate expressions to start JIT-compilation. Works only if the [compile\_aggregate\_expressions](https://clickhouse.com/docs/operations/settings/settings#compile_aggregate_expressions) setting is enabled.
Possible values:
- Positive integer.
- 0 β Identical aggregate expressions are always JIT-compiled.
## min\_count\_to\_compile\_expression[β](https://clickhouse.com/docs/operations/settings/settings#min_count_to_compile_expression "Direct link to min_count_to_compile_expression")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value3 |
Minimum count of executing same expression before it is get compiled.
## min\_count\_to\_compile\_sort\_description[β](https://clickhouse.com/docs/operations/settings/settings#min_count_to_compile_sort_description "Direct link to min_count_to_compile_sort_description")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value3 |
The number of identical sort descriptions before they are JIT-compiled
## min\_execution\_speed[β](https://clickhouse.com/docs/operations/settings/settings#min_execution_speed "Direct link to min_execution_speed")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Minimal execution speed in rows per second. Checked on every data block when [`timeout_before_checking_execution_speed`](https://clickhouse.com/docs/operations/settings/settings#timeout_before_checking_execution_speed) expires. If the execution speed is lower, an exception is thrown.
## min\_execution\_speed\_bytes[β](https://clickhouse.com/docs/operations/settings/settings#min_execution_speed_bytes "Direct link to min_execution_speed_bytes")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
The minimum number of execution bytes per second. Checked on every data block when [`timeout_before_checking_execution_speed`](https://clickhouse.com/docs/operations/settings/settings#timeout_before_checking_execution_speed) expires. If the execution speed is lower, an exception is thrown.
## min\_external\_table\_block\_size\_bytes[β](https://clickhouse.com/docs/operations/settings/settings#min_external_table_block_size_bytes "Direct link to min_external_table_block_size_bytes")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value268402944 |
Version history
Squash blocks passed to the external table to a specified size in bytes, if blocks are not big enough.
## min\_external\_table\_block\_size\_rows[β](https://clickhouse.com/docs/operations/settings/settings#min_external_table_block_size_rows "Direct link to min_external_table_block_size_rows")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value1048449 |
Version history
Squash blocks passed to external table to specified size in rows, if blocks are not big enough.
## min\_free\_disk\_bytes\_to\_perform\_insert[β](https://clickhouse.com/docs/operations/settings/settings#min_free_disk_bytes_to_perform_insert "Direct link to min_free_disk_bytes_to_perform_insert")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Version history
Minimum free disk space bytes to perform an insert.
## min\_free\_disk\_ratio\_to\_perform\_insert[β](https://clickhouse.com/docs/operations/settings/settings#min_free_disk_ratio_to_perform_insert "Direct link to min_free_disk_ratio_to_perform_insert")
| Type | Default value |
|---|---|
| TypeFloat | Default value0 |
Version history
Minimum free disk space ratio to perform an insert.
## min\_free\_disk\_space\_for\_temporary\_data[β](https://clickhouse.com/docs/operations/settings/settings#min_free_disk_space_for_temporary_data "Direct link to min_free_disk_space_for_temporary_data")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
The minimum disk space to keep while writing temporary data used in external sorting and aggregation.
## min\_hit\_rate\_to\_use\_consecutive\_keys\_optimization[β](https://clickhouse.com/docs/operations/settings/settings#min_hit_rate_to_use_consecutive_keys_optimization "Direct link to min_hit_rate_to_use_consecutive_keys_optimization")
| Type | Default value |
|---|---|
| TypeFloat | Default value0\.5 |
Minimal hit rate of a cache which is used for consecutive keys optimization in aggregation to keep it enabled
## min\_insert\_block\_size\_bytes[β](https://clickhouse.com/docs/operations/settings/settings#min_insert_block_size_bytes "Direct link to min_insert_block_size_bytes")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value268402944 |
The minimum size of blocks (in bytes) to form for insertion into a table.
This setting works together with min\_insert\_block\_size\_rows and controls block formation in the same contexts (format parsing and INSERT operations). See min\_insert\_block\_size\_rows for detailed information about when and how these settings are applied.
Possible values:
- Positive integer.
- 0 β setting does not participate in block formation.
## min\_insert\_block\_size\_bytes\_for\_materialized\_views[β](https://clickhouse.com/docs/operations/settings/settings#min_insert_block_size_bytes_for_materialized_views "Direct link to min_insert_block_size_bytes_for_materialized_views")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Sets the minimum number of bytes in the block which can be inserted into a table by an `INSERT` query. Smaller-sized blocks are squashed into bigger ones. This setting is applied only for blocks inserted into [materialized view](https://clickhouse.com/docs/sql-reference/statements/create/view). By adjusting this setting, you control blocks squashing while pushing to materialized view and avoid excessive memory usage.
Possible values:
- Any positive integer.
- 0 β Squashing disabled.
**See also**
- [min\_insert\_block\_size\_bytes](https://clickhouse.com/docs/operations/settings/settings#min_insert_block_size_bytes)
## min\_insert\_block\_size\_rows[β](https://clickhouse.com/docs/operations/settings/settings#min_insert_block_size_rows "Direct link to min_insert_block_size_rows")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value1048449 |
The minimum size of blocks (in rows) to form for insertion into a table.
This setting controls block formation in two contexts:
1. Format parsing: When the server parses row-based input formats (CSV, TSV, JSONEachRow, etc.) from any interface (HTTP, clickhouse-client with inline data, gRPC, PostgreSQL wire protocol), blocks are emitted when:
- Both min\_insert\_block\_size\_rows AND min\_insert\_block\_size\_bytes are reached, OR
- Either max\_insert\_block\_size\_rows OR max\_insert\_block\_size\_bytes is reached
Note: When using clickhouse-client or clickhouse-local to read from a file, the client itself parses the data and this setting applies on the client side.
2. INSERT operations: During INSERT queries and when data flows through materialized views, this setting's behavior depends on `use_strict_insert_block_limits`:
- When enabled: Blocks are emitted when:
- Min thresholds (AND): Both min\_insert\_block\_size\_rows AND min\_insert\_block\_size\_bytes are reached
- Max thresholds (OR): Either max\_insert\_block\_size\_rows OR max\_insert\_block\_size\_bytes is reached
- When disabled (default): Blocks are emitted when min\_insert\_block\_size\_rows OR min\_insert\_block\_size\_bytes is reached. The max\_insert\_block\_size settings are not enforced.
Possible values:
- Positive integer.
- 0 β setting does not participate in block formation.
## min\_insert\_block\_size\_rows\_for\_materialized\_views[β](https://clickhouse.com/docs/operations/settings/settings#min_insert_block_size_rows_for_materialized_views "Direct link to min_insert_block_size_rows_for_materialized_views")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Sets the minimum number of rows in the block which can be inserted into a table by an `INSERT` query. Smaller-sized blocks are squashed into bigger ones. This setting is applied only for blocks inserted into [materialized view](https://clickhouse.com/docs/sql-reference/statements/create/view). By adjusting this setting, you control blocks squashing while pushing to materialized view and avoid excessive memory usage.
Possible values:
- Any positive integer.
- 0 β Squashing disabled.
**See Also**
- [min\_insert\_block\_size\_rows](https://clickhouse.com/docs/operations/settings/settings#min_insert_block_size_rows)
## min\_joined\_block\_size\_bytes[β](https://clickhouse.com/docs/operations/settings/settings#min_joined_block_size_bytes "Direct link to min_joined_block_size_bytes")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value524288 |
Version history
Minimum block size in bytes for JOIN input and output blocks (if join algorithm supports it). Small blocks will be squashed. 0 means unlimited.
## min\_joined\_block\_size\_rows[β](https://clickhouse.com/docs/operations/settings/settings#min_joined_block_size_rows "Direct link to min_joined_block_size_rows")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value65409 |
Version history
Minimum block size in rows for JOIN input and output blocks (if join algorithm supports it). Small blocks will be squashed. 0 means unlimited.
## min\_os\_cpu\_wait\_time\_ratio\_to\_throw[β](https://clickhouse.com/docs/operations/settings/settings#min_os_cpu_wait_time_ratio_to_throw "Direct link to min_os_cpu_wait_time_ratio_to_throw")
| Type | Default value |
|---|---|
| TypeFloat | Default value0 |
Version history
Min ratio between OS CPU wait (OSCPUWaitMicroseconds metric) and busy (OSCPUVirtualTimeMicroseconds metric) times to consider rejecting queries. Linear interpolation between min and max ratio is used to calculate the probability, the probability is 0 at this point.
## min\_outstreams\_per\_resize\_after\_split[β](https://clickhouse.com/docs/operations/settings/settings#min_outstreams_per_resize_after_split "Direct link to min_outstreams_per_resize_after_split")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value24 |
Version history
Specifies the minimum number of output streams of a `Resize` or `StrictResize` processor after the split is performed during pipeline generation. If the resulting number of streams is less than this value, the split operation will not occur.
### What is a Resize Node[β](https://clickhouse.com/docs/operations/settings/settings#what-is-a-resize-node "Direct link to What is a Resize Node")
A `Resize` node is a processor in the query pipeline that adjusts the number of data streams flowing through the pipeline. It can either increase or decrease the number of streams to balance the workload across multiple threads or processors. For example, if a query requires more parallelism, the `Resize` node can split a single stream into multiple streams. Conversely, it can merge multiple streams into fewer streams to consolidate data processing.
The `Resize` node ensures that data is evenly distributed across streams, maintaining the structure of the data blocks. This helps optimize resource utilization and improve query performance.
### Why the Resize Node Needs to Be Split[β](https://clickhouse.com/docs/operations/settings/settings#why-the-resize-node-needs-to-be-split "Direct link to Why the Resize Node Needs to Be Split")
During pipeline execution, ExecutingGraph::Node::status\_mutex of the centrally-hubbed `Resize` node is heavily contended especially in high-core-count environments, and this contention leads to:
1. Increased latency for ExecutingGraph::updateNode, directly impacting query performance.
2. Excessive CPU cycles are wasted in spin-lock contention (native\_queued\_spin\_lock\_slowpath), degrading efficiency.
3. Reduced CPU utilization, limiting parallelism and throughput.
### How the Resize Node Gets Split[β](https://clickhouse.com/docs/operations/settings/settings#how-the-resize-node-gets-split "Direct link to How the Resize Node Gets Split")
1. The number of output streams is checked to ensure the split could be performed: the output streams of each split processor meet or exceed the `min_outstreams_per_resize_after_split` threshold.
2. The `Resize` node is divided into smaller `Resize` nodes with equal count of ports, each handling a subset of input and output streams.
3. Each group is processed independently, reducing the lock contention.
### Splitting Resize Node with Arbitrary Inputs/Outputs[β](https://clickhouse.com/docs/operations/settings/settings#splitting-resize-node-with-arbitrary-inputsoutputs "Direct link to Splitting Resize Node with Arbitrary Inputs/Outputs")
In some cases, where the inputs/outputs are indivisible by the number of split `Resize` nodes, some inputs are connected to `NullSource`s and some outputs are connected to `NullSink`s. This allows the split to occur without affecting the overall data flow.
### Purpose of the Setting[β](https://clickhouse.com/docs/operations/settings/settings#purpose-of-the-setting "Direct link to Purpose of the Setting")
The `min_outstreams_per_resize_after_split` setting ensures that the splitting of `Resize` nodes is meaningful and avoids creating too few streams, which could lead to inefficient parallel processing. By enforcing a minimum number of output streams, this setting helps maintain a balance between parallelism and overhead, optimizing query execution in scenarios involving stream splitting and merging.
### Disabling the Setting[β](https://clickhouse.com/docs/operations/settings/settings#disabling-the-setting "Direct link to Disabling the Setting")
To disable the split of `Resize` nodes, set this setting to 0. This will prevent the splitting of `Resize` nodes during pipeline generation, allowing them to retain their original structure without division into smaller nodes.
## min\_table\_rows\_to\_use\_projection\_index[β](https://clickhouse.com/docs/operations/settings/settings#min_table_rows_to_use_projection_index "Direct link to min_table_rows_to_use_projection_index")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value1000000 |
Version history
If the estimated number of rows to read from the table is greater than or equal to this threshold, ClickHouse will try to use the projection index during query execution.
## mongodb\_throw\_on\_unsupported\_query[β](https://clickhouse.com/docs/operations/settings/settings#mongodb_throw_on_unsupported_query "Direct link to mongodb_throw_on_unsupported_query")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
If enabled, MongoDB tables will return an error when a MongoDB query cannot be built. Otherwise, ClickHouse reads the full table and processes it locally. This option does not apply when 'allow\_experimental\_analyzer=0'.
## move\_all\_conditions\_to\_prewhere[β](https://clickhouse.com/docs/operations/settings/settings#move_all_conditions_to_prewhere "Direct link to move_all_conditions_to_prewhere")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Move all viable conditions from WHERE to PREWHERE
## move\_primary\_key\_columns\_to\_end\_of\_prewhere[β](https://clickhouse.com/docs/operations/settings/settings#move_primary_key_columns_to_end_of_prewhere "Direct link to move_primary_key_columns_to_end_of_prewhere")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Move PREWHERE conditions containing primary key columns to the end of AND chain. It is likely that these conditions are taken into account during primary key analysis and thus will not contribute a lot to PREWHERE filtering.
## multiple\_joins\_try\_to\_keep\_original\_names[β](https://clickhouse.com/docs/operations/settings/settings#multiple_joins_try_to_keep_original_names "Direct link to multiple_joins_try_to_keep_original_names")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Do not add aliases to top level expression list on multiple joins rewrite
## mutations\_execute\_nondeterministic\_on\_initiator[β](https://clickhouse.com/docs/operations/settings/settings#mutations_execute_nondeterministic_on_initiator "Direct link to mutations_execute_nondeterministic_on_initiator")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
If true constant nondeterministic functions (e.g. function `now()`) are executed on initiator and replaced to literals in `UPDATE` and `DELETE` queries. It helps to keep data in sync on replicas while executing mutations with constant nondeterministic functions. Default value: `false`.
## mutations\_execute\_subqueries\_on\_initiator[β](https://clickhouse.com/docs/operations/settings/settings#mutations_execute_subqueries_on_initiator "Direct link to mutations_execute_subqueries_on_initiator")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
If true scalar subqueries are executed on initiator and replaced to literals in `UPDATE` and `DELETE` queries. Default value: `false`.
## mutations\_max\_literal\_size\_to\_replace[β](https://clickhouse.com/docs/operations/settings/settings#mutations_max_literal_size_to_replace "Direct link to mutations_max_literal_size_to_replace")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value16384 |
The maximum size of serialized literal in bytes to replace in `UPDATE` and `DELETE` queries. Takes effect only if at least one the two settings above is enabled. Default value: 16384 (16 KiB).
## mutations\_sync[β](https://clickhouse.com/docs/operations/settings/settings#mutations_sync "Direct link to mutations_sync")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Allows to execute `ALTER TABLE ... UPDATE|DELETE|MATERIALIZE INDEX|MATERIALIZE PROJECTION|MATERIALIZE COLUMN|MATERIALIZE STATISTICS` queries ([mutations](https://clickhouse.com/docs/sql-reference/statements/alter#mutations)) synchronously.
Possible values:
| Value | Description |
|---|---|
| `0` | Mutations execute asynchronously. |
| `1` | The query waits for all mutations to complete on the current server. |
| `2` | The query waits for all mutations to complete on all replicas (if they exist). |
| `3` | The query waits only for active replicas. Supported only for `SharedMergeTree`. For `ReplicatedMergeTree` it behaves the same as `mutations_sync = 2`. |
## mysql\_datatypes\_support\_level[β](https://clickhouse.com/docs/operations/settings/settings#mysql_datatypes_support_level "Direct link to mysql_datatypes_support_level")
| Type | Default value |
|---|---|
| TypeMySQLDataTypesSupport | Default valuedecimal,datetime64,date2Date32 |
Version history
Defines how MySQL types are converted to corresponding ClickHouse types. A comma separated list in any combination of `decimal`, `datetime64`, `date2Date32` or `date2String`. All modern mappings (`decimal`, `datetime64`, `date2Date32`) are enabled by default.
- `decimal`: convert `NUMERIC` and `DECIMAL` types to `Decimal` when precision allows it.
- `datetime64`: convert `DATETIME` and `TIMESTAMP` types to `DateTime64` instead of `DateTime` when precision is not `0`.
- `date2Date32`: convert `DATE` to `Date32` instead of `Date`. Takes precedence over `date2String`.
- `date2String`: convert `DATE` to `String` instead of `Date`. Overridden by `datetime64`.
## mysql\_map\_fixed\_string\_to\_text\_in\_show\_columns[β](https://clickhouse.com/docs/operations/settings/settings#mysql_map_fixed_string_to_text_in_show_columns "Direct link to mysql_map_fixed_string_to_text_in_show_columns")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
When enabled, [FixedString](https://clickhouse.com/docs/sql-reference/data-types/fixedstring) ClickHouse data type will be displayed as `TEXT` in [SHOW COLUMNS](https://clickhouse.com/docs/sql-reference/statements/show#show_columns).
Has an effect only when the connection is made through the MySQL wire protocol.
- 0 - Use `BLOB`.
- 1 - Use `TEXT`.
## mysql\_map\_string\_to\_text\_in\_show\_columns[β](https://clickhouse.com/docs/operations/settings/settings#mysql_map_string_to_text_in_show_columns "Direct link to mysql_map_string_to_text_in_show_columns")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
When enabled, [String](https://clickhouse.com/docs/sql-reference/data-types/string) ClickHouse data type will be displayed as `TEXT` in [SHOW COLUMNS](https://clickhouse.com/docs/sql-reference/statements/show#show_columns).
Has an effect only when the connection is made through the MySQL wire protocol.
- 0 - Use `BLOB`.
- 1 - Use `TEXT`.
## mysql\_max\_rows\_to\_insert[β](https://clickhouse.com/docs/operations/settings/settings#mysql_max_rows_to_insert "Direct link to mysql_max_rows_to_insert")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value65536 |
The maximum number of rows in MySQL batch insertion of the MySQL storage engine
## network\_compression\_method[β](https://clickhouse.com/docs/operations/settings/settings#network_compression_method "Direct link to network_compression_method")
| Type | Default value |
|---|---|
| TypeString | Default valueLZ4 |
The codec for compressing the client/server and server/server communication.
Possible values:
- `NONE` β no compression.
- `LZ4` β use the LZ4 codec.
- `LZ4HC` β use the LZ4HC codec.
- `ZSTD` β use the ZSTD codec.
**See Also**
- [network\_zstd\_compression\_level](https://clickhouse.com/docs/operations/settings/settings#network_zstd_compression_level)
## network\_zstd\_compression\_level[β](https://clickhouse.com/docs/operations/settings/settings#network_zstd_compression_level "Direct link to network_zstd_compression_level")
| Type | Default value |
|---|---|
| TypeInt64 | Default value1 |
Adjusts the level of ZSTD compression. Used only when [network\_compression\_method](https://clickhouse.com/docs/operations/settings/settings#network_compression_method) is set to `ZSTD`.
Possible values:
- Positive integer from 1 to 15.
## normalize\_function\_names[β](https://clickhouse.com/docs/operations/settings/settings#normalize_function_names "Direct link to normalize_function_names")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Normalize function names to their canonical names
## number\_of\_mutations\_to\_delay[β](https://clickhouse.com/docs/operations/settings/settings#number_of_mutations_to_delay "Direct link to number_of_mutations_to_delay")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
If the mutated table contains at least that many unfinished mutations, artificially slow down mutations of table. 0 - disabled
## number\_of\_mutations\_to\_throw[β](https://clickhouse.com/docs/operations/settings/settings#number_of_mutations_to_throw "Direct link to number_of_mutations_to_throw")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
If the mutated table contains at least that many unfinished mutations, throw 'Too many mutations ...' exception. 0 - disabled
## odbc\_bridge\_connection\_pool\_size[β](https://clickhouse.com/docs/operations/settings/settings#odbc_bridge_connection_pool_size "Direct link to odbc_bridge_connection_pool_size")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value16 |
Connection pool size for each connection settings string in ODBC bridge.
## odbc\_bridge\_use\_connection\_pooling[β](https://clickhouse.com/docs/operations/settings/settings#odbc_bridge_use_connection_pooling "Direct link to odbc_bridge_use_connection_pooling")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Use connection pooling in ODBC bridge. If set to false, a new connection is created every time.
## offset[β](https://clickhouse.com/docs/operations/settings/settings#offset "Direct link to offset")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Sets the number of rows to skip before starting to return rows from the query. It adjusts the offset set by the [OFFSET](https://clickhouse.com/docs/sql-reference/statements/select/offset) clause, so that these two values are summarized.
Possible values:
- 0 β No rows are skipped .
- Positive integer.
**Example**
Input table:
```
CREATE TABLE test (i UInt64) ENGINE = MergeTree() ORDER BY i;
INSERT INTO test SELECT number FROM numbers(500);
```
Query:
```
SET limit = 5;
SET offset = 7;
SELECT * FROM test LIMIT 10 OFFSET 100;
```
Result:
```
ββββiββ
β 107 β
β 108 β
β 109 β
βββββββ
```
## opentelemetry\_start\_keeper\_trace\_probability[β](https://clickhouse.com/docs/operations/settings/settings#opentelemetry_start_keeper_trace_probability "Direct link to opentelemetry_start_keeper_trace_probability")
| Type | Default value |
|---|---|
| TypeFloatAuto | Default valueauto |
Version history
Probability to start a trace for ZooKeeper request - whether there is a parent trace or not.
Possible values:
- 'auto' - Equals the opentelemetry\_start\_trace\_probability setting
- 0 β Tracing is disabled
- 0 to 1 β Probability (e.g., 1.0 = always enable)
## opentelemetry\_start\_trace\_probability[β](https://clickhouse.com/docs/operations/settings/settings#opentelemetry_start_trace_probability "Direct link to opentelemetry_start_trace_probability")
| Type | Default value |
|---|---|
| TypeFloat | Default value0 |
Sets the probability that the ClickHouse can start a trace for executed queries (if no parent [trace context](https://www.w3.org/TR/trace-context/) is supplied).
Possible values:
- 0 β The trace for all executed queries is disabled (if no parent trace context is supplied).
- Positive floating-point number in the range \[0..1\]. For example, if the setting value is `0,5`, ClickHouse can start a trace on average for half of the queries.
- 1 β The trace for all executed queries is enabled.
## opentelemetry\_trace\_cpu\_scheduling[β](https://clickhouse.com/docs/operations/settings/settings#opentelemetry_trace_cpu_scheduling "Direct link to opentelemetry_trace_cpu_scheduling")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
Collect OpenTelemetry spans for workload preemptive CPU scheduling.
## opentelemetry\_trace\_processors[β](https://clickhouse.com/docs/operations/settings/settings#opentelemetry_trace_processors "Direct link to opentelemetry_trace_processors")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Collect OpenTelemetry spans for processors.
## optimize\_aggregation\_in\_order[β](https://clickhouse.com/docs/operations/settings/settings#optimize_aggregation_in_order "Direct link to optimize_aggregation_in_order")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Enables [GROUP BY](https://clickhouse.com/docs/sql-reference/statements/select/group-by) optimization in [SELECT](https://clickhouse.com/docs/sql-reference/statements/select) queries for aggregating data in corresponding order in [MergeTree](https://clickhouse.com/docs/engines/table-engines/mergetree-family/mergetree) tables.
Possible values:
- 0 β `GROUP BY` optimization is disabled.
- 1 β `GROUP BY` optimization is enabled.
**See Also**
- [GROUP BY optimization](https://clickhouse.com/docs/sql-reference/statements/select/group-by#group-by-optimization-depending-on-table-sorting-key)
## optimize\_aggregators\_of\_group\_by\_keys[β](https://clickhouse.com/docs/operations/settings/settings#optimize_aggregators_of_group_by_keys "Direct link to optimize_aggregators_of_group_by_keys")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Eliminates min/max/any/anyLast aggregators of GROUP BY keys in SELECT sectio
## optimize\_and\_compare\_chain[β](https://clickhouse.com/docs/operations/settings/settings#optimize_and_compare_chain "Direct link to optimize_and_compare_chain")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Populate constant comparison in AND chains to enhance filtering ability. Support operators `<`, `<=`, `>`, `>=`, `=` and mix of them. For example, `(a < b) AND (b < c) AND (c < 5)` would be `(a < b) AND (b < c) AND (c < 5) AND (b < 5) AND (a < 5)`.
## optimize\_append\_index[β](https://clickhouse.com/docs/operations/settings/settings#optimize_append_index "Direct link to optimize_append_index")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Use [constraints](https://clickhouse.com/docs/sql-reference/statements/create/table#constraints) in order to append index condition. The default is `false`.
Possible values:
- true, false
## optimize\_arithmetic\_operations\_in\_aggregate\_functions[β](https://clickhouse.com/docs/operations/settings/settings#optimize_arithmetic_operations_in_aggregate_functions "Direct link to optimize_arithmetic_operations_in_aggregate_functions")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Move arithmetic operations out of aggregation functions
## optimize\_const\_name\_size[β](https://clickhouse.com/docs/operations/settings/settings#optimize_const_name_size "Direct link to optimize_const_name_size")
| Type | Default value |
|---|---|
| TypeInt64 | Default value256 |
Version history
Replace with scalar and use hash as a name for large constants (size is estimated by the name length).
Possible values:
- positive integer - max length of the name,
- 0 β always,
- negative integer - never.
## optimize\_count\_from\_files[β](https://clickhouse.com/docs/operations/settings/settings#optimize_count_from_files "Direct link to optimize_count_from_files")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Enables or disables the optimization of counting number of rows from files in different input formats. It applies to table functions/engines `file`/`s3`/`url`/`hdfs`/`azureBlobStorage`.
Possible values:
- 0 β Optimization disabled.
- 1 β Optimization enabled.
## optimize\_distinct\_in\_order[β](https://clickhouse.com/docs/operations/settings/settings#optimize_distinct_in_order "Direct link to optimize_distinct_in_order")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Enable DISTINCT optimization if some columns in DISTINCT form a prefix of sorting. For example, prefix of sorting key in merge tree or ORDER BY statement
## optimize\_distributed\_group\_by\_sharding\_key[β](https://clickhouse.com/docs/operations/settings/settings#optimize_distributed_group_by_sharding_key "Direct link to optimize_distributed_group_by_sharding_key")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Optimize `GROUP BY sharding_key` queries, by avoiding costly aggregation on the initiator server (which will reduce memory usage for the query on the initiator server).
The following types of queries are supported (and all combinations of them):
- `SELECT DISTINCT [..., ]sharding_key[, ...] FROM dist`
- `SELECT ... FROM dist GROUP BY sharding_key[, ...]`
- `SELECT ... FROM dist GROUP BY sharding_key[, ...] ORDER BY x`
- `SELECT ... FROM dist GROUP BY sharding_key[, ...] LIMIT 1`
- `SELECT ... FROM dist GROUP BY sharding_key[, ...] LIMIT 1 BY x`
The following types of queries are not supported (support for some of them may be added later):
- `SELECT ... GROUP BY sharding_key[, ...] WITH TOTALS`
- `SELECT ... GROUP BY sharding_key[, ...] WITH ROLLUP`
- `SELECT ... GROUP BY sharding_key[, ...] WITH CUBE`
- `SELECT ... GROUP BY sharding_key[, ...] SETTINGS extremes=1`
Possible values:
- 0 β Disabled.
- 1 β Enabled.
See also:
- [distributed\_group\_by\_no\_merge](https://clickhouse.com/docs/operations/settings/settings#distributed_group_by_no_merge)
- [distributed\_push\_down\_limit](https://clickhouse.com/docs/operations/settings/settings#distributed_push_down_limit)
- [optimize\_skip\_unused\_shards](https://clickhouse.com/docs/operations/settings/settings#optimize_skip_unused_shards)
Note
Right now it requires `optimize_skip_unused_shards` (the reason behind this is that one day it may be enabled by default, and it will work correctly only if data was inserted via Distributed table, i.e. data is distributed according to sharding\_key).
## optimize\_dry\_run\_check\_part[β](https://clickhouse.com/docs/operations/settings/settings#optimize_dry_run_check_part "Direct link to optimize_dry_run_check_part")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
When enabled, `OPTIMIZE ... DRY RUN` validates the resulting merged part using `checkDataPart`. If the check fails, an exception is thrown.
## optimize\_empty\_string\_comparisons[β](https://clickhouse.com/docs/operations/settings/settings#optimize_empty_string_comparisons "Direct link to optimize_empty_string_comparisons")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Convert expressions like col = '' or '' = col into empty(col), and col != '' or '' != col into notEmpty(col), only when col is of String or FixedString type.
## optimize\_extract\_common\_expressions[β](https://clickhouse.com/docs/operations/settings/settings#optimize_extract_common_expressions "Direct link to optimize_extract_common_expressions")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Allow extracting common expressions from disjunctions in WHERE, PREWHERE, ON, HAVING and QUALIFY expressions. A logical expression like `(A AND B) OR (A AND C)` can be rewritten to `A AND (B OR C)`, which might help to utilize:
- indices in simple filtering expressions
- cross to inner join optimizatio
## optimize\_functions\_to\_subcolumns[β](https://clickhouse.com/docs/operations/settings/settings#optimize_functions_to_subcolumns "Direct link to optimize_functions_to_subcolumns")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Enables or disables optimization by transforming some functions to reading subcolumns. This reduces the amount of data to read.
These functions can be transformed:
- [length](https://clickhouse.com/docs/sql-reference/functions/array-functions#length) to read the [size0](https://clickhouse.com/docs/sql-reference/data-types/array#array-size) subcolumn.
- [empty](https://clickhouse.com/docs/sql-reference/functions/array-functions#empty) to read the [size0](https://clickhouse.com/docs/sql-reference/data-types/array#array-size) subcolumn.
- [notEmpty](https://clickhouse.com/docs/sql-reference/functions/array-functions#notEmpty) to read the [size0](https://clickhouse.com/docs/sql-reference/data-types/array#array-size) subcolumn.
- [isNull](https://clickhouse.com/docs/sql-reference/functions/functions-for-nulls#isNull) to read the [null](https://clickhouse.com/docs/sql-reference/data-types/nullable#finding-null) subcolumn.
- [isNotNull](https://clickhouse.com/docs/sql-reference/functions/functions-for-nulls#isNotNull) to read the [null](https://clickhouse.com/docs/sql-reference/data-types/nullable#finding-null) subcolumn.
- [count](https://clickhouse.com/docs/sql-reference/aggregate-functions/reference/count) to read the [null](https://clickhouse.com/docs/sql-reference/data-types/nullable#finding-null) subcolumn.
- [mapKeys](https://clickhouse.com/docs/sql-reference/functions/tuple-map-functions#mapKeys) to read the [keys](https://clickhouse.com/docs/sql-reference/data-types/map#reading-subcolumns-of-map) subcolumn.
- [mapValues](https://clickhouse.com/docs/sql-reference/functions/tuple-map-functions#mapValues) to read the [values](https://clickhouse.com/docs/sql-reference/data-types/map#reading-subcolumns-of-map) subcolumn.
Possible values:
- 0 β Optimization disabled.
- 1 β Optimization enabled.
## optimize\_group\_by\_constant\_keys[β](https://clickhouse.com/docs/operations/settings/settings#optimize_group_by_constant_keys "Direct link to optimize_group_by_constant_keys")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Optimize GROUP BY when all keys in block are constant
## optimize\_group\_by\_function\_keys[β](https://clickhouse.com/docs/operations/settings/settings#optimize_group_by_function_keys "Direct link to optimize_group_by_function_keys")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Eliminates functions of other keys in GROUP BY sectio
## optimize\_if\_chain\_to\_multiif[β](https://clickhouse.com/docs/operations/settings/settings#optimize_if_chain_to_multiif "Direct link to optimize_if_chain_to_multiif")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Replace if(cond1, then1, if(cond2, ...)) chains to multiIf. Currently it's not beneficial for numeric types.
## optimize\_if\_transform\_strings\_to\_enum[β](https://clickhouse.com/docs/operations/settings/settings#optimize_if_transform_strings_to_enum "Direct link to optimize_if_transform_strings_to_enum")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Replaces string-type arguments in If and Transform to enum. Disabled by default cause it could make inconsistent change in distributed query that would lead to its fail.
## optimize\_injective\_functions\_in\_group\_by[β](https://clickhouse.com/docs/operations/settings/settings#optimize_injective_functions_in_group_by "Direct link to optimize_injective_functions_in_group_by")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Replaces injective functions by it's arguments in GROUP BY sectio
## optimize\_injective\_functions\_inside\_uniq[β](https://clickhouse.com/docs/operations/settings/settings#optimize_injective_functions_inside_uniq "Direct link to optimize_injective_functions_inside_uniq")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Delete injective functions of one argument inside uniq\*() functions.
## optimize\_inverse\_dictionary\_lookup[β](https://clickhouse.com/docs/operations/settings/settings#optimize_inverse_dictionary_lookup "Direct link to optimize_inverse_dictionary_lookup")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Avoid repeated inverse dictionary lookup by doing faster lookups into a precomputed set of possible key values.
## optimize\_min\_equality\_disjunction\_chain\_length[β](https://clickhouse.com/docs/operations/settings/settings#optimize_min_equality_disjunction_chain_length "Direct link to optimize_min_equality_disjunction_chain_length")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value3 |
The minimum length of the expression `expr = x1 OR ... expr = xN` for optimizatio
## optimize\_min\_inequality\_conjunction\_chain\_length[β](https://clickhouse.com/docs/operations/settings/settings#optimize_min_inequality_conjunction_chain_length "Direct link to optimize_min_inequality_conjunction_chain_length")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value3 |
The minimum length of the expression `expr <> x1 AND ... expr <> xN` for optimizatio
## optimize\_move\_to\_prewhere[β](https://clickhouse.com/docs/operations/settings/settings#optimize_move_to_prewhere "Direct link to optimize_move_to_prewhere")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Enables or disables automatic [PREWHERE](https://clickhouse.com/docs/sql-reference/statements/select/prewhere) optimization in [SELECT](https://clickhouse.com/docs/sql-reference/statements/select) queries.
Works only for [\*MergeTree](https://clickhouse.com/docs/engines/table-engines/mergetree-family) tables.
Possible values:
- 0 β Automatic `PREWHERE` optimization is disabled.
- 1 β Automatic `PREWHERE` optimization is enabled.
## optimize\_move\_to\_prewhere\_if\_final[β](https://clickhouse.com/docs/operations/settings/settings#optimize_move_to_prewhere_if_final "Direct link to optimize_move_to_prewhere_if_final")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Enables or disables automatic [PREWHERE](https://clickhouse.com/docs/sql-reference/statements/select/prewhere) optimization in [SELECT](https://clickhouse.com/docs/sql-reference/statements/select) queries with [FINAL](https://clickhouse.com/docs/sql-reference/statements/select/from#final-modifier) modifier.
Works only for [\*MergeTree](https://clickhouse.com/docs/engines/table-engines/mergetree-family) tables.
Possible values:
- 0 β Automatic `PREWHERE` optimization in `SELECT` queries with `FINAL` modifier is disabled.
- 1 β Automatic `PREWHERE` optimization in `SELECT` queries with `FINAL` modifier is enabled.
**See Also**
- [optimize\_move\_to\_prewhere](https://clickhouse.com/docs/operations/settings/settings#optimize_move_to_prewhere) setting
## optimize\_multiif\_to\_if[β](https://clickhouse.com/docs/operations/settings/settings#optimize_multiif_to_if "Direct link to optimize_multiif_to_if")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Replace 'multiIf' with only one condition to 'if'.
## optimize\_normalize\_count\_variants[β](https://clickhouse.com/docs/operations/settings/settings#optimize_normalize_count_variants "Direct link to optimize_normalize_count_variants")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Rewrite aggregate functions that semantically equals to count() as count().
## optimize\_on\_insert[β](https://clickhouse.com/docs/operations/settings/settings#optimize_on_insert "Direct link to optimize_on_insert")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Enables or disables data transformation before the insertion, as if merge was done on this block (according to table engine).
Possible values:
- 0 β Disabled.
- 1 β Enabled.
**Example**
The difference between enabled and disabled:
Query:
```
SET optimize_on_insert = 1;
CREATE TABLE test1 (`FirstTable` UInt32) ENGINE = ReplacingMergeTree ORDER BY FirstTable;
INSERT INTO test1 SELECT number % 2 FROM numbers(5);
SELECT * FROM test1;
SET optimize_on_insert = 0;
CREATE TABLE test2 (`SecondTable` UInt32) ENGINE = ReplacingMergeTree ORDER BY SecondTable;
INSERT INTO test2 SELECT number % 2 FROM numbers(5);
SELECT * FROM test2;
```
Result:
```
ββFirstTableββ
β 0 β
β 1 β
ββββββββββββββ
ββSecondTableββ
β 0 β
β 0 β
β 0 β
β 1 β
β 1 β
βββββββββββββββ
```
Note that this setting influences [Materialized view](https://clickhouse.com/docs/sql-reference/statements/create/view#materialized-view) behaviour.
## optimize\_or\_like\_chain[β](https://clickhouse.com/docs/operations/settings/settings#optimize_or_like_chain "Direct link to optimize_or_like_chain")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Optimize multiple OR LIKE into multiMatchAny. This optimization should not be enabled by default, because it defies index analysis in some cases.
## optimize\_qbit\_distance\_function\_reads[β](https://clickhouse.com/docs/operations/settings/settings#optimize_qbit_distance_function_reads "Direct link to optimize_qbit_distance_function_reads")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Replace distance functions on `QBit` data type with equivalent ones that only read the columns necessary for the calculation from the storage.
## optimize\_read\_in\_order[β](https://clickhouse.com/docs/operations/settings/settings#optimize_read_in_order "Direct link to optimize_read_in_order")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Enables [ORDER BY](https://clickhouse.com/docs/sql-reference/statements/select/order-by#optimization-of-data-reading) optimization in [SELECT](https://clickhouse.com/docs/sql-reference/statements/select) queries for reading data from [MergeTree](https://clickhouse.com/docs/engines/table-engines/mergetree-family/mergetree) tables.
Possible values:
- 0 β `ORDER BY` optimization is disabled.
- 1 β `ORDER BY` optimization is enabled.
**See Also**
- [ORDER BY Clause](https://clickhouse.com/docs/sql-reference/statements/select/order-by#optimization-of-data-reading)
## optimize\_redundant\_functions\_in\_order\_by[β](https://clickhouse.com/docs/operations/settings/settings#optimize_redundant_functions_in_order_by "Direct link to optimize_redundant_functions_in_order_by")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Remove functions from ORDER BY if its argument is also in ORDER BY
## optimize\_respect\_aliases[β](https://clickhouse.com/docs/operations/settings/settings#optimize_respect_aliases "Direct link to optimize_respect_aliases")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
If it is set to true, it will respect aliases in WHERE/GROUP BY/ORDER BY, that will help with partition pruning/secondary indexes/optimize\_aggregation\_in\_order/optimize\_read\_in\_order/optimize\_trivial\_count
## optimize\_rewrite\_aggregate\_function\_with\_if[β](https://clickhouse.com/docs/operations/settings/settings#optimize_rewrite_aggregate_function_with_if "Direct link to optimize_rewrite_aggregate_function_with_if")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Rewrite aggregate functions with if expression as argument when logically equivalent. For example, `avg(if(cond, col, null))` can be rewritten to `avgOrNullIf(cond, col)`. It may improve performance.
Note
Supported only with the analyzer (`enable_analyzer = 1`).
## optimize\_rewrite\_array\_exists\_to\_has[β](https://clickhouse.com/docs/operations/settings/settings#optimize_rewrite_array_exists_to_has "Direct link to optimize_rewrite_array_exists_to_has")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Rewrite arrayExists() functions to has() when logically equivalent. For example, arrayExists(x -\> x = 1, arr) can be rewritten to has(arr, 1)
## optimize\_rewrite\_like\_perfect\_affix[β](https://clickhouse.com/docs/operations/settings/settings#optimize_rewrite_like_perfect_affix "Direct link to optimize_rewrite_like_perfect_affix")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Rewrite LIKE expressions with perfect prefix or suffix (e.g. `col LIKE 'ClickHouse%'`) to startsWith or endsWith functions (e.g. `startsWith(col, 'ClickHouse')`).
## optimize\_rewrite\_regexp\_functions[β](https://clickhouse.com/docs/operations/settings/settings#optimize_rewrite_regexp_functions "Direct link to optimize_rewrite_regexp_functions")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Rewrite regular expression related functions into simpler and more efficient forms
## optimize\_rewrite\_sum\_if\_to\_count\_if[β](https://clickhouse.com/docs/operations/settings/settings#optimize_rewrite_sum_if_to_count_if "Direct link to optimize_rewrite_sum_if_to_count_if")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Rewrite sumIf() and sum(if()) function countIf() function when logically equivalent
## optimize\_skip\_merged\_partitions[β](https://clickhouse.com/docs/operations/settings/settings#optimize_skip_merged_partitions "Direct link to optimize_skip_merged_partitions")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Enables or disables optimization for [OPTIMIZE TABLE ... FINAL](https://clickhouse.com/docs/sql-reference/statements/optimize) query if there is only one part with level \> 0 and it doesn't have expired TTL.
- `OPTIMIZE TABLE ... FINAL SETTINGS optimize_skip_merged_partitions=1`
By default, `OPTIMIZE TABLE ... FINAL` query rewrites the one part even if there is only a single part.
Possible values:
- 1 - Enable optimization.
- 0 - Disable optimization.
## optimize\_skip\_unused\_shards[β](https://clickhouse.com/docs/operations/settings/settings#optimize_skip_unused_shards "Direct link to optimize_skip_unused_shards")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Enables or disables skipping of unused shards for [SELECT](https://clickhouse.com/docs/sql-reference/statements/select) queries that have sharding key condition in `WHERE/PREWHERE`, and activates related optimizations for distributed queries (e.g. aggregation by sharding key).
Note
Assumes that the data is distributed by sharding key, otherwise a query yields incorrect result.
Possible values:
- 0 β Disabled.
- 1 β Enabled.
## optimize\_skip\_unused\_shards\_limit[β](https://clickhouse.com/docs/operations/settings/settings#optimize_skip_unused_shards_limit "Direct link to optimize_skip_unused_shards_limit")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value1000 |
Limit for number of sharding key values, turns off `optimize_skip_unused_shards` if the limit is reached.
Too many values may require significant amount for processing, while the benefit is doubtful, since if you have huge number of values in `IN (...)`, then most likely the query will be sent to all shards anyway.
## optimize\_skip\_unused\_shards\_nesting[β](https://clickhouse.com/docs/operations/settings/settings#optimize_skip_unused_shards_nesting "Direct link to optimize_skip_unused_shards_nesting")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Controls [`optimize_skip_unused_shards`](https://clickhouse.com/docs/operations/settings/settings#optimize_skip_unused_shards) (hence still requires [`optimize_skip_unused_shards`](https://clickhouse.com/docs/operations/settings/settings#optimize_skip_unused_shards)) depends on the nesting level of the distributed query (case when you have `Distributed` table that look into another `Distributed` table).
Possible values:
- 0 β Disabled, `optimize_skip_unused_shards` works always.
- 1 β Enables `optimize_skip_unused_shards` only for the first level.
- 2 β Enables `optimize_skip_unused_shards` up to the second level.
## optimize\_skip\_unused\_shards\_rewrite\_in[β](https://clickhouse.com/docs/operations/settings/settings#optimize_skip_unused_shards_rewrite_in "Direct link to optimize_skip_unused_shards_rewrite_in")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Rewrite IN in query for remote shards to exclude values that does not belong to the shard (requires optimize\_skip\_unused\_shards).
Possible values:
- 0 β Disabled.
- 1 β Enabled.
## optimize\_sorting\_by\_input\_stream\_properties[β](https://clickhouse.com/docs/operations/settings/settings#optimize_sorting_by_input_stream_properties "Direct link to optimize_sorting_by_input_stream_properties")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Optimize sorting by sorting properties of input stream
## optimize\_substitute\_columns[β](https://clickhouse.com/docs/operations/settings/settings#optimize_substitute_columns "Direct link to optimize_substitute_columns")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Use [constraints](https://clickhouse.com/docs/sql-reference/statements/create/table#constraints) for column substitution. The default is `false`.
Possible values:
- true, false
## optimize\_syntax\_fuse\_functions[β](https://clickhouse.com/docs/operations/settings/settings#optimize_syntax_fuse_functions "Direct link to optimize_syntax_fuse_functions")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Enables to fuse aggregate functions with identical argument. It rewrites query contains at least two aggregate functions from [sum](https://clickhouse.com/docs/sql-reference/aggregate-functions/reference/sum), [count](https://clickhouse.com/docs/sql-reference/aggregate-functions/reference/count) or [avg](https://clickhouse.com/docs/sql-reference/aggregate-functions/reference/avg) with identical argument to [sumCount](https://clickhouse.com/docs/sql-reference/aggregate-functions/reference/sumcount).
Possible values:
- 0 β Functions with identical argument are not fused.
- 1 β Functions with identical argument are fused.
**Example**
Query:
```
CREATE TABLE fuse_tbl(a Int8, b Int8) Engine = Log;
SET optimize_syntax_fuse_functions = 1;
EXPLAIN SYNTAX run_query_tree_passes = 1 SELECT sum(a), sum(b), count(b), avg(b) from fuse_tbl FORMAT TSV;
```
Result:
```
SELECT
sum(__table1.a) AS `sum(a)`,
tupleElement(sumCount(__table1.b), 1) AS `sum(b)`,
tupleElement(sumCount(__table1.b), 2) AS `count(b)`,
divide(tupleElement(sumCount(__table1.b), 1), toFloat64(tupleElement(sumCount(__table1.b), 2))) AS `avg(b)`
FROM default.fuse_tbl AS __table1
```
## optimize\_throw\_if\_noop[β](https://clickhouse.com/docs/operations/settings/settings#optimize_throw_if_noop "Direct link to optimize_throw_if_noop")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Enables or disables throwing an exception if an [OPTIMIZE](https://clickhouse.com/docs/sql-reference/statements/optimize) query didn't perform a merge.
By default, `OPTIMIZE` returns successfully even if it didn't do anything. This setting lets you differentiate these situations and get the reason in an exception message.
Possible values:
- 1 β Throwing an exception is enabled.
- 0 β Throwing an exception is disabled.
## optimize\_time\_filter\_with\_preimage[β](https://clickhouse.com/docs/operations/settings/settings#optimize_time_filter_with_preimage "Direct link to optimize_time_filter_with_preimage")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Optimize Date and DateTime predicates by converting functions into equivalent comparisons without conversions (e.g. `toYear(col) = 2023 -> col >= '2023-01-01' AND col <= '2023-12-31'`)
## optimize\_trivial\_approximate\_count\_query[β](https://clickhouse.com/docs/operations/settings/settings#optimize_trivial_approximate_count_query "Direct link to optimize_trivial_approximate_count_query")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Use an approximate value for trivial count optimization of storages that support such estimation, for example, EmbeddedRocksDB.
Possible values:
- 0 β Optimization disabled.
- 1 β Optimization enabled.
## optimize\_trivial\_count\_query[β](https://clickhouse.com/docs/operations/settings/settings#optimize_trivial_count_query "Direct link to optimize_trivial_count_query")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Enables or disables the optimization to trivial query `SELECT count() FROM table` using metadata from MergeTree. If you need to use row-level security, disable this setting.
Possible values:
- 0 β Optimization disabled.
- 1 β Optimization enabled.
See also:
- [optimize\_functions\_to\_subcolumns](https://clickhouse.com/docs/operations/settings/settings#optimize_functions_to_subcolumns)
## optimize\_trivial\_insert\_select[β](https://clickhouse.com/docs/operations/settings/settings#optimize_trivial_insert_select "Direct link to optimize_trivial_insert_select")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
Optimize trivial 'INSERT INTO table SELECT ... FROM TABLES' query
## optimize\_truncate\_order\_by\_after\_group\_by\_keys[β](https://clickhouse.com/docs/operations/settings/settings#optimize_truncate_order_by_after_group_by_keys "Direct link to optimize_truncate_order_by_after_group_by_keys")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Remove trailing ORDER BY elements once all GROUP BY keys are covered in the ORDER BY prefix.
## optimize\_uniq\_to\_count[β](https://clickhouse.com/docs/operations/settings/settings#optimize_uniq_to_count "Direct link to optimize_uniq_to_count")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Rewrite uniq and its variants(except uniqUpTo) to count if subquery has distinct or group by clause.
## optimize\_use\_implicit\_projections[β](https://clickhouse.com/docs/operations/settings/settings#optimize_use_implicit_projections "Direct link to optimize_use_implicit_projections")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Automatically choose implicit projections to perform SELECT query
## optimize\_use\_projection\_filtering[β](https://clickhouse.com/docs/operations/settings/settings#optimize_use_projection_filtering "Direct link to optimize_use_projection_filtering")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Enables using projections to filter part ranges even when projections are not selected to perform SELECT query.
## optimize\_use\_projections[β](https://clickhouse.com/docs/operations/settings/settings#optimize_use_projections "Direct link to optimize_use_projections")
**Aliases**: `allow_experimental_projection_optimization`
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Enables or disables [projection](https://clickhouse.com/docs/engines/table-engines/mergetree-family/mergetree#projections) optimization when processing `SELECT` queries.
Possible values:
- 0 β Projection optimization disabled.
- 1 β Projection optimization enabled.
## optimize\_using\_constraints[β](https://clickhouse.com/docs/operations/settings/settings#optimize_using_constraints "Direct link to optimize_using_constraints")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Use [constraints](https://clickhouse.com/docs/sql-reference/statements/create/table#constraints) for query optimization. The default is `false`.
Possible values:
- true, false
## os\_threads\_nice\_value\_materialized\_view[β](https://clickhouse.com/docs/operations/settings/settings#os_threads_nice_value_materialized_view "Direct link to os_threads_nice_value_materialized_view")
| Type | Default value |
|---|---|
| TypeInt32 | Default value0 |
Version history
Linux nice value for materialized view threads. Lower values mean higher CPU priority.
Requires CAP\_SYS\_NICE capability, otherwise no-op.
Possible values: -20 to 19.
## os\_threads\_nice\_value\_query[β](https://clickhouse.com/docs/operations/settings/settings#os_threads_nice_value_query "Direct link to os_threads_nice_value_query")
**Aliases**: `os_thread_priority`
| Type | Default value |
|---|---|
| TypeInt32 | Default value0 |
Version history
Linux nice value for query processing threads. Lower values mean higher CPU priority.
Requires CAP\_SYS\_NICE capability, otherwise no-op.
Possible values: -20 to 19.
## page\_cache\_block\_size[β](https://clickhouse.com/docs/operations/settings/settings#page_cache_block_size "Direct link to page_cache_block_size")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value1048576 |
Version history
Size of file chunks to store in the userspace page cache, in bytes. All reads that go through the cache will be rounded up to a multiple of this size.
This setting can be adjusted on a per-query level basis, but cache entries with different block sizes cannot be reused. Changing this setting effectively invalidates existing entries in the cache.
A higher value, like 1 MiB is good for high-throughput queries, and a lower value, like 64 KiB is good for low-latency point queries.
## page\_cache\_inject\_eviction[β](https://clickhouse.com/docs/operations/settings/settings#page_cache_inject_eviction "Direct link to page_cache_inject_eviction")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
Userspace page cache will sometimes invalidate some pages at random. Intended for testing.
## page\_cache\_lookahead\_blocks[β](https://clickhouse.com/docs/operations/settings/settings#page_cache_lookahead_blocks "Direct link to page_cache_lookahead_blocks")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value16 |
Version history
On userspace page cache miss, read up to this many consecutive blocks at once from the underlying storage, if they're also not in the cache. Each block is page\_cache\_block\_size bytes.
A higher value is good for high-throughput queries, while low-latency point queries will work better without readahead.
## parallel\_distributed\_insert\_select[β](https://clickhouse.com/docs/operations/settings/settings#parallel_distributed_insert_select "Direct link to parallel_distributed_insert_select")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value2 |
Version history
Enables parallel distributed `INSERT ... SELECT` query.
If we execute `INSERT INTO distributed_table_a SELECT ... FROM distributed_table_b` queries and both tables use the same cluster, and both tables are either [replicated](https://clickhouse.com/docs/engines/table-engines/mergetree-family/replication) or non-replicated, then this query is processed locally on every shard.
Possible values:
- `0` β Disabled.
- `1` β `SELECT` will be executed on each shard from the underlying table of the distributed engine.
- `2` β `SELECT` and `INSERT` will be executed on each shard from/to the underlying table of the distributed engine.
Setting `enable_parallel_replicas = 1` is needed when using this setting.
## parallel\_hash\_join\_threshold[β](https://clickhouse.com/docs/operations/settings/settings#parallel_hash_join_threshold "Direct link to parallel_hash_join_threshold")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value100000 |
Version history
When hash-based join algorithm is applied, this threshold helps to decide between using `hash` and `parallel_hash` (only if estimation of the right table size is available). The former is used when we know that the right table size is below the threshold.
## parallel\_non\_joined\_rows\_processing[β](https://clickhouse.com/docs/operations/settings/settings#parallel_non_joined_rows_processing "Direct link to parallel_non_joined_rows_processing")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Allow multiple threads to process non-joined rows from the right table in parallel during RIGHT and FULL JOINs. This can speed up the non-joined phase when using the `parallel_hash` join algorithm with large tables. When disabled, non-joined rows are processed by a single thread.
## parallel\_replica\_offset[β](https://clickhouse.com/docs/operations/settings/settings#parallel_replica_offset "Direct link to parallel_replica_offset")
Beta feature.
[Learn more.](https://clickhouse.com/docs/beta-and-experimental-features#beta-features)
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
This is internal setting that should not be used directly and represents an implementation detail of the 'parallel replicas' mode. This setting will be automatically set up by the initiator server for distributed queries to the index of the replica participating in query processing among parallel replicas.
## parallel\_replicas\_allow\_in\_with\_subquery[β](https://clickhouse.com/docs/operations/settings/settings#parallel_replicas_allow_in_with_subquery "Direct link to parallel_replicas_allow_in_with_subquery")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
If true, subquery for IN will be executed on every follower replica.
## parallel\_replicas\_allow\_materialized\_views[β](https://clickhouse.com/docs/operations/settings/settings#parallel_replicas_allow_materialized_views "Direct link to parallel_replicas_allow_materialized_views")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Allow usage of materialized views with parallel replicas
## parallel\_replicas\_connect\_timeout\_ms[β](https://clickhouse.com/docs/operations/settings/settings#parallel_replicas_connect_timeout_ms "Direct link to parallel_replicas_connect_timeout_ms")
| Type | Default value |
|---|---|
| TypeMilliseconds | Default value300 |
Version history
The timeout in milliseconds for connecting to a remote replica during query execution with parallel replicas. If the timeout is expired, the corresponding replicas is not used for query executio
## parallel\_replicas\_count[β](https://clickhouse.com/docs/operations/settings/settings#parallel_replicas_count "Direct link to parallel_replicas_count")
Beta feature.
[Learn more.](https://clickhouse.com/docs/beta-and-experimental-features#beta-features)
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
This is internal setting that should not be used directly and represents an implementation detail of the 'parallel replicas' mode. This setting will be automatically set up by the initiator server for distributed queries to the number of parallel replicas participating in query processing.
## parallel\_replicas\_custom\_key[β](https://clickhouse.com/docs/operations/settings/settings#parallel_replicas_custom_key "Direct link to parallel_replicas_custom_key")
Beta feature.
[Learn more.](https://clickhouse.com/docs/beta-and-experimental-features#beta-features)
An arbitrary integer expression that can be used to split work between replicas for a specific table. The value can be any integer expression.
Simple expressions using primary keys are preferred.
If the setting is used on a cluster that consists of a single shard with multiple replicas, those replicas will be converted into virtual shards. Otherwise, it will behave same as for `SAMPLE` key, it will use multiple replicas of each shard.
## parallel\_replicas\_custom\_key\_range\_lower[β](https://clickhouse.com/docs/operations/settings/settings#parallel_replicas_custom_key_range_lower "Direct link to parallel_replicas_custom_key_range_lower")
Beta feature.
[Learn more.](https://clickhouse.com/docs/beta-and-experimental-features#beta-features)
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Version history
Allows the filter type `range` to split the work evenly between replicas based on the custom range `[parallel_replicas_custom_key_range_lower, INT_MAX]`.
When used in conjunction with [parallel\_replicas\_custom\_key\_range\_upper](https://clickhouse.com/docs/operations/settings/settings#parallel_replicas_custom_key_range_upper), it lets the filter evenly split the work over replicas for the range `[parallel_replicas_custom_key_range_lower, parallel_replicas_custom_key_range_upper]`.
Note: This setting will not cause any additional data to be filtered during query processing, rather it changes the points at which the range filter breaks up the range `[0, INT_MAX]` for parallel processing.
## parallel\_replicas\_custom\_key\_range\_upper[β](https://clickhouse.com/docs/operations/settings/settings#parallel_replicas_custom_key_range_upper "Direct link to parallel_replicas_custom_key_range_upper")
Beta feature.
[Learn more.](https://clickhouse.com/docs/beta-and-experimental-features#beta-features)
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Version history
Allows the filter type `range` to split the work evenly between replicas based on the custom range `[0, parallel_replicas_custom_key_range_upper]`. A value of 0 disables the upper bound, setting it the max value of the custom key expression.
When used in conjunction with [parallel\_replicas\_custom\_key\_range\_lower](https://clickhouse.com/docs/operations/settings/settings#parallel_replicas_custom_key_range_lower), it lets the filter evenly split the work over replicas for the range `[parallel_replicas_custom_key_range_lower, parallel_replicas_custom_key_range_upper]`.
Note: This setting will not cause any additional data to be filtered during query processing, rather it changes the points at which the range filter breaks up the range `[0, INT_MAX]` for parallel processing
## parallel\_replicas\_filter\_pushdown[β](https://clickhouse.com/docs/operations/settings/settings#parallel_replicas_filter_pushdown "Direct link to parallel_replicas_filter_pushdown")
Beta feature.
[Learn more.](https://clickhouse.com/docs/beta-and-experimental-features#beta-features)
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
Allow pushing down filters to part of query which parallel replicas choose to execute
## parallel\_replicas\_for\_cluster\_engines[β](https://clickhouse.com/docs/operations/settings/settings#parallel_replicas_for_cluster_engines "Direct link to parallel_replicas_for_cluster_engines")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Replace table function engines with their -Cluster alternatives
## parallel\_replicas\_for\_non\_replicated\_merge\_tree[β](https://clickhouse.com/docs/operations/settings/settings#parallel_replicas_for_non_replicated_merge_tree "Direct link to parallel_replicas_for_non_replicated_merge_tree")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
If true, ClickHouse will use parallel replicas algorithm also for non-replicated MergeTree tables
## parallel\_replicas\_index\_analysis\_only\_on\_coordinator[β](https://clickhouse.com/docs/operations/settings/settings#parallel_replicas_index_analysis_only_on_coordinator "Direct link to parallel_replicas_index_analysis_only_on_coordinator")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Index analysis done only on replica-coordinator and skipped on other replicas. Effective only with enabled parallel\_replicas\_local\_pla
## parallel\_replicas\_insert\_select\_local\_pipeline[β](https://clickhouse.com/docs/operations/settings/settings#parallel_replicas_insert_select_local_pipeline "Direct link to parallel_replicas_insert_select_local_pipeline")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Use local pipeline during distributed INSERT SELECT with parallel replicas
## parallel\_replicas\_local\_plan[β](https://clickhouse.com/docs/operations/settings/settings#parallel_replicas_local_plan "Direct link to parallel_replicas_local_plan")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Build local plan for local replica
## parallel\_replicas\_mark\_segment\_size[β](https://clickhouse.com/docs/operations/settings/settings#parallel_replicas_mark_segment_size "Direct link to parallel_replicas_mark_segment_size")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Version history
Parts virtually divided into segments to be distributed between replicas for parallel reading. This setting controls the size of these segments. Not recommended to change until you're absolutely sure in what you're doing. Value should be in range \[128; 16384\]
## parallel\_replicas\_min\_number\_of\_rows\_per\_replica[β](https://clickhouse.com/docs/operations/settings/settings#parallel_replicas_min_number_of_rows_per_replica "Direct link to parallel_replicas_min_number_of_rows_per_replica")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Limit the number of replicas used in a query to (estimated rows to read / min\_number\_of\_rows\_per\_replica). The max is still limited by 'max\_parallel\_replicas'
## parallel\_replicas\_mode[β](https://clickhouse.com/docs/operations/settings/settings#parallel_replicas_mode "Direct link to parallel_replicas_mode")
| Type | Default value |
|---|---|
| TypeParallelReplicasMode | Default valueread\_tasks |
Version history
Type of filter to use with custom key for parallel replicas. default - use modulo operation on the custom key, range - use range filter on custom key using all possible values for the value type of custom key.
## parallel\_replicas\_only\_with\_analyzer[β](https://clickhouse.com/docs/operations/settings/settings#parallel_replicas_only_with_analyzer "Direct link to parallel_replicas_only_with_analyzer")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
The analyzer should be enabled to use parallel replicas. With disabled analyzer query execution fallbacks to local execution, even if parallel reading from replicas is enabled. Using parallel replicas without the analyzer enabled is not supported
## parallel\_replicas\_prefer\_local\_join[β](https://clickhouse.com/docs/operations/settings/settings#parallel_replicas_prefer_local_join "Direct link to parallel_replicas_prefer_local_join")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
If true, and JOIN can be executed with parallel replicas algorithm, and all storages of right JOIN part are \*MergeTree, local JOIN will be used instead of GLOBAL JOIN.
## parallel\_replicas\_support\_projection[β](https://clickhouse.com/docs/operations/settings/settings#parallel_replicas_support_projection "Direct link to parallel_replicas_support_projection")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Optimization of projections can be applied in parallel replicas. Effective only with enabled parallel\_replicas\_local\_plan and aggregation\_in\_order is inactive.
## parallel\_view\_processing[β](https://clickhouse.com/docs/operations/settings/settings#parallel_view_processing "Direct link to parallel_view_processing")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Enables pushing to attached views concurrently instead of sequentially.
## parallelize\_output\_from\_storages[β](https://clickhouse.com/docs/operations/settings/settings#parallelize_output_from_storages "Direct link to parallelize_output_from_storages")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Parallelize output for reading step from storage. It allows parallelization of query processing right after reading from storage if possible
## parsedatetime\_e\_requires\_space\_padding[β](https://clickhouse.com/docs/operations/settings/settings#parsedatetime_e_requires_space_padding "Direct link to parsedatetime_e_requires_space_padding")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
Formatter '%e' in function 'parseDateTime' expects that single-digit days are space-padded, e.g., ' 2' is accepted but '2' raises an error.
## parsedatetime\_parse\_without\_leading\_zeros[β](https://clickhouse.com/docs/operations/settings/settings#parsedatetime_parse_without_leading_zeros "Direct link to parsedatetime_parse_without_leading_zeros")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Formatters '%c', '%l' and '%k' in function 'parseDateTime' parse months and hours without leading zeros.
## partial\_merge\_join\_left\_table\_buffer\_bytes[β](https://clickhouse.com/docs/operations/settings/settings#partial_merge_join_left_table_buffer_bytes "Direct link to partial_merge_join_left_table_buffer_bytes")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
If not 0 group left table blocks in bigger ones for left-side table in partial merge join. It uses up to 2x of specified memory per joining thread.
## partial\_merge\_join\_rows\_in\_right\_blocks[β](https://clickhouse.com/docs/operations/settings/settings#partial_merge_join_rows_in_right_blocks "Direct link to partial_merge_join_rows_in_right_blocks")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value65536 |
Limits sizes of right-hand join data blocks in partial merge join algorithm for [JOIN](https://clickhouse.com/docs/sql-reference/statements/select/join) queries.
ClickHouse server:
1. Splits right-hand join data into blocks with up to the specified number of rows.
2. Indexes each block with its minimum and maximum values.
3. Unloads prepared blocks to disk if it is possible.
Possible values:
- Any positive integer. Recommended range of values: \[1000, 100000\].
## partial\_result\_on\_first\_cancel[β](https://clickhouse.com/docs/operations/settings/settings#partial_result_on_first_cancel "Direct link to partial_result_on_first_cancel")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Allows query to return a partial result after cancel.
## parts\_to\_delay\_insert[β](https://clickhouse.com/docs/operations/settings/settings#parts_to_delay_insert "Direct link to parts_to_delay_insert")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
If the destination table contains at least that many active parts in a single partition, artificially slow down insert into table.
## parts\_to\_throw\_insert[β](https://clickhouse.com/docs/operations/settings/settings#parts_to_throw_insert "Direct link to parts_to_throw_insert")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
If more than this number active parts in a single partition of the destination table, throw 'Too many parts ...' exception.
## per\_part\_index\_stats[β](https://clickhouse.com/docs/operations/settings/settings#per_part_index_stats "Direct link to per_part_index_stats")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
Logs index statistics per part
## poll\_interval[β](https://clickhouse.com/docs/operations/settings/settings#poll_interval "Direct link to poll_interval")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value10 |
Block at the query wait loop on the server for the specified number of seconds.
## polyglot\_dialect[β](https://clickhouse.com/docs/operations/settings/settings#polyglot_dialect "Direct link to polyglot_dialect")
Experimental feature.
[Learn more.](https://clickhouse.com/docs/beta-and-experimental-features#experimental-features)
Version history
Source SQL dialect for the polyglot transpiler (e.g. 'sqlite', 'mysql', 'postgresql', 'snowflake', 'duckdb').
## postgresql\_connection\_attempt\_timeout[β](https://clickhouse.com/docs/operations/settings/settings#postgresql_connection_attempt_timeout "Direct link to postgresql_connection_attempt_timeout")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value2 |
Version history
Connection timeout in seconds of a single attempt to connect PostgreSQL end-point. The value is passed as a `connect_timeout` parameter of the connection URL.
## postgresql\_connection\_pool\_auto\_close\_connection[β](https://clickhouse.com/docs/operations/settings/settings#postgresql_connection_pool_auto_close_connection "Direct link to postgresql_connection_pool_auto_close_connection")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Close connection before returning connection to the pool.
## postgresql\_connection\_pool\_retries[β](https://clickhouse.com/docs/operations/settings/settings#postgresql_connection_pool_retries "Direct link to postgresql_connection_pool_retries")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value2 |
Version history
Connection pool push/pop retries number for PostgreSQL table engine and database engine.
## postgresql\_connection\_pool\_size[β](https://clickhouse.com/docs/operations/settings/settings#postgresql_connection_pool_size "Direct link to postgresql_connection_pool_size")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value16 |
Connection pool size for PostgreSQL table engine and database engine.
## postgresql\_connection\_pool\_wait\_timeout[β](https://clickhouse.com/docs/operations/settings/settings#postgresql_connection_pool_wait_timeout "Direct link to postgresql_connection_pool_wait_timeout")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value5000 |
Connection pool push/pop timeout on empty pool for PostgreSQL table engine and database engine. By default it will block on empty pool.
## postgresql\_fault\_injection\_probability[β](https://clickhouse.com/docs/operations/settings/settings#postgresql_fault_injection_probability "Direct link to postgresql_fault_injection_probability")
| Type | Default value |
|---|---|
| TypeFloat | Default value0 |
Version history
Approximate probability of failing internal (for replication) PostgreSQL queries. Valid value is in interval \[0.0f, 1.0f\]
## prefer\_column\_name\_to\_alias[β](https://clickhouse.com/docs/operations/settings/settings#prefer_column_name_to_alias "Direct link to prefer_column_name_to_alias")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Enables or disables using the original column names instead of aliases in query expressions and clauses. It especially matters when alias is the same as the column name, see [Expression Aliases](https://clickhouse.com/docs/sql-reference/syntax#notes-on-usage). Enable this setting to make aliases syntax rules in ClickHouse more compatible with most other database engines.
Possible values:
- 0 β The column name is substituted with the alias.
- 1 β The column name is not substituted with the alias.
**Example**
The difference between enabled and disabled:
Query:
```
SET prefer_column_name_to_alias = 0;
SELECT avg(number) AS number, max(number) FROM numbers(10);
```
Result:
```
Received exception from server (version 21.5.1):
Code: 184. DB::Exception: Received from localhost:9000. DB::Exception: Aggregate function avg(number) is found inside another aggregate function in query: While processing avg(number) AS number.
```
Query:
```
SET prefer_column_name_to_alias = 1;
SELECT avg(number) AS number, max(number) FROM numbers(10);
```
Result:
```
ββnumberββ¬βmax(number)ββ
β 4.5 β 9 β
ββββββββββ΄ββββββββββββββ
```
## prefer\_external\_sort\_block\_bytes[β](https://clickhouse.com/docs/operations/settings/settings#prefer_external_sort_block_bytes "Direct link to prefer_external_sort_block_bytes")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value16744704 |
Version history
Prefer maximum block bytes for external sort, reduce the memory usage during merging.
## prefer\_global\_in\_and\_join[β](https://clickhouse.com/docs/operations/settings/settings#prefer_global_in_and_join "Direct link to prefer_global_in_and_join")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Enables the replacement of `IN`/`JOIN` operators with `GLOBAL IN`/`GLOBAL JOIN`.
Possible values:
- 0 β Disabled. `IN`/`JOIN` operators are not replaced with `GLOBAL IN`/`GLOBAL JOIN`.
- 1 β Enabled. `IN`/`JOIN` operators are replaced with `GLOBAL IN`/`GLOBAL JOIN`.
**Usage**
Although `SET distributed_product_mode=global` can change the queries behavior for the distributed tables, it's not suitable for local tables or tables from external resources. Here is when the `prefer_global_in_and_join` setting comes into play.
For example, we have query serving nodes that contain local tables, which are not suitable for distribution. We need to scatter their data on the fly during distributed processing with the `GLOBAL` keyword β `GLOBAL IN`/`GLOBAL JOIN`.
Another use case of `prefer_global_in_and_join` is accessing tables created by external engines. This setting helps to reduce the number of calls to external sources while joining such tables: only one call per query.
**See also:**
- [Distributed subqueries](https://clickhouse.com/docs/sql-reference/operators/in#distributed-subqueries) for more information on how to use `GLOBAL IN`/`GLOBAL JOIN`
## prefer\_localhost\_replica[β](https://clickhouse.com/docs/operations/settings/settings#prefer_localhost_replica "Direct link to prefer_localhost_replica")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Enables/disables preferable using the localhost replica when processing distributed queries.
Possible values:
- 1 β ClickHouse always sends a query to the localhost replica if it exists.
- 0 β ClickHouse uses the balancing strategy specified by the [load\_balancing](https://clickhouse.com/docs/operations/settings/settings#load_balancing) setting.
Note
Disable this setting if you use [max\_parallel\_replicas](https://clickhouse.com/docs/operations/settings/settings#max_parallel_replicas) without [parallel\_replicas\_custom\_key](https://clickhouse.com/docs/operations/settings/settings#parallel_replicas_custom_key). If [parallel\_replicas\_custom\_key](https://clickhouse.com/docs/operations/settings/settings#parallel_replicas_custom_key) is set, disable this setting only if it's used on a cluster with multiple shards containing multiple replicas. If it's used on a cluster with a single shard and multiple replicas, disabling this setting will have negative effects.
## prefer\_warmed\_unmerged\_parts\_seconds[β](https://clickhouse.com/docs/operations/settings/settings#prefer_warmed_unmerged_parts_seconds "Direct link to prefer_warmed_unmerged_parts_seconds")
ClickHouse Cloud only
| Type | Default value |
|---|---|
| TypeInt64 | Default value0 |
Only has an effect in ClickHouse Cloud. If a merged part is less than this many seconds old and is not pre-warmed (see [cache\_populated\_by\_fetch](https://clickhouse.com/docs/operations/settings/merge-tree-settings#cache_populated_by_fetch)), but all its source parts are available and pre-warmed, SELECT queries will read from those parts instead. Only for Replicated-/SharedMergeTree. Note that this only checks whether CacheWarmer processed the part; if the part was fetched into cache by something else, it'll still be considered cold until CacheWarmer gets to it; if it was warmed, then evicted from cache, it'll still be considered warm.
## preferred\_block\_size\_bytes[β](https://clickhouse.com/docs/operations/settings/settings#preferred_block_size_bytes "Direct link to preferred_block_size_bytes")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value1000000 |
This setting adjusts the data block size for query processing and represents additional fine-tuning to the more rough 'max\_block\_size' setting. If the columns are large and with 'max\_block\_size' rows the block size is likely to be larger than the specified amount of bytes, its size will be lowered for better CPU cache locality.
## preferred\_max\_column\_in\_block\_size\_bytes[β](https://clickhouse.com/docs/operations/settings/settings#preferred_max_column_in_block_size_bytes "Direct link to preferred_max_column_in_block_size_bytes")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Limit on max column size in block while reading. Helps to decrease cache misses count. Should be close to L2 cache size.
## preferred\_optimize\_projection\_name[β](https://clickhouse.com/docs/operations/settings/settings#preferred_optimize_projection_name "Direct link to preferred_optimize_projection_name")
If it is set to a non-empty string, ClickHouse will try to apply specified projection in query.
Possible values:
- string: name of preferred projectio
## prefetch\_buffer\_size[β](https://clickhouse.com/docs/operations/settings/settings#prefetch_buffer_size "Direct link to prefetch_buffer_size")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value1048576 |
The maximum size of the prefetch buffer to read from the filesystem.
## print\_pretty\_type\_names[β](https://clickhouse.com/docs/operations/settings/settings#print_pretty_type_names "Direct link to print_pretty_type_names")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Allows to print deep-nested type names in a pretty way with indents in `DESCRIBE` query and in `toTypeName()` function.
Example:
```
CREATE TABLE test (a Tuple(b String, c Tuple(d Nullable(UInt64), e Array(UInt32), f Array(Tuple(g String, h Map(String, Array(Tuple(i String, j UInt64))))), k Date), l Nullable(String))) ENGINE=Memory;
DESCRIBE TABLE test FORMAT TSVRaw SETTINGS print_pretty_type_names=1;
```
```
a Tuple(
b String,
c Tuple(
d Nullable(UInt64),
e Array(UInt32),
f Array(Tuple(
g String,
h Map(
String,
Array(Tuple(
i String,
j UInt64
))
)
)),
k Date
),
l Nullable(String)
)
```
## priority[β](https://clickhouse.com/docs/operations/settings/settings#priority "Direct link to priority")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Priority of the query. 1 - the highest, higher value - lower priority; 0 - do not use priorities.
## promql\_database[β](https://clickhouse.com/docs/operations/settings/settings#promql_database "Direct link to promql_database")
Experimental feature.
[Learn more.](https://clickhouse.com/docs/beta-and-experimental-features#experimental-features)
Version history
Specifies the database name used by the 'promql' dialect. Empty string means the current database.
## promql\_evaluation\_time[β](https://clickhouse.com/docs/operations/settings/settings#promql_evaluation_time "Direct link to promql_evaluation_time")
Experimental feature.
[Learn more.](https://clickhouse.com/docs/beta-and-experimental-features#experimental-features)
**Aliases**: `evaluation_time`
| Type | Default value |
|---|---|
| TypeFloatAuto | Default valueauto |
Version history
Sets the evaluation time to be used with promql dialect. 'auto' means the current time.
## promql\_table[β](https://clickhouse.com/docs/operations/settings/settings#promql_table "Direct link to promql_table")
Experimental feature.
[Learn more.](https://clickhouse.com/docs/beta-and-experimental-features#experimental-features)
Version history
Specifies the name of a TimeSeries table used by the 'promql' dialect.
## push\_external\_roles\_in\_interserver\_queries[β](https://clickhouse.com/docs/operations/settings/settings#push_external_roles_in_interserver_queries "Direct link to push_external_roles_in_interserver_queries")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Enable pushing user roles from originator to other nodes while performing a query.
## query\_cache\_compress\_entries[β](https://clickhouse.com/docs/operations/settings/settings#query_cache_compress_entries "Direct link to query_cache_compress_entries")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Compress entries in the [query cache](https://clickhouse.com/docs/operations/query-cache). Lessens the memory consumption of the query cache at the cost of slower inserts into / reads from it.
Possible values:
- 0 - Disabled
- 1 - Enabled
## query\_cache\_max\_entries[β](https://clickhouse.com/docs/operations/settings/settings#query_cache_max_entries "Direct link to query_cache_max_entries")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
The maximum number of query results the current user may store in the [query cache](https://clickhouse.com/docs/operations/query-cache). 0 means unlimited.
Possible values:
- Positive integer \>= 0.
## query\_cache\_max\_size\_in\_bytes[β](https://clickhouse.com/docs/operations/settings/settings#query_cache_max_size_in_bytes "Direct link to query_cache_max_size_in_bytes")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
The maximum amount of memory (in bytes) the current user may allocate in the [query cache](https://clickhouse.com/docs/operations/query-cache). 0 means unlimited.
Possible values:
- Positive integer \>= 0.
## query\_cache\_min\_query\_duration[β](https://clickhouse.com/docs/operations/settings/settings#query_cache_min_query_duration "Direct link to query_cache_min_query_duration")
| Type | Default value |
|---|---|
| TypeMilliseconds | Default value0 |
Minimum duration in milliseconds a query needs to run for its result to be stored in the [query cache](https://clickhouse.com/docs/operations/query-cache).
Possible values:
- Positive integer \>= 0.
## query\_cache\_min\_query\_runs[β](https://clickhouse.com/docs/operations/settings/settings#query_cache_min_query_runs "Direct link to query_cache_min_query_runs")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Minimum number of times a `SELECT` query must run before its result is stored in the [query cache](https://clickhouse.com/docs/operations/query-cache).
Possible values:
- Positive integer \>= 0.
## query\_cache\_nondeterministic\_function\_handling[β](https://clickhouse.com/docs/operations/settings/settings#query_cache_nondeterministic_function_handling "Direct link to query_cache_nondeterministic_function_handling")
| Type | Default value |
|---|---|
| TypeQueryResultCacheNondeterministicFunctionHandling | Default valuethrow |
Controls how the [query cache](https://clickhouse.com/docs/operations/query-cache) handles `SELECT` queries with non-deterministic functions like `rand()` or `now()`.
Possible values:
- `'throw'` - Throw an exception and don't cache the query result.
- `'save'` - Cache the query result.
- `'ignore'` - Don't cache the query result and don't throw an exception.
## query\_cache\_share\_between\_users[β](https://clickhouse.com/docs/operations/settings/settings#query_cache_share_between_users "Direct link to query_cache_share_between_users")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
If turned on, the result of `SELECT` queries cached in the [query cache](https://clickhouse.com/docs/operations/query-cache) can be read by other users. It is not recommended to enable this setting due to security reasons.
Possible values:
- 0 - Disabled
- 1 - Enabled
## query\_cache\_squash\_partial\_results[β](https://clickhouse.com/docs/operations/settings/settings#query_cache_squash_partial_results "Direct link to query_cache_squash_partial_results")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Squash partial result blocks to blocks of size [max\_block\_size](https://clickhouse.com/docs/operations/settings/settings#max_block_size). Reduces performance of inserts into the [query cache](https://clickhouse.com/docs/operations/query-cache) but improves the compressability of cache entries (see [query\_cache\_compress-entries](https://clickhouse.com/docs/operations/settings/settings#query_cache_compress_entries)).
Possible values:
- 0 - Disabled
- 1 - Enabled
## query\_cache\_system\_table\_handling[β](https://clickhouse.com/docs/operations/settings/settings#query_cache_system_table_handling "Direct link to query_cache_system_table_handling")
| Type | Default value |
|---|---|
| TypeQueryResultCacheSystemTableHandling | Default valuethrow |
Version history
Controls how the [query cache](https://clickhouse.com/docs/operations/query-cache) handles `SELECT` queries against system tables, i.e. tables in databases `system.*` and `information_schema.*`.
Possible values:
- `'throw'` - Throw an exception and don't cache the query result.
- `'save'` - Cache the query result.
- `'ignore'` - Don't cache the query result and don't throw an exception.
## query\_cache\_tag[β](https://clickhouse.com/docs/operations/settings/settings#query_cache_tag "Direct link to query_cache_tag")
Version history
A string which acts as a label for [query cache](https://clickhouse.com/docs/operations/query-cache) entries. The same queries with different tags are considered different by the query cache.
Possible values:
- Any string
## query\_cache\_ttl[β](https://clickhouse.com/docs/operations/settings/settings#query_cache_ttl "Direct link to query_cache_ttl")
| Type | Default value |
|---|---|
| TypeSeconds | Default value60 |
After this time in seconds entries in the [query cache](https://clickhouse.com/docs/operations/query-cache) become stale.
Possible values:
- Positive integer \>= 0.
## query\_metric\_log\_interval[β](https://clickhouse.com/docs/operations/settings/settings#query_metric_log_interval "Direct link to query_metric_log_interval")
| Type | Default value |
|---|---|
| TypeInt64 | Default value\-1 |
Version history
The interval in milliseconds at which the [query\_metric\_log](https://clickhouse.com/docs/operations/system-tables/query_metric_log) for individual queries is collected.
If set to any negative value, it will take the value `collect_interval_milliseconds` from the [query\_metric\_log setting](https://clickhouse.com/docs/operations/server-configuration-parameters/settings#query_metric_log) or default to 1000 if not present.
To disable the collection of a single query, set `query_metric_log_interval` to 0.
Default value: -1
## query\_plan\_aggregation\_in\_order[β](https://clickhouse.com/docs/operations/settings/settings#query_plan_aggregation_in_order "Direct link to query_plan_aggregation_in_order")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Toggles the aggregation in-order query-plan-level optimization. Only takes effect if setting [`query_plan_enable_optimizations`](https://clickhouse.com/docs/operations/settings/settings#query_plan_enable_optimizations) is 1.
Note
This is an expert-level setting which should only be used for debugging by developers. The setting may change in future in backward-incompatible ways or be removed.
Possible values:
- 0 - Disable
- 1 - Enable
## query\_plan\_convert\_any\_join\_to\_semi\_or\_anti\_join[β](https://clickhouse.com/docs/operations/settings/settings#query_plan_convert_any_join_to_semi_or_anti_join "Direct link to query_plan_convert_any_join_to_semi_or_anti_join")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Allow to convert ANY JOIN to SEMI or ANTI JOIN if filter after JOIN always evaluates to false for not-matched or matched rows
## query\_plan\_convert\_join\_to\_in[β](https://clickhouse.com/docs/operations/settings/settings#query_plan_convert_join_to_in "Direct link to query_plan_convert_join_to_in")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
Allow to convert `JOIN` to subquery with `IN` if output columns tied to only left table. May cause wrong results with non-ANY JOINs (e.g. ALL JOINs which is the default).
## query\_plan\_convert\_outer\_join\_to\_inner\_join[β](https://clickhouse.com/docs/operations/settings/settings#query_plan_convert_outer_join_to_inner_join "Direct link to query_plan_convert_outer_join_to_inner_join")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Allow to convert `OUTER JOIN` to `INNER JOIN` if filter after `JOIN` always filters default values
## query\_plan\_direct\_read\_from\_text\_index[β](https://clickhouse.com/docs/operations/settings/settings#query_plan_direct_read_from_text_index "Direct link to query_plan_direct_read_from_text_index")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Allow to perform full text search filtering using only the inverted text index in query plan.
## query\_plan\_display\_internal\_aliases[β](https://clickhouse.com/docs/operations/settings/settings#query_plan_display_internal_aliases "Direct link to query_plan_display_internal_aliases")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
Show internal aliases (such as \_\_table1) in EXPLAIN PLAN instead of those specified in the original query.
## query\_plan\_enable\_multithreading\_after\_window\_functions[β](https://clickhouse.com/docs/operations/settings/settings#query_plan_enable_multithreading_after_window_functions "Direct link to query_plan_enable_multithreading_after_window_functions")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Enable multithreading after evaluating window functions to allow parallel stream processing
## query\_plan\_enable\_optimizations[β](https://clickhouse.com/docs/operations/settings/settings#query_plan_enable_optimizations "Direct link to query_plan_enable_optimizations")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Toggles query optimization at the query plan level.
Note
This is an expert-level setting which should only be used for debugging by developers. The setting may change in future in backward-incompatible ways or be removed.
Possible values:
- 0 - Disable all optimizations at the query plan level
- 1 - Enable optimizations at the query plan level (but individual optimizations may still be disabled via their individual settings)
## query\_plan\_execute\_functions\_after\_sorting[β](https://clickhouse.com/docs/operations/settings/settings#query_plan_execute_functions_after_sorting "Direct link to query_plan_execute_functions_after_sorting")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Toggles a query-plan-level optimization which moves expressions after sorting steps. Only takes effect if setting [`query_plan_enable_optimizations`](https://clickhouse.com/docs/operations/settings/settings#query_plan_enable_optimizations) is 1.
Note
This is an expert-level setting which should only be used for debugging by developers. The setting may change in future in backward-incompatible ways or be removed.
Possible values:
- 0 - Disable
- 1 - Enable
## query\_plan\_filter\_push\_down[β](https://clickhouse.com/docs/operations/settings/settings#query_plan_filter_push_down "Direct link to query_plan_filter_push_down")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Toggles a query-plan-level optimization which moves filters down in the execution plan. Only takes effect if setting [query\_plan\_enable\_optimizations](https://clickhouse.com/docs/operations/settings/settings#query_plan_enable_optimizations) is 1.
Note
This is an expert-level setting which should only be used for debugging by developers. The setting may change in future in backward-incompatible ways or be removed.
Possible values:
- 0 - Disable
- 1 - Enable
## query\_plan\_join\_shard\_by\_pk\_ranges[β](https://clickhouse.com/docs/operations/settings/settings#query_plan_join_shard_by_pk_ranges "Direct link to query_plan_join_shard_by_pk_ranges")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
Apply sharding for JOIN if join keys contain a prefix of PRIMARY KEY for both tables. Supported for hash, parallel\_hash and full\_sorting\_merge algorithms. Usually does not speed up queries but may lower memory consumption.
## query\_plan\_join\_swap\_table[β](https://clickhouse.com/docs/operations/settings/settings#query_plan_join_swap_table "Direct link to query_plan_join_swap_table")
| Type | Default value |
|---|---|
| TypeBoolAuto | Default valueauto |
Version history
Determine which side of the join should be the build table (also called inner, the one inserted into the hash table for a hash join) in the query plan. This setting is supported only for `ALL` join strictness with the `JOIN ON` clause. Possible values are:
- 'auto': Let the planner decide which table to use as the build table.
- 'false': Never swap tables (the right table is the build table).
- 'true': Always swap tables (the left table is the build table).
## query\_plan\_lift\_up\_array\_join[β](https://clickhouse.com/docs/operations/settings/settings#query_plan_lift_up_array_join "Direct link to query_plan_lift_up_array_join")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Toggles a query-plan-level optimization which moves ARRAY JOINs up in the execution plan. Only takes effect if setting [query\_plan\_enable\_optimizations](https://clickhouse.com/docs/operations/settings/settings#query_plan_enable_optimizations) is 1.
Note
This is an expert-level setting which should only be used for debugging by developers. The setting may change in future in backward-incompatible ways or be removed.
Possible values:
- 0 - Disable
- 1 - Enable
## query\_plan\_lift\_up\_union[β](https://clickhouse.com/docs/operations/settings/settings#query_plan_lift_up_union "Direct link to query_plan_lift_up_union")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Toggles a query-plan-level optimization which moves larger subtrees of the query plan into union to enable further optimizations. Only takes effect if setting [`query_plan_enable_optimizations`](https://clickhouse.com/docs/operations/settings/settings#query_plan_enable_optimizations) is 1.
Note
This is an expert-level setting which should only be used for debugging by developers. The setting may change in future in backward-incompatible ways or be removed.
Possible values:
- 0 - Disable
- 1 - Enable
## query\_plan\_max\_limit\_for\_lazy\_materialization[β](https://clickhouse.com/docs/operations/settings/settings#query_plan_max_limit_for_lazy_materialization "Direct link to query_plan_max_limit_for_lazy_materialization")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value10000 |
Version history
Control maximum limit value that allows to use query plan for lazy materialization optimization. If zero, there is no limit.
## query\_plan\_max\_limit\_for\_top\_k\_optimization[β](https://clickhouse.com/docs/operations/settings/settings#query_plan_max_limit_for_top_k_optimization "Direct link to query_plan_max_limit_for_top_k_optimization")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value1000 |
Version history
Control maximum limit value that allows to evaluate query plan for TopK optimization by using minmax skip index and dynamic threshold filtering. If zero, there is no limit.
## query\_plan\_max\_optimizations\_to\_apply[β](https://clickhouse.com/docs/operations/settings/settings#query_plan_max_optimizations_to_apply "Direct link to query_plan_max_optimizations_to_apply")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value10000 |
Limits the total number of optimizations applied to query plan, see setting [query\_plan\_enable\_optimizations](https://clickhouse.com/docs/operations/settings/settings#query_plan_enable_optimizations). Useful to avoid long optimization times for complex queries. In the EXPLAIN PLAN query, stop applying optimizations after this limit is reached and return the plan as is. For regular query execution if the actual number of optimizations exceeds this setting, an exception is thrown.
Note
This is an expert-level setting which should only be used for debugging by developers. The setting may change in future in backward-incompatible ways or be removed.
## query\_plan\_max\_step\_description\_length[β](https://clickhouse.com/docs/operations/settings/settings#query_plan_max_step_description_length "Direct link to query_plan_max_step_description_length")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value500 |
Version history
Maximum length of step description in EXPLAIN PLAN.
## query\_plan\_merge\_expressions[β](https://clickhouse.com/docs/operations/settings/settings#query_plan_merge_expressions "Direct link to query_plan_merge_expressions")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Toggles a query-plan-level optimization which merges consecutive filters. Only takes effect if setting [query\_plan\_enable\_optimizations](https://clickhouse.com/docs/operations/settings/settings#query_plan_enable_optimizations) is 1.
Note
This is an expert-level setting which should only be used for debugging by developers. The setting may change in future in backward-incompatible ways or be removed.
Possible values:
- 0 - Disable
- 1 - Enable
## query\_plan\_merge\_filter\_into\_join\_condition[β](https://clickhouse.com/docs/operations/settings/settings#query_plan_merge_filter_into_join_condition "Direct link to query_plan_merge_filter_into_join_condition")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Allow to merge filter into `JOIN` condition and convert `CROSS JOIN` to `INNER`.
## query\_plan\_merge\_filters[β](https://clickhouse.com/docs/operations/settings/settings#query_plan_merge_filters "Direct link to query_plan_merge_filters")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Allow to merge filters in the query plan.
## query\_plan\_optimize\_join\_order\_algorithm[β](https://clickhouse.com/docs/operations/settings/settings#query_plan_optimize_join_order_algorithm "Direct link to query_plan_optimize_join_order_algorithm")
Experimental feature.
[Learn more.](https://clickhouse.com/docs/beta-and-experimental-features#experimental-features)
| Type | Default value |
|---|---|
| TypeJoinOrderAlgorithm | Default valuegreedy |
Version history
Specifies which JOIN order algorithms to attempt during query plan optimization. The following algorithms are available:
- 'greedy' - basic greedy algorithm - works fast but might not produce the best join order
- 'dpsize' - implements DPsize algorithm currently only for Inner joins - considers all possible join orders and finds the most optimal one but might be slow for queries with many tables and join predicates. Multiple algorithms can be specified, e.g. 'dpsize,greedy'.
## query\_plan\_optimize\_join\_order\_limit[β](https://clickhouse.com/docs/operations/settings/settings#query_plan_optimize_join_order_limit "Direct link to query_plan_optimize_join_order_limit")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value10 |
Version history
Optimize the order of joins within the same subquery. Currently only supported for very limited cases. Value is the maximum number of tables to optimize.
## query\_plan\_optimize\_join\_order\_randomize[β](https://clickhouse.com/docs/operations/settings/settings#query_plan_optimize_join_order_randomize "Direct link to query_plan_optimize_join_order_randomize")
Experimental feature.
[Learn more.](https://clickhouse.com/docs/beta-and-experimental-features#experimental-features)
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Version history
When non-zero, the join order optimizer uses randomly generated cardinalities and NDVs instead of real statistics. When set to 1, a random seed is generated, when set to a value \> 1, that value is used as the seed directly. This is intended for testing to find errors caused by different join orderings.
## query\_plan\_optimize\_lazy\_materialization[β](https://clickhouse.com/docs/operations/settings/settings#query_plan_optimize_lazy_materialization "Direct link to query_plan_optimize_lazy_materialization")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Use query plan for lazy materialization optimization.
## query\_plan\_optimize\_prewhere[β](https://clickhouse.com/docs/operations/settings/settings#query_plan_optimize_prewhere "Direct link to query_plan_optimize_prewhere")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Allow to push down filter to PREWHERE expression for supported storages
## query\_plan\_push\_down\_limit[β](https://clickhouse.com/docs/operations/settings/settings#query_plan_push_down_limit "Direct link to query_plan_push_down_limit")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Toggles a query-plan-level optimization which moves LIMITs down in the execution plan. Only takes effect if setting [query\_plan\_enable\_optimizations](https://clickhouse.com/docs/operations/settings/settings#query_plan_enable_optimizations) is 1.
Note
This is an expert-level setting which should only be used for debugging by developers. The setting may change in future in backward-incompatible ways or be removed.
Possible values:
- 0 - Disable
- 1 - Enable
## query\_plan\_read\_in\_order[β](https://clickhouse.com/docs/operations/settings/settings#query_plan_read_in_order "Direct link to query_plan_read_in_order")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Toggles the read in-order optimization query-plan-level optimization. Only takes effect if setting [`query_plan_enable_optimizations`](https://clickhouse.com/docs/operations/settings/settings#query_plan_enable_optimizations) is 1.
Note
This is an expert-level setting which should only be used for debugging by developers. The setting may change in future in backward-incompatible ways or be removed.
Possible values:
- 0 - Disable
- 1 - Enable
## query\_plan\_read\_in\_order\_through\_join[β](https://clickhouse.com/docs/operations/settings/settings#query_plan_read_in_order_through_join "Direct link to query_plan_read_in_order_through_join")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Keep reading in order from the left table in JOIN operations, which can be utilized by subsequent steps.
## query\_plan\_remove\_redundant\_distinct[β](https://clickhouse.com/docs/operations/settings/settings#query_plan_remove_redundant_distinct "Direct link to query_plan_remove_redundant_distinct")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Toggles a query-plan-level optimization which removes redundant DISTINCT steps. Only takes effect if setting [`query_plan_enable_optimizations`](https://clickhouse.com/docs/operations/settings/settings#query_plan_enable_optimizations) is 1.
Note
This is an expert-level setting which should only be used for debugging by developers. The setting may change in future in backward-incompatible ways or be removed.
Possible values:
- 0 - Disable
- 1 - Enable
## query\_plan\_remove\_redundant\_sorting[β](https://clickhouse.com/docs/operations/settings/settings#query_plan_remove_redundant_sorting "Direct link to query_plan_remove_redundant_sorting")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Toggles a query-plan-level optimization which removes redundant sorting steps, e.g. in subqueries. Only takes effect if setting [`query_plan_enable_optimizations`](https://clickhouse.com/docs/operations/settings/settings#query_plan_enable_optimizations) is 1.
Note
This is an expert-level setting which should only be used for debugging by developers. The setting may change in future in backward-incompatible ways or be removed.
Possible values:
- 0 - Disable
- 1 - Enable
## query\_plan\_remove\_unused\_columns[β](https://clickhouse.com/docs/operations/settings/settings#query_plan_remove_unused_columns "Direct link to query_plan_remove_unused_columns")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Toggles a query-plan-level optimization which tries to remove unused columns (both input and output columns) from query plan steps. Only takes effect if setting [query\_plan\_enable\_optimizations](https://clickhouse.com/docs/operations/settings/settings#query_plan_enable_optimizations) is 1.
Note
This is an expert-level setting which should only be used for debugging by developers. The setting may change in future in backward-incompatible ways or be removed.
Possible values:
- 0 - Disable
- 1 - Enable
## query\_plan\_reuse\_storage\_ordering\_for\_window\_functions[β](https://clickhouse.com/docs/operations/settings/settings#query_plan_reuse_storage_ordering_for_window_functions "Direct link to query_plan_reuse_storage_ordering_for_window_functions")
**Aliases**: `optimize_read_in_window_order`
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
Toggles a query-plan-level optimization which uses storage sorting when sorting for window functions. Only takes effect if setting [`query_plan_enable_optimizations`](https://clickhouse.com/docs/operations/settings/settings#query_plan_enable_optimizations) is 1.
Note
This is an expert-level setting which should only be used for debugging by developers. The setting may change in future in backward-incompatible ways or be removed.
Possible values:
- 0 - Disable
- 1 - Enable
## query\_plan\_split\_filter[β](https://clickhouse.com/docs/operations/settings/settings#query_plan_split_filter "Direct link to query_plan_split_filter")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Note
This is an expert-level setting which should only be used for debugging by developers. The setting may change in future in backward-incompatible ways or be removed.
Toggles a query-plan-level optimization which splits filters into expressions. Only takes effect if setting [query\_plan\_enable\_optimizations](https://clickhouse.com/docs/operations/settings/settings#query_plan_enable_optimizations) is 1.
Possible values:
- 0 - Disable
- 1 - Enable
## query\_plan\_text\_index\_add\_hint[β](https://clickhouse.com/docs/operations/settings/settings#query_plan_text_index_add_hint "Direct link to query_plan_text_index_add_hint")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Allow to add hint (additional predicate) for filtering built from the inverted text index in query plan.
## query\_plan\_try\_use\_vector\_search[β](https://clickhouse.com/docs/operations/settings/settings#query_plan_try_use_vector_search "Direct link to query_plan_try_use_vector_search")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Toggles a query-plan-level optimization which tries to use the vector similarity index. Only takes effect if setting [`query_plan_enable_optimizations`](https://clickhouse.com/docs/operations/settings/settings#query_plan_enable_optimizations) is 1.
Note
This is an expert-level setting which should only be used for debugging by developers. The setting may change in future in backward-incompatible ways or be removed.
Possible values:
- 0 - Disable
- 1 - Enable
## query\_plan\_use\_new\_logical\_join\_step[β](https://clickhouse.com/docs/operations/settings/settings#query_plan_use_new_logical_join_step "Direct link to query_plan_use_new_logical_join_step")
**Aliases**: `query_plan_use_logical_join_step`
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Use logical join step in query plan. Note: setting `query_plan_use_new_logical_join_step` is deprecated, use `query_plan_use_logical_join_step` instead.
## query\_profiler\_cpu\_time\_period\_ns[β](https://clickhouse.com/docs/operations/settings/settings#query_profiler_cpu_time_period_ns "Direct link to query_profiler_cpu_time_period_ns")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value1000000000 |
Sets the period for a CPU clock timer of the [query profiler](https://clickhouse.com/docs/operations/optimizing-performance/sampling-query-profiler). This timer counts only CPU time.
Possible values:
- A positive integer number of nanoseconds.
Recommended values:
- 10000000 (100 times a second) nanoseconds and more for single queries.
- 1000000000 (once a second) for cluster-wide profiling.
- 0 for turning off the timer.
See also:
- System table [trace\_log](https://clickhouse.com/docs/operations/system-tables/trace_log)
## query\_profiler\_real\_time\_period\_ns[β](https://clickhouse.com/docs/operations/settings/settings#query_profiler_real_time_period_ns "Direct link to query_profiler_real_time_period_ns")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value1000000000 |
Sets the period for a real clock timer of the [query profiler](https://clickhouse.com/docs/operations/optimizing-performance/sampling-query-profiler). Real clock timer counts wall-clock time.
Possible values:
- Positive integer number, in nanoseconds.
Recommended values:
- 10000000 (100 times a second) nanoseconds and less for single queries.
- 1000000000 (once a second) for cluster-wide profiling.
- 0 for turning off the timer.
See also:
- System table [trace\_log](https://clickhouse.com/docs/operations/system-tables/trace_log)
Cloud default value: `3000000000`.
## queue\_max\_wait\_ms[β](https://clickhouse.com/docs/operations/settings/settings#queue_max_wait_ms "Direct link to queue_max_wait_ms")
| Type | Default value |
|---|---|
| TypeMilliseconds | Default value0 |
The wait time in the request queue, if the number of concurrent requests exceeds the maximum.
## rabbitmq\_max\_wait\_ms[β](https://clickhouse.com/docs/operations/settings/settings#rabbitmq_max_wait_ms "Direct link to rabbitmq_max_wait_ms")
| Type | Default value |
|---|---|
| TypeMilliseconds | Default value5000 |
The wait time for reading from RabbitMQ before retry.
## read\_backoff\_max\_throughput[β](https://clickhouse.com/docs/operations/settings/settings#read_backoff_max_throughput "Direct link to read_backoff_max_throughput")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value1048576 |
Settings to reduce the number of threads in case of slow reads. Count events when the read bandwidth is less than that many bytes per second.
## read\_backoff\_min\_concurrency[β](https://clickhouse.com/docs/operations/settings/settings#read_backoff_min_concurrency "Direct link to read_backoff_min_concurrency")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value1 |
Settings to try keeping the minimal number of threads in case of slow reads.
## read\_backoff\_min\_events[β](https://clickhouse.com/docs/operations/settings/settings#read_backoff_min_events "Direct link to read_backoff_min_events")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value2 |
Settings to reduce the number of threads in case of slow reads. The number of events after which the number of threads will be reduced.
## read\_backoff\_min\_interval\_between\_events\_ms[β](https://clickhouse.com/docs/operations/settings/settings#read_backoff_min_interval_between_events_ms "Direct link to read_backoff_min_interval_between_events_ms")
| Type | Default value |
|---|---|
| TypeMilliseconds | Default value1000 |
Settings to reduce the number of threads in case of slow reads. Do not pay attention to the event, if the previous one has passed less than a certain amount of time.
## read\_backoff\_min\_latency\_ms[β](https://clickhouse.com/docs/operations/settings/settings#read_backoff_min_latency_ms "Direct link to read_backoff_min_latency_ms")
| Type | Default value |
|---|---|
| TypeMilliseconds | Default value1000 |
Setting to reduce the number of threads in case of slow reads. Pay attention only to reads that took at least that much time.
## read\_from\_distributed\_cache\_if\_exists\_otherwise\_bypass\_cache[β](https://clickhouse.com/docs/operations/settings/settings#read_from_distributed_cache_if_exists_otherwise_bypass_cache "Direct link to read_from_distributed_cache_if_exists_otherwise_bypass_cache")
ClickHouse Cloud only
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
Only has an effect in ClickHouse Cloud. Same as read\_from\_filesystem\_cache\_if\_exists\_otherwise\_bypass\_cache, but for distributed cache.
## read\_from\_filesystem\_cache\_if\_exists\_otherwise\_bypass\_cache[β](https://clickhouse.com/docs/operations/settings/settings#read_from_filesystem_cache_if_exists_otherwise_bypass_cache "Direct link to read_from_filesystem_cache_if_exists_otherwise_bypass_cache")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Allow to use the filesystem cache in passive mode - benefit from the existing cache entries, but don't put more entries into the cache. If you set this setting for heavy ad-hoc queries and leave it disabled for short real-time queries, this will allows to avoid cache threshing by too heavy queries and to improve the overall system efficiency.
## read\_from\_page\_cache\_if\_exists\_otherwise\_bypass\_cache[β](https://clickhouse.com/docs/operations/settings/settings#read_from_page_cache_if_exists_otherwise_bypass_cache "Direct link to read_from_page_cache_if_exists_otherwise_bypass_cache")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
Use userspace page cache in passive mode, similar to read\_from\_filesystem\_cache\_if\_exists\_otherwise\_bypass\_cache.
## read\_in\_order\_two\_level\_merge\_threshold[β](https://clickhouse.com/docs/operations/settings/settings#read_in_order_two_level_merge_threshold "Direct link to read_in_order_two_level_merge_threshold")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value100 |
Minimal number of parts to read to run preliminary merge step during multithread reading in order of primary key.
## read\_in\_order\_use\_buffering[β](https://clickhouse.com/docs/operations/settings/settings#read_in_order_use_buffering "Direct link to read_in_order_use_buffering")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Use buffering before merging while reading in order of primary key. It increases the parallelism of query executio
## read\_in\_order\_use\_virtual\_row[β](https://clickhouse.com/docs/operations/settings/settings#read_in_order_use_virtual_row "Direct link to read_in_order_use_virtual_row")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
Use virtual row while reading in order of primary key or its monotonic function fashion. It is useful when searching over multiple parts as only relevant ones are touched.
## read\_overflow\_mode[β](https://clickhouse.com/docs/operations/settings/settings#read_overflow_mode "Direct link to read_overflow_mode")
| Type | Default value |
|---|---|
| TypeOverflowMode | Default valuethrow |
What to do when the limit is exceeded.
## read\_overflow\_mode\_leaf[β](https://clickhouse.com/docs/operations/settings/settings#read_overflow_mode_leaf "Direct link to read_overflow_mode_leaf")
| Type | Default value |
|---|---|
| TypeOverflowMode | Default valuethrow |
Sets what happens when the volume of data read exceeds one of the leaf limits.
Possible options:
- `throw`: throw an exception (default).
- `break`: stop executing the query and return the partial result.
## read\_priority[β](https://clickhouse.com/docs/operations/settings/settings#read_priority "Direct link to read_priority")
| Type | Default value |
|---|---|
| TypeInt64 | Default value0 |
Priority to read data from local filesystem or remote filesystem. Only supported for 'pread\_threadpool' method for local filesystem and for `threadpool` method for remote filesystem.
## read\_through\_distributed\_cache[β](https://clickhouse.com/docs/operations/settings/settings#read_through_distributed_cache "Direct link to read_through_distributed_cache")
ClickHouse Cloud only
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
Only has an effect in ClickHouse Cloud. Allow reading from distributed cache
## readonly[β](https://clickhouse.com/docs/operations/settings/settings#readonly "Direct link to readonly")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
0 - no read-only restrictions. 1 - only read requests, as well as changing explicitly allowed settings. 2 - only read requests, as well as changing settings, except for the 'readonly' setting.
## receive\_data\_timeout\_ms[β](https://clickhouse.com/docs/operations/settings/settings#receive_data_timeout_ms "Direct link to receive_data_timeout_ms")
| Type | Default value |
|---|---|
| TypeMilliseconds | Default value2000 |
Connection timeout for receiving first packet of data or packet with positive progress from replica
## receive\_timeout[β](https://clickhouse.com/docs/operations/settings/settings#receive_timeout "Direct link to receive_timeout")
| Type | Default value |
|---|---|
| TypeSeconds | Default value300 |
Timeout for receiving data from the network, in seconds. If no bytes were received in this interval, the exception is thrown. If you set this setting on the client, the 'send\_timeout' for the socket will also be set on the corresponding connection end on the server.
## regexp\_dict\_allow\_hyperscan[β](https://clickhouse.com/docs/operations/settings/settings#regexp_dict_allow_hyperscan "Direct link to regexp_dict_allow_hyperscan")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Allow regexp\_tree dictionary using Hyperscan library.
## regexp\_dict\_flag\_case\_insensitive[β](https://clickhouse.com/docs/operations/settings/settings#regexp_dict_flag_case_insensitive "Direct link to regexp_dict_flag_case_insensitive")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Use case-insensitive matching for a regexp\_tree dictionary. Can be overridden in individual expressions with (?i) and (?-i).
## regexp\_dict\_flag\_dotall[β](https://clickhouse.com/docs/operations/settings/settings#regexp_dict_flag_dotall "Direct link to regexp_dict_flag_dotall")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Allow '.' to match newline characters for a regexp\_tree dictionary.
## regexp\_max\_matches\_per\_row[β](https://clickhouse.com/docs/operations/settings/settings#regexp_max_matches_per_row "Direct link to regexp_max_matches_per_row")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value1000 |
Sets the maximum number of matches for a single regular expression per row. Use it to protect against memory overload when using greedy regular expression in the [extractAllGroupsHorizontal](https://clickhouse.com/docs/sql-reference/functions/string-search-functions#extractAllGroupsHorizontal) function.
Possible values:
- Positive integer.
## reject\_expensive\_hyperscan\_regexps[β](https://clickhouse.com/docs/operations/settings/settings#reject_expensive_hyperscan_regexps "Direct link to reject_expensive_hyperscan_regexps")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Reject patterns which will likely be expensive to evaluate with hyperscan (due to NFA state explosion)
## remerge\_sort\_lowered\_memory\_bytes\_ratio[β](https://clickhouse.com/docs/operations/settings/settings#remerge_sort_lowered_memory_bytes_ratio "Direct link to remerge_sort_lowered_memory_bytes_ratio")
| Type | Default value |
|---|---|
| TypeFloat | Default value2 |
If memory usage after remerge does not reduced by this ratio, remerge will be disabled.
## remote\_filesystem\_read\_method[β](https://clickhouse.com/docs/operations/settings/settings#remote_filesystem_read_method "Direct link to remote_filesystem_read_method")
| Type | Default value |
|---|---|
| TypeString | Default valuethreadpool |
Method of reading data from remote filesystem, one of: read, threadpool.
## remote\_filesystem\_read\_prefetch[β](https://clickhouse.com/docs/operations/settings/settings#remote_filesystem_read_prefetch "Direct link to remote_filesystem_read_prefetch")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Should use prefetching when reading data from remote filesystem.
## remote\_fs\_read\_backoff\_max\_tries[β](https://clickhouse.com/docs/operations/settings/settings#remote_fs_read_backoff_max_tries "Direct link to remote_fs_read_backoff_max_tries")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value5 |
Max attempts to read with backoff
## remote\_fs\_read\_max\_backoff\_ms[β](https://clickhouse.com/docs/operations/settings/settings#remote_fs_read_max_backoff_ms "Direct link to remote_fs_read_max_backoff_ms")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value10000 |
Max wait time when trying to read data for remote disk
## remote\_read\_min\_bytes\_for\_seek[β](https://clickhouse.com/docs/operations/settings/settings#remote_read_min_bytes_for_seek "Direct link to remote_read_min_bytes_for_seek")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value4194304 |
Min bytes required for remote read (url, s3) to do seek, instead of read with ignore.
## rename\_files\_after\_processing[β](https://clickhouse.com/docs/operations/settings/settings#rename_files_after_processing "Direct link to rename_files_after_processing")
- **Type:** String
- **Default value:** Empty string
This setting allows to specify renaming pattern for files processed by `file` table function. When option is set, all files read by `file` table function will be renamed according to specified pattern with placeholders, only if files processing was successful.
### Placeholders[β](https://clickhouse.com/docs/operations/settings/settings#placeholders "Direct link to Placeholders")
- `%a` β Full original filename (e.g., "sample.csv").
- `%f` β Original filename without extension (e.g., "sample").
- `%e` β Original file extension with dot (e.g., ".csv").
- `%t` β Timestamp (in microseconds).
- `%%` β Percentage sign ("%").
### Example[β](https://clickhouse.com/docs/operations/settings/settings#example "Direct link to Example")
- Option: `--rename_files_after_processing="processed_%f_%t%e"`
- Query: `SELECT * FROM file('sample.csv')`
If reading `sample.csv` is successful, file will be renamed to `processed_sample_1683473210851438.csv`
## replace\_running\_query[β](https://clickhouse.com/docs/operations/settings/settings#replace_running_query "Direct link to replace_running_query")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
When using the HTTP interface, the 'query\_id' parameter can be passed. This is any string that serves as the query identifier. If a query from the same user with the same 'query\_id' already exists at this time, the behaviour depends on the 'replace\_running\_query' parameter.
`0` (default) β Throw an exception (do not allow the query to run if a query with the same 'query\_id' is already running).
`1` β Cancel the old query and start running the new one.
Set this parameter to 1 for implementing suggestions for segmentation conditions. After entering the next character, if the old query hasn't finished yet, it should be cancelled.
## replace\_running\_query\_max\_wait\_ms[β](https://clickhouse.com/docs/operations/settings/settings#replace_running_query_max_wait_ms "Direct link to replace_running_query_max_wait_ms")
| Type | Default value |
|---|---|
| TypeMilliseconds | Default value5000 |
The wait time for running the query with the same `query_id` to finish, when the [replace\_running\_query](https://clickhouse.com/docs/operations/settings/settings#replace_running_query) setting is active.
Possible values:
- Positive integer.
- 0 β Throwing an exception that does not allow to run a new query if the server already executes a query with the same `query_id`.
## replication\_wait\_for\_inactive\_replica\_timeout[β](https://clickhouse.com/docs/operations/settings/settings#replication_wait_for_inactive_replica_timeout "Direct link to replication_wait_for_inactive_replica_timeout")
| Type | Default value |
|---|---|
| TypeInt64 | Default value120 |
Specifies how long (in seconds) to wait for inactive replicas to execute [`ALTER`](https://clickhouse.com/docs/sql-reference/statements/alter), [`OPTIMIZE`](https://clickhouse.com/docs/sql-reference/statements/optimize) or [`TRUNCATE`](https://clickhouse.com/docs/sql-reference/statements/truncate) queries.
Possible values:
- `0` β Do not wait.
- Negative integer β Wait for unlimited time.
- Positive integer β The number of seconds to wait.
## restore\_replace\_external\_dictionary\_source\_to\_null[β](https://clickhouse.com/docs/operations/settings/settings#restore_replace_external_dictionary_source_to_null "Direct link to restore_replace_external_dictionary_source_to_null")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
Replace external dictionary sources to Null on restore. Useful for testing purposes
## restore\_replace\_external\_engines\_to\_null[β](https://clickhouse.com/docs/operations/settings/settings#restore_replace_external_engines_to_null "Direct link to restore_replace_external_engines_to_null")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
For testing purposes. Replaces all external engines to Null to not initiate external connections.
## restore\_replace\_external\_table\_functions\_to\_null[β](https://clickhouse.com/docs/operations/settings/settings#restore_replace_external_table_functions_to_null "Direct link to restore_replace_external_table_functions_to_null")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
For testing purposes. Replaces all external table functions to Null to not initiate external connections.
## restore\_replicated\_merge\_tree\_to\_shared\_merge\_tree[β](https://clickhouse.com/docs/operations/settings/settings#restore_replicated_merge_tree_to_shared_merge_tree "Direct link to restore_replicated_merge_tree_to_shared_merge_tree")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
Replace table engine from Replicated*MergeTree -\> Shared*MergeTree during RESTORE.
Cloud default value: `1`.
## result\_overflow\_mode[β](https://clickhouse.com/docs/operations/settings/settings#result_overflow_mode "Direct link to result_overflow_mode")
| Type | Default value |
|---|---|
| TypeOverflowMode | Default valuethrow |
Cloud default value: `throw`
Sets what to do if the volume of the result exceeds one of the limits.
Possible values:
- `throw`: throw an exception (default).
- `break`: stop executing the query and return the partial result, as if the source data ran out.
Using 'break' is similar to using LIMIT. `Break` interrupts execution only at the block level. This means that amount of returned rows is greater than [`max_result_rows`](https://clickhouse.com/docs/operations/settings/settings#max_result_rows), multiple of [`max_block_size`](https://clickhouse.com/docs/operations/settings/settings#max_block_size) and depends on [`max_threads`](https://clickhouse.com/docs/operations/settings/settings#max_threads).
**Example**
```
SET max_threads = 3, max_block_size = 3333;
SET max_result_rows = 3334, result_overflow_mode = 'break';
SELECT *
FROM numbers_mt(100000)
FORMAT Null;
```
```
6666 rows in set. ...
```
## rewrite\_count\_distinct\_if\_with\_count\_distinct\_implementation[β](https://clickhouse.com/docs/operations/settings/settings#rewrite_count_distinct_if_with_count_distinct_implementation "Direct link to rewrite_count_distinct_if_with_count_distinct_implementation")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
Allows you to rewrite `countDistcintIf` with [count\_distinct\_implementation](https://clickhouse.com/docs/operations/settings/settings#count_distinct_implementation) setting.
Possible values:
- true β Allow.
- false β Disallow.
## rewrite\_in\_to\_join[β](https://clickhouse.com/docs/operations/settings/settings#rewrite_in_to_join "Direct link to rewrite_in_to_join")
Experimental feature.
[Learn more.](https://clickhouse.com/docs/beta-and-experimental-features#experimental-features)
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
Rewrite expressions like 'x IN subquery' to JOIN. This might be useful for optimizing the whole query with join reordering.
## rows\_before\_aggregation[β](https://clickhouse.com/docs/operations/settings/settings#rows_before_aggregation "Direct link to rows_before_aggregation")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
When enabled, ClickHouse will provide exact value for rows\_before\_aggregation statistic, represents the number of rows read before aggregatio
## s3\_allow\_multipart\_copy[β](https://clickhouse.com/docs/operations/settings/settings#s3_allow_multipart_copy "Direct link to s3_allow_multipart_copy")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Allow multipart copy in S3.
## s3\_allow\_parallel\_part\_upload[β](https://clickhouse.com/docs/operations/settings/settings#s3_allow_parallel_part_upload "Direct link to s3_allow_parallel_part_upload")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Use multiple threads for s3 multipart upload. It may lead to slightly higher memory usage
## s3\_check\_objects\_after\_upload[β](https://clickhouse.com/docs/operations/settings/settings#s3_check_objects_after_upload "Direct link to s3_check_objects_after_upload")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Check each uploaded object to s3 with head request to be sure that upload was successful
## s3\_connect\_timeout\_ms[β](https://clickhouse.com/docs/operations/settings/settings#s3_connect_timeout_ms "Direct link to s3_connect_timeout_ms")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value1000 |
Version history
Connection timeout for host from s3 disks.
## s3\_create\_new\_file\_on\_insert[β](https://clickhouse.com/docs/operations/settings/settings#s3_create_new_file_on_insert "Direct link to s3_create_new_file_on_insert")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Enables or disables creating a new file on each insert in s3 engine tables. If enabled, on each insert a new S3 object will be created with the key, similar to this pattern:
initial: `data.Parquet.gz` -\> `data.1.Parquet.gz` -\> `data.2.Parquet.gz`, etc.
Possible values:
- 0 β `INSERT` query creates a new file or fail if file exists and s3\_truncate\_on\_insert is not set.
- 1 β `INSERT` query creates a new file on each insert using suffix (from the second one) if s3\_truncate\_on\_insert is not set.
See more details [here](https://clickhouse.com/docs/integrations/s3#inserting-data).
## s3\_disable\_checksum[β](https://clickhouse.com/docs/operations/settings/settings#s3_disable_checksum "Direct link to s3_disable_checksum")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Do not calculate a checksum when sending a file to S3. This speeds up writes by avoiding excessive processing passes on a file. It is mostly safe as the data of MergeTree tables is checksummed by ClickHouse anyway, and when S3 is accessed with HTTPS, the TLS layer already provides integrity while transferring through the network. While additional checksums on S3 give defense in depth.
## s3\_ignore\_file\_doesnt\_exist[β](https://clickhouse.com/docs/operations/settings/settings#s3_ignore_file_doesnt_exist "Direct link to s3_ignore_file_doesnt_exist")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
Ignore absence of file if it does not exist when reading certain keys.
Possible values:
- 1 β `SELECT` returns empty result.
- 0 β `SELECT` throws an exception.
## s3\_list\_object\_keys\_size[β](https://clickhouse.com/docs/operations/settings/settings#s3_list_object_keys_size "Direct link to s3_list_object_keys_size")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value1000 |
Maximum number of files that could be returned in batch by ListObject request
## s3\_max\_connections[β](https://clickhouse.com/docs/operations/settings/settings#s3_max_connections "Direct link to s3_max_connections")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value1024 |
The maximum number of connections per server.
## s3\_max\_get\_burst[β](https://clickhouse.com/docs/operations/settings/settings#s3_max_get_burst "Direct link to s3_max_get_burst")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Max number of requests that can be issued simultaneously before hitting request per second limit. By default (0) equals to `s3_max_get_rps`
## s3\_max\_get\_rps[β](https://clickhouse.com/docs/operations/settings/settings#s3_max_get_rps "Direct link to s3_max_get_rps")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Limit on S3 GET request per second rate before throttling. Zero means unlimited.
## s3\_max\_inflight\_parts\_for\_one\_file[β](https://clickhouse.com/docs/operations/settings/settings#s3_max_inflight_parts_for_one_file "Direct link to s3_max_inflight_parts_for_one_file")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value20 |
The maximum number of a concurrent loaded parts in multipart upload request. 0 means unlimited.
## s3\_max\_part\_number[β](https://clickhouse.com/docs/operations/settings/settings#s3_max_part_number "Direct link to s3_max_part_number")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value10000 |
Version history
Maximum part number number for s3 upload part.
## s3\_max\_put\_burst[β](https://clickhouse.com/docs/operations/settings/settings#s3_max_put_burst "Direct link to s3_max_put_burst")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Max number of requests that can be issued simultaneously before hitting request per second limit. By default (0) equals to `s3_max_put_rps`
## s3\_max\_put\_rps[β](https://clickhouse.com/docs/operations/settings/settings#s3_max_put_rps "Direct link to s3_max_put_rps")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Limit on S3 PUT request per second rate before throttling. Zero means unlimited.
## s3\_max\_single\_operation\_copy\_size[β](https://clickhouse.com/docs/operations/settings/settings#s3_max_single_operation_copy_size "Direct link to s3_max_single_operation_copy_size")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value33554432 |
Version history
Maximum size for single-operation copy in s3. This setting is used only if s3\_allow\_multipart\_copy is true.
## s3\_max\_single\_part\_upload\_size[β](https://clickhouse.com/docs/operations/settings/settings#s3_max_single_part_upload_size "Direct link to s3_max_single_part_upload_size")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value33554432 |
The maximum size of object to upload using singlepart upload to S3.
## s3\_max\_single\_read\_retries[β](https://clickhouse.com/docs/operations/settings/settings#s3_max_single_read_retries "Direct link to s3_max_single_read_retries")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value4 |
The maximum number of retries during single S3 read.
## s3\_max\_unexpected\_write\_error\_retries[β](https://clickhouse.com/docs/operations/settings/settings#s3_max_unexpected_write_error_retries "Direct link to s3_max_unexpected_write_error_retries")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value4 |
The maximum number of retries in case of unexpected errors during S3 write.
## s3\_max\_upload\_part\_size[β](https://clickhouse.com/docs/operations/settings/settings#s3_max_upload_part_size "Direct link to s3_max_upload_part_size")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value5368709120 |
The maximum size of part to upload during multipart upload to S3.
## s3\_min\_upload\_part\_size[β](https://clickhouse.com/docs/operations/settings/settings#s3_min_upload_part_size "Direct link to s3_min_upload_part_size")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value16777216 |
The minimum size of part to upload during multipart upload to S3.
## s3\_path\_filter\_limit[β](https://clickhouse.com/docs/operations/settings/settings#s3_path_filter_limit "Direct link to s3_path_filter_limit")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value1000 |
Version history
Maximum number of `_path` values that can be extracted from query filters to use for file iteration instead of glob listing. 0 means disabled.
## s3\_request\_timeout\_ms[β](https://clickhouse.com/docs/operations/settings/settings#s3_request_timeout_ms "Direct link to s3_request_timeout_ms")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value30000 |
Idleness timeout for sending and receiving data to/from S3. Fail if a single TCP read or write call blocks for this long.
## s3\_skip\_empty\_files[β](https://clickhouse.com/docs/operations/settings/settings#s3_skip_empty_files "Direct link to s3_skip_empty_files")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Enables or disables skipping empty files in [S3](https://clickhouse.com/docs/engines/table-engines/integrations/s3) engine tables.
Possible values:
- 0 β `SELECT` throws an exception if empty file is not compatible with requested format.
- 1 β `SELECT` returns empty result for empty file.
## s3\_slow\_all\_threads\_after\_network\_error[β](https://clickhouse.com/docs/operations/settings/settings#s3_slow_all_threads_after_network_error "Direct link to s3_slow_all_threads_after_network_error")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
When set to `true`, all threads executing S3 requests to the same backup endpoint are slowed down after any single s3 request encounters a retryable network error, such as socket timeout. When set to `false`, each thread handles S3 request backoff independently of the others.
## s3\_strict\_upload\_part\_size[β](https://clickhouse.com/docs/operations/settings/settings#s3_strict_upload_part_size "Direct link to s3_strict_upload_part_size")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
The exact size of part to upload during multipart upload to S3 (some implementations does not supports variable size parts).
## s3\_throw\_on\_zero\_files\_match[β](https://clickhouse.com/docs/operations/settings/settings#s3_throw_on_zero_files_match "Direct link to s3_throw_on_zero_files_match")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Throw an error, when ListObjects request cannot match any files
## s3\_truncate\_on\_insert[β](https://clickhouse.com/docs/operations/settings/settings#s3_truncate_on_insert "Direct link to s3_truncate_on_insert")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Enables or disables truncate before inserts in s3 engine tables. If disabled, an exception will be thrown on insert attempts if an S3 object already exists.
Possible values:
- 0 β `INSERT` query creates a new file or fail if file exists and s3\_create\_new\_file\_on\_insert is not set.
- 1 β `INSERT` query replaces existing content of the file with the new data.
See more details [here](https://clickhouse.com/docs/integrations/s3#inserting-data).
## s3\_upload\_part\_size\_multiply\_factor[β](https://clickhouse.com/docs/operations/settings/settings#s3_upload_part_size_multiply_factor "Direct link to s3_upload_part_size_multiply_factor")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value2 |
Multiply s3\_min\_upload\_part\_size by this factor each time s3\_multiply\_parts\_count\_threshold parts were uploaded from a single write to S3.
## s3\_upload\_part\_size\_multiply\_parts\_count\_threshold[β](https://clickhouse.com/docs/operations/settings/settings#s3_upload_part_size_multiply_parts_count_threshold "Direct link to s3_upload_part_size_multiply_parts_count_threshold")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value500 |
Each time this number of parts was uploaded to S3, s3\_min\_upload\_part\_size is multiplied by s3\_upload\_part\_size\_multiply\_factor.
## s3\_use\_adaptive\_timeouts[β](https://clickhouse.com/docs/operations/settings/settings#s3_use_adaptive_timeouts "Direct link to s3_use_adaptive_timeouts")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
When set to `true` than for all s3 requests first two attempts are made with low send and receive timeouts. When set to `false` than all attempts are made with identical timeouts.
## s3\_validate\_request\_settings[β](https://clickhouse.com/docs/operations/settings/settings#s3_validate_request_settings "Direct link to s3_validate_request_settings")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Enables s3 request settings validation. Possible values:
- 1 β validate settings.
- 0 β do not validate settings.
## s3queue\_default\_zookeeper\_path[β](https://clickhouse.com/docs/operations/settings/settings#s3queue_default_zookeeper_path "Direct link to s3queue_default_zookeeper_path")
| Type | Default value |
|---|---|
| TypeString | Default value/clickhouse/s3queue/ |
Default zookeeper path prefix for S3Queue engine
## s3queue\_enable\_logging\_to\_s3queue\_log[β](https://clickhouse.com/docs/operations/settings/settings#s3queue_enable_logging_to_s3queue_log "Direct link to s3queue_enable_logging_to_s3queue_log")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Enable writing to system.s3queue\_log. The value can be overwritten per table with table settings
## s3queue\_keeper\_fault\_injection\_probability[β](https://clickhouse.com/docs/operations/settings/settings#s3queue_keeper_fault_injection_probability "Direct link to s3queue_keeper_fault_injection_probability")
| Type | Default value |
|---|---|
| TypeFloat | Default value0 |
Version history
Keeper fault injection probability for S3Queue.
## s3queue\_migrate\_old\_metadata\_to\_buckets[β](https://clickhouse.com/docs/operations/settings/settings#s3queue_migrate_old_metadata_to_buckets "Direct link to s3queue_migrate_old_metadata_to_buckets")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
Migrate old metadata structure of S3Queue table to a new one
## schema\_inference\_cache\_require\_modification\_time\_for\_url[β](https://clickhouse.com/docs/operations/settings/settings#schema_inference_cache_require_modification_time_for_url "Direct link to schema_inference_cache_require_modification_time_for_url")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Use schema from cache for URL with last modification time validation (for URLs with Last-Modified header)
## schema\_inference\_use\_cache\_for\_azure[β](https://clickhouse.com/docs/operations/settings/settings#schema_inference_use_cache_for_azure "Direct link to schema_inference_use_cache_for_azure")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Use cache in schema inference while using azure table functio
## schema\_inference\_use\_cache\_for\_file[β](https://clickhouse.com/docs/operations/settings/settings#schema_inference_use_cache_for_file "Direct link to schema_inference_use_cache_for_file")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Use cache in schema inference while using file table functio
## schema\_inference\_use\_cache\_for\_hdfs[β](https://clickhouse.com/docs/operations/settings/settings#schema_inference_use_cache_for_hdfs "Direct link to schema_inference_use_cache_for_hdfs")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Use cache in schema inference while using hdfs table functio
## schema\_inference\_use\_cache\_for\_s3[β](https://clickhouse.com/docs/operations/settings/settings#schema_inference_use_cache_for_s3 "Direct link to schema_inference_use_cache_for_s3")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Use cache in schema inference while using s3 table functio
## schema\_inference\_use\_cache\_for\_url[β](https://clickhouse.com/docs/operations/settings/settings#schema_inference_use_cache_for_url "Direct link to schema_inference_use_cache_for_url")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Use cache in schema inference while using url table functio
## secondary\_indices\_enable\_bulk\_filtering[β](https://clickhouse.com/docs/operations/settings/settings#secondary_indices_enable_bulk_filtering "Direct link to secondary_indices_enable_bulk_filtering")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Enable the bulk filtering algorithm for indices. It is expected to be always better, but we have this setting for compatibility and control.
## select\_sequential\_consistency[β](https://clickhouse.com/docs/operations/settings/settings#select_sequential_consistency "Direct link to select_sequential_consistency")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Note
This setting differ in behavior between SharedMergeTree and ReplicatedMergeTree, see [SharedMergeTree consistency](https://clickhouse.com/docs/cloud/reference/shared-merge-tree#consistency) for more information about the behavior of `select_sequential_consistency` in SharedMergeTree.
Enables or disables sequential consistency for `SELECT` queries. Requires `insert_quorum_parallel` to be disabled (enabled by default).
Possible values:
- 0 β Disabled.
- 1 β Enabled.
Usage
When sequential consistency is enabled, ClickHouse allows the client to execute the `SELECT` query only for those replicas that contain data from all previous `INSERT` queries executed with `insert_quorum`. If the client refers to a partial replica, ClickHouse will generate an exception. The SELECT query will not include data that has not yet been written to the quorum of replicas.
When `insert_quorum_parallel` is enabled (the default), then `select_sequential_consistency` does not work. This is because parallel `INSERT` queries can be written to different sets of quorum replicas so there is no guarantee a single replica will have received all writes.
See also:
- [insert\_quorum](https://clickhouse.com/docs/operations/settings/settings#insert_quorum)
- [insert\_quorum\_timeout](https://clickhouse.com/docs/operations/settings/settings#insert_quorum_timeout)
- [insert\_quorum\_parallel](https://clickhouse.com/docs/operations/settings/settings#insert_quorum_parallel)
## send\_logs\_level[β](https://clickhouse.com/docs/operations/settings/settings#send_logs_level "Direct link to send_logs_level")
| Type | Default value |
|---|---|
| TypeLogsLevel | Default valuefatal |
Send server text logs with specified minimum level to client. Valid values: 'trace', 'debug', 'information', 'warning', 'error', 'fatal', 'none'
## send\_logs\_source\_regexp[β](https://clickhouse.com/docs/operations/settings/settings#send_logs_source_regexp "Direct link to send_logs_source_regexp")
Send server text logs with specified regexp to match log source name. Empty means all sources.
## send\_profile\_events[β](https://clickhouse.com/docs/operations/settings/settings#send_profile_events "Direct link to send_profile_events")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Enables or disables sending of [ProfileEvents](https://clickhouse.com/docs/native-protocol/server#profile-events) packets to the client.
This can be disabled to reduce network traffic for clients that do not require profile events.
Possible values:
- 0 β Disabled.
- 1 β Enabled.
## send\_progress\_in\_http\_headers[β](https://clickhouse.com/docs/operations/settings/settings#send_progress_in_http_headers "Direct link to send_progress_in_http_headers")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Enables or disables `X-ClickHouse-Progress` HTTP response headers in `clickhouse-server` responses.
For more information, read the [HTTP interface description](https://clickhouse.com/docs/interfaces/http).
Possible values:
- 0 β Disabled.
- 1 β Enabled.
## send\_timeout[β](https://clickhouse.com/docs/operations/settings/settings#send_timeout "Direct link to send_timeout")
| Type | Default value |
|---|---|
| TypeSeconds | Default value300 |
Timeout for sending data to the network, in seconds. If a client needs to send some data but is not able to send any bytes in this interval, the exception is thrown. If you set this setting on the client, the 'receive\_timeout' for the socket will also be set on the corresponding connection end on the server.
## serialize\_query\_plan[β](https://clickhouse.com/docs/operations/settings/settings#serialize_query_plan "Direct link to serialize_query_plan")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
Serialize query plan for distributed processing
## serialize\_string\_in\_memory\_with\_zero\_byte[β](https://clickhouse.com/docs/operations/settings/settings#serialize_string_in_memory_with_zero_byte "Direct link to serialize_string_in_memory_with_zero_byte")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Serialize String values during aggregation with zero byte at the end. Enable to keep compatibility when querying cluster of incompatible versions.
## session\_timezone[β](https://clickhouse.com/docs/operations/settings/settings#session_timezone "Direct link to session_timezone")
Beta feature.
[Learn more.](https://clickhouse.com/docs/beta-and-experimental-features#beta-features)
Sets the implicit time zone of the current session or query. The implicit time zone is the time zone applied to values of type DateTime/DateTime64 which have no explicitly specified time zone. The setting takes precedence over the globally configured (server-level) implicit time zone. A value of '' (empty string) means that the implicit time zone of the current session or query is equal to the [server time zone](https://clickhouse.com/docs/operations/server-configuration-parameters/settings#timezone).
You can use functions `timeZone()` and `serverTimeZone()` to get the session time zone and server time zone.
Possible values:
- Any time zone name from `system.time_zones`, e.g. `Europe/Berlin`, `UTC` or `Zulu`
Examples:
```
SELECT timeZone(), serverTimeZone() FORMAT CSV
"Europe/Berlin","Europe/Berlin"
```
```
SELECT timeZone(), serverTimeZone() SETTINGS session_timezone = 'Asia/Novosibirsk' FORMAT CSV
"Asia/Novosibirsk","Europe/Berlin"
```
Assign session time zone 'America/Denver' to the inner DateTime without explicitly specified time zone:
```
SELECT toDateTime64(toDateTime64('1999-12-12 23:23:23.123', 3), 3, 'Europe/Zurich') SETTINGS session_timezone = 'America/Denver' FORMAT TSV
1999-12-13 07:23:23.123
```
Note
Not all functions that parse DateTime/DateTime64 respect `session_timezone`. This can lead to subtle errors. See the following example and explanation.
```
CREATE TABLE test_tz (`d` DateTime('UTC')) ENGINE = Memory AS SELECT toDateTime('2000-01-01 00:00:00', 'UTC');
SELECT *, timeZone() FROM test_tz WHERE d = toDateTime('2000-01-01 00:00:00') SETTINGS session_timezone = 'Asia/Novosibirsk'
0 rows in set.
SELECT *, timeZone() FROM test_tz WHERE d = '2000-01-01 00:00:00' SETTINGS session_timezone = 'Asia/Novosibirsk'
ββββββββββββββββββββdββ¬βtimeZone()ββββββββ
β 2000-01-01 00:00:00 β Asia/Novosibirsk β
βββββββββββββββββββββββ΄βββββββββββββββββββ
```
This happens due to different parsing pipelines:
- `toDateTime()` without explicitly given time zone used in the first `SELECT` query honors setting `session_timezone` and the global time zone.
- In the second query, a DateTime is parsed from a String, and inherits the type and time zone of the existing column`d`. Thus, setting `session_timezone` and the global time zone are not honored.
**See also**
- [timezone](https://clickhouse.com/docs/operations/server-configuration-parameters/settings#timezone)
## set\_overflow\_mode[β](https://clickhouse.com/docs/operations/settings/settings#set_overflow_mode "Direct link to set_overflow_mode")
| Type | Default value |
|---|---|
| TypeOverflowMode | Default valuethrow |
Sets what happens when the amount of data exceeds one of the limits.
Possible values:
- `throw`: throw an exception (default).
- `break`: stop executing the query and return the partial result, as if the source data ran out.
## shared\_merge\_tree\_sync\_parts\_on\_partition\_operations[β](https://clickhouse.com/docs/operations/settings/settings#shared_merge_tree_sync_parts_on_partition_operations "Direct link to shared_merge_tree_sync_parts_on_partition_operations")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Automatically synchronize set of data parts after MOVE\|REPLACE\|ATTACH partition operations in SMT tables. Cloud only
## short\_circuit\_function\_evaluation[β](https://clickhouse.com/docs/operations/settings/settings#short_circuit_function_evaluation "Direct link to short_circuit_function_evaluation")
| Type | Default value |
|---|---|
| TypeShortCircuitFunctionEvaluation | Default valueenable |
Allows calculating the [if](https://clickhouse.com/docs/sql-reference/functions/conditional-functions#if), [multiIf](https://clickhouse.com/docs/sql-reference/functions/conditional-functions#multiIf), [and](https://clickhouse.com/docs/sql-reference/functions/logical-functions#and), and [or](https://clickhouse.com/docs/sql-reference/functions/logical-functions#or) functions according to a [short scheme](https://en.wikipedia.org/wiki/Short-circuit_evaluation). This helps optimize the execution of complex expressions in these functions and prevent possible exceptions (such as division by zero when it is not expected).
Possible values:
- `enable` β Enables short-circuit function evaluation for functions that are suitable for it (can throw an exception or computationally heavy).
- `force_enable` β Enables short-circuit function evaluation for all functions.
- `disable` β Disables short-circuit function evaluation.
## short\_circuit\_function\_evaluation\_for\_nulls[β](https://clickhouse.com/docs/operations/settings/settings#short_circuit_function_evaluation_for_nulls "Direct link to short_circuit_function_evaluation_for_nulls")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Optimizes evaluation of functions that return NULL when any argument is NULL. When the percentage of NULL values in the function's arguments exceeds the short\_circuit\_function\_evaluation\_for\_nulls\_threshold, the system skips evaluating the function row-by-row. Instead, it immediately returns NULL for all rows, avoiding unnecessary computation.
## short\_circuit\_function\_evaluation\_for\_nulls\_threshold[β](https://clickhouse.com/docs/operations/settings/settings#short_circuit_function_evaluation_for_nulls_threshold "Direct link to short_circuit_function_evaluation_for_nulls_threshold")
| Type | Default value |
|---|---|
| TypeDouble | Default value1 |
Version history
Ratio threshold of NULL values to execute functions with Nullable arguments only on rows with non-NULL values in all arguments. Applies when setting short\_circuit\_function\_evaluation\_for\_nulls is enabled. When the ratio of rows containing NULL values to the total number of rows exceeds this threshold, these rows containing NULL values will not be evaluated.
## show\_data\_lake\_catalogs\_in\_system\_tables[β](https://clickhouse.com/docs/operations/settings/settings#show_data_lake_catalogs_in_system_tables "Direct link to show_data_lake_catalogs_in_system_tables")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
Enables showing data lake catalogs in system tables.
## show\_processlist\_include\_internal[β](https://clickhouse.com/docs/operations/settings/settings#show_processlist_include_internal "Direct link to show_processlist_include_internal")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Show internal auxiliary processes in the `SHOW PROCESSLIST` query output.
Internal processes include dictionary reloads, refreshable materialized view reloads, auxiliary `SELECT`s executed in `SHOW ...` queries, auxiliary `CREATE DATABASE ...` queries executed internally to accommodate broken tables and more.
## show\_table\_uuid\_in\_table\_create\_query\_if\_not\_nil[β](https://clickhouse.com/docs/operations/settings/settings#show_table_uuid_in_table_create_query_if_not_nil "Direct link to show_table_uuid_in_table_create_query_if_not_nil")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
Sets the `SHOW TABLE` query display.
Possible values:
- 0 β The query will be displayed without table UUID.
- 1 β The query will be displayed with table UUID.
## single\_join\_prefer\_left\_table[β](https://clickhouse.com/docs/operations/settings/settings#single_join_prefer_left_table "Direct link to single_join_prefer_left_table")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
For single JOIN in case of identifier ambiguity prefer left table
## skip\_redundant\_aliases\_in\_udf[β](https://clickhouse.com/docs/operations/settings/settings#skip_redundant_aliases_in_udf "Direct link to skip_redundant_aliases_in_udf")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
Redundant aliases are not used (substituted) in user-defined functions in order to simplify it's usage.
Possible values:
- 1 β The aliases are skipped (substituted) in UDFs.
- 0 β The aliases are not skipped (substituted) in UDFs.
**Example**
The difference between enabled and disabled:
Query:
```
SET skip_redundant_aliases_in_udf = 0;
CREATE FUNCTION IF NOT EXISTS test_03274 AS ( x ) -> ((x + 1 as y, y + 2));
EXPLAIN SYNTAX SELECT test_03274(4 + 2);
```
Result:
```
SELECT ((4 + 2) + 1 AS y, y + 2)
```
Query:
```
SET skip_redundant_aliases_in_udf = 1;
CREATE FUNCTION IF NOT EXISTS test_03274 AS ( x ) -> ((x + 1 as y, y + 2));
EXPLAIN SYNTAX SELECT test_03274(4 + 2);
```
Result:
```
SELECT ((4 + 2) + 1, ((4 + 2) + 1) + 2)
```
## skip\_unavailable\_shards[β](https://clickhouse.com/docs/operations/settings/settings#skip_unavailable_shards "Direct link to skip_unavailable_shards")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Enables or disables silently skipping of unavailable shards.
Shard is considered unavailable if all its replicas are unavailable. A replica is unavailable in the following cases:
- ClickHouse can't connect to replica for any reason.
When connecting to a replica, ClickHouse performs several attempts. If all these attempts fail, the replica is considered unavailable.
- Replica can't be resolved through DNS.
If replica's hostname can't be resolved through DNS, it can indicate the following situations:
- Replica's host has no DNS record. It can occur in systems with dynamic DNS, for example, [Kubernetes](https://kubernetes.io/), where nodes can be unresolvable during downtime, and this is not an error.
- Configuration error. ClickHouse configuration file contains a wrong hostname.
Possible values:
- 1 β skipping enabled.
If a shard is unavailable, ClickHouse returns a result based on partial data and does not report node availability issues.
- 0 β skipping disabled.
If a shard is unavailable, ClickHouse throws an exception.
## sleep\_after\_receiving\_query\_ms[β](https://clickhouse.com/docs/operations/settings/settings#sleep_after_receiving_query_ms "Direct link to sleep_after_receiving_query_ms")
| Type | Default value |
|---|---|
| TypeMilliseconds | Default value0 |
Time to sleep after receiving query in TCPHandler
## sleep\_in\_send\_data\_ms[β](https://clickhouse.com/docs/operations/settings/settings#sleep_in_send_data_ms "Direct link to sleep_in_send_data_ms")
| Type | Default value |
|---|---|
| TypeMilliseconds | Default value0 |
Time to sleep in sending data in TCPHandler
## sleep\_in\_send\_tables\_status\_ms[β](https://clickhouse.com/docs/operations/settings/settings#sleep_in_send_tables_status_ms "Direct link to sleep_in_send_tables_status_ms")
| Type | Default value |
|---|---|
| TypeMilliseconds | Default value0 |
Time to sleep in sending tables status response in TCPHandler
## sort\_overflow\_mode[β](https://clickhouse.com/docs/operations/settings/settings#sort_overflow_mode "Direct link to sort_overflow_mode")
| Type | Default value |
|---|---|
| TypeOverflowMode | Default valuethrow |
Sets what happens if the number of rows received before sorting exceeds one of the limits.
Possible values:
- `throw`: throw an exception.
- `break`: stop executing the query and return the partial result.
## split\_intersecting\_parts\_ranges\_into\_layers\_final[β](https://clickhouse.com/docs/operations/settings/settings#split_intersecting_parts_ranges_into_layers_final "Direct link to split_intersecting_parts_ranges_into_layers_final")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Split intersecting parts ranges into layers during FINAL optimizatio
## split\_parts\_ranges\_into\_intersecting\_and\_non\_intersecting\_final[β](https://clickhouse.com/docs/operations/settings/settings#split_parts_ranges_into_intersecting_and_non_intersecting_final "Direct link to split_parts_ranges_into_intersecting_and_non_intersecting_final")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Split parts ranges into intersecting and non intersecting during FINAL optimizatio
## splitby\_max\_substrings\_includes\_remaining\_string[β](https://clickhouse.com/docs/operations/settings/settings#splitby_max_substrings_includes_remaining_string "Direct link to splitby_max_substrings_includes_remaining_string")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Controls whether function [splitBy\*()](https://clickhouse.com/docs/sql-reference/functions/splitting-merging-functions) with argument `max_substrings` \> 0 will include the remaining string in the last element of the result array.
Possible values:
- `0` - The remaining string will not be included in the last element of the result array.
- `1` - The remaining string will be included in the last element of the result array. This is the behavior of Spark's [`split()`](https://spark.apache.org/docs/3.1.2/api/python/reference/api/pyspark.sql.functions.split.html) function and Python's ['string.split()'](https://docs.python.org/3/library/stdtypes.html#str.split) method.
## stop\_refreshable\_materialized\_views\_on\_startup[β](https://clickhouse.com/docs/operations/settings/settings#stop_refreshable_materialized_views_on_startup "Direct link to stop_refreshable_materialized_views_on_startup")
Experimental feature.
[Learn more.](https://clickhouse.com/docs/beta-and-experimental-features#experimental-features)
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
On server startup, prevent scheduling of refreshable materialized views, as if with SYSTEM STOP VIEWS. You can manually start them with `SYSTEM START VIEWS` or `SYSTEM START VIEW <name>` afterwards. Also applies to newly created views. Has no effect on non-refreshable materialized views.
## storage\_file\_read\_method[β](https://clickhouse.com/docs/operations/settings/settings#storage_file_read_method "Direct link to storage_file_read_method")
| Type | Default value |
|---|---|
| TypeLocalFSReadMethod | Default valuepread |
Method of reading data from storage file, one of: `read`, `pread`, `mmap`. The mmap method does not apply to clickhouse-server (it's intended for clickhouse-local).
## storage\_system\_stack\_trace\_pipe\_read\_timeout\_ms[β](https://clickhouse.com/docs/operations/settings/settings#storage_system_stack_trace_pipe_read_timeout_ms "Direct link to storage_system_stack_trace_pipe_read_timeout_ms")
| Type | Default value |
|---|---|
| TypeMilliseconds | Default value100 |
Maximum time to read from a pipe for receiving information from the threads when querying the `system.stack_trace` table. This setting is used for testing purposes and not meant to be changed by users.
## stream\_flush\_interval\_ms[β](https://clickhouse.com/docs/operations/settings/settings#stream_flush_interval_ms "Direct link to stream_flush_interval_ms")
| Type | Default value |
|---|---|
| TypeMilliseconds | Default value7500 |
Works for tables with streaming in the case of a timeout, or when a thread generates [max\_insert\_block\_size](https://clickhouse.com/docs/operations/settings/settings#max_insert_block_size) rows.
The default value is 7500.
The smaller the value, the more often data is flushed into the table. Setting the value too low leads to poor performance.
## stream\_like\_engine\_allow\_direct\_select[β](https://clickhouse.com/docs/operations/settings/settings#stream_like_engine_allow_direct_select "Direct link to stream_like_engine_allow_direct_select")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
Allow direct SELECT query for Kafka, RabbitMQ, FileLog, Redis Streams, S3Queue, AzureQueue and NATS engines. In case there are attached materialized views, SELECT query is not allowed even if this setting is enabled. If there are no attached materialized views, enabling this setting allows to read data. Be aware that usually the read data is removed from the queue. In order to avoid removing read data the related engine settings should be configured properly.
## stream\_like\_engine\_insert\_queue[β](https://clickhouse.com/docs/operations/settings/settings#stream_like_engine_insert_queue "Direct link to stream_like_engine_insert_queue")
When stream-like engine reads from multiple queues, the user will need to select one queue to insert into when writing. Used by Redis Streams and NATS.
## stream\_poll\_timeout\_ms[β](https://clickhouse.com/docs/operations/settings/settings#stream_poll_timeout_ms "Direct link to stream_poll_timeout_ms")
| Type | Default value |
|---|---|
| TypeMilliseconds | Default value500 |
Timeout for polling data from/to streaming storages.
## system\_events\_show\_zero\_values[β](https://clickhouse.com/docs/operations/settings/settings#system_events_show_zero_values "Direct link to system_events_show_zero_values")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Allows to select zero-valued events from [`system.events`](https://clickhouse.com/docs/operations/system-tables/events).
Some monitoring systems require passing all the metrics values to them for each checkpoint, even if the metric value is zero.
Possible values:
- 0 β Disabled.
- 1 β Enabled.
**Examples**
Query
```
SELECT * FROM system.events WHERE event='QueryMemoryLimitExceeded';
```
Result
```
Ok.
```
Query
```
SET system_events_show_zero_values = 1;
SELECT * FROM system.events WHERE event='QueryMemoryLimitExceeded';
```
Result
```
ββeventβββββββββββββββββββββ¬βvalueββ¬βdescriptionββββββββββββββββββββββββββββββββββββββββββββ
β QueryMemoryLimitExceeded β 0 β Number of times when memory limit exceeded for query. β
ββββββββββββββββββββββββββββ΄ββββββββ΄ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
```
## table\_engine\_read\_through\_distributed\_cache[β](https://clickhouse.com/docs/operations/settings/settings#table_engine_read_through_distributed_cache "Direct link to table_engine_read_through_distributed_cache")
ClickHouse Cloud only
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
Only has an effect in ClickHouse Cloud. Allow reading from distributed cache via table engines / table functions (s3, azure, etc)
## table\_function\_remote\_max\_addresses[β](https://clickhouse.com/docs/operations/settings/settings#table_function_remote_max_addresses "Direct link to table_function_remote_max_addresses")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value1000 |
Sets the maximum number of addresses generated from patterns for the [remote](https://clickhouse.com/docs/sql-reference/table-functions/remote) function.
Possible values:
- Positive integer.
## tcp\_keep\_alive\_timeout[β](https://clickhouse.com/docs/operations/settings/settings#tcp_keep_alive_timeout "Direct link to tcp_keep_alive_timeout")
| Type | Default value |
|---|---|
| TypeSeconds | Default value290 |
The time in seconds the connection needs to remain idle before TCP starts sending keepalive probes
## temporary\_data\_in\_cache\_reserve\_space\_wait\_lock\_timeout\_milliseconds[β](https://clickhouse.com/docs/operations/settings/settings#temporary_data_in_cache_reserve_space_wait_lock_timeout_milliseconds "Direct link to temporary_data_in_cache_reserve_space_wait_lock_timeout_milliseconds")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value600000 |
Version history
Wait time to lock cache for space reservation for temporary data in filesystem cache
## temporary\_files\_buffer\_size[β](https://clickhouse.com/docs/operations/settings/settings#temporary_files_buffer_size "Direct link to temporary_files_buffer_size")
| Type | Default value |
|---|---|
| TypeNonZeroUInt64 | Default value1048576 |
Version history
Size of the buffer for temporary files writers. Larger buffer size means less system calls, but more memory consumption.
## temporary\_files\_codec[β](https://clickhouse.com/docs/operations/settings/settings#temporary_files_codec "Direct link to temporary_files_codec")
| Type | Default value |
|---|---|
| TypeString | Default valueLZ4 |
Sets compression codec for temporary files used in sorting and joining operations on disk.
Possible values:
- LZ4 β [LZ4](https://en.wikipedia.org/wiki/LZ4_\(compression_algorithm\)) compression is applied.
- NONE β No compression is applied.
## text\_index\_hint\_max\_selectivity[β](https://clickhouse.com/docs/operations/settings/settings#text_index_hint_max_selectivity "Direct link to text_index_hint_max_selectivity")
| Type | Default value |
|---|---|
| TypeFloat | Default value0\.2 |
Version history
Maximal selectivity of the filter to use the hint built from the inverted text index.
## text\_index\_like\_max\_postings\_to\_read[β](https://clickhouse.com/docs/operations/settings/settings#text_index_like_max_postings_to_read "Direct link to text_index_like_max_postings_to_read")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value50 |
Version history
Maximum number of large postings to read when text index LIKE evaluation by the dictionary scan is enabled.
Requires `use_text_index_like_evaluation_by_dictionary_scan` to be enabled.
## text\_index\_like\_min\_pattern\_length[β](https://clickhouse.com/docs/operations/settings/settings#text_index_like_min_pattern_length "Direct link to text_index_like_min_pattern_length")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value4 |
Version history
Minimum length of the alphanumeric needle in a LIKE/ILIKE pattern required to use the text index LIKE evaluation by the dictionary scan. Patterns shorter than this threshold match too many dictionary tokens and are skipped to avoid expensive scans.
Requires `use_text_index_like_evaluation_by_dictionary_scan` to be enabled.
## throw\_if\_no\_data\_to\_insert[β](https://clickhouse.com/docs/operations/settings/settings#throw_if_no_data_to_insert "Direct link to throw_if_no_data_to_insert")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Allows or forbids empty INSERTs, enabled by default (throws an error on an empty insert). Only applies to INSERTs using [`clickhouse-client`](https://clickhouse.com/docs/interfaces/cli) or using the [gRPC interface](https://clickhouse.com/docs/interfaces/grpc).
## throw\_on\_error\_from\_cache\_on\_write\_operations[β](https://clickhouse.com/docs/operations/settings/settings#throw_on_error_from_cache_on_write_operations "Direct link to throw_on_error_from_cache_on_write_operations")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Ignore error from cache when caching on write operations (INSERT, merges)
## throw\_on\_max\_partitions\_per\_insert\_block[β](https://clickhouse.com/docs/operations/settings/settings#throw_on_max_partitions_per_insert_block "Direct link to throw_on_max_partitions_per_insert_block")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Allows you to control the behaviour when `max_partitions_per_insert_block` is reached.
Possible values:
- `true` - When an insert block reaches `max_partitions_per_insert_block`, an exception is raised.
- `false` - Logs a warning when `max_partitions_per_insert_block` is reached.
Tip
This can be useful if you're trying to understand the impact on users when changing [`max_partitions_per_insert_block`](https://clickhouse.com/docs/operations/settings/settings#max_partitions_per_insert_block).
## throw\_on\_unsupported\_query\_inside\_transaction[β](https://clickhouse.com/docs/operations/settings/settings#throw_on_unsupported_query_inside_transaction "Direct link to throw_on_unsupported_query_inside_transaction")
Experimental feature.
[Learn more.](https://clickhouse.com/docs/beta-and-experimental-features#experimental-features)
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Throw exception if unsupported query is used inside transactio
## timeout\_before\_checking\_execution\_speed[β](https://clickhouse.com/docs/operations/settings/settings#timeout_before_checking_execution_speed "Direct link to timeout_before_checking_execution_speed")
| Type | Default value |
|---|---|
| TypeSeconds | Default value10 |
Checks that execution speed is not too slow (no less than `min_execution_speed`), after the specified time in seconds has expired.
## timeout\_overflow\_mode[β](https://clickhouse.com/docs/operations/settings/settings#timeout_overflow_mode "Direct link to timeout_overflow_mode")
| Type | Default value |
|---|---|
| TypeOverflowMode | Default valuethrow |
Sets what to do if the query is run longer than the `max_execution_time` or the estimated running time is longer than `max_estimated_execution_time`.
Possible values:
- `throw`: throw an exception (default).
- `break`: stop executing the query and return the partial result, as if the source data ran out.
## timeout\_overflow\_mode\_leaf[β](https://clickhouse.com/docs/operations/settings/settings#timeout_overflow_mode_leaf "Direct link to timeout_overflow_mode_leaf")
| Type | Default value |
|---|---|
| TypeOverflowMode | Default valuethrow |
Sets what happens when the query in leaf node run longer than `max_execution_time_leaf`.
Possible values:
- `throw`: throw an exception (default).
- `break`: stop executing the query and return the partial result, as if the source data ran out.
## totals\_auto\_threshold[β](https://clickhouse.com/docs/operations/settings/settings#totals_auto_threshold "Direct link to totals_auto_threshold")
| Type | Default value |
|---|---|
| TypeFloat | Default value0\.5 |
The threshold for `totals_mode = 'auto'`. See the section "WITH TOTALS modifier".
## totals\_mode[β](https://clickhouse.com/docs/operations/settings/settings#totals_mode "Direct link to totals_mode")
| Type | Default value |
|---|---|
| TypeTotalsMode | Default valueafter\_having\_exclusive |
How to calculate TOTALS when HAVING is present, as well as when max\_rows\_to\_group\_by and group\_by\_overflow\_mode = 'any' are present. See the section "WITH TOTALS modifier".
## trace\_profile\_events[β](https://clickhouse.com/docs/operations/settings/settings#trace_profile_events "Direct link to trace_profile_events")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Enables or disables collecting stacktraces on each update of profile events along with the name of profile event and the value of increment and sending them into [trace\_log](https://clickhouse.com/docs/operations/system-tables/trace_log).
Possible values:
- 1 β Tracing of profile events enabled.
- 0 β Tracing of profile events disabled.
## trace\_profile\_events\_list[β](https://clickhouse.com/docs/operations/settings/settings#trace_profile_events_list "Direct link to trace_profile_events_list")
Version history
When the setting `trace_profile_events` is enabled, limit the traced events to the specified list of comma-separated names. If the `trace_profile_events_list` is an empty string (by default), trace all profile events.
Example value: 'DiskS3ReadMicroseconds,DiskS3ReadRequestsCount,SelectQueryTimeMicroseconds,ReadBufferFromS3Bytes'
Using this setting allows more precise collection of data for a large number of queries, because otherwise the vast amount of events can overflow the internal system log queue and some portion of them will be dropped.
## transfer\_overflow\_mode[β](https://clickhouse.com/docs/operations/settings/settings#transfer_overflow_mode "Direct link to transfer_overflow_mode")
| Type | Default value |
|---|---|
| TypeOverflowMode | Default valuethrow |
Sets what happens when the amount of data exceeds one of the limits.
Possible values:
- `throw`: throw an exception (default).
- `break`: stop executing the query and return the partial result, as if the source data ran out.
## transform\_null\_in[β](https://clickhouse.com/docs/operations/settings/settings#transform_null_in "Direct link to transform_null_in")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Enables equality of [NULL](https://clickhouse.com/docs/sql-reference/syntax#null) values for [IN](https://clickhouse.com/docs/sql-reference/operators/in) operator.
By default, `NULL` values can't be compared because `NULL` means undefined value. Thus, comparison `expr = NULL` must always return `false`. With this setting `NULL = NULL` returns `true` for `IN` operator.
Possible values:
- 0 β Comparison of `NULL` values in `IN` operator returns `false`.
- 1 β Comparison of `NULL` values in `IN` operator returns `true`.
**Example**
Consider the `null_in` table:
```
βββidxββ¬βββββiββ
β 1 β 1 β
β 2 β NULL β
β 3 β 3 β
ββββββββ΄ββββββββ
```
Query:
```
SELECT idx, i FROM null_in WHERE i IN (1, NULL) SETTINGS transform_null_in = 0;
```
Result:
```
βββidxββ¬ββββiββ
β 1 β 1 β
ββββββββ΄βββββββ
```
Query:
```
SELECT idx, i FROM null_in WHERE i IN (1, NULL) SETTINGS transform_null_in = 1;
```
Result:
```
βββidxββ¬βββββiββ
β 1 β 1 β
β 2 β NULL β
ββββββββ΄ββββββββ
```
**See Also**
- [NULL Processing in IN Operators](https://clickhouse.com/docs/sql-reference/operators/in#null-processing)
## traverse\_shadow\_remote\_data\_paths[β](https://clickhouse.com/docs/operations/settings/settings#traverse_shadow_remote_data_paths "Direct link to traverse_shadow_remote_data_paths")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
Traverse frozen data (shadow directory) in addition to actual table data when query system.remote\_data\_paths
## union\_default\_mode[β](https://clickhouse.com/docs/operations/settings/settings#union_default_mode "Direct link to union_default_mode")
Sets a mode for combining `SELECT` query results. The setting is only used when shared with [UNION](https://clickhouse.com/docs/sql-reference/statements/select/union) without explicitly specifying the `UNION ALL` or `UNION DISTINCT`.
Possible values:
- `'DISTINCT'` β ClickHouse outputs rows as a result of combining queries removing duplicate rows.
- `'ALL'` β ClickHouse outputs all rows as a result of combining queries including duplicate rows.
- `''` β ClickHouse generates an exception when used with `UNION`.
See examples in [UNION](https://clickhouse.com/docs/sql-reference/statements/select/union).
## unknown\_packet\_in\_send\_data[β](https://clickhouse.com/docs/operations/settings/settings#unknown_packet_in_send_data "Direct link to unknown_packet_in_send_data")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Send unknown packet instead of data Nth data packet
## update\_parallel\_mode[β](https://clickhouse.com/docs/operations/settings/settings#update_parallel_mode "Direct link to update_parallel_mode")
| Type | Default value |
|---|---|
| TypeUpdateParallelMode | Default valueauto |
Version history
Determines the behavior of concurrent update queries.
Possible values:
- `sync` - run sequentially all `UPDATE` queries.
- `auto` - run sequentially only `UPDATE` queries with dependencies between columns updated in one query and columns used in expressions of another query.
- `async` - do not synchronize update queries.
## update\_sequential\_consistency[β](https://clickhouse.com/docs/operations/settings/settings#update_sequential_consistency "Direct link to update_sequential_consistency")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
If true set of parts is updated to the latest version before execution of update.
## use\_async\_executor\_for\_materialized\_views[β](https://clickhouse.com/docs/operations/settings/settings#use_async_executor_for_materialized_views "Direct link to use_async_executor_for_materialized_views")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
Use async and potentially multithreaded execution of materialized view query, can speedup views processing during INSERT, but also consume more memory.
## use\_cache\_for\_count\_from\_files[β](https://clickhouse.com/docs/operations/settings/settings#use_cache_for_count_from_files "Direct link to use_cache_for_count_from_files")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Enables caching of rows number during count from files in table functions `file`/`s3`/`url`/`hdfs`/`azureBlobStorage`.
Enabled by default.
## use\_client\_time\_zone[β](https://clickhouse.com/docs/operations/settings/settings#use_client_time_zone "Direct link to use_client_time_zone")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Use client timezone for interpreting DateTime string values, instead of adopting server timezone.
## use\_compact\_format\_in\_distributed\_parts\_names[β](https://clickhouse.com/docs/operations/settings/settings#use_compact_format_in_distributed_parts_names "Direct link to use_compact_format_in_distributed_parts_names")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Uses compact format for storing blocks for background (`distributed_foreground_insert`) INSERT into tables with `Distributed` engine.
Possible values:
- 0 β Uses `user[:password]@host:port#default_database` directory format.
- 1 β Uses `[shard{shard_index}[_replica{replica_index}]]` directory format.
Note
- with `use_compact_format_in_distributed_parts_names=0` changes from cluster definition will not be applied for background INSERT.
- with `use_compact_format_in_distributed_parts_names=1` changing the order of the nodes in the cluster definition, will change the `shard_index`/`replica_index` so be aware.
## use\_concurrency\_control[β](https://clickhouse.com/docs/operations/settings/settings#use_concurrency_control "Direct link to use_concurrency_control")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Respect the server's concurrency control (see the `concurrent_threads_soft_limit_num` and `concurrent_threads_soft_limit_ratio_to_cores` global server settings). If disabled, it allows using a larger number of threads even if the server is overloaded (not recommended for normal usage, and needed mostly for tests).
Cloud default value: `0`.
## use\_hash\_table\_stats\_for\_join\_reordering[β](https://clickhouse.com/docs/operations/settings/settings#use_hash_table_stats_for_join_reordering "Direct link to use_hash_table_stats_for_join_reordering")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Enable using collected hash table statistics for cardinality estimation during join reordering
## use\_hedged\_requests[β](https://clickhouse.com/docs/operations/settings/settings#use_hedged_requests "Direct link to use_hedged_requests")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Enables hedged requests logic for remote queries. It allows to establish many connections with different replicas for query. New connection is enabled in case existent connection(s) with replica(s) were not established within `hedged_connection_timeout` or no data was received within `receive_data_timeout`. Query uses the first connection which send non empty progress packet (or data packet, if `allow_changing_replica_until_first_data_packet`); other connections are cancelled. Queries with `max_parallel_replicas > 1` are supported.
Enabled by default.
Cloud default value: `0`.
## use\_hive\_partitioning[β](https://clickhouse.com/docs/operations/settings/settings#use_hive_partitioning "Direct link to use_hive_partitioning")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
When enabled, ClickHouse will detect Hive-style partitioning in path (`/name=value/`) in file-like table engines [File](https://clickhouse.com/docs/sql-reference/table-functions/file#hive-style-partitioning)/[S3](https://clickhouse.com/docs/sql-reference/table-functions/s3#hive-style-partitioning)/[URL](https://clickhouse.com/docs/sql-reference/table-functions/url#hive-style-partitioning)/[HDFS](https://clickhouse.com/docs/sql-reference/table-functions/hdfs#hive-style-partitioning)/[AzureBlobStorage](https://clickhouse.com/docs/sql-reference/table-functions/azureBlobStorage#hive-style-partitioning) and will allow to use partition columns as virtual columns in the query. These virtual columns will have the same names as in the partitioned path, but starting with `_`.
## use\_iceberg\_metadata\_files\_cache[β](https://clickhouse.com/docs/operations/settings/settings#use_iceberg_metadata_files_cache "Direct link to use_iceberg_metadata_files_cache")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
If turned on, iceberg table function and iceberg storage may utilize the iceberg metadata files cache.
Possible values:
- 0 - Disabled
- 1 - Enabled
## use\_iceberg\_partition\_pruning[β](https://clickhouse.com/docs/operations/settings/settings#use_iceberg_partition_pruning "Direct link to use_iceberg_partition_pruning")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Use Iceberg partition pruning for Iceberg tables
## use\_index\_for\_in\_with\_subqueries[β](https://clickhouse.com/docs/operations/settings/settings#use_index_for_in_with_subqueries "Direct link to use_index_for_in_with_subqueries")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Try using an index if there is a subquery or a table expression on the right side of the IN operator.
## use\_index\_for\_in\_with\_subqueries\_max\_values[β](https://clickhouse.com/docs/operations/settings/settings#use_index_for_in_with_subqueries_max_values "Direct link to use_index_for_in_with_subqueries_max_values")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
The maximum size of the set in the right-hand side of the IN operator to use table index for filtering. It allows to avoid performance degradation and higher memory usage due to the preparation of additional data structures for large queries. Zero means no limit.
## use\_join\_disjunctions\_push\_down[β](https://clickhouse.com/docs/operations/settings/settings#use_join_disjunctions_push_down "Direct link to use_join_disjunctions_push_down")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Enable pushing OR-connected parts of JOIN conditions down to the corresponding input sides ("partial pushdown"). This allows storage engines to filter earlier, which can reduce data read. The optimization is semantics-preserving and is applied only when each top-level OR branch contributes at least one deterministic predicate for the target side.
## use\_legacy\_to\_time[β](https://clickhouse.com/docs/operations/settings/settings#use_legacy_to_time "Direct link to use_legacy_to_time")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
When enabled, allows to use legacy toTime function, which converts a date with time to a certain fixed date, while preserving the time. Otherwise, uses a new toTime function, that converts different type of data into the Time type. The old legacy function is also unconditionally accessible as toTimeWithFixedDate.
## use\_page\_cache\_for\_disks\_without\_file\_cache[β](https://clickhouse.com/docs/operations/settings/settings#use_page_cache_for_disks_without_file_cache "Direct link to use_page_cache_for_disks_without_file_cache")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
Use userspace page cache for remote disks that don't have filesystem cache enabled.
## use\_page\_cache\_for\_local\_disks[β](https://clickhouse.com/docs/operations/settings/settings#use_page_cache_for_local_disks "Direct link to use_page_cache_for_local_disks")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
Use userspace page cache when reading from local disks. Used for testing, unlikely to improve performance in practice. Requires local\_filesystem\_read\_method = 'pread' or 'read'. Doesn't disable the OS page cache; min\_bytes\_to\_use\_direct\_io can be used for that. Only affects regular tables, not file() table function or File() table engine.
## use\_page\_cache\_for\_object\_storage[β](https://clickhouse.com/docs/operations/settings/settings#use_page_cache_for_object_storage "Direct link to use_page_cache_for_object_storage")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
Use userspace page cache when reading from object storage table functions (s3, azure, hdfs) and table engines (S3, Azure, HDFS).
## use\_page\_cache\_with\_distributed\_cache[β](https://clickhouse.com/docs/operations/settings/settings#use_page_cache_with_distributed_cache "Direct link to use_page_cache_with_distributed_cache")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
Use userspace page cache when distributed cache is used.
## use\_paimon\_partition\_pruning[β](https://clickhouse.com/docs/operations/settings/settings#use_paimon_partition_pruning "Direct link to use_paimon_partition_pruning")
Experimental feature.
[Learn more.](https://clickhouse.com/docs/beta-and-experimental-features#experimental-features)
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
Use Paimon partition pruning for Paimon table functions
## use\_parquet\_metadata\_cache[β](https://clickhouse.com/docs/operations/settings/settings#use_parquet_metadata_cache "Direct link to use_parquet_metadata_cache")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
If turned on, parquet format may utilize the parquet metadata cache.
Possible values:
- 0 - Disabled
- 1 - Enabled
## use\_partition\_pruning[β](https://clickhouse.com/docs/operations/settings/settings#use_partition_pruning "Direct link to use_partition_pruning")
**Aliases**: `use_partition_key`
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Use partition key to prune partitions during query execution for MergeTree tables.
Possible values:
- 0 β Disabled.
- 1 β Enabled.
## use\_primary\_key[β](https://clickhouse.com/docs/operations/settings/settings#use_primary_key "Direct link to use_primary_key")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Use the primary key to prune granules during query execution for MergeTree tables.
Possible values:
- 0 β Disabled.
- 1 β Enabled.
## use\_query\_cache[β](https://clickhouse.com/docs/operations/settings/settings#use_query_cache "Direct link to use_query_cache")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
If turned on, `SELECT` queries may utilize the [query cache](https://clickhouse.com/docs/operations/query-cache). Parameters [enable\_reads\_from\_query\_cache](https://clickhouse.com/docs/operations/settings/settings#enable_reads_from_query_cache) and [enable\_writes\_to\_query\_cache](https://clickhouse.com/docs/operations/settings/settings#enable_writes_to_query_cache) control in more detail how the cache is used.
Possible values:
- 0 - Disabled
- 1 - Enabled
## use\_query\_condition\_cache[β](https://clickhouse.com/docs/operations/settings/settings#use_query_condition_cache "Direct link to use_query_condition_cache")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Enable the [query condition cache](https://clickhouse.com/docs/operations/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\_roaring\_bitmap\_iceberg\_positional\_deletes[β](https://clickhouse.com/docs/operations/settings/settings#use_roaring_bitmap_iceberg_positional_deletes "Direct link to use_roaring_bitmap_iceberg_positional_deletes")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
Use roaring bitmap for iceberg positional deletes.
## use\_skip\_indexes[β](https://clickhouse.com/docs/operations/settings/settings#use_skip_indexes "Direct link to use_skip_indexes")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Use data skipping indexes during query execution.
Possible values:
- 0 β Disabled.
- 1 β Enabled.
## use\_skip\_indexes\_for\_disjunctions[β](https://clickhouse.com/docs/operations/settings/settings#use_skip_indexes_for_disjunctions "Direct link to use_skip_indexes_for_disjunctions")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Evaluate WHERE filters with mixed AND and OR conditions using skip indexes. Example: WHERE A = 5 AND (B = 5 OR C = 5). If disabled, skip indexes are still used to evaluate WHERE conditions but they must only contain AND-ed clauses.
Possible values:
- 0 β Disabled.
- 1 β Enabled.
## use\_skip\_indexes\_for\_top\_k[β](https://clickhouse.com/docs/operations/settings/settings#use_skip_indexes_for_top_k "Direct link to use_skip_indexes_for_top_k")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
Enable using data skipping indexes for TopK filtering.
When enabled, if a minmax skip index exists on the column in `ORDER BY <column> LIMIT n` query, optimizer will attempt to use the minmax index to skip granules that are not relevant for the final result . This can reduce query latency.
Possible values:
- 0 β Disabled.
- 1 β Enabled.
## use\_skip\_indexes\_if\_final[β](https://clickhouse.com/docs/operations/settings/settings#use_skip_indexes_if_final "Direct link to use_skip_indexes_if_final")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Controls whether skipping indexes are used when executing a query with the FINAL modifier.
Skip indexes may exclude rows (granules) containing the latest data, which could lead to incorrect results from a query with the FINAL modifier. When this setting is enabled, skipping indexes are applied even with the FINAL modifier, potentially improving performance but with the risk of missing recent updates. This setting should be enabled in sync with the setting use\_skip\_indexes\_if\_final\_exact\_mode (default is enabled).
Possible values:
- 0 β Disabled.
- 1 β Enabled.
## use\_skip\_indexes\_if\_final\_exact\_mode[β](https://clickhouse.com/docs/operations/settings/settings#use_skip_indexes_if_final_exact_mode "Direct link to use_skip_indexes_if_final_exact_mode")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Controls whether granules returned by a skipping index are expanded in newer parts to return correct results when executing a query with the FINAL modifier.
Using skip indexes may exclude rows (granules) containing the latest data which could lead to incorrect results. This setting can ensure that correct results are returned by scanning newer parts that have overlap with the ranges returned by the skip index. This setting should be disabled only if approximate results based on looking up the skip index are okay for an application.
Possible values:
- 0 β Disabled.
- 1 β Enabled.
## use\_skip\_indexes\_on\_data\_read[β](https://clickhouse.com/docs/operations/settings/settings#use_skip_indexes_on_data_read "Direct link to use_skip_indexes_on_data_read")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Enable using data skipping indexes during data reading.
When enabled, skip indexes are evaluated dynamically at the time each data granule is being read, rather than being analyzed in advance before query execution begins. This can reduce query startup latency.
Possible values:
- 0 β Disabled.
- 1 β Enabled.
## use\_statistics[β](https://clickhouse.com/docs/operations/settings/settings#use_statistics "Direct link to use_statistics")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
/// preferred over 'allow\_statistics\_optimize' because of consistency with 'use\_primary\_key' and 'use\_skip\_indexes' Allows using statistics to optimize queries
## use\_statistics\_cache[β](https://clickhouse.com/docs/operations/settings/settings#use_statistics_cache "Direct link to use_statistics_cache")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Use statistics cache in a query to avoid the overhead of loading statistics of every parts
## use\_statistics\_for\_part\_pruning[β](https://clickhouse.com/docs/operations/settings/settings#use_statistics_for_part_pruning "Direct link to use_statistics_for_part_pruning")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Use statistics to filter out parts during query execution.
When enabled, pruning in SELECT queries will use column statistics (e.g. MinMax statistics) to eliminate parts that cannot contain matching data before reading any data.
Possible values:
- 0 β Disabled.
- 1 β Enabled.
## use\_strict\_insert\_block\_limits[β](https://clickhouse.com/docs/operations/settings/settings#use_strict_insert_block_limits "Direct link to use_strict_insert_block_limits")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
When enabled, strictly enforces both minimum and maximum insert block size limits.
A block is emitted when:
- Min thresholds (AND): Both min\_insert\_block\_size\_rows AND min\_insert\_block\_size\_bytes are reached.
- Max thresholds (OR): Either max\_insert\_block\_size\_rows OR max\_insert\_block\_size\_bytes is reached.
When disabled, a block is emitted when:
- Min thresholds (OR): min\_insert\_block\_size\_rows OR min\_insert\_block\_size\_bytes is reached.
**Note**: If max settings are smaller than min settings, the max limits take precedence and blocks will be emitted before min thresholds are reached.
**Note**: This setting is automatically disabled for async inserts, because async inserts attach per-entry deduplication tokens that are incompatible with block splitting that is needed for enforcement of strict limits.
Disabled by default.
## use\_structure\_from\_insertion\_table\_in\_table\_functions[β](https://clickhouse.com/docs/operations/settings/settings#use_structure_from_insertion_table_in_table_functions "Direct link to use_structure_from_insertion_table_in_table_functions")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value2 |
Version history
Use structure from insertion table instead of schema inference from data. Possible values: 0 - disabled, 1 - enabled, 2 - auto
## use\_text\_index\_header\_cache[β](https://clickhouse.com/docs/operations/settings/settings#use_text_index_header_cache "Direct link to use_text_index_header_cache")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
Whether to use a cache of deserialized text index header. Using the text index header cache can significantly reduce latency and increase throughput when working with a large number of text index queries.
## use\_text\_index\_like\_evaluation\_by\_dictionary\_scan[β](https://clickhouse.com/docs/operations/settings/settings#use_text_index_like_evaluation_by_dictionary_scan "Direct link to use_text_index_like_evaluation_by_dictionary_scan")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Enable evaluation of LIKE/ILIKE queries by scanning the inverted text index dictionary.
## use\_text\_index\_postings\_cache[β](https://clickhouse.com/docs/operations/settings/settings#use_text_index_postings_cache "Direct link to use_text_index_postings_cache")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
Whether to use a cache of deserialized text index posting lists. Using the text index postings cache can significantly reduce latency and increase throughput when working with a large number of text index queries.
## use\_text\_index\_tokens\_cache[β](https://clickhouse.com/docs/operations/settings/settings#use_text_index_tokens_cache "Direct link to use_text_index_tokens_cache")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
Whether to use a cache of deserialized text index token infos. Using the text index tokens cache can significantly reduce latency and increase throughput when working with a large number of text index queries.
## use\_top\_k\_dynamic\_filtering[β](https://clickhouse.com/docs/operations/settings/settings#use_top_k_dynamic_filtering "Direct link to use_top_k_dynamic_filtering")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
Enable dynamic filtering optimization when executing a `ORDER BY <column> LIMIT n` query.
When enabled, the query executor will try to skip granules and rows that will not be part of the final `top N` rows in the resultset. This optimization is dynamic in nature and latency improvements depends on data distribution and presence of other predicates in the query.
Possible values:
- 0 β Disabled.
- 1 β Enabled.
## use\_uncompressed\_cache[β](https://clickhouse.com/docs/operations/settings/settings#use_uncompressed_cache "Direct link to use_uncompressed_cache")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Whether to use a cache of uncompressed blocks. Accepts 0 or 1. By default, 0 (disabled). Using the uncompressed cache (only for tables in the MergeTree family) can significantly reduce latency and increase throughput when working with a large number of short queries. Enable this setting for users who send frequent short requests. Also pay attention to the [uncompressed\_cache\_size](https://clickhouse.com/docs/operations/server-configuration-parameters/settings#uncompressed_cache_size) configuration parameter (only set in the config file) β the size of uncompressed cache blocks. By default, it is 8 GiB. The uncompressed cache is filled in as needed and the least-used data is automatically deleted.
For queries that read at least a somewhat large volume of data (one million rows or more), the uncompressed cache is disabled automatically to save space for truly small queries. This means that you can keep the 'use\_uncompressed\_cache' setting always set to 1.
## use\_variant\_as\_common\_type[β](https://clickhouse.com/docs/operations/settings/settings#use_variant_as_common_type "Direct link to use_variant_as_common_type")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Allows to use `Variant` type as a result type for [if](https://clickhouse.com/docs/sql-reference/functions/conditional-functions#if)/[multiIf](https://clickhouse.com/docs/sql-reference/functions/conditional-functions#multiIf)/[array](https://clickhouse.com/docs/sql-reference/functions/array-functions)/[map](https://clickhouse.com/docs/sql-reference/functions/tuple-map-functions) functions when there is no common type for argument types.
Example:
```
SET use_variant_as_common_type = 1;
SELECT toTypeName(if(number % 2, number, range(number))) as variant_type FROM numbers(1);
SELECT if(number % 2, number, range(number)) as variant FROM numbers(5);
```
```
ββvariant_typeββββββββββββββββββββ
β Variant(Array(UInt64), UInt64) β
ββββββββββββββββββββββββββββββββββ
ββvariantββββ
β [] β
β 1 β
β [0,1] β
β 3 β
β [0,1,2,3] β
βββββββββββββ
```
```
SET use_variant_as_common_type = 1;
SELECT toTypeName(multiIf((number % 4) = 0, 42, (number % 4) = 1, [1, 2, 3], (number % 4) = 2, 'Hello, World!', NULL)) AS variant_type FROM numbers(1);
SELECT multiIf((number % 4) = 0, 42, (number % 4) = 1, [1, 2, 3], (number % 4) = 2, 'Hello, World!', NULL) AS variant FROM numbers(4);
```
```
βvariant_typeββββββββββββββββββββββββββ
β Variant(Array(UInt8), String, UInt8) β
ββββββββββββββββββββββββββββββββββββββββ
ββvariantββββββββ
β 42 β
β [1,2,3] β
β Hello, World! β
β α΄Ία΅α΄Έα΄Έ β
βββββββββββββββββ
```
```
SET use_variant_as_common_type = 1;
SELECT toTypeName(array(range(number), number, 'str_' || toString(number))) as array_of_variants_type from numbers(1);
SELECT array(range(number), number, 'str_' || toString(number)) as array_of_variants FROM numbers(3);
```
```
ββarray_of_variants_typeβββββββββββββββββββββββββ
β Array(Variant(Array(UInt64), String, UInt64)) β
βββββββββββββββββββββββββββββββββββββββββββββββββ
ββarray_of_variantsββ
β [[],0,'str_0'] β
β [[0],1,'str_1'] β
β [[0,1],2,'str_2'] β
βββββββββββββββββββββ
```
```
SET use_variant_as_common_type = 1;
SELECT toTypeName(map('a', range(number), 'b', number, 'c', 'str_' || toString(number))) as map_of_variants_type from numbers(1);
SELECT map('a', range(number), 'b', number, 'c', 'str_' || toString(number)) as map_of_variants FROM numbers(3);
```
```
ββmap_of_variants_typeβββββββββββββββββββββββββββββββββ
β Map(String, Variant(Array(UInt64), String, UInt64)) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
ββmap_of_variantsββββββββββββββββ
β {'a':[],'b':0,'c':'str_0'} β
β {'a':[0],'b':1,'c':'str_1'} β
β {'a':[0,1],'b':2,'c':'str_2'} β
βββββββββββββββββββββββββββββββββ
```
## use\_variant\_default\_implementation\_for\_comparisons[β](https://clickhouse.com/docs/operations/settings/settings#use_variant_default_implementation_for_comparisons "Direct link to use_variant_default_implementation_for_comparisons")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Enables or disables default implementation for Variant type in comparison functions.
## use\_with\_fill\_by\_sorting\_prefix[β](https://clickhouse.com/docs/operations/settings/settings#use_with_fill_by_sorting_prefix "Direct link to use_with_fill_by_sorting_prefix")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Columns preceding WITH FILL columns in ORDER BY clause form sorting prefix. Rows with different values in sorting prefix are filled independently
## validate\_enum\_literals\_in\_operators[β](https://clickhouse.com/docs/operations/settings/settings#validate_enum_literals_in_operators "Direct link to validate_enum_literals_in_operators")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
If enabled, validate enum literals in operators like `IN`, `NOT IN`, `==`, `!=` against the enum type and throw an exception if the literal is not a valid enum value.
## validate\_mutation\_query[β](https://clickhouse.com/docs/operations/settings/settings#validate_mutation_query "Direct link to validate_mutation_query")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Validate mutation queries before accepting them. Mutations are executed in the background, and running an invalid query will cause mutations to get stuck, requiring manual intervention.
Only change this setting if you encounter a backward-incompatible bug.
## validate\_polygons[β](https://clickhouse.com/docs/operations/settings/settings#validate_polygons "Direct link to validate_polygons")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Version history
Enables or disables throwing an exception in the [pointInPolygon](https://clickhouse.com/docs/sql-reference/functions/geo/coordinates#pointinpolygon) function, if the polygon is self-intersecting or self-tangent.
Possible values:
- 0 β Throwing an exception is disabled. `pointInPolygon` accepts invalid polygons and returns possibly incorrect results for them.
- 1 β Throwing an exception is enabled.
## vector\_search\_filter\_strategy[β](https://clickhouse.com/docs/operations/settings/settings#vector_search_filter_strategy "Direct link to vector_search_filter_strategy")
| Type | Default value |
|---|---|
| TypeVectorSearchFilterStrategy | Default valueauto |
Version history
If a vector search query has a WHERE clause, this setting determines if it is evaluated first (pre-filtering) OR if the vector similarity index is checked first (post-filtering). Possible values:
- 'auto' - Postfiltering (the exact semantics may change in future).
- 'postfilter' - Use vector similarity index to identify the nearest neighbours, then apply other filters
- 'prefilter' - Evaluate other filters first, then perform brute-force search to identify neighbours.
## vector\_search\_index\_fetch\_multiplier[β](https://clickhouse.com/docs/operations/settings/settings#vector_search_index_fetch_multiplier "Direct link to vector_search_index_fetch_multiplier")
**Aliases**: `vector_search_postfilter_multiplier`
| Type | Default value |
|---|---|
| TypeFloat | Default value1 |
Version history
Multiply the number of fetched nearest neighbors from the vector similarity index by this number. Only applied for post-filtering with other predicates or if setting 'vector\_search\_with\_rescoring = 1'.
## vector\_search\_with\_rescoring[β](https://clickhouse.com/docs/operations/settings/settings#vector_search_with_rescoring "Direct link to vector_search_with_rescoring")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
If ClickHouse performs rescoring for queries that use the vector similarity index. Without rescoring, the vector similarity index returns the rows containing the best matches directly. With rescoring, the rows are extrapolated to granule level and all rows in the granule are checked again. In most situations, rescoring helps only marginally with accuracy but it deteriorates performance of vector search queries significantly. Note: A query run without rescoring and with parallel replicas enabled may fall back to rescoring.
## wait\_changes\_become\_visible\_after\_commit\_mode[β](https://clickhouse.com/docs/operations/settings/settings#wait_changes_become_visible_after_commit_mode "Direct link to wait_changes_become_visible_after_commit_mode")
Experimental feature.
[Learn more.](https://clickhouse.com/docs/beta-and-experimental-features#experimental-features)
| Type | Default value |
|---|---|
| TypeTransactionsWaitCSNMode | Default valuewait\_unknown |
Wait for committed changes to become actually visible in the latest snapshot
## wait\_for\_async\_insert[β](https://clickhouse.com/docs/operations/settings/settings#wait_for_async_insert "Direct link to wait_for_async_insert")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
If true wait for processing of asynchronous insertio
## wait\_for\_async\_insert\_timeout[β](https://clickhouse.com/docs/operations/settings/settings#wait_for_async_insert_timeout "Direct link to wait_for_async_insert_timeout")
| Type | Default value |
|---|---|
| TypeSeconds | Default value120 |
Timeout for waiting for processing asynchronous insertio
## wait\_for\_window\_view\_fire\_signal\_timeout[β](https://clickhouse.com/docs/operations/settings/settings#wait_for_window_view_fire_signal_timeout "Direct link to wait_for_window_view_fire_signal_timeout")
Experimental feature.
[Learn more.](https://clickhouse.com/docs/beta-and-experimental-features#experimental-features)
| Type | Default value |
|---|---|
| TypeSeconds | Default value10 |
Timeout for waiting for window view fire signal in event time processing
## webassembly\_udf\_max\_fuel[β](https://clickhouse.com/docs/operations/settings/settings#webassembly_udf_max_fuel "Direct link to webassembly_udf_max_fuel")
Experimental feature.
[Learn more.](https://clickhouse.com/docs/beta-and-experimental-features#experimental-features)
| Type | Default value |
|---|---|
| TypeUInt64 | Default value100000 |
Version history
Fuel limit per WebAssembly UDF instance execution. Each WebAssembly instruction consumes some amount of fuel. Set to 0 for no limit.
## webassembly\_udf\_max\_input\_block\_size[β](https://clickhouse.com/docs/operations/settings/settings#webassembly_udf_max_input_block_size "Direct link to webassembly_udf_max_input_block_size")
Experimental feature.
[Learn more.](https://clickhouse.com/docs/beta-and-experimental-features#experimental-features)
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Version history
Maximum number of rows passed to a WebAssembly UDF in a single block. Set to 0 to process all rows at once.
## webassembly\_udf\_max\_instances[β](https://clickhouse.com/docs/operations/settings/settings#webassembly_udf_max_instances "Direct link to webassembly_udf_max_instances")
Experimental feature.
[Learn more.](https://clickhouse.com/docs/beta-and-experimental-features#experimental-features)
| Type | Default value |
|---|---|
| TypeUInt64 | Default value32 |
Version history
Maximum number of WebAssembly UDF instances that can run in parallel per function.
## webassembly\_udf\_max\_memory[β](https://clickhouse.com/docs/operations/settings/settings#webassembly_udf_max_memory "Direct link to webassembly_udf_max_memory")
Experimental feature.
[Learn more.](https://clickhouse.com/docs/beta-and-experimental-features#experimental-features)
| Type | Default value |
|---|---|
| TypeUInt64 | Default value134217728 |
Version history
Memory limit in bytes per WebAssembly UDF instance.
## window\_view\_clean\_interval[β](https://clickhouse.com/docs/operations/settings/settings#window_view_clean_interval "Direct link to window_view_clean_interval")
Experimental feature.
[Learn more.](https://clickhouse.com/docs/beta-and-experimental-features#experimental-features)
| Type | Default value |
|---|---|
| TypeSeconds | Default value60 |
The clean interval of window view in seconds to free outdated data.
## window\_view\_heartbeat\_interval[β](https://clickhouse.com/docs/operations/settings/settings#window_view_heartbeat_interval "Direct link to window_view_heartbeat_interval")
Experimental feature.
[Learn more.](https://clickhouse.com/docs/beta-and-experimental-features#experimental-features)
| Type | Default value |
|---|---|
| TypeSeconds | Default value15 |
The heartbeat interval in seconds to indicate watch query is alive.
## workload[β](https://clickhouse.com/docs/operations/settings/settings#workload "Direct link to workload")
| Type | Default value |
|---|---|
| TypeString | Default valuedefault |
Name of workload to be used to access resources
## write\_full\_path\_in\_iceberg\_metadata[β](https://clickhouse.com/docs/operations/settings/settings#write_full_path_in_iceberg_metadata "Direct link to write_full_path_in_iceberg_metadata")
Experimental feature.
[Learn more.](https://clickhouse.com/docs/beta-and-experimental-features#experimental-features)
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
Write full paths (including s3://) into iceberg metadata files.
## write\_through\_distributed\_cache[β](https://clickhouse.com/docs/operations/settings/settings#write_through_distributed_cache "Direct link to write_through_distributed_cache")
ClickHouse Cloud only
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Version history
Only has an effect in ClickHouse Cloud. Allow writing to distributed cache (writing to s3 will also be done by distributed cache)
## write\_through\_distributed\_cache\_buffer\_size[β](https://clickhouse.com/docs/operations/settings/settings#write_through_distributed_cache_buffer_size "Direct link to write_through_distributed_cache_buffer_size")
ClickHouse Cloud only
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Version history
Only has an effect in ClickHouse Cloud. Set buffer size for write-through distributed cache. If 0, will use buffer size which would have been used if there was not distributed cache.
## zstd\_window\_log\_max[β](https://clickhouse.com/docs/operations/settings/settings#zstd_window_log_max "Direct link to zstd_window_log_max")
| Type | Default value |
|---|---|
| TypeInt64 | Default value0 |
Allows you to select the max window log of ZSTD (it will not be used for MergeTree family)
[Previous Server Settings](https://clickhouse.com/docs/operations/server-configuration-parameters/settings)
[Next MergeTree tables settings](https://clickhouse.com/docs/operations/settings/merge-tree-settings)
- [add\_http\_cors\_header](https://clickhouse.com/docs/operations/settings/settings#add_http_cors_header)
- [additional\_result\_filter](https://clickhouse.com/docs/operations/settings/settings#additional_result_filter)
- [additional\_table\_filters](https://clickhouse.com/docs/operations/settings/settings#additional_table_filters)
- [aggregate\_function\_input\_format](https://clickhouse.com/docs/operations/settings/settings#aggregate_function_input_format)
- [aggregate\_functions\_null\_for\_empty](https://clickhouse.com/docs/operations/settings/settings#aggregate_functions_null_for_empty)
- [aggregation\_in\_order\_max\_block\_bytes](https://clickhouse.com/docs/operations/settings/settings#aggregation_in_order_max_block_bytes)
- [aggregation\_memory\_efficient\_merge\_threads](https://clickhouse.com/docs/operations/settings/settings#aggregation_memory_efficient_merge_threads)
- [allow\_aggregate\_partitions\_independently](https://clickhouse.com/docs/operations/settings/settings#allow_aggregate_partitions_independently)
- [allow\_archive\_path\_syntax](https://clickhouse.com/docs/operations/settings/settings#allow_archive_path_syntax)
- [allow\_asynchronous\_read\_from\_io\_pool\_for\_merge\_tree](https://clickhouse.com/docs/operations/settings/settings#allow_asynchronous_read_from_io_pool_for_merge_tree)
- [allow\_calculating\_subcolumns\_sizes\_for\_merge\_tree\_reading](https://clickhouse.com/docs/operations/settings/settings#allow_calculating_subcolumns_sizes_for_merge_tree_reading)
- [allow\_changing\_replica\_until\_first\_data\_packet](https://clickhouse.com/docs/operations/settings/settings#allow_changing_replica_until_first_data_packet)
- [allow\_create\_index\_without\_type](https://clickhouse.com/docs/operations/settings/settings#allow_create_index_without_type)
- [allow\_custom\_error\_code\_in\_throwif](https://clickhouse.com/docs/operations/settings/settings#allow_custom_error_code_in_throwif)
- [allow\_ddl](https://clickhouse.com/docs/operations/settings/settings#allow_ddl)
- [allow\_deprecated\_database\_ordinary](https://clickhouse.com/docs/operations/settings/settings#allow_deprecated_database_ordinary)
- [allow\_deprecated\_error\_prone\_window\_functions](https://clickhouse.com/docs/operations/settings/settings#allow_deprecated_error_prone_window_functions)
- [allow\_deprecated\_snowflake\_conversion\_functions](https://clickhouse.com/docs/operations/settings/settings#allow_deprecated_snowflake_conversion_functions)
- [allow\_deprecated\_syntax\_for\_merge\_tree](https://clickhouse.com/docs/operations/settings/settings#allow_deprecated_syntax_for_merge_tree)
- [allow\_distributed\_ddl](https://clickhouse.com/docs/operations/settings/settings#allow_distributed_ddl)
- [allow\_drop\_detached](https://clickhouse.com/docs/operations/settings/settings#allow_drop_detached)
- [allow\_dynamic\_type\_in\_join\_keys](https://clickhouse.com/docs/operations/settings/settings#allow_dynamic_type_in_join_keys)
- [allow\_execute\_multiif\_columnar](https://clickhouse.com/docs/operations/settings/settings#allow_execute_multiif_columnar)
- [allow\_experimental\_alias\_table\_engine](https://clickhouse.com/docs/operations/settings/settings#allow_experimental_alias_table_engine)
- [allow\_experimental\_analyzer](https://clickhouse.com/docs/operations/settings/settings#allow_experimental_analyzer)
- [allow\_experimental\_codecs](https://clickhouse.com/docs/operations/settings/settings#allow_experimental_codecs)
- [allow\_experimental\_correlated\_subqueries](https://clickhouse.com/docs/operations/settings/settings#allow_experimental_correlated_subqueries)
- [allow\_experimental\_database\_glue\_catalog](https://clickhouse.com/docs/operations/settings/settings#allow_experimental_database_glue_catalog)
- [allow\_experimental\_database\_hms\_catalog](https://clickhouse.com/docs/operations/settings/settings#allow_experimental_database_hms_catalog)
- [allow\_experimental\_database\_iceberg](https://clickhouse.com/docs/operations/settings/settings#allow_experimental_database_iceberg)
- [allow\_experimental\_database\_materialized\_postgresql](https://clickhouse.com/docs/operations/settings/settings#allow_experimental_database_materialized_postgresql)
- [allow\_experimental\_database\_paimon\_rest\_catalog](https://clickhouse.com/docs/operations/settings/settings#allow_experimental_database_paimon_rest_catalog)
- [allow\_experimental\_database\_unity\_catalog](https://clickhouse.com/docs/operations/settings/settings#allow_experimental_database_unity_catalog)
- [allow\_experimental\_delta\_kernel\_rs](https://clickhouse.com/docs/operations/settings/settings#allow_experimental_delta_kernel_rs)
- [allow\_experimental\_delta\_lake\_writes](https://clickhouse.com/docs/operations/settings/settings#allow_experimental_delta_lake_writes)
- [allow\_experimental\_expire\_snapshots](https://clickhouse.com/docs/operations/settings/settings#allow_experimental_expire_snapshots)
- [allow\_experimental\_funnel\_functions](https://clickhouse.com/docs/operations/settings/settings#allow_experimental_funnel_functions)
- [allow\_experimental\_hash\_functions](https://clickhouse.com/docs/operations/settings/settings#allow_experimental_hash_functions)
- [allow\_experimental\_iceberg\_compaction](https://clickhouse.com/docs/operations/settings/settings#allow_experimental_iceberg_compaction)
- [allow\_experimental\_join\_right\_table\_sorting](https://clickhouse.com/docs/operations/settings/settings#allow_experimental_join_right_table_sorting)
- [allow\_experimental\_json\_lazy\_type\_hints](https://clickhouse.com/docs/operations/settings/settings#allow_experimental_json_lazy_type_hints)
- [allow\_experimental\_kafka\_offsets\_storage\_in\_keeper](https://clickhouse.com/docs/operations/settings/settings#allow_experimental_kafka_offsets_storage_in_keeper)
- [allow\_experimental\_kusto\_dialect](https://clickhouse.com/docs/operations/settings/settings#allow_experimental_kusto_dialect)
- [allow\_experimental\_materialized\_postgresql\_table](https://clickhouse.com/docs/operations/settings/settings#allow_experimental_materialized_postgresql_table)
- [allow\_experimental\_nlp\_functions](https://clickhouse.com/docs/operations/settings/settings#allow_experimental_nlp_functions)
- [allow\_experimental\_nullable\_tuple\_type](https://clickhouse.com/docs/operations/settings/settings#allow_experimental_nullable_tuple_type)
- [allow\_experimental\_object\_storage\_queue\_hive\_partitioning](https://clickhouse.com/docs/operations/settings/settings#allow_experimental_object_storage_queue_hive_partitioning)
- [allow\_experimental\_parallel\_reading\_from\_replicas](https://clickhouse.com/docs/operations/settings/settings#allow_experimental_parallel_reading_from_replicas)
- [allow\_experimental\_polyglot\_dialect](https://clickhouse.com/docs/operations/settings/settings#allow_experimental_polyglot_dialect)
- [allow\_experimental\_prql\_dialect](https://clickhouse.com/docs/operations/settings/settings#allow_experimental_prql_dialect)
- [allow\_experimental\_query\_deduplication](https://clickhouse.com/docs/operations/settings/settings#allow_experimental_query_deduplication)
- [allow\_experimental\_time\_series\_aggregate\_functions](https://clickhouse.com/docs/operations/settings/settings#allow_experimental_time_series_aggregate_functions)
- [allow\_experimental\_time\_series\_table](https://clickhouse.com/docs/operations/settings/settings#allow_experimental_time_series_table)
- [allow\_experimental\_window\_view](https://clickhouse.com/docs/operations/settings/settings#allow_experimental_window_view)
- [allow\_experimental\_ytsaurus\_dictionary\_source](https://clickhouse.com/docs/operations/settings/settings#allow_experimental_ytsaurus_dictionary_source)
- [allow\_experimental\_ytsaurus\_table\_engine](https://clickhouse.com/docs/operations/settings/settings#allow_experimental_ytsaurus_table_engine)
- [allow\_experimental\_ytsaurus\_table\_function](https://clickhouse.com/docs/operations/settings/settings#allow_experimental_ytsaurus_table_function)
- [allow\_fuzz\_query\_functions](https://clickhouse.com/docs/operations/settings/settings#allow_fuzz_query_functions)
- [allow\_general\_join\_planning](https://clickhouse.com/docs/operations/settings/settings#allow_general_join_planning)
- [allow\_get\_client\_http\_header](https://clickhouse.com/docs/operations/settings/settings#allow_get_client_http_header)
- [allow\_hyperscan](https://clickhouse.com/docs/operations/settings/settings#allow_hyperscan)
- [allow\_insert\_into\_iceberg](https://clickhouse.com/docs/operations/settings/settings#allow_insert_into_iceberg)
- [allow\_introspection\_functions](https://clickhouse.com/docs/operations/settings/settings#allow_introspection_functions)
- [allow\_materialized\_view\_with\_bad\_select](https://clickhouse.com/docs/operations/settings/settings#allow_materialized_view_with_bad_select)
- [allow\_named\_collection\_override\_by\_default](https://clickhouse.com/docs/operations/settings/settings#allow_named_collection_override_by_default)
- [allow\_non\_metadata\_alters](https://clickhouse.com/docs/operations/settings/settings#allow_non_metadata_alters)
- [allow\_nonconst\_timezone\_arguments](https://clickhouse.com/docs/operations/settings/settings#allow_nonconst_timezone_arguments)
- [allow\_nondeterministic\_mutations](https://clickhouse.com/docs/operations/settings/settings#allow_nondeterministic_mutations)
- [allow\_nondeterministic\_optimize\_skip\_unused\_shards](https://clickhouse.com/docs/operations/settings/settings#allow_nondeterministic_optimize_skip_unused_shards)
- [allow\_nullable\_tuple\_in\_extracted\_subcolumns](https://clickhouse.com/docs/operations/settings/settings#allow_nullable_tuple_in_extracted_subcolumns)
- [allow\_prefetched\_read\_pool\_for\_local\_filesystem](https://clickhouse.com/docs/operations/settings/settings#allow_prefetched_read_pool_for_local_filesystem)
- [allow\_prefetched\_read\_pool\_for\_remote\_filesystem](https://clickhouse.com/docs/operations/settings/settings#allow_prefetched_read_pool_for_remote_filesystem)
- [allow\_push\_predicate\_ast\_for\_distributed\_subqueries](https://clickhouse.com/docs/operations/settings/settings#allow_push_predicate_ast_for_distributed_subqueries)
- [allow\_push\_predicate\_when\_subquery\_contains\_with](https://clickhouse.com/docs/operations/settings/settings#allow_push_predicate_when_subquery_contains_with)
- [allow\_reorder\_prewhere\_conditions](https://clickhouse.com/docs/operations/settings/settings#allow_reorder_prewhere_conditions)
- [allow\_settings\_after\_format\_in\_insert](https://clickhouse.com/docs/operations/settings/settings#allow_settings_after_format_in_insert)
- [allow\_simdjson](https://clickhouse.com/docs/operations/settings/settings#allow_simdjson)
- [allow\_special\_serialization\_kinds\_in\_output\_formats](https://clickhouse.com/docs/operations/settings/settings#allow_special_serialization_kinds_in_output_formats)
- [allow\_statistics](https://clickhouse.com/docs/operations/settings/settings#allow_statistics)
- [allow\_statistics\_optimize](https://clickhouse.com/docs/operations/settings/settings#allow_statistics_optimize)
- [allow\_suspicious\_codecs](https://clickhouse.com/docs/operations/settings/settings#allow_suspicious_codecs)
- [allow\_suspicious\_fixed\_string\_types](https://clickhouse.com/docs/operations/settings/settings#allow_suspicious_fixed_string_types)
- [allow\_suspicious\_indices](https://clickhouse.com/docs/operations/settings/settings#allow_suspicious_indices)
- [allow\_suspicious\_low\_cardinality\_types](https://clickhouse.com/docs/operations/settings/settings#allow_suspicious_low_cardinality_types)
- [allow\_suspicious\_primary\_key](https://clickhouse.com/docs/operations/settings/settings#allow_suspicious_primary_key)
- [allow\_suspicious\_ttl\_expressions](https://clickhouse.com/docs/operations/settings/settings#allow_suspicious_ttl_expressions)
- [allow\_suspicious\_types\_in\_group\_by](https://clickhouse.com/docs/operations/settings/settings#allow_suspicious_types_in_group_by)
- [allow\_suspicious\_types\_in\_order\_by](https://clickhouse.com/docs/operations/settings/settings#allow_suspicious_types_in_order_by)
- [allow\_suspicious\_variant\_types](https://clickhouse.com/docs/operations/settings/settings#allow_suspicious_variant_types)
- [allow\_unrestricted\_reads\_from\_keeper](https://clickhouse.com/docs/operations/settings/settings#allow_unrestricted_reads_from_keeper)
- [alter\_move\_to\_space\_execute\_async](https://clickhouse.com/docs/operations/settings/settings#alter_move_to_space_execute_async)
- [alter\_partition\_verbose\_result](https://clickhouse.com/docs/operations/settings/settings#alter_partition_verbose_result)
- [alter\_sync](https://clickhouse.com/docs/operations/settings/settings#alter_sync)
- [alter\_update\_mode](https://clickhouse.com/docs/operations/settings/settings#alter_update_mode)
- [analyze\_index\_with\_space\_filling\_curves](https://clickhouse.com/docs/operations/settings/settings#analyze_index_with_space_filling_curves)
- [analyzer\_compatibility\_allow\_compound\_identifiers\_in\_unflatten\_nested](https://clickhouse.com/docs/operations/settings/settings#analyzer_compatibility_allow_compound_identifiers_in_unflatten_nested)
- [analyzer\_compatibility\_join\_using\_top\_level\_identifier](https://clickhouse.com/docs/operations/settings/settings#analyzer_compatibility_join_using_top_level_identifier)
- [analyzer\_inline\_views](https://clickhouse.com/docs/operations/settings/settings#analyzer_inline_views)
- [any\_join\_distinct\_right\_table\_keys](https://clickhouse.com/docs/operations/settings/settings#any_join_distinct_right_table_keys)
- [apply\_deleted\_mask](https://clickhouse.com/docs/operations/settings/settings#apply_deleted_mask)
- [apply\_mutations\_on\_fly](https://clickhouse.com/docs/operations/settings/settings#apply_mutations_on_fly)
- [apply\_patch\_parts](https://clickhouse.com/docs/operations/settings/settings#apply_patch_parts)
- [apply\_patch\_parts\_join\_cache\_buckets](https://clickhouse.com/docs/operations/settings/settings#apply_patch_parts_join_cache_buckets)
- [apply\_prewhere\_after\_final](https://clickhouse.com/docs/operations/settings/settings#apply_prewhere_after_final)
- [apply\_row\_policy\_after\_final](https://clickhouse.com/docs/operations/settings/settings#apply_row_policy_after_final)
- [apply\_settings\_from\_server](https://clickhouse.com/docs/operations/settings/settings#apply_settings_from_server)
- [archive\_adaptive\_buffer\_max\_size\_bytes](https://clickhouse.com/docs/operations/settings/settings#archive_adaptive_buffer_max_size_bytes)
- [arrow\_flight\_request\_descriptor\_type](https://clickhouse.com/docs/operations/settings/settings#arrow_flight_request_descriptor_type)
- [ast\_fuzzer\_any\_query](https://clickhouse.com/docs/operations/settings/settings#ast_fuzzer_any_query)
- [ast\_fuzzer\_runs](https://clickhouse.com/docs/operations/settings/settings#ast_fuzzer_runs)
- [asterisk\_include\_alias\_columns](https://clickhouse.com/docs/operations/settings/settings#asterisk_include_alias_columns)
- [asterisk\_include\_materialized\_columns](https://clickhouse.com/docs/operations/settings/settings#asterisk_include_materialized_columns)
- [async\_insert](https://clickhouse.com/docs/operations/settings/settings#async_insert)
- [async\_insert\_busy\_timeout\_decrease\_rate](https://clickhouse.com/docs/operations/settings/settings#async_insert_busy_timeout_decrease_rate)
- [async\_insert\_busy\_timeout\_increase\_rate](https://clickhouse.com/docs/operations/settings/settings#async_insert_busy_timeout_increase_rate)
- [async\_insert\_busy\_timeout\_max\_ms](https://clickhouse.com/docs/operations/settings/settings#async_insert_busy_timeout_max_ms)
- [async\_insert\_busy\_timeout\_min\_ms](https://clickhouse.com/docs/operations/settings/settings#async_insert_busy_timeout_min_ms)
- [async\_insert\_deduplicate](https://clickhouse.com/docs/operations/settings/settings#async_insert_deduplicate)
- [async\_insert\_max\_data\_size](https://clickhouse.com/docs/operations/settings/settings#async_insert_max_data_size)
- [async\_insert\_max\_query\_number](https://clickhouse.com/docs/operations/settings/settings#async_insert_max_query_number)
- [async\_insert\_poll\_timeout\_ms](https://clickhouse.com/docs/operations/settings/settings#async_insert_poll_timeout_ms)
- [async\_insert\_use\_adaptive\_busy\_timeout](https://clickhouse.com/docs/operations/settings/settings#async_insert_use_adaptive_busy_timeout)
- [async\_query\_sending\_for\_remote](https://clickhouse.com/docs/operations/settings/settings#async_query_sending_for_remote)
- [async\_socket\_for\_remote](https://clickhouse.com/docs/operations/settings/settings#async_socket_for_remote)
- [automatic\_parallel\_replicas\_min\_bytes\_per\_replica](https://clickhouse.com/docs/operations/settings/settings#automatic_parallel_replicas_min_bytes_per_replica)
- [automatic\_parallel\_replicas\_mode](https://clickhouse.com/docs/operations/settings/settings#automatic_parallel_replicas_mode)
- [azure\_allow\_parallel\_part\_upload](https://clickhouse.com/docs/operations/settings/settings#azure_allow_parallel_part_upload)
- [azure\_check\_objects\_after\_upload](https://clickhouse.com/docs/operations/settings/settings#azure_check_objects_after_upload)
- [azure\_connect\_timeout\_ms](https://clickhouse.com/docs/operations/settings/settings#azure_connect_timeout_ms)
- [azure\_create\_new\_file\_on\_insert](https://clickhouse.com/docs/operations/settings/settings#azure_create_new_file_on_insert)
- [azure\_ignore\_file\_doesnt\_exist](https://clickhouse.com/docs/operations/settings/settings#azure_ignore_file_doesnt_exist)
- [azure\_list\_object\_keys\_size](https://clickhouse.com/docs/operations/settings/settings#azure_list_object_keys_size)
- [azure\_max\_blocks\_in\_multipart\_upload](https://clickhouse.com/docs/operations/settings/settings#azure_max_blocks_in_multipart_upload)
- [azure\_max\_get\_burst](https://clickhouse.com/docs/operations/settings/settings#azure_max_get_burst)
- [azure\_max\_get\_rps](https://clickhouse.com/docs/operations/settings/settings#azure_max_get_rps)
- [azure\_max\_inflight\_parts\_for\_one\_file](https://clickhouse.com/docs/operations/settings/settings#azure_max_inflight_parts_for_one_file)
- [azure\_max\_put\_burst](https://clickhouse.com/docs/operations/settings/settings#azure_max_put_burst)
- [azure\_max\_put\_rps](https://clickhouse.com/docs/operations/settings/settings#azure_max_put_rps)
- [azure\_max\_redirects](https://clickhouse.com/docs/operations/settings/settings#azure_max_redirects)
- [azure\_max\_single\_part\_copy\_size](https://clickhouse.com/docs/operations/settings/settings#azure_max_single_part_copy_size)
- [azure\_max\_single\_part\_upload\_size](https://clickhouse.com/docs/operations/settings/settings#azure_max_single_part_upload_size)
- [azure\_max\_single\_read\_retries](https://clickhouse.com/docs/operations/settings/settings#azure_max_single_read_retries)
- [azure\_max\_unexpected\_write\_error\_retries](https://clickhouse.com/docs/operations/settings/settings#azure_max_unexpected_write_error_retries)
- [azure\_max\_upload\_part\_size](https://clickhouse.com/docs/operations/settings/settings#azure_max_upload_part_size)
- [azure\_min\_upload\_part\_size](https://clickhouse.com/docs/operations/settings/settings#azure_min_upload_part_size)
- [azure\_request\_timeout\_ms](https://clickhouse.com/docs/operations/settings/settings#azure_request_timeout_ms)
- [azure\_sdk\_max\_retries](https://clickhouse.com/docs/operations/settings/settings#azure_sdk_max_retries)
- [azure\_sdk\_retry\_initial\_backoff\_ms](https://clickhouse.com/docs/operations/settings/settings#azure_sdk_retry_initial_backoff_ms)
- [azure\_sdk\_retry\_max\_backoff\_ms](https://clickhouse.com/docs/operations/settings/settings#azure_sdk_retry_max_backoff_ms)
- [azure\_skip\_empty\_files](https://clickhouse.com/docs/operations/settings/settings#azure_skip_empty_files)
- [azure\_strict\_upload\_part\_size](https://clickhouse.com/docs/operations/settings/settings#azure_strict_upload_part_size)
- [azure\_throw\_on\_zero\_files\_match](https://clickhouse.com/docs/operations/settings/settings#azure_throw_on_zero_files_match)
- [azure\_truncate\_on\_insert](https://clickhouse.com/docs/operations/settings/settings#azure_truncate_on_insert)
- [azure\_upload\_part\_size\_multiply\_factor](https://clickhouse.com/docs/operations/settings/settings#azure_upload_part_size_multiply_factor)
- [azure\_upload\_part\_size\_multiply\_parts\_count\_threshold](https://clickhouse.com/docs/operations/settings/settings#azure_upload_part_size_multiply_parts_count_threshold)
- [azure\_use\_adaptive\_timeouts](https://clickhouse.com/docs/operations/settings/settings#azure_use_adaptive_timeouts)
- [backup\_restore\_batch\_size\_for\_keeper\_multi](https://clickhouse.com/docs/operations/settings/settings#backup_restore_batch_size_for_keeper_multi)
- [backup\_restore\_batch\_size\_for\_keeper\_multiread](https://clickhouse.com/docs/operations/settings/settings#backup_restore_batch_size_for_keeper_multiread)
- [backup\_restore\_failure\_after\_host\_disconnected\_for\_seconds](https://clickhouse.com/docs/operations/settings/settings#backup_restore_failure_after_host_disconnected_for_seconds)
- [backup\_restore\_finish\_timeout\_after\_error\_sec](https://clickhouse.com/docs/operations/settings/settings#backup_restore_finish_timeout_after_error_sec)
- [backup\_restore\_keeper\_fault\_injection\_probability](https://clickhouse.com/docs/operations/settings/settings#backup_restore_keeper_fault_injection_probability)
- [backup\_restore\_keeper\_fault\_injection\_seed](https://clickhouse.com/docs/operations/settings/settings#backup_restore_keeper_fault_injection_seed)
- [backup\_restore\_keeper\_max\_retries](https://clickhouse.com/docs/operations/settings/settings#backup_restore_keeper_max_retries)
- [backup\_restore\_keeper\_max\_retries\_while\_handling\_error](https://clickhouse.com/docs/operations/settings/settings#backup_restore_keeper_max_retries_while_handling_error)
- [backup\_restore\_keeper\_max\_retries\_while\_initializing](https://clickhouse.com/docs/operations/settings/settings#backup_restore_keeper_max_retries_while_initializing)
- [backup\_restore\_keeper\_retry\_initial\_backoff\_ms](https://clickhouse.com/docs/operations/settings/settings#backup_restore_keeper_retry_initial_backoff_ms)
- [backup\_restore\_keeper\_retry\_max\_backoff\_ms](https://clickhouse.com/docs/operations/settings/settings#backup_restore_keeper_retry_max_backoff_ms)
- [backup\_restore\_keeper\_value\_max\_size](https://clickhouse.com/docs/operations/settings/settings#backup_restore_keeper_value_max_size)
- [backup\_restore\_s3\_retry\_attempts](https://clickhouse.com/docs/operations/settings/settings#backup_restore_s3_retry_attempts)
- [backup\_restore\_s3\_retry\_initial\_backoff\_ms](https://clickhouse.com/docs/operations/settings/settings#backup_restore_s3_retry_initial_backoff_ms)
- [backup\_restore\_s3\_retry\_jitter\_factor](https://clickhouse.com/docs/operations/settings/settings#backup_restore_s3_retry_jitter_factor)
- [backup\_restore\_s3\_retry\_max\_backoff\_ms](https://clickhouse.com/docs/operations/settings/settings#backup_restore_s3_retry_max_backoff_ms)
- [backup\_slow\_all\_threads\_after\_retryable\_s3\_error](https://clickhouse.com/docs/operations/settings/settings#backup_slow_all_threads_after_retryable_s3_error)
- [cache\_warmer\_threads](https://clickhouse.com/docs/operations/settings/settings#cache_warmer_threads)
- [calculate\_text\_stack\_trace](https://clickhouse.com/docs/operations/settings/settings#calculate_text_stack_trace)
- [cancel\_http\_readonly\_queries\_on\_client\_close](https://clickhouse.com/docs/operations/settings/settings#cancel_http_readonly_queries_on_client_close)
- [cast\_ipv4\_ipv6\_default\_on\_conversion\_error](https://clickhouse.com/docs/operations/settings/settings#cast_ipv4_ipv6_default_on_conversion_error)
- [cast\_keep\_nullable](https://clickhouse.com/docs/operations/settings/settings#cast_keep_nullable)
- [cast\_string\_to\_date\_time\_mode](https://clickhouse.com/docs/operations/settings/settings#cast_string_to_date_time_mode)
- [cast\_string\_to\_dynamic\_use\_inference](https://clickhouse.com/docs/operations/settings/settings#cast_string_to_dynamic_use_inference)
- [cast\_string\_to\_variant\_use\_inference](https://clickhouse.com/docs/operations/settings/settings#cast_string_to_variant_use_inference)
- [check\_named\_collection\_dependencies](https://clickhouse.com/docs/operations/settings/settings#check_named_collection_dependencies)
- [check\_query\_single\_value\_result](https://clickhouse.com/docs/operations/settings/settings#check_query_single_value_result)
- [check\_referential\_table\_dependencies](https://clickhouse.com/docs/operations/settings/settings#check_referential_table_dependencies)
- [check\_table\_dependencies](https://clickhouse.com/docs/operations/settings/settings#check_table_dependencies)
- [checksum\_on\_read](https://clickhouse.com/docs/operations/settings/settings#checksum_on_read)
- [cloud\_mode](https://clickhouse.com/docs/operations/settings/settings#cloud_mode)
- [cloud\_mode\_database\_engine](https://clickhouse.com/docs/operations/settings/settings#cloud_mode_database_engine)
- [cloud\_mode\_engine](https://clickhouse.com/docs/operations/settings/settings#cloud_mode_engine)
- [cluster\_for\_parallel\_replicas](https://clickhouse.com/docs/operations/settings/settings#cluster_for_parallel_replicas)
- [cluster\_function\_process\_archive\_on\_multiple\_nodes](https://clickhouse.com/docs/operations/settings/settings#cluster_function_process_archive_on_multiple_nodes)
- [cluster\_table\_function\_buckets\_batch\_size](https://clickhouse.com/docs/operations/settings/settings#cluster_table_function_buckets_batch_size)
- [cluster\_table\_function\_split\_granularity](https://clickhouse.com/docs/operations/settings/settings#cluster_table_function_split_granularity)
- [collect\_hash\_table\_stats\_during\_aggregation](https://clickhouse.com/docs/operations/settings/settings#collect_hash_table_stats_during_aggregation)
- [collect\_hash\_table\_stats\_during\_joins](https://clickhouse.com/docs/operations/settings/settings#collect_hash_table_stats_during_joins)
- [compatibility](https://clickhouse.com/docs/operations/settings/settings#compatibility)
- [compatibility\_ignore\_auto\_increment\_in\_create\_table](https://clickhouse.com/docs/operations/settings/settings#compatibility_ignore_auto_increment_in_create_table)
- [compatibility\_ignore\_collation\_in\_create\_table](https://clickhouse.com/docs/operations/settings/settings#compatibility_ignore_collation_in_create_table)
- [compatibility\_s3\_presigned\_url\_query\_in\_path](https://clickhouse.com/docs/operations/settings/settings#compatibility_s3_presigned_url_query_in_path)
- [compile\_aggregate\_expressions](https://clickhouse.com/docs/operations/settings/settings#compile_aggregate_expressions)
- [compile\_expressions](https://clickhouse.com/docs/operations/settings/settings#compile_expressions)
- [compile\_sort\_description](https://clickhouse.com/docs/operations/settings/settings#compile_sort_description)
- [connect\_timeout](https://clickhouse.com/docs/operations/settings/settings#connect_timeout)
- [connect\_timeout\_with\_failover\_ms](https://clickhouse.com/docs/operations/settings/settings#connect_timeout_with_failover_ms)
- [connect\_timeout\_with\_failover\_secure\_ms](https://clickhouse.com/docs/operations/settings/settings#connect_timeout_with_failover_secure_ms)
- [connection\_pool\_max\_wait\_ms](https://clickhouse.com/docs/operations/settings/settings#connection_pool_max_wait_ms)
- [connections\_with\_failover\_max\_tries](https://clickhouse.com/docs/operations/settings/settings#connections_with_failover_max_tries)
- [convert\_query\_to\_cnf](https://clickhouse.com/docs/operations/settings/settings#convert_query_to_cnf)
- [correlated\_subqueries\_default\_join\_kind](https://clickhouse.com/docs/operations/settings/settings#correlated_subqueries_default_join_kind)
- [correlated\_subqueries\_substitute\_equivalent\_expressions](https://clickhouse.com/docs/operations/settings/settings#correlated_subqueries_substitute_equivalent_expressions)
- [correlated\_subqueries\_use\_in\_memory\_buffer](https://clickhouse.com/docs/operations/settings/settings#correlated_subqueries_use_in_memory_buffer)
- [count\_distinct\_implementation](https://clickhouse.com/docs/operations/settings/settings#count_distinct_implementation)
- [count\_distinct\_optimization](https://clickhouse.com/docs/operations/settings/settings#count_distinct_optimization)
- [count\_matches\_stop\_at\_empty\_match](https://clickhouse.com/docs/operations/settings/settings#count_matches_stop_at_empty_match)
- [create\_if\_not\_exists](https://clickhouse.com/docs/operations/settings/settings#create_if_not_exists)
- [create\_index\_ignore\_unique](https://clickhouse.com/docs/operations/settings/settings#create_index_ignore_unique)
- [create\_replicated\_merge\_tree\_fault\_injection\_probability](https://clickhouse.com/docs/operations/settings/settings#create_replicated_merge_tree_fault_injection_probability)
- [create\_table\_empty\_primary\_key\_by\_default](https://clickhouse.com/docs/operations/settings/settings#create_table_empty_primary_key_by_default)
- [cross\_join\_min\_bytes\_to\_compress](https://clickhouse.com/docs/operations/settings/settings#cross_join_min_bytes_to_compress)
- [cross\_join\_min\_rows\_to\_compress](https://clickhouse.com/docs/operations/settings/settings#cross_join_min_rows_to_compress)
- [cross\_to\_inner\_join\_rewrite](https://clickhouse.com/docs/operations/settings/settings#cross_to_inner_join_rewrite)
- [data\_type\_default\_nullable](https://clickhouse.com/docs/operations/settings/settings#data_type_default_nullable)
- [database\_atomic\_wait\_for\_drop\_and\_detach\_synchronously](https://clickhouse.com/docs/operations/settings/settings#database_atomic_wait_for_drop_and_detach_synchronously)
- [database\_datalake\_require\_metadata\_access](https://clickhouse.com/docs/operations/settings/settings#database_datalake_require_metadata_access)
- [database\_replicated\_allow\_explicit\_uuid](https://clickhouse.com/docs/operations/settings/settings#database_replicated_allow_explicit_uuid)
- [database\_replicated\_allow\_heavy\_create](https://clickhouse.com/docs/operations/settings/settings#database_replicated_allow_heavy_create)
- [database\_replicated\_allow\_only\_replicated\_engine](https://clickhouse.com/docs/operations/settings/settings#database_replicated_allow_only_replicated_engine)
- [database\_replicated\_allow\_replicated\_engine\_arguments](https://clickhouse.com/docs/operations/settings/settings#database_replicated_allow_replicated_engine_arguments)
- [database\_replicated\_always\_detach\_permanently](https://clickhouse.com/docs/operations/settings/settings#database_replicated_always_detach_permanently)
- [database\_replicated\_enforce\_synchronous\_settings](https://clickhouse.com/docs/operations/settings/settings#database_replicated_enforce_synchronous_settings)
- [database\_replicated\_initial\_query\_timeout\_sec](https://clickhouse.com/docs/operations/settings/settings#database_replicated_initial_query_timeout_sec)
- [database\_shared\_drop\_table\_delay\_seconds](https://clickhouse.com/docs/operations/settings/settings#database_shared_drop_table_delay_seconds)
- [decimal\_check\_overflow](https://clickhouse.com/docs/operations/settings/settings#decimal_check_overflow)
- [deduplicate\_blocks\_in\_dependent\_materialized\_views](https://clickhouse.com/docs/operations/settings/settings#deduplicate_blocks_in_dependent_materialized_views)
- [deduplicate\_insert](https://clickhouse.com/docs/operations/settings/settings#deduplicate_insert)
- [deduplicate\_insert\_select](https://clickhouse.com/docs/operations/settings/settings#deduplicate_insert_select)
- [default\_materialized\_view\_sql\_security](https://clickhouse.com/docs/operations/settings/settings#default_materialized_view_sql_security)
- [default\_max\_bytes\_in\_join](https://clickhouse.com/docs/operations/settings/settings#default_max_bytes_in_join)
- [default\_normal\_view\_sql\_security](https://clickhouse.com/docs/operations/settings/settings#default_normal_view_sql_security)
- [default\_table\_engine](https://clickhouse.com/docs/operations/settings/settings#default_table_engine)
- [default\_temporary\_table\_engine](https://clickhouse.com/docs/operations/settings/settings#default_temporary_table_engine)
- [default\_view\_definer](https://clickhouse.com/docs/operations/settings/settings#default_view_definer)
- [delta\_lake\_enable\_engine\_predicate](https://clickhouse.com/docs/operations/settings/settings#delta_lake_enable_engine_predicate)
- [delta\_lake\_enable\_expression\_visitor\_logging](https://clickhouse.com/docs/operations/settings/settings#delta_lake_enable_expression_visitor_logging)
- [delta\_lake\_insert\_max\_bytes\_in\_data\_file](https://clickhouse.com/docs/operations/settings/settings#delta_lake_insert_max_bytes_in_data_file)
- [delta\_lake\_insert\_max\_rows\_in\_data\_file](https://clickhouse.com/docs/operations/settings/settings#delta_lake_insert_max_rows_in_data_file)
- [delta\_lake\_log\_metadata](https://clickhouse.com/docs/operations/settings/settings#delta_lake_log_metadata)
- [delta\_lake\_reload\_schema\_for\_consistency](https://clickhouse.com/docs/operations/settings/settings#delta_lake_reload_schema_for_consistency)
- [delta\_lake\_snapshot\_end\_version](https://clickhouse.com/docs/operations/settings/settings#delta_lake_snapshot_end_version)
- [delta\_lake\_snapshot\_start\_version](https://clickhouse.com/docs/operations/settings/settings#delta_lake_snapshot_start_version)
- [delta\_lake\_snapshot\_version](https://clickhouse.com/docs/operations/settings/settings#delta_lake_snapshot_version)
- [delta\_lake\_throw\_on\_engine\_predicate\_error](https://clickhouse.com/docs/operations/settings/settings#delta_lake_throw_on_engine_predicate_error)
- [describe\_compact\_output](https://clickhouse.com/docs/operations/settings/settings#describe_compact_output)
- [describe\_include\_subcolumns](https://clickhouse.com/docs/operations/settings/settings#describe_include_subcolumns)
- [describe\_include\_virtual\_columns](https://clickhouse.com/docs/operations/settings/settings#describe_include_virtual_columns)
- [dialect](https://clickhouse.com/docs/operations/settings/settings#dialect)
- [dictionary\_use\_async\_executor](https://clickhouse.com/docs/operations/settings/settings#dictionary_use_async_executor)
- [dictionary\_validate\_primary\_key\_type](https://clickhouse.com/docs/operations/settings/settings#dictionary_validate_primary_key_type)
- [distinct\_overflow\_mode](https://clickhouse.com/docs/operations/settings/settings#distinct_overflow_mode)
- [distributed\_aggregation\_memory\_efficient](https://clickhouse.com/docs/operations/settings/settings#distributed_aggregation_memory_efficient)
- [distributed\_background\_insert\_batch](https://clickhouse.com/docs/operations/settings/settings#distributed_background_insert_batch)
- [distributed\_background\_insert\_max\_sleep\_time\_ms](https://clickhouse.com/docs/operations/settings/settings#distributed_background_insert_max_sleep_time_ms)
- [distributed\_background\_insert\_sleep\_time\_ms](https://clickhouse.com/docs/operations/settings/settings#distributed_background_insert_sleep_time_ms)
- [distributed\_background\_insert\_split\_batch\_on\_failure](https://clickhouse.com/docs/operations/settings/settings#distributed_background_insert_split_batch_on_failure)
- [distributed\_background\_insert\_timeout](https://clickhouse.com/docs/operations/settings/settings#distributed_background_insert_timeout)
- [distributed\_cache\_alignment](https://clickhouse.com/docs/operations/settings/settings#distributed_cache_alignment)
- [distributed\_cache\_bypass\_connection\_pool](https://clickhouse.com/docs/operations/settings/settings#distributed_cache_bypass_connection_pool)
- [distributed\_cache\_connect\_backoff\_max\_ms](https://clickhouse.com/docs/operations/settings/settings#distributed_cache_connect_backoff_max_ms)
- [distributed\_cache\_connect\_backoff\_min\_ms](https://clickhouse.com/docs/operations/settings/settings#distributed_cache_connect_backoff_min_ms)
- [distributed\_cache\_connect\_max\_tries](https://clickhouse.com/docs/operations/settings/settings#distributed_cache_connect_max_tries)
- [distributed\_cache\_connect\_timeout\_ms](https://clickhouse.com/docs/operations/settings/settings#distributed_cache_connect_timeout_ms)
- [distributed\_cache\_credentials\_refresh\_period\_seconds](https://clickhouse.com/docs/operations/settings/settings#distributed_cache_credentials_refresh_period_seconds)
- [distributed\_cache\_data\_packet\_ack\_window](https://clickhouse.com/docs/operations/settings/settings#distributed_cache_data_packet_ack_window)
- [distributed\_cache\_discard\_connection\_if\_unread\_data](https://clickhouse.com/docs/operations/settings/settings#distributed_cache_discard_connection_if_unread_data)
- [distributed\_cache\_fetch\_metrics\_only\_from\_current\_az](https://clickhouse.com/docs/operations/settings/settings#distributed_cache_fetch_metrics_only_from_current_az)
- [distributed\_cache\_file\_cache\_name](https://clickhouse.com/docs/operations/settings/settings#distributed_cache_file_cache_name)
- [distributed\_cache\_log\_mode](https://clickhouse.com/docs/operations/settings/settings#distributed_cache_log_mode)
- [distributed\_cache\_max\_unacked\_inflight\_packets](https://clickhouse.com/docs/operations/settings/settings#distributed_cache_max_unacked_inflight_packets)
- [distributed\_cache\_min\_bytes\_for\_seek](https://clickhouse.com/docs/operations/settings/settings#distributed_cache_min_bytes_for_seek)
- [distributed\_cache\_pool\_behaviour\_on\_limit](https://clickhouse.com/docs/operations/settings/settings#distributed_cache_pool_behaviour_on_limit)
- [distributed\_cache\_prefer\_bigger\_buffer\_size](https://clickhouse.com/docs/operations/settings/settings#distributed_cache_prefer_bigger_buffer_size)
- [distributed\_cache\_read\_only\_from\_current\_az](https://clickhouse.com/docs/operations/settings/settings#distributed_cache_read_only_from_current_az)
- [distributed\_cache\_read\_request\_max\_tries](https://clickhouse.com/docs/operations/settings/settings#distributed_cache_read_request_max_tries)
- [distributed\_cache\_receive\_response\_wait\_milliseconds](https://clickhouse.com/docs/operations/settings/settings#distributed_cache_receive_response_wait_milliseconds)
- [distributed\_cache\_receive\_timeout\_milliseconds](https://clickhouse.com/docs/operations/settings/settings#distributed_cache_receive_timeout_milliseconds)
- [distributed\_cache\_receive\_timeout\_ms](https://clickhouse.com/docs/operations/settings/settings#distributed_cache_receive_timeout_ms)
- [distributed\_cache\_send\_timeout\_ms](https://clickhouse.com/docs/operations/settings/settings#distributed_cache_send_timeout_ms)
- [distributed\_cache\_tcp\_keep\_alive\_timeout\_ms](https://clickhouse.com/docs/operations/settings/settings#distributed_cache_tcp_keep_alive_timeout_ms)
- [distributed\_cache\_throw\_on\_error](https://clickhouse.com/docs/operations/settings/settings#distributed_cache_throw_on_error)
- [distributed\_cache\_use\_clients\_cache\_for\_read](https://clickhouse.com/docs/operations/settings/settings#distributed_cache_use_clients_cache_for_read)
- [distributed\_cache\_use\_clients\_cache\_for\_write](https://clickhouse.com/docs/operations/settings/settings#distributed_cache_use_clients_cache_for_write)
- [distributed\_cache\_wait\_connection\_from\_pool\_milliseconds](https://clickhouse.com/docs/operations/settings/settings#distributed_cache_wait_connection_from_pool_milliseconds)
- [distributed\_connections\_pool\_size](https://clickhouse.com/docs/operations/settings/settings#distributed_connections_pool_size)
- [distributed\_ddl\_entry\_format\_version](https://clickhouse.com/docs/operations/settings/settings#distributed_ddl_entry_format_version)
- [distributed\_ddl\_output\_mode](https://clickhouse.com/docs/operations/settings/settings#distributed_ddl_output_mode)
- [distributed\_ddl\_task\_timeout](https://clickhouse.com/docs/operations/settings/settings#distributed_ddl_task_timeout)
- [distributed\_foreground\_insert](https://clickhouse.com/docs/operations/settings/settings#distributed_foreground_insert)
- [distributed\_group\_by\_no\_merge](https://clickhouse.com/docs/operations/settings/settings#distributed_group_by_no_merge)
- [distributed\_index\_analysis](https://clickhouse.com/docs/operations/settings/settings#distributed_index_analysis)
- [distributed\_index\_analysis\_for\_non\_shared\_merge\_tree](https://clickhouse.com/docs/operations/settings/settings#distributed_index_analysis_for_non_shared_merge_tree)
- [distributed\_index\_analysis\_only\_on\_coordinator](https://clickhouse.com/docs/operations/settings/settings#distributed_index_analysis_only_on_coordinator)
- [distributed\_insert\_skip\_read\_only\_replicas](https://clickhouse.com/docs/operations/settings/settings#distributed_insert_skip_read_only_replicas)
- [distributed\_plan\_default\_reader\_bucket\_count](https://clickhouse.com/docs/operations/settings/settings#distributed_plan_default_reader_bucket_count)
- [distributed\_plan\_default\_shuffle\_join\_bucket\_count](https://clickhouse.com/docs/operations/settings/settings#distributed_plan_default_shuffle_join_bucket_count)
- [distributed\_plan\_execute\_locally](https://clickhouse.com/docs/operations/settings/settings#distributed_plan_execute_locally)
- [distributed\_plan\_force\_exchange\_kind](https://clickhouse.com/docs/operations/settings/settings#distributed_plan_force_exchange_kind)
- [distributed\_plan\_force\_shuffle\_aggregation](https://clickhouse.com/docs/operations/settings/settings#distributed_plan_force_shuffle_aggregation)
- [distributed\_plan\_max\_rows\_to\_broadcast](https://clickhouse.com/docs/operations/settings/settings#distributed_plan_max_rows_to_broadcast)
- [distributed\_plan\_optimize\_exchanges](https://clickhouse.com/docs/operations/settings/settings#distributed_plan_optimize_exchanges)
- [distributed\_plan\_prefer\_replicas\_over\_workers](https://clickhouse.com/docs/operations/settings/settings#distributed_plan_prefer_replicas_over_workers)
- [distributed\_product\_mode](https://clickhouse.com/docs/operations/settings/settings#distributed_product_mode)
- [distributed\_push\_down\_limit](https://clickhouse.com/docs/operations/settings/settings#distributed_push_down_limit)
- [distributed\_replica\_error\_cap](https://clickhouse.com/docs/operations/settings/settings#distributed_replica_error_cap)
- [distributed\_replica\_error\_half\_life](https://clickhouse.com/docs/operations/settings/settings#distributed_replica_error_half_life)
- [distributed\_replica\_max\_ignored\_errors](https://clickhouse.com/docs/operations/settings/settings#distributed_replica_max_ignored_errors)
- [do\_not\_merge\_across\_partitions\_select\_final](https://clickhouse.com/docs/operations/settings/settings#do_not_merge_across_partitions_select_final)
- [empty\_result\_for\_aggregation\_by\_constant\_keys\_on\_empty\_set](https://clickhouse.com/docs/operations/settings/settings#empty_result_for_aggregation_by_constant_keys_on_empty_set)
- [empty\_result\_for\_aggregation\_by\_empty\_set](https://clickhouse.com/docs/operations/settings/settings#empty_result_for_aggregation_by_empty_set)
- [enable\_adaptive\_memory\_spill\_scheduler](https://clickhouse.com/docs/operations/settings/settings#enable_adaptive_memory_spill_scheduler)
- [enable\_add\_distinct\_to\_in\_subqueries](https://clickhouse.com/docs/operations/settings/settings#enable_add_distinct_to_in_subqueries)
- [enable\_automatic\_decision\_for\_merging\_across\_partitions\_for\_final](https://clickhouse.com/docs/operations/settings/settings#enable_automatic_decision_for_merging_across_partitions_for_final)
- [enable\_blob\_storage\_log](https://clickhouse.com/docs/operations/settings/settings#enable_blob_storage_log)
- [enable\_early\_constant\_folding](https://clickhouse.com/docs/operations/settings/settings#enable_early_constant_folding)
- [enable\_extended\_results\_for\_datetime\_functions](https://clickhouse.com/docs/operations/settings/settings#enable_extended_results_for_datetime_functions)
- [enable\_filesystem\_cache](https://clickhouse.com/docs/operations/settings/settings#enable_filesystem_cache)
- [enable\_filesystem\_cache\_log](https://clickhouse.com/docs/operations/settings/settings#enable_filesystem_cache_log)
- [enable\_filesystem\_cache\_on\_write\_operations](https://clickhouse.com/docs/operations/settings/settings#enable_filesystem_cache_on_write_operations)
- [enable\_filesystem\_read\_prefetches\_log](https://clickhouse.com/docs/operations/settings/settings#enable_filesystem_read_prefetches_log)
- [enable\_full\_text\_index](https://clickhouse.com/docs/operations/settings/settings#enable_full_text_index)
- [enable\_global\_with\_statement](https://clickhouse.com/docs/operations/settings/settings#enable_global_with_statement)
- [enable\_hdfs\_pread](https://clickhouse.com/docs/operations/settings/settings#enable_hdfs_pread)
- [enable\_http\_compression](https://clickhouse.com/docs/operations/settings/settings#enable_http_compression)
- [enable\_job\_stack\_trace](https://clickhouse.com/docs/operations/settings/settings#enable_job_stack_trace)
- [enable\_join\_runtime\_filters](https://clickhouse.com/docs/operations/settings/settings#enable_join_runtime_filters)
- [enable\_join\_transitive\_predicates](https://clickhouse.com/docs/operations/settings/settings#enable_join_transitive_predicates)
- [enable\_lazy\_columns\_replication](https://clickhouse.com/docs/operations/settings/settings#enable_lazy_columns_replication)
- [enable\_lightweight\_delete](https://clickhouse.com/docs/operations/settings/settings#enable_lightweight_delete)
- [enable\_lightweight\_update](https://clickhouse.com/docs/operations/settings/settings#enable_lightweight_update)
- [enable\_materialized\_cte](https://clickhouse.com/docs/operations/settings/settings#enable_materialized_cte)
- [enable\_memory\_bound\_merging\_of\_aggregation\_results](https://clickhouse.com/docs/operations/settings/settings#enable_memory_bound_merging_of_aggregation_results)
- [enable\_multiple\_prewhere\_read\_steps](https://clickhouse.com/docs/operations/settings/settings#enable_multiple_prewhere_read_steps)
- [enable\_named\_columns\_in\_function\_tuple](https://clickhouse.com/docs/operations/settings/settings#enable_named_columns_in_function_tuple)
- [enable\_optimize\_predicate\_expression](https://clickhouse.com/docs/operations/settings/settings#enable_optimize_predicate_expression)
- [enable\_optimize\_predicate\_expression\_to\_final\_subquery](https://clickhouse.com/docs/operations/settings/settings#enable_optimize_predicate_expression_to_final_subquery)
- [enable\_order\_by\_all](https://clickhouse.com/docs/operations/settings/settings#enable_order_by_all)
- [enable\_parallel\_blocks\_marshalling](https://clickhouse.com/docs/operations/settings/settings#enable_parallel_blocks_marshalling)
- [enable\_parsing\_to\_custom\_serialization](https://clickhouse.com/docs/operations/settings/settings#enable_parsing_to_custom_serialization)
- [enable\_positional\_arguments](https://clickhouse.com/docs/operations/settings/settings#enable_positional_arguments)
- [enable\_positional\_arguments\_for\_projections](https://clickhouse.com/docs/operations/settings/settings#enable_positional_arguments_for_projections)
- [enable\_producing\_buckets\_out\_of\_order\_in\_aggregation](https://clickhouse.com/docs/operations/settings/settings#enable_producing_buckets_out_of_order_in_aggregation)
- [enable\_reads\_from\_query\_cache](https://clickhouse.com/docs/operations/settings/settings#enable_reads_from_query_cache)
- [enable\_s3\_requests\_logging](https://clickhouse.com/docs/operations/settings/settings#enable_s3_requests_logging)
- [enable\_scalar\_subquery\_optimization](https://clickhouse.com/docs/operations/settings/settings#enable_scalar_subquery_optimization)
- [enable\_scopes\_for\_with\_statement](https://clickhouse.com/docs/operations/settings/settings#enable_scopes_for_with_statement)
- [enable\_shared\_storage\_snapshot\_in\_query](https://clickhouse.com/docs/operations/settings/settings#enable_shared_storage_snapshot_in_query)
- [enable\_sharing\_sets\_for\_mutations](https://clickhouse.com/docs/operations/settings/settings#enable_sharing_sets_for_mutations)
- [enable\_software\_prefetch\_in\_aggregation](https://clickhouse.com/docs/operations/settings/settings#enable_software_prefetch_in_aggregation)
- [enable\_time\_time64\_type](https://clickhouse.com/docs/operations/settings/settings#enable_time_time64_type)
- [enable\_unaligned\_array\_join](https://clickhouse.com/docs/operations/settings/settings#enable_unaligned_array_join)
- [enable\_url\_encoding](https://clickhouse.com/docs/operations/settings/settings#enable_url_encoding)
- [enable\_vertical\_final](https://clickhouse.com/docs/operations/settings/settings#enable_vertical_final)
- [enable\_writes\_to\_query\_cache](https://clickhouse.com/docs/operations/settings/settings#enable_writes_to_query_cache)
- [enforce\_strict\_identifier\_format](https://clickhouse.com/docs/operations/settings/settings#enforce_strict_identifier_format)
- [engine\_file\_allow\_create\_multiple\_files](https://clickhouse.com/docs/operations/settings/settings#engine_file_allow_create_multiple_files)
- [engine\_file\_empty\_if\_not\_exists](https://clickhouse.com/docs/operations/settings/settings#engine_file_empty_if_not_exists)
- [engine\_file\_skip\_empty\_files](https://clickhouse.com/docs/operations/settings/settings#engine_file_skip_empty_files)
- [engine\_file\_truncate\_on\_insert](https://clickhouse.com/docs/operations/settings/settings#engine_file_truncate_on_insert)
- [engine\_url\_skip\_empty\_files](https://clickhouse.com/docs/operations/settings/settings#engine_url_skip_empty_files)
- [exact\_rows\_before\_limit](https://clickhouse.com/docs/operations/settings/settings#exact_rows_before_limit)
- [except\_default\_mode](https://clickhouse.com/docs/operations/settings/settings#except_default_mode)
- [exclude\_materialize\_skip\_indexes\_on\_insert](https://clickhouse.com/docs/operations/settings/settings#exclude_materialize_skip_indexes_on_insert)
- [execute\_exists\_as\_scalar\_subquery](https://clickhouse.com/docs/operations/settings/settings#execute_exists_as_scalar_subquery)
- [external\_storage\_connect\_timeout\_sec](https://clickhouse.com/docs/operations/settings/settings#external_storage_connect_timeout_sec)
- [external\_storage\_max\_read\_bytes](https://clickhouse.com/docs/operations/settings/settings#external_storage_max_read_bytes)
- [external\_storage\_max\_read\_rows](https://clickhouse.com/docs/operations/settings/settings#external_storage_max_read_rows)
- [external\_storage\_rw\_timeout\_sec](https://clickhouse.com/docs/operations/settings/settings#external_storage_rw_timeout_sec)
- [external\_table\_functions\_use\_nulls](https://clickhouse.com/docs/operations/settings/settings#external_table_functions_use_nulls)
- [external\_table\_strict\_query](https://clickhouse.com/docs/operations/settings/settings#external_table_strict_query)
- [extract\_key\_value\_pairs\_max\_pairs\_per\_row](https://clickhouse.com/docs/operations/settings/settings#extract_key_value_pairs_max_pairs_per_row)
- [extremes](https://clickhouse.com/docs/operations/settings/settings#extremes)
- [fallback\_to\_stale\_replicas\_for\_distributed\_queries](https://clickhouse.com/docs/operations/settings/settings#fallback_to_stale_replicas_for_distributed_queries)
- [filesystem\_cache\_allow\_background\_download](https://clickhouse.com/docs/operations/settings/settings#filesystem_cache_allow_background_download)
- [filesystem\_cache\_boundary\_alignment](https://clickhouse.com/docs/operations/settings/settings#filesystem_cache_boundary_alignment)
- [filesystem\_cache\_enable\_background\_download\_during\_fetch](https://clickhouse.com/docs/operations/settings/settings#filesystem_cache_enable_background_download_during_fetch)
- [filesystem\_cache\_enable\_background\_download\_for\_metadata\_files\_in\_packed\_storage](https://clickhouse.com/docs/operations/settings/settings#filesystem_cache_enable_background_download_for_metadata_files_in_packed_storage)
- [filesystem\_cache\_max\_download\_size](https://clickhouse.com/docs/operations/settings/settings#filesystem_cache_max_download_size)
- [filesystem\_cache\_name](https://clickhouse.com/docs/operations/settings/settings#filesystem_cache_name)
- [filesystem\_cache\_prefer\_bigger\_buffer\_size](https://clickhouse.com/docs/operations/settings/settings#filesystem_cache_prefer_bigger_buffer_size)
- [filesystem\_cache\_reserve\_space\_wait\_lock\_timeout\_milliseconds](https://clickhouse.com/docs/operations/settings/settings#filesystem_cache_reserve_space_wait_lock_timeout_milliseconds)
- [filesystem\_cache\_segments\_batch\_size](https://clickhouse.com/docs/operations/settings/settings#filesystem_cache_segments_batch_size)
- [filesystem\_cache\_skip\_download\_if\_exceeds\_per\_query\_cache\_write\_limit](https://clickhouse.com/docs/operations/settings/settings#filesystem_cache_skip_download_if_exceeds_per_query_cache_write_limit)
- [filesystem\_prefetch\_max\_memory\_usage](https://clickhouse.com/docs/operations/settings/settings#filesystem_prefetch_max_memory_usage)
- [filesystem\_prefetch\_step\_bytes](https://clickhouse.com/docs/operations/settings/settings#filesystem_prefetch_step_bytes)
- [filesystem\_prefetch\_step\_marks](https://clickhouse.com/docs/operations/settings/settings#filesystem_prefetch_step_marks)
- [filesystem\_prefetches\_limit](https://clickhouse.com/docs/operations/settings/settings#filesystem_prefetches_limit)
- [final](https://clickhouse.com/docs/operations/settings/settings#final)
- [finalize\_projection\_parts\_synchronously](https://clickhouse.com/docs/operations/settings/settings#finalize_projection_parts_synchronously)
- [flatten\_nested](https://clickhouse.com/docs/operations/settings/settings#flatten_nested)
- [force\_aggregate\_partitions\_independently](https://clickhouse.com/docs/operations/settings/settings#force_aggregate_partitions_independently)
- [force\_aggregation\_in\_order](https://clickhouse.com/docs/operations/settings/settings#force_aggregation_in_order)
- [force\_data\_skipping\_indices](https://clickhouse.com/docs/operations/settings/settings#force_data_skipping_indices)
- [force\_grouping\_standard\_compatibility](https://clickhouse.com/docs/operations/settings/settings#force_grouping_standard_compatibility)
- [force\_index\_by\_date](https://clickhouse.com/docs/operations/settings/settings#force_index_by_date)
- [force\_optimize\_projection](https://clickhouse.com/docs/operations/settings/settings#force_optimize_projection)
- [force\_optimize\_projection\_name](https://clickhouse.com/docs/operations/settings/settings#force_optimize_projection_name)
- [force\_optimize\_skip\_unused\_shards](https://clickhouse.com/docs/operations/settings/settings#force_optimize_skip_unused_shards)
- [force\_optimize\_skip\_unused\_shards\_nesting](https://clickhouse.com/docs/operations/settings/settings#force_optimize_skip_unused_shards_nesting)
- [force\_primary\_key](https://clickhouse.com/docs/operations/settings/settings#force_primary_key)
- [force\_remove\_data\_recursively\_on\_drop](https://clickhouse.com/docs/operations/settings/settings#force_remove_data_recursively_on_drop)
- [formatdatetime\_e\_with\_space\_padding](https://clickhouse.com/docs/operations/settings/settings#formatdatetime_e_with_space_padding)
- [formatdatetime\_f\_prints\_scale\_number\_of\_digits](https://clickhouse.com/docs/operations/settings/settings#formatdatetime_f_prints_scale_number_of_digits)
- [formatdatetime\_f\_prints\_single\_zero](https://clickhouse.com/docs/operations/settings/settings#formatdatetime_f_prints_single_zero)
- [formatdatetime\_format\_without\_leading\_zeros](https://clickhouse.com/docs/operations/settings/settings#formatdatetime_format_without_leading_zeros)
- [formatdatetime\_parsedatetime\_m\_is\_month\_name](https://clickhouse.com/docs/operations/settings/settings#formatdatetime_parsedatetime_m_is_month_name)
- [fsync\_metadata](https://clickhouse.com/docs/operations/settings/settings#fsync_metadata)
- [function\_date\_trunc\_return\_type\_behavior](https://clickhouse.com/docs/operations/settings/settings#function_date_trunc_return_type_behavior)
- [function\_implementation](https://clickhouse.com/docs/operations/settings/settings#function_implementation)
- [function\_json\_value\_return\_type\_allow\_complex](https://clickhouse.com/docs/operations/settings/settings#function_json_value_return_type_allow_complex)
- [function\_json\_value\_return\_type\_allow\_nullable](https://clickhouse.com/docs/operations/settings/settings#function_json_value_return_type_allow_nullable)
- [function\_locate\_has\_mysql\_compatible\_argument\_order](https://clickhouse.com/docs/operations/settings/settings#function_locate_has_mysql_compatible_argument_order)
- [function\_range\_max\_elements\_in\_block](https://clickhouse.com/docs/operations/settings/settings#function_range_max_elements_in_block)
- [function\_sleep\_max\_microseconds\_per\_block](https://clickhouse.com/docs/operations/settings/settings#function_sleep_max_microseconds_per_block)
- [function\_visible\_width\_behavior](https://clickhouse.com/docs/operations/settings/settings#function_visible_width_behavior)
- [functions\_h3\_default\_if\_invalid](https://clickhouse.com/docs/operations/settings/settings#functions_h3_default_if_invalid)
- [geo\_distance\_returns\_float64\_on\_float64\_arguments](https://clickhouse.com/docs/operations/settings/settings#geo_distance_returns_float64_on_float64_arguments)
- [geotoh3\_argument\_order](https://clickhouse.com/docs/operations/settings/settings#geotoh3_argument_order)
- [glob\_expansion\_max\_elements](https://clickhouse.com/docs/operations/settings/settings#glob_expansion_max_elements)
- [grace\_hash\_join\_initial\_buckets](https://clickhouse.com/docs/operations/settings/settings#grace_hash_join_initial_buckets)
- [grace\_hash\_join\_max\_buckets](https://clickhouse.com/docs/operations/settings/settings#grace_hash_join_max_buckets)
- [group\_by\_overflow\_mode](https://clickhouse.com/docs/operations/settings/settings#group_by_overflow_mode)
- [group\_by\_two\_level\_threshold](https://clickhouse.com/docs/operations/settings/settings#group_by_two_level_threshold)
- [group\_by\_two\_level\_threshold\_bytes](https://clickhouse.com/docs/operations/settings/settings#group_by_two_level_threshold_bytes)
- [group\_by\_use\_nulls](https://clickhouse.com/docs/operations/settings/settings#group_by_use_nulls)
- [h3togeo\_lon\_lat\_result\_order](https://clickhouse.com/docs/operations/settings/settings#h3togeo_lon_lat_result_order)
- [handshake\_timeout\_ms](https://clickhouse.com/docs/operations/settings/settings#handshake_timeout_ms)
- [hdfs\_create\_new\_file\_on\_insert](https://clickhouse.com/docs/operations/settings/settings#hdfs_create_new_file_on_insert)
- [hdfs\_ignore\_file\_doesnt\_exist](https://clickhouse.com/docs/operations/settings/settings#hdfs_ignore_file_doesnt_exist)
- [hdfs\_replication](https://clickhouse.com/docs/operations/settings/settings#hdfs_replication)
- [hdfs\_skip\_empty\_files](https://clickhouse.com/docs/operations/settings/settings#hdfs_skip_empty_files)
- [hdfs\_throw\_on\_zero\_files\_match](https://clickhouse.com/docs/operations/settings/settings#hdfs_throw_on_zero_files_match)
- [hdfs\_truncate\_on\_insert](https://clickhouse.com/docs/operations/settings/settings#hdfs_truncate_on_insert)
- [hedged\_connection\_timeout\_ms](https://clickhouse.com/docs/operations/settings/settings#hedged_connection_timeout_ms)
- [highlight\_max\_matches\_per\_row](https://clickhouse.com/docs/operations/settings/settings#highlight_max_matches_per_row)
- [hnsw\_candidate\_list\_size\_for\_search](https://clickhouse.com/docs/operations/settings/settings#hnsw_candidate_list_size_for_search)
- [hsts\_max\_age](https://clickhouse.com/docs/operations/settings/settings#hsts_max_age)
- [http\_connection\_timeout](https://clickhouse.com/docs/operations/settings/settings#http_connection_timeout)
- [http\_headers\_progress\_interval\_ms](https://clickhouse.com/docs/operations/settings/settings#http_headers_progress_interval_ms)
- [http\_make\_head\_request](https://clickhouse.com/docs/operations/settings/settings#http_make_head_request)
- [http\_max\_field\_name\_size](https://clickhouse.com/docs/operations/settings/settings#http_max_field_name_size)
- [http\_max\_field\_value\_size](https://clickhouse.com/docs/operations/settings/settings#http_max_field_value_size)
- [http\_max\_fields](https://clickhouse.com/docs/operations/settings/settings#http_max_fields)
- [http\_max\_multipart\_form\_data\_size](https://clickhouse.com/docs/operations/settings/settings#http_max_multipart_form_data_size)
- [http\_max\_request\_param\_data\_size](https://clickhouse.com/docs/operations/settings/settings#http_max_request_param_data_size)
- [http\_max\_tries](https://clickhouse.com/docs/operations/settings/settings#http_max_tries)
- [http\_max\_uri\_size](https://clickhouse.com/docs/operations/settings/settings#http_max_uri_size)
- [http\_native\_compression\_disable\_checksumming\_on\_decompress](https://clickhouse.com/docs/operations/settings/settings#http_native_compression_disable_checksumming_on_decompress)
- [http\_receive\_timeout](https://clickhouse.com/docs/operations/settings/settings#http_receive_timeout)
- [http\_response\_buffer\_size](https://clickhouse.com/docs/operations/settings/settings#http_response_buffer_size)
- [http\_response\_headers](https://clickhouse.com/docs/operations/settings/settings#http_response_headers)
- [http\_retry\_initial\_backoff\_ms](https://clickhouse.com/docs/operations/settings/settings#http_retry_initial_backoff_ms)
- [http\_retry\_max\_backoff\_ms](https://clickhouse.com/docs/operations/settings/settings#http_retry_max_backoff_ms)
- [http\_send\_timeout](https://clickhouse.com/docs/operations/settings/settings#http_send_timeout)
- [http\_skip\_not\_found\_url\_for\_globs](https://clickhouse.com/docs/operations/settings/settings#http_skip_not_found_url_for_globs)
- [http\_wait\_end\_of\_query](https://clickhouse.com/docs/operations/settings/settings#http_wait_end_of_query)
- [http\_write\_exception\_in\_output\_format](https://clickhouse.com/docs/operations/settings/settings#http_write_exception_in_output_format)
- [http\_zlib\_compression\_level](https://clickhouse.com/docs/operations/settings/settings#http_zlib_compression_level)
- [iceberg\_delete\_data\_on\_drop](https://clickhouse.com/docs/operations/settings/settings#iceberg_delete_data_on_drop)
- [iceberg\_expire\_default\_max\_ref\_age\_ms](https://clickhouse.com/docs/operations/settings/settings#iceberg_expire_default_max_ref_age_ms)
- [iceberg\_expire\_default\_max\_snapshot\_age\_ms](https://clickhouse.com/docs/operations/settings/settings#iceberg_expire_default_max_snapshot_age_ms)
- [iceberg\_expire\_default\_min\_snapshots\_to\_keep](https://clickhouse.com/docs/operations/settings/settings#iceberg_expire_default_min_snapshots_to_keep)
- [iceberg\_insert\_max\_bytes\_in\_data\_file](https://clickhouse.com/docs/operations/settings/settings#iceberg_insert_max_bytes_in_data_file)
- [iceberg\_insert\_max\_partitions](https://clickhouse.com/docs/operations/settings/settings#iceberg_insert_max_partitions)
- [iceberg\_insert\_max\_rows\_in\_data\_file](https://clickhouse.com/docs/operations/settings/settings#iceberg_insert_max_rows_in_data_file)
- [iceberg\_metadata\_compression\_method](https://clickhouse.com/docs/operations/settings/settings#iceberg_metadata_compression_method)
- [iceberg\_metadata\_log\_level](https://clickhouse.com/docs/operations/settings/settings#iceberg_metadata_log_level)
- [iceberg\_metadata\_staleness\_ms](https://clickhouse.com/docs/operations/settings/settings#iceberg_metadata_staleness_ms)
- [iceberg\_snapshot\_id](https://clickhouse.com/docs/operations/settings/settings#iceberg_snapshot_id)
- [iceberg\_timestamp\_ms](https://clickhouse.com/docs/operations/settings/settings#iceberg_timestamp_ms)
- [idle\_connection\_timeout](https://clickhouse.com/docs/operations/settings/settings#idle_connection_timeout)
- [ignore\_cold\_parts\_seconds](https://clickhouse.com/docs/operations/settings/settings#ignore_cold_parts_seconds)
- [ignore\_data\_skipping\_indices](https://clickhouse.com/docs/operations/settings/settings#ignore_data_skipping_indices)
- [ignore\_drop\_queries\_probability](https://clickhouse.com/docs/operations/settings/settings#ignore_drop_queries_probability)
- [ignore\_format\_null\_for\_explain](https://clickhouse.com/docs/operations/settings/settings#ignore_format_null_for_explain)
- [ignore\_materialized\_views\_with\_dropped\_target\_table](https://clickhouse.com/docs/operations/settings/settings#ignore_materialized_views_with_dropped_target_table)
- [ignore\_on\_cluster\_for\_replicated\_access\_entities\_queries](https://clickhouse.com/docs/operations/settings/settings#ignore_on_cluster_for_replicated_access_entities_queries)
- [ignore\_on\_cluster\_for\_replicated\_database](https://clickhouse.com/docs/operations/settings/settings#ignore_on_cluster_for_replicated_database)
- [ignore\_on\_cluster\_for\_replicated\_named\_collections\_queries](https://clickhouse.com/docs/operations/settings/settings#ignore_on_cluster_for_replicated_named_collections_queries)
- [ignore\_on\_cluster\_for\_replicated\_udf\_queries](https://clickhouse.com/docs/operations/settings/settings#ignore_on_cluster_for_replicated_udf_queries)
- [implicit\_select](https://clickhouse.com/docs/operations/settings/settings#implicit_select)
- [implicit\_table\_at\_top\_level](https://clickhouse.com/docs/operations/settings/settings#implicit_table_at_top_level)
- [implicit\_transaction](https://clickhouse.com/docs/operations/settings/settings#implicit_transaction)
- [inject\_random\_order\_for\_select\_without\_order\_by](https://clickhouse.com/docs/operations/settings/settings#inject_random_order_for_select_without_order_by)
- [insert\_allow\_materialized\_columns](https://clickhouse.com/docs/operations/settings/settings#insert_allow_materialized_columns)
- [insert\_deduplicate](https://clickhouse.com/docs/operations/settings/settings#insert_deduplicate)
- [insert\_deduplication\_token](https://clickhouse.com/docs/operations/settings/settings#insert_deduplication_token)
- [insert\_keeper\_fault\_injection\_probability](https://clickhouse.com/docs/operations/settings/settings#insert_keeper_fault_injection_probability)
- [insert\_keeper\_fault\_injection\_seed](https://clickhouse.com/docs/operations/settings/settings#insert_keeper_fault_injection_seed)
- [insert\_keeper\_max\_retries](https://clickhouse.com/docs/operations/settings/settings#insert_keeper_max_retries)
- [insert\_keeper\_retry\_initial\_backoff\_ms](https://clickhouse.com/docs/operations/settings/settings#insert_keeper_retry_initial_backoff_ms)
- [insert\_keeper\_retry\_max\_backoff\_ms](https://clickhouse.com/docs/operations/settings/settings#insert_keeper_retry_max_backoff_ms)
- [insert\_null\_as\_default](https://clickhouse.com/docs/operations/settings/settings#insert_null_as_default)
- [insert\_quorum](https://clickhouse.com/docs/operations/settings/settings#insert_quorum)
- [insert\_quorum\_parallel](https://clickhouse.com/docs/operations/settings/settings#insert_quorum_parallel)
- [insert\_quorum\_timeout](https://clickhouse.com/docs/operations/settings/settings#insert_quorum_timeout)
- [insert\_shard\_id](https://clickhouse.com/docs/operations/settings/settings#insert_shard_id)
- [interactive\_delay](https://clickhouse.com/docs/operations/settings/settings#interactive_delay)
- [intersect\_default\_mode](https://clickhouse.com/docs/operations/settings/settings#intersect_default_mode)
- [jemalloc\_collect\_profile\_samples\_in\_trace\_log](https://clickhouse.com/docs/operations/settings/settings#jemalloc_collect_profile_samples_in_trace_log)
- [jemalloc\_enable\_profiler](https://clickhouse.com/docs/operations/settings/settings#jemalloc_enable_profiler)
- [jemalloc\_profile\_text\_collapsed\_use\_count](https://clickhouse.com/docs/operations/settings/settings#jemalloc_profile_text_collapsed_use_count)
- [jemalloc\_profile\_text\_output\_format](https://clickhouse.com/docs/operations/settings/settings#jemalloc_profile_text_output_format)
- [jemalloc\_profile\_text\_symbolize\_with\_inline](https://clickhouse.com/docs/operations/settings/settings#jemalloc_profile_text_symbolize_with_inline)
- [join\_algorithm](https://clickhouse.com/docs/operations/settings/settings#join_algorithm)
- [join\_any\_take\_last\_row](https://clickhouse.com/docs/operations/settings/settings#join_any_take_last_row)
- [join\_default\_strictness](https://clickhouse.com/docs/operations/settings/settings#join_default_strictness)
- [join\_on\_disk\_max\_files\_to\_merge](https://clickhouse.com/docs/operations/settings/settings#join_on_disk_max_files_to_merge)
- [join\_output\_by\_rowlist\_perkey\_rows\_threshold](https://clickhouse.com/docs/operations/settings/settings#join_output_by_rowlist_perkey_rows_threshold)
- [join\_overflow\_mode](https://clickhouse.com/docs/operations/settings/settings#join_overflow_mode)
- [join\_runtime\_bloom\_filter\_bytes](https://clickhouse.com/docs/operations/settings/settings#join_runtime_bloom_filter_bytes)
- [join\_runtime\_bloom\_filter\_hash\_functions](https://clickhouse.com/docs/operations/settings/settings#join_runtime_bloom_filter_hash_functions)
- [join\_runtime\_bloom\_filter\_max\_ratio\_of\_set\_bits](https://clickhouse.com/docs/operations/settings/settings#join_runtime_bloom_filter_max_ratio_of_set_bits)
- [join\_runtime\_filter\_blocks\_to\_skip\_before\_reenabling](https://clickhouse.com/docs/operations/settings/settings#join_runtime_filter_blocks_to_skip_before_reenabling)
- [join\_runtime\_filter\_exact\_values\_limit](https://clickhouse.com/docs/operations/settings/settings#join_runtime_filter_exact_values_limit)
- [join\_runtime\_filter\_pass\_ratio\_threshold\_for\_disabling](https://clickhouse.com/docs/operations/settings/settings#join_runtime_filter_pass_ratio_threshold_for_disabling)
- [join\_to\_sort\_maximum\_table\_rows](https://clickhouse.com/docs/operations/settings/settings#join_to_sort_maximum_table_rows)
- [join\_to\_sort\_minimum\_perkey\_rows](https://clickhouse.com/docs/operations/settings/settings#join_to_sort_minimum_perkey_rows)
- [join\_use\_nulls](https://clickhouse.com/docs/operations/settings/settings#join_use_nulls)
- [joined\_block\_split\_single\_row](https://clickhouse.com/docs/operations/settings/settings#joined_block_split_single_row)
- [joined\_subquery\_requires\_alias](https://clickhouse.com/docs/operations/settings/settings#joined_subquery_requires_alias)
- [kafka\_disable\_num\_consumers\_limit](https://clickhouse.com/docs/operations/settings/settings#kafka_disable_num_consumers_limit)
- [kafka\_max\_wait\_ms](https://clickhouse.com/docs/operations/settings/settings#kafka_max_wait_ms)
- [keeper\_map\_strict\_mode](https://clickhouse.com/docs/operations/settings/settings#keeper_map_strict_mode)
- [keeper\_max\_retries](https://clickhouse.com/docs/operations/settings/settings#keeper_max_retries)
- [keeper\_retry\_initial\_backoff\_ms](https://clickhouse.com/docs/operations/settings/settings#keeper_retry_initial_backoff_ms)
- [keeper\_retry\_max\_backoff\_ms](https://clickhouse.com/docs/operations/settings/settings#keeper_retry_max_backoff_ms)
- [least\_greatest\_legacy\_null\_behavior](https://clickhouse.com/docs/operations/settings/settings#least_greatest_legacy_null_behavior)
- [legacy\_column\_name\_of\_tuple\_literal](https://clickhouse.com/docs/operations/settings/settings#legacy_column_name_of_tuple_literal)
- [lightweight\_delete\_mode](https://clickhouse.com/docs/operations/settings/settings#lightweight_delete_mode)
- [lightweight\_deletes\_sync](https://clickhouse.com/docs/operations/settings/settings#lightweight_deletes_sync)
- [limit](https://clickhouse.com/docs/operations/settings/settings#limit)
- [load\_balancing](https://clickhouse.com/docs/operations/settings/settings#load_balancing)
- [load\_balancing\_first\_offset](https://clickhouse.com/docs/operations/settings/settings#load_balancing_first_offset)
- [load\_marks\_asynchronously](https://clickhouse.com/docs/operations/settings/settings#load_marks_asynchronously)
- [local\_filesystem\_read\_method](https://clickhouse.com/docs/operations/settings/settings#local_filesystem_read_method)
- [local\_filesystem\_read\_prefetch](https://clickhouse.com/docs/operations/settings/settings#local_filesystem_read_prefetch)
- [lock\_acquire\_timeout](https://clickhouse.com/docs/operations/settings/settings#lock_acquire_timeout)
- [log\_comment](https://clickhouse.com/docs/operations/settings/settings#log_comment)
- [log\_formatted\_queries](https://clickhouse.com/docs/operations/settings/settings#log_formatted_queries)
- [log\_processors\_profiles](https://clickhouse.com/docs/operations/settings/settings#log_processors_profiles)
- [log\_profile\_events](https://clickhouse.com/docs/operations/settings/settings#log_profile_events)
- [log\_queries](https://clickhouse.com/docs/operations/settings/settings#log_queries)
- [log\_queries\_cut\_to\_length](https://clickhouse.com/docs/operations/settings/settings#log_queries_cut_to_length)
- [log\_queries\_min\_query\_duration\_ms](https://clickhouse.com/docs/operations/settings/settings#log_queries_min_query_duration_ms)
- [log\_queries\_min\_type](https://clickhouse.com/docs/operations/settings/settings#log_queries_min_type)
- [log\_queries\_probability](https://clickhouse.com/docs/operations/settings/settings#log_queries_probability)
- [log\_query\_settings](https://clickhouse.com/docs/operations/settings/settings#log_query_settings)
- [log\_query\_threads](https://clickhouse.com/docs/operations/settings/settings#log_query_threads)
- [log\_query\_views](https://clickhouse.com/docs/operations/settings/settings#log_query_views)
- [low\_cardinality\_allow\_in\_native\_format](https://clickhouse.com/docs/operations/settings/settings#low_cardinality_allow_in_native_format)
- [low\_cardinality\_max\_dictionary\_size](https://clickhouse.com/docs/operations/settings/settings#low_cardinality_max_dictionary_size)
- [low\_cardinality\_use\_single\_dictionary\_for\_part](https://clickhouse.com/docs/operations/settings/settings#low_cardinality_use_single_dictionary_for_part)
- [low\_priority\_query\_wait\_time\_ms](https://clickhouse.com/docs/operations/settings/settings#low_priority_query_wait_time_ms)
- [make\_distributed\_plan](https://clickhouse.com/docs/operations/settings/settings#make_distributed_plan)
- [materialize\_skip\_indexes\_on\_insert](https://clickhouse.com/docs/operations/settings/settings#materialize_skip_indexes_on_insert)
- [materialize\_statistics\_on\_insert](https://clickhouse.com/docs/operations/settings/settings#materialize_statistics_on_insert)
- [materialize\_ttl\_after\_modify](https://clickhouse.com/docs/operations/settings/settings#materialize_ttl_after_modify)
- [materialized\_views\_ignore\_errors](https://clickhouse.com/docs/operations/settings/settings#materialized_views_ignore_errors)
- [materialized\_views\_squash\_parallel\_inserts](https://clickhouse.com/docs/operations/settings/settings#materialized_views_squash_parallel_inserts)
- [max\_analyze\_depth](https://clickhouse.com/docs/operations/settings/settings#max_analyze_depth)
- [max\_ast\_depth](https://clickhouse.com/docs/operations/settings/settings#max_ast_depth)
- [max\_ast\_elements](https://clickhouse.com/docs/operations/settings/settings#max_ast_elements)
- [max\_autoincrement\_series](https://clickhouse.com/docs/operations/settings/settings#max_autoincrement_series)
- [max\_backup\_bandwidth](https://clickhouse.com/docs/operations/settings/settings#max_backup_bandwidth)
- [max\_block\_size](https://clickhouse.com/docs/operations/settings/settings#max_block_size)
- [max\_bytes\_before\_external\_group\_by](https://clickhouse.com/docs/operations/settings/settings#max_bytes_before_external_group_by)
- [max\_bytes\_before\_external\_sort](https://clickhouse.com/docs/operations/settings/settings#max_bytes_before_external_sort)
- [max\_bytes\_before\_remerge\_sort](https://clickhouse.com/docs/operations/settings/settings#max_bytes_before_remerge_sort)
- [max\_bytes\_in\_distinct](https://clickhouse.com/docs/operations/settings/settings#max_bytes_in_distinct)
- [max\_bytes\_in\_join](https://clickhouse.com/docs/operations/settings/settings#max_bytes_in_join)
- [max\_bytes\_in\_set](https://clickhouse.com/docs/operations/settings/settings#max_bytes_in_set)
- [max\_bytes\_ratio\_before\_external\_group\_by](https://clickhouse.com/docs/operations/settings/settings#max_bytes_ratio_before_external_group_by)
- [max\_bytes\_ratio\_before\_external\_sort](https://clickhouse.com/docs/operations/settings/settings#max_bytes_ratio_before_external_sort)
- [max\_bytes\_to\_read](https://clickhouse.com/docs/operations/settings/settings#max_bytes_to_read)
- [max\_bytes\_to\_read\_leaf](https://clickhouse.com/docs/operations/settings/settings#max_bytes_to_read_leaf)
- [max\_bytes\_to\_sort](https://clickhouse.com/docs/operations/settings/settings#max_bytes_to_sort)
- [max\_bytes\_to\_transfer](https://clickhouse.com/docs/operations/settings/settings#max_bytes_to_transfer)
- [max\_columns\_to\_read](https://clickhouse.com/docs/operations/settings/settings#max_columns_to_read)
- [max\_compress\_block\_size](https://clickhouse.com/docs/operations/settings/settings#max_compress_block_size)
- [max\_concurrent\_queries\_for\_all\_users](https://clickhouse.com/docs/operations/settings/settings#max_concurrent_queries_for_all_users)
- [max\_concurrent\_queries\_for\_user](https://clickhouse.com/docs/operations/settings/settings#max_concurrent_queries_for_user)
- [max\_distributed\_connections](https://clickhouse.com/docs/operations/settings/settings#max_distributed_connections)
- [max\_distributed\_depth](https://clickhouse.com/docs/operations/settings/settings#max_distributed_depth)
- [max\_download\_buffer\_size](https://clickhouse.com/docs/operations/settings/settings#max_download_buffer_size)
- [max\_download\_threads](https://clickhouse.com/docs/operations/settings/settings#max_download_threads)
- [max\_estimated\_execution\_time](https://clickhouse.com/docs/operations/settings/settings#max_estimated_execution_time)
- [max\_execution\_speed](https://clickhouse.com/docs/operations/settings/settings#max_execution_speed)
- [max\_execution\_speed\_bytes](https://clickhouse.com/docs/operations/settings/settings#max_execution_speed_bytes)
- [max\_execution\_time](https://clickhouse.com/docs/operations/settings/settings#max_execution_time)
- [max\_execution\_time\_leaf](https://clickhouse.com/docs/operations/settings/settings#max_execution_time_leaf)
- [max\_expanded\_ast\_elements](https://clickhouse.com/docs/operations/settings/settings#max_expanded_ast_elements)
- [max\_fetch\_partition\_retries\_count](https://clickhouse.com/docs/operations/settings/settings#max_fetch_partition_retries_count)
- [max\_final\_threads](https://clickhouse.com/docs/operations/settings/settings#max_final_threads)
- [max\_http\_get\_redirects](https://clickhouse.com/docs/operations/settings/settings#max_http_get_redirects)
- [max\_hyperscan\_regexp\_length](https://clickhouse.com/docs/operations/settings/settings#max_hyperscan_regexp_length)
- [max\_hyperscan\_regexp\_total\_length](https://clickhouse.com/docs/operations/settings/settings#max_hyperscan_regexp_total_length)
- [max\_insert\_block\_size](https://clickhouse.com/docs/operations/settings/settings#max_insert_block_size)
- [max\_insert\_block\_size\_bytes](https://clickhouse.com/docs/operations/settings/settings#max_insert_block_size_bytes)
- [max\_insert\_delayed\_streams\_for\_parallel\_write](https://clickhouse.com/docs/operations/settings/settings#max_insert_delayed_streams_for_parallel_write)
- [max\_insert\_threads](https://clickhouse.com/docs/operations/settings/settings#max_insert_threads)
- [max\_joined\_block\_size\_bytes](https://clickhouse.com/docs/operations/settings/settings#max_joined_block_size_bytes)
- [max\_joined\_block\_size\_rows](https://clickhouse.com/docs/operations/settings/settings#max_joined_block_size_rows)
- [max\_limit\_for\_vector\_search\_queries](https://clickhouse.com/docs/operations/settings/settings#max_limit_for_vector_search_queries)
- [max\_local\_read\_bandwidth](https://clickhouse.com/docs/operations/settings/settings#max_local_read_bandwidth)
- [max\_local\_write\_bandwidth](https://clickhouse.com/docs/operations/settings/settings#max_local_write_bandwidth)
- [max\_memory\_usage](https://clickhouse.com/docs/operations/settings/settings#max_memory_usage)
- [max\_memory\_usage\_for\_user](https://clickhouse.com/docs/operations/settings/settings#max_memory_usage_for_user)
- [max\_network\_bandwidth](https://clickhouse.com/docs/operations/settings/settings#max_network_bandwidth)
- [max\_network\_bandwidth\_for\_all\_users](https://clickhouse.com/docs/operations/settings/settings#max_network_bandwidth_for_all_users)
- [max\_network\_bandwidth\_for\_user](https://clickhouse.com/docs/operations/settings/settings#max_network_bandwidth_for_user)
- [max\_network\_bytes](https://clickhouse.com/docs/operations/settings/settings#max_network_bytes)
- [max\_number\_of\_partitions\_for\_independent\_aggregation](https://clickhouse.com/docs/operations/settings/settings#max_number_of_partitions_for_independent_aggregation)
- [max\_os\_cpu\_wait\_time\_ratio\_to\_throw](https://clickhouse.com/docs/operations/settings/settings#max_os_cpu_wait_time_ratio_to_throw)
- [max\_parallel\_replicas](https://clickhouse.com/docs/operations/settings/settings#max_parallel_replicas)
- [max\_parser\_backtracks](https://clickhouse.com/docs/operations/settings/settings#max_parser_backtracks)
- [max\_parser\_depth](https://clickhouse.com/docs/operations/settings/settings#max_parser_depth)
- [max\_parsing\_threads](https://clickhouse.com/docs/operations/settings/settings#max_parsing_threads)
- [max\_partition\_size\_to\_drop](https://clickhouse.com/docs/operations/settings/settings#max_partition_size_to_drop)
- [max\_partitions\_per\_insert\_block](https://clickhouse.com/docs/operations/settings/settings#max_partitions_per_insert_block)
- [max\_partitions\_to\_read](https://clickhouse.com/docs/operations/settings/settings#max_partitions_to_read)
- [max\_parts\_to\_move](https://clickhouse.com/docs/operations/settings/settings#max_parts_to_move)
- [max\_projection\_rows\_to\_use\_projection\_index](https://clickhouse.com/docs/operations/settings/settings#max_projection_rows_to_use_projection_index)
- [max\_query\_size](https://clickhouse.com/docs/operations/settings/settings#max_query_size)
- [max\_rand\_distribution\_parameter](https://clickhouse.com/docs/operations/settings/settings#max_rand_distribution_parameter)
- [max\_rand\_distribution\_trials](https://clickhouse.com/docs/operations/settings/settings#max_rand_distribution_trials)
- [max\_read\_buffer\_size](https://clickhouse.com/docs/operations/settings/settings#max_read_buffer_size)
- [max\_read\_buffer\_size\_local\_fs](https://clickhouse.com/docs/operations/settings/settings#max_read_buffer_size_local_fs)
- [max\_read\_buffer\_size\_remote\_fs](https://clickhouse.com/docs/operations/settings/settings#max_read_buffer_size_remote_fs)
- [max\_recursive\_cte\_evaluation\_depth](https://clickhouse.com/docs/operations/settings/settings#max_recursive_cte_evaluation_depth)
- [max\_remote\_read\_network\_bandwidth](https://clickhouse.com/docs/operations/settings/settings#max_remote_read_network_bandwidth)
- [max\_remote\_write\_network\_bandwidth](https://clickhouse.com/docs/operations/settings/settings#max_remote_write_network_bandwidth)
- [max\_replica\_delay\_for\_distributed\_queries](https://clickhouse.com/docs/operations/settings/settings#max_replica_delay_for_distributed_queries)
- [max\_result\_bytes](https://clickhouse.com/docs/operations/settings/settings#max_result_bytes)
- [max\_result\_rows](https://clickhouse.com/docs/operations/settings/settings#max_result_rows)
- [max\_reverse\_dictionary\_lookup\_cache\_size\_bytes](https://clickhouse.com/docs/operations/settings/settings#max_reverse_dictionary_lookup_cache_size_bytes)
- [max\_rows\_in\_distinct](https://clickhouse.com/docs/operations/settings/settings#max_rows_in_distinct)
- [max\_rows\_in\_join](https://clickhouse.com/docs/operations/settings/settings#max_rows_in_join)
- [max\_rows\_in\_set](https://clickhouse.com/docs/operations/settings/settings#max_rows_in_set)
- [max\_rows\_in\_set\_to\_optimize\_join](https://clickhouse.com/docs/operations/settings/settings#max_rows_in_set_to_optimize_join)
- [max\_rows\_to\_group\_by](https://clickhouse.com/docs/operations/settings/settings#max_rows_to_group_by)
- [max\_rows\_to\_read](https://clickhouse.com/docs/operations/settings/settings#max_rows_to_read)
- [max\_rows\_to\_read\_leaf](https://clickhouse.com/docs/operations/settings/settings#max_rows_to_read_leaf)
- [max\_rows\_to\_sort](https://clickhouse.com/docs/operations/settings/settings#max_rows_to_sort)
- [max\_rows\_to\_transfer](https://clickhouse.com/docs/operations/settings/settings#max_rows_to_transfer)
- [max\_sessions\_for\_user](https://clickhouse.com/docs/operations/settings/settings#max_sessions_for_user)
- [max\_size\_to\_preallocate\_for\_aggregation](https://clickhouse.com/docs/operations/settings/settings#max_size_to_preallocate_for_aggregation)
- [max\_size\_to\_preallocate\_for\_joins](https://clickhouse.com/docs/operations/settings/settings#max_size_to_preallocate_for_joins)
- [max\_skip\_unavailable\_shards\_num](https://clickhouse.com/docs/operations/settings/settings#max_skip_unavailable_shards_num)
- [max\_skip\_unavailable\_shards\_ratio](https://clickhouse.com/docs/operations/settings/settings#max_skip_unavailable_shards_ratio)
- [max\_streams\_for\_files\_processing\_in\_cluster\_functions](https://clickhouse.com/docs/operations/settings/settings#max_streams_for_files_processing_in_cluster_functions)
- [max\_streams\_for\_merge\_tree\_reading](https://clickhouse.com/docs/operations/settings/settings#max_streams_for_merge_tree_reading)
- [max\_streams\_multiplier\_for\_merge\_tables](https://clickhouse.com/docs/operations/settings/settings#max_streams_multiplier_for_merge_tables)
- [max\_streams\_to\_max\_threads\_ratio](https://clickhouse.com/docs/operations/settings/settings#max_streams_to_max_threads_ratio)
- [max\_subquery\_depth](https://clickhouse.com/docs/operations/settings/settings#max_subquery_depth)
- [max\_table\_size\_to\_drop](https://clickhouse.com/docs/operations/settings/settings#max_table_size_to_drop)
- [max\_temporary\_columns](https://clickhouse.com/docs/operations/settings/settings#max_temporary_columns)
- [max\_temporary\_data\_on\_disk\_size\_for\_query](https://clickhouse.com/docs/operations/settings/settings#max_temporary_data_on_disk_size_for_query)
- [max\_temporary\_data\_on\_disk\_size\_for\_user](https://clickhouse.com/docs/operations/settings/settings#max_temporary_data_on_disk_size_for_user)
- [max\_temporary\_non\_const\_columns](https://clickhouse.com/docs/operations/settings/settings#max_temporary_non_const_columns)
- [max\_threads](https://clickhouse.com/docs/operations/settings/settings#max_threads)
- [max\_threads\_for\_indexes](https://clickhouse.com/docs/operations/settings/settings#max_threads_for_indexes)
- [max\_untracked\_memory](https://clickhouse.com/docs/operations/settings/settings#max_untracked_memory)
- [max\_wkb\_geometry\_elements](https://clickhouse.com/docs/operations/settings/settings#max_wkb_geometry_elements)
- [memory\_overcommit\_ratio\_denominator](https://clickhouse.com/docs/operations/settings/settings#memory_overcommit_ratio_denominator)
- [memory\_overcommit\_ratio\_denominator\_for\_user](https://clickhouse.com/docs/operations/settings/settings#memory_overcommit_ratio_denominator_for_user)
- [memory\_profiler\_sample\_max\_allocation\_size](https://clickhouse.com/docs/operations/settings/settings#memory_profiler_sample_max_allocation_size)
- [memory\_profiler\_sample\_min\_allocation\_size](https://clickhouse.com/docs/operations/settings/settings#memory_profiler_sample_min_allocation_size)
- [memory\_profiler\_sample\_probability](https://clickhouse.com/docs/operations/settings/settings#memory_profiler_sample_probability)
- [memory\_profiler\_step](https://clickhouse.com/docs/operations/settings/settings#memory_profiler_step)
- [memory\_tracker\_fault\_probability](https://clickhouse.com/docs/operations/settings/settings#memory_tracker_fault_probability)
- [memory\_usage\_overcommit\_max\_wait\_microseconds](https://clickhouse.com/docs/operations/settings/settings#memory_usage_overcommit_max_wait_microseconds)
- [merge\_table\_max\_tables\_to\_look\_for\_schema\_inference](https://clickhouse.com/docs/operations/settings/settings#merge_table_max_tables_to_look_for_schema_inference)
- [merge\_tree\_coarse\_index\_granularity](https://clickhouse.com/docs/operations/settings/settings#merge_tree_coarse_index_granularity)
- [merge\_tree\_compact\_parts\_min\_granules\_to\_multibuffer\_read](https://clickhouse.com/docs/operations/settings/settings#merge_tree_compact_parts_min_granules_to_multibuffer_read)
- [merge\_tree\_determine\_task\_size\_by\_prewhere\_columns](https://clickhouse.com/docs/operations/settings/settings#merge_tree_determine_task_size_by_prewhere_columns)
- [merge\_tree\_max\_bytes\_to\_use\_cache](https://clickhouse.com/docs/operations/settings/settings#merge_tree_max_bytes_to_use_cache)
- [merge\_tree\_max\_rows\_to\_use\_cache](https://clickhouse.com/docs/operations/settings/settings#merge_tree_max_rows_to_use_cache)
- [merge\_tree\_min\_bytes\_for\_concurrent\_read](https://clickhouse.com/docs/operations/settings/settings#merge_tree_min_bytes_for_concurrent_read)
- [merge\_tree\_min\_bytes\_for\_concurrent\_read\_for\_remote\_filesystem](https://clickhouse.com/docs/operations/settings/settings#merge_tree_min_bytes_for_concurrent_read_for_remote_filesystem)
- [merge\_tree\_min\_bytes\_for\_seek](https://clickhouse.com/docs/operations/settings/settings#merge_tree_min_bytes_for_seek)
- [merge\_tree\_min\_bytes\_per\_task\_for\_remote\_reading](https://clickhouse.com/docs/operations/settings/settings#merge_tree_min_bytes_per_task_for_remote_reading)
- [merge\_tree\_min\_read\_task\_size](https://clickhouse.com/docs/operations/settings/settings#merge_tree_min_read_task_size)
- [merge\_tree\_min\_rows\_for\_concurrent\_read](https://clickhouse.com/docs/operations/settings/settings#merge_tree_min_rows_for_concurrent_read)
- [merge\_tree\_min\_rows\_for\_concurrent\_read\_for\_remote\_filesystem](https://clickhouse.com/docs/operations/settings/settings#merge_tree_min_rows_for_concurrent_read_for_remote_filesystem)
- [merge\_tree\_min\_rows\_for\_seek](https://clickhouse.com/docs/operations/settings/settings#merge_tree_min_rows_for_seek)
- [merge\_tree\_read\_split\_ranges\_into\_intersecting\_and\_non\_intersecting\_injection\_probability](https://clickhouse.com/docs/operations/settings/settings#merge_tree_read_split_ranges_into_intersecting_and_non_intersecting_injection_probability)
- [merge\_tree\_storage\_snapshot\_sleep\_ms](https://clickhouse.com/docs/operations/settings/settings#merge_tree_storage_snapshot_sleep_ms)
- [merge\_tree\_use\_const\_size\_tasks\_for\_remote\_reading](https://clickhouse.com/docs/operations/settings/settings#merge_tree_use_const_size_tasks_for_remote_reading)
- [merge\_tree\_use\_deserialization\_prefixes\_cache](https://clickhouse.com/docs/operations/settings/settings#merge_tree_use_deserialization_prefixes_cache)
- [merge\_tree\_use\_prefixes\_deserialization\_thread\_pool](https://clickhouse.com/docs/operations/settings/settings#merge_tree_use_prefixes_deserialization_thread_pool)
- [merge\_tree\_use\_v1\_object\_and\_dynamic\_serialization](https://clickhouse.com/docs/operations/settings/settings#merge_tree_use_v1_object_and_dynamic_serialization)
- [metrics\_perf\_events\_enabled](https://clickhouse.com/docs/operations/settings/settings#metrics_perf_events_enabled)
- [metrics\_perf\_events\_list](https://clickhouse.com/docs/operations/settings/settings#metrics_perf_events_list)
- [min\_bytes\_to\_use\_direct\_io](https://clickhouse.com/docs/operations/settings/settings#min_bytes_to_use_direct_io)
- [min\_bytes\_to\_use\_mmap\_io](https://clickhouse.com/docs/operations/settings/settings#min_bytes_to_use_mmap_io)
- [min\_chunk\_bytes\_for\_parallel\_parsing](https://clickhouse.com/docs/operations/settings/settings#min_chunk_bytes_for_parallel_parsing)
- [min\_compress\_block\_size](https://clickhouse.com/docs/operations/settings/settings#min_compress_block_size)
- [min\_count\_to\_compile\_aggregate\_expression](https://clickhouse.com/docs/operations/settings/settings#min_count_to_compile_aggregate_expression)
- [min\_count\_to\_compile\_expression](https://clickhouse.com/docs/operations/settings/settings#min_count_to_compile_expression)
- [min\_count\_to\_compile\_sort\_description](https://clickhouse.com/docs/operations/settings/settings#min_count_to_compile_sort_description)
- [min\_execution\_speed](https://clickhouse.com/docs/operations/settings/settings#min_execution_speed)
- [min\_execution\_speed\_bytes](https://clickhouse.com/docs/operations/settings/settings#min_execution_speed_bytes)
- [min\_external\_table\_block\_size\_bytes](https://clickhouse.com/docs/operations/settings/settings#min_external_table_block_size_bytes)
- [min\_external\_table\_block\_size\_rows](https://clickhouse.com/docs/operations/settings/settings#min_external_table_block_size_rows)
- [min\_free\_disk\_bytes\_to\_perform\_insert](https://clickhouse.com/docs/operations/settings/settings#min_free_disk_bytes_to_perform_insert)
- [min\_free\_disk\_ratio\_to\_perform\_insert](https://clickhouse.com/docs/operations/settings/settings#min_free_disk_ratio_to_perform_insert)
- [min\_free\_disk\_space\_for\_temporary\_data](https://clickhouse.com/docs/operations/settings/settings#min_free_disk_space_for_temporary_data)
- [min\_hit\_rate\_to\_use\_consecutive\_keys\_optimization](https://clickhouse.com/docs/operations/settings/settings#min_hit_rate_to_use_consecutive_keys_optimization)
- [min\_insert\_block\_size\_bytes](https://clickhouse.com/docs/operations/settings/settings#min_insert_block_size_bytes)
- [min\_insert\_block\_size\_bytes\_for\_materialized\_views](https://clickhouse.com/docs/operations/settings/settings#min_insert_block_size_bytes_for_materialized_views)
- [min\_insert\_block\_size\_rows](https://clickhouse.com/docs/operations/settings/settings#min_insert_block_size_rows)
- [min\_insert\_block\_size\_rows\_for\_materialized\_views](https://clickhouse.com/docs/operations/settings/settings#min_insert_block_size_rows_for_materialized_views)
- [min\_joined\_block\_size\_bytes](https://clickhouse.com/docs/operations/settings/settings#min_joined_block_size_bytes)
- [min\_joined\_block\_size\_rows](https://clickhouse.com/docs/operations/settings/settings#min_joined_block_size_rows)
- [min\_os\_cpu\_wait\_time\_ratio\_to\_throw](https://clickhouse.com/docs/operations/settings/settings#min_os_cpu_wait_time_ratio_to_throw)
- [min\_outstreams\_per\_resize\_after\_split](https://clickhouse.com/docs/operations/settings/settings#min_outstreams_per_resize_after_split)
- [min\_table\_rows\_to\_use\_projection\_index](https://clickhouse.com/docs/operations/settings/settings#min_table_rows_to_use_projection_index)
- [mongodb\_throw\_on\_unsupported\_query](https://clickhouse.com/docs/operations/settings/settings#mongodb_throw_on_unsupported_query)
- [move\_all\_conditions\_to\_prewhere](https://clickhouse.com/docs/operations/settings/settings#move_all_conditions_to_prewhere)
- [move\_primary\_key\_columns\_to\_end\_of\_prewhere](https://clickhouse.com/docs/operations/settings/settings#move_primary_key_columns_to_end_of_prewhere)
- [multiple\_joins\_try\_to\_keep\_original\_names](https://clickhouse.com/docs/operations/settings/settings#multiple_joins_try_to_keep_original_names)
- [mutations\_execute\_nondeterministic\_on\_initiator](https://clickhouse.com/docs/operations/settings/settings#mutations_execute_nondeterministic_on_initiator)
- [mutations\_execute\_subqueries\_on\_initiator](https://clickhouse.com/docs/operations/settings/settings#mutations_execute_subqueries_on_initiator)
- [mutations\_max\_literal\_size\_to\_replace](https://clickhouse.com/docs/operations/settings/settings#mutations_max_literal_size_to_replace)
- [mutations\_sync](https://clickhouse.com/docs/operations/settings/settings#mutations_sync)
- [mysql\_datatypes\_support\_level](https://clickhouse.com/docs/operations/settings/settings#mysql_datatypes_support_level)
- [mysql\_map\_fixed\_string\_to\_text\_in\_show\_columns](https://clickhouse.com/docs/operations/settings/settings#mysql_map_fixed_string_to_text_in_show_columns)
- [mysql\_map\_string\_to\_text\_in\_show\_columns](https://clickhouse.com/docs/operations/settings/settings#mysql_map_string_to_text_in_show_columns)
- [mysql\_max\_rows\_to\_insert](https://clickhouse.com/docs/operations/settings/settings#mysql_max_rows_to_insert)
- [network\_compression\_method](https://clickhouse.com/docs/operations/settings/settings#network_compression_method)
- [network\_zstd\_compression\_level](https://clickhouse.com/docs/operations/settings/settings#network_zstd_compression_level)
- [normalize\_function\_names](https://clickhouse.com/docs/operations/settings/settings#normalize_function_names)
- [number\_of\_mutations\_to\_delay](https://clickhouse.com/docs/operations/settings/settings#number_of_mutations_to_delay)
- [number\_of\_mutations\_to\_throw](https://clickhouse.com/docs/operations/settings/settings#number_of_mutations_to_throw)
- [odbc\_bridge\_connection\_pool\_size](https://clickhouse.com/docs/operations/settings/settings#odbc_bridge_connection_pool_size)
- [odbc\_bridge\_use\_connection\_pooling](https://clickhouse.com/docs/operations/settings/settings#odbc_bridge_use_connection_pooling)
- [offset](https://clickhouse.com/docs/operations/settings/settings#offset)
- [opentelemetry\_start\_keeper\_trace\_probability](https://clickhouse.com/docs/operations/settings/settings#opentelemetry_start_keeper_trace_probability)
- [opentelemetry\_start\_trace\_probability](https://clickhouse.com/docs/operations/settings/settings#opentelemetry_start_trace_probability)
- [opentelemetry\_trace\_cpu\_scheduling](https://clickhouse.com/docs/operations/settings/settings#opentelemetry_trace_cpu_scheduling)
- [opentelemetry\_trace\_processors](https://clickhouse.com/docs/operations/settings/settings#opentelemetry_trace_processors)
- [optimize\_aggregation\_in\_order](https://clickhouse.com/docs/operations/settings/settings#optimize_aggregation_in_order)
- [optimize\_aggregators\_of\_group\_by\_keys](https://clickhouse.com/docs/operations/settings/settings#optimize_aggregators_of_group_by_keys)
- [optimize\_and\_compare\_chain](https://clickhouse.com/docs/operations/settings/settings#optimize_and_compare_chain)
- [optimize\_append\_index](https://clickhouse.com/docs/operations/settings/settings#optimize_append_index)
- [optimize\_arithmetic\_operations\_in\_aggregate\_functions](https://clickhouse.com/docs/operations/settings/settings#optimize_arithmetic_operations_in_aggregate_functions)
- [optimize\_const\_name\_size](https://clickhouse.com/docs/operations/settings/settings#optimize_const_name_size)
- [optimize\_count\_from\_files](https://clickhouse.com/docs/operations/settings/settings#optimize_count_from_files)
- [optimize\_distinct\_in\_order](https://clickhouse.com/docs/operations/settings/settings#optimize_distinct_in_order)
- [optimize\_distributed\_group\_by\_sharding\_key](https://clickhouse.com/docs/operations/settings/settings#optimize_distributed_group_by_sharding_key)
- [optimize\_dry\_run\_check\_part](https://clickhouse.com/docs/operations/settings/settings#optimize_dry_run_check_part)
- [optimize\_empty\_string\_comparisons](https://clickhouse.com/docs/operations/settings/settings#optimize_empty_string_comparisons)
- [optimize\_extract\_common\_expressions](https://clickhouse.com/docs/operations/settings/settings#optimize_extract_common_expressions)
- [optimize\_functions\_to\_subcolumns](https://clickhouse.com/docs/operations/settings/settings#optimize_functions_to_subcolumns)
- [optimize\_group\_by\_constant\_keys](https://clickhouse.com/docs/operations/settings/settings#optimize_group_by_constant_keys)
- [optimize\_group\_by\_function\_keys](https://clickhouse.com/docs/operations/settings/settings#optimize_group_by_function_keys)
- [optimize\_if\_chain\_to\_multiif](https://clickhouse.com/docs/operations/settings/settings#optimize_if_chain_to_multiif)
- [optimize\_if\_transform\_strings\_to\_enum](https://clickhouse.com/docs/operations/settings/settings#optimize_if_transform_strings_to_enum)
- [optimize\_injective\_functions\_in\_group\_by](https://clickhouse.com/docs/operations/settings/settings#optimize_injective_functions_in_group_by)
- [optimize\_injective\_functions\_inside\_uniq](https://clickhouse.com/docs/operations/settings/settings#optimize_injective_functions_inside_uniq)
- [optimize\_inverse\_dictionary\_lookup](https://clickhouse.com/docs/operations/settings/settings#optimize_inverse_dictionary_lookup)
- [optimize\_min\_equality\_disjunction\_chain\_length](https://clickhouse.com/docs/operations/settings/settings#optimize_min_equality_disjunction_chain_length)
- [optimize\_min\_inequality\_conjunction\_chain\_length](https://clickhouse.com/docs/operations/settings/settings#optimize_min_inequality_conjunction_chain_length)
- [optimize\_move\_to\_prewhere](https://clickhouse.com/docs/operations/settings/settings#optimize_move_to_prewhere)
- [optimize\_move\_to\_prewhere\_if\_final](https://clickhouse.com/docs/operations/settings/settings#optimize_move_to_prewhere_if_final)
- [optimize\_multiif\_to\_if](https://clickhouse.com/docs/operations/settings/settings#optimize_multiif_to_if)
- [optimize\_normalize\_count\_variants](https://clickhouse.com/docs/operations/settings/settings#optimize_normalize_count_variants)
- [optimize\_on\_insert](https://clickhouse.com/docs/operations/settings/settings#optimize_on_insert)
- [optimize\_or\_like\_chain](https://clickhouse.com/docs/operations/settings/settings#optimize_or_like_chain)
- [optimize\_qbit\_distance\_function\_reads](https://clickhouse.com/docs/operations/settings/settings#optimize_qbit_distance_function_reads)
- [optimize\_read\_in\_order](https://clickhouse.com/docs/operations/settings/settings#optimize_read_in_order)
- [optimize\_redundant\_functions\_in\_order\_by](https://clickhouse.com/docs/operations/settings/settings#optimize_redundant_functions_in_order_by)
- [optimize\_respect\_aliases](https://clickhouse.com/docs/operations/settings/settings#optimize_respect_aliases)
- [optimize\_rewrite\_aggregate\_function\_with\_if](https://clickhouse.com/docs/operations/settings/settings#optimize_rewrite_aggregate_function_with_if)
- [optimize\_rewrite\_array\_exists\_to\_has](https://clickhouse.com/docs/operations/settings/settings#optimize_rewrite_array_exists_to_has)
- [optimize\_rewrite\_like\_perfect\_affix](https://clickhouse.com/docs/operations/settings/settings#optimize_rewrite_like_perfect_affix)
- [optimize\_rewrite\_regexp\_functions](https://clickhouse.com/docs/operations/settings/settings#optimize_rewrite_regexp_functions)
- [optimize\_rewrite\_sum\_if\_to\_count\_if](https://clickhouse.com/docs/operations/settings/settings#optimize_rewrite_sum_if_to_count_if)
- [optimize\_skip\_merged\_partitions](https://clickhouse.com/docs/operations/settings/settings#optimize_skip_merged_partitions)
- [optimize\_skip\_unused\_shards](https://clickhouse.com/docs/operations/settings/settings#optimize_skip_unused_shards)
- [optimize\_skip\_unused\_shards\_limit](https://clickhouse.com/docs/operations/settings/settings#optimize_skip_unused_shards_limit)
- [optimize\_skip\_unused\_shards\_nesting](https://clickhouse.com/docs/operations/settings/settings#optimize_skip_unused_shards_nesting)
- [optimize\_skip\_unused\_shards\_rewrite\_in](https://clickhouse.com/docs/operations/settings/settings#optimize_skip_unused_shards_rewrite_in)
- [optimize\_sorting\_by\_input\_stream\_properties](https://clickhouse.com/docs/operations/settings/settings#optimize_sorting_by_input_stream_properties)
- [optimize\_substitute\_columns](https://clickhouse.com/docs/operations/settings/settings#optimize_substitute_columns)
- [optimize\_syntax\_fuse\_functions](https://clickhouse.com/docs/operations/settings/settings#optimize_syntax_fuse_functions)
- [optimize\_throw\_if\_noop](https://clickhouse.com/docs/operations/settings/settings#optimize_throw_if_noop)
- [optimize\_time\_filter\_with\_preimage](https://clickhouse.com/docs/operations/settings/settings#optimize_time_filter_with_preimage)
- [optimize\_trivial\_approximate\_count\_query](https://clickhouse.com/docs/operations/settings/settings#optimize_trivial_approximate_count_query)
- [optimize\_trivial\_count\_query](https://clickhouse.com/docs/operations/settings/settings#optimize_trivial_count_query)
- [optimize\_trivial\_insert\_select](https://clickhouse.com/docs/operations/settings/settings#optimize_trivial_insert_select)
- [optimize\_truncate\_order\_by\_after\_group\_by\_keys](https://clickhouse.com/docs/operations/settings/settings#optimize_truncate_order_by_after_group_by_keys)
- [optimize\_uniq\_to\_count](https://clickhouse.com/docs/operations/settings/settings#optimize_uniq_to_count)
- [optimize\_use\_implicit\_projections](https://clickhouse.com/docs/operations/settings/settings#optimize_use_implicit_projections)
- [optimize\_use\_projection\_filtering](https://clickhouse.com/docs/operations/settings/settings#optimize_use_projection_filtering)
- [optimize\_use\_projections](https://clickhouse.com/docs/operations/settings/settings#optimize_use_projections)
- [optimize\_using\_constraints](https://clickhouse.com/docs/operations/settings/settings#optimize_using_constraints)
- [os\_threads\_nice\_value\_materialized\_view](https://clickhouse.com/docs/operations/settings/settings#os_threads_nice_value_materialized_view)
- [os\_threads\_nice\_value\_query](https://clickhouse.com/docs/operations/settings/settings#os_threads_nice_value_query)
- [page\_cache\_block\_size](https://clickhouse.com/docs/operations/settings/settings#page_cache_block_size)
- [page\_cache\_inject\_eviction](https://clickhouse.com/docs/operations/settings/settings#page_cache_inject_eviction)
- [page\_cache\_lookahead\_blocks](https://clickhouse.com/docs/operations/settings/settings#page_cache_lookahead_blocks)
- [parallel\_distributed\_insert\_select](https://clickhouse.com/docs/operations/settings/settings#parallel_distributed_insert_select)
- [parallel\_hash\_join\_threshold](https://clickhouse.com/docs/operations/settings/settings#parallel_hash_join_threshold)
- [parallel\_non\_joined\_rows\_processing](https://clickhouse.com/docs/operations/settings/settings#parallel_non_joined_rows_processing)
- [parallel\_replica\_offset](https://clickhouse.com/docs/operations/settings/settings#parallel_replica_offset)
- [parallel\_replicas\_allow\_in\_with\_subquery](https://clickhouse.com/docs/operations/settings/settings#parallel_replicas_allow_in_with_subquery)
- [parallel\_replicas\_allow\_materialized\_views](https://clickhouse.com/docs/operations/settings/settings#parallel_replicas_allow_materialized_views)
- [parallel\_replicas\_connect\_timeout\_ms](https://clickhouse.com/docs/operations/settings/settings#parallel_replicas_connect_timeout_ms)
- [parallel\_replicas\_count](https://clickhouse.com/docs/operations/settings/settings#parallel_replicas_count)
- [parallel\_replicas\_custom\_key](https://clickhouse.com/docs/operations/settings/settings#parallel_replicas_custom_key)
- [parallel\_replicas\_custom\_key\_range\_lower](https://clickhouse.com/docs/operations/settings/settings#parallel_replicas_custom_key_range_lower)
- [parallel\_replicas\_custom\_key\_range\_upper](https://clickhouse.com/docs/operations/settings/settings#parallel_replicas_custom_key_range_upper)
- [parallel\_replicas\_filter\_pushdown](https://clickhouse.com/docs/operations/settings/settings#parallel_replicas_filter_pushdown)
- [parallel\_replicas\_for\_cluster\_engines](https://clickhouse.com/docs/operations/settings/settings#parallel_replicas_for_cluster_engines)
- [parallel\_replicas\_for\_non\_replicated\_merge\_tree](https://clickhouse.com/docs/operations/settings/settings#parallel_replicas_for_non_replicated_merge_tree)
- [parallel\_replicas\_index\_analysis\_only\_on\_coordinator](https://clickhouse.com/docs/operations/settings/settings#parallel_replicas_index_analysis_only_on_coordinator)
- [parallel\_replicas\_insert\_select\_local\_pipeline](https://clickhouse.com/docs/operations/settings/settings#parallel_replicas_insert_select_local_pipeline)
- [parallel\_replicas\_local\_plan](https://clickhouse.com/docs/operations/settings/settings#parallel_replicas_local_plan)
- [parallel\_replicas\_mark\_segment\_size](https://clickhouse.com/docs/operations/settings/settings#parallel_replicas_mark_segment_size)
- [parallel\_replicas\_min\_number\_of\_rows\_per\_replica](https://clickhouse.com/docs/operations/settings/settings#parallel_replicas_min_number_of_rows_per_replica)
- [parallel\_replicas\_mode](https://clickhouse.com/docs/operations/settings/settings#parallel_replicas_mode)
- [parallel\_replicas\_only\_with\_analyzer](https://clickhouse.com/docs/operations/settings/settings#parallel_replicas_only_with_analyzer)
- [parallel\_replicas\_prefer\_local\_join](https://clickhouse.com/docs/operations/settings/settings#parallel_replicas_prefer_local_join)
- [parallel\_replicas\_support\_projection](https://clickhouse.com/docs/operations/settings/settings#parallel_replicas_support_projection)
- [parallel\_view\_processing](https://clickhouse.com/docs/operations/settings/settings#parallel_view_processing)
- [parallelize\_output\_from\_storages](https://clickhouse.com/docs/operations/settings/settings#parallelize_output_from_storages)
- [parsedatetime\_e\_requires\_space\_padding](https://clickhouse.com/docs/operations/settings/settings#parsedatetime_e_requires_space_padding)
- [parsedatetime\_parse\_without\_leading\_zeros](https://clickhouse.com/docs/operations/settings/settings#parsedatetime_parse_without_leading_zeros)
- [partial\_merge\_join\_left\_table\_buffer\_bytes](https://clickhouse.com/docs/operations/settings/settings#partial_merge_join_left_table_buffer_bytes)
- [partial\_merge\_join\_rows\_in\_right\_blocks](https://clickhouse.com/docs/operations/settings/settings#partial_merge_join_rows_in_right_blocks)
- [partial\_result\_on\_first\_cancel](https://clickhouse.com/docs/operations/settings/settings#partial_result_on_first_cancel)
- [parts\_to\_delay\_insert](https://clickhouse.com/docs/operations/settings/settings#parts_to_delay_insert)
- [parts\_to\_throw\_insert](https://clickhouse.com/docs/operations/settings/settings#parts_to_throw_insert)
- [per\_part\_index\_stats](https://clickhouse.com/docs/operations/settings/settings#per_part_index_stats)
- [poll\_interval](https://clickhouse.com/docs/operations/settings/settings#poll_interval)
- [polyglot\_dialect](https://clickhouse.com/docs/operations/settings/settings#polyglot_dialect)
- [postgresql\_connection\_attempt\_timeout](https://clickhouse.com/docs/operations/settings/settings#postgresql_connection_attempt_timeout)
- [postgresql\_connection\_pool\_auto\_close\_connection](https://clickhouse.com/docs/operations/settings/settings#postgresql_connection_pool_auto_close_connection)
- [postgresql\_connection\_pool\_retries](https://clickhouse.com/docs/operations/settings/settings#postgresql_connection_pool_retries)
- [postgresql\_connection\_pool\_size](https://clickhouse.com/docs/operations/settings/settings#postgresql_connection_pool_size)
- [postgresql\_connection\_pool\_wait\_timeout](https://clickhouse.com/docs/operations/settings/settings#postgresql_connection_pool_wait_timeout)
- [postgresql\_fault\_injection\_probability](https://clickhouse.com/docs/operations/settings/settings#postgresql_fault_injection_probability)
- [prefer\_column\_name\_to\_alias](https://clickhouse.com/docs/operations/settings/settings#prefer_column_name_to_alias)
- [prefer\_external\_sort\_block\_bytes](https://clickhouse.com/docs/operations/settings/settings#prefer_external_sort_block_bytes)
- [prefer\_global\_in\_and\_join](https://clickhouse.com/docs/operations/settings/settings#prefer_global_in_and_join)
- [prefer\_localhost\_replica](https://clickhouse.com/docs/operations/settings/settings#prefer_localhost_replica)
- [prefer\_warmed\_unmerged\_parts\_seconds](https://clickhouse.com/docs/operations/settings/settings#prefer_warmed_unmerged_parts_seconds)
- [preferred\_block\_size\_bytes](https://clickhouse.com/docs/operations/settings/settings#preferred_block_size_bytes)
- [preferred\_max\_column\_in\_block\_size\_bytes](https://clickhouse.com/docs/operations/settings/settings#preferred_max_column_in_block_size_bytes)
- [preferred\_optimize\_projection\_name](https://clickhouse.com/docs/operations/settings/settings#preferred_optimize_projection_name)
- [prefetch\_buffer\_size](https://clickhouse.com/docs/operations/settings/settings#prefetch_buffer_size)
- [print\_pretty\_type\_names](https://clickhouse.com/docs/operations/settings/settings#print_pretty_type_names)
- [priority](https://clickhouse.com/docs/operations/settings/settings#priority)
- [promql\_database](https://clickhouse.com/docs/operations/settings/settings#promql_database)
- [promql\_evaluation\_time](https://clickhouse.com/docs/operations/settings/settings#promql_evaluation_time)
- [promql\_table](https://clickhouse.com/docs/operations/settings/settings#promql_table)
- [push\_external\_roles\_in\_interserver\_queries](https://clickhouse.com/docs/operations/settings/settings#push_external_roles_in_interserver_queries)
- [query\_cache\_compress\_entries](https://clickhouse.com/docs/operations/settings/settings#query_cache_compress_entries)
- [query\_cache\_max\_entries](https://clickhouse.com/docs/operations/settings/settings#query_cache_max_entries)
- [query\_cache\_max\_size\_in\_bytes](https://clickhouse.com/docs/operations/settings/settings#query_cache_max_size_in_bytes)
- [query\_cache\_min\_query\_duration](https://clickhouse.com/docs/operations/settings/settings#query_cache_min_query_duration)
- [query\_cache\_min\_query\_runs](https://clickhouse.com/docs/operations/settings/settings#query_cache_min_query_runs)
- [query\_cache\_nondeterministic\_function\_handling](https://clickhouse.com/docs/operations/settings/settings#query_cache_nondeterministic_function_handling)
- [query\_cache\_share\_between\_users](https://clickhouse.com/docs/operations/settings/settings#query_cache_share_between_users)
- [query\_cache\_squash\_partial\_results](https://clickhouse.com/docs/operations/settings/settings#query_cache_squash_partial_results)
- [query\_cache\_system\_table\_handling](https://clickhouse.com/docs/operations/settings/settings#query_cache_system_table_handling)
- [query\_cache\_tag](https://clickhouse.com/docs/operations/settings/settings#query_cache_tag)
- [query\_cache\_ttl](https://clickhouse.com/docs/operations/settings/settings#query_cache_ttl)
- [query\_metric\_log\_interval](https://clickhouse.com/docs/operations/settings/settings#query_metric_log_interval)
- [query\_plan\_aggregation\_in\_order](https://clickhouse.com/docs/operations/settings/settings#query_plan_aggregation_in_order)
- [query\_plan\_convert\_any\_join\_to\_semi\_or\_anti\_join](https://clickhouse.com/docs/operations/settings/settings#query_plan_convert_any_join_to_semi_or_anti_join)
- [query\_plan\_convert\_join\_to\_in](https://clickhouse.com/docs/operations/settings/settings#query_plan_convert_join_to_in)
- [query\_plan\_convert\_outer\_join\_to\_inner\_join](https://clickhouse.com/docs/operations/settings/settings#query_plan_convert_outer_join_to_inner_join)
- [query\_plan\_direct\_read\_from\_text\_index](https://clickhouse.com/docs/operations/settings/settings#query_plan_direct_read_from_text_index)
- [query\_plan\_display\_internal\_aliases](https://clickhouse.com/docs/operations/settings/settings#query_plan_display_internal_aliases)
- [query\_plan\_enable\_multithreading\_after\_window\_functions](https://clickhouse.com/docs/operations/settings/settings#query_plan_enable_multithreading_after_window_functions)
- [query\_plan\_enable\_optimizations](https://clickhouse.com/docs/operations/settings/settings#query_plan_enable_optimizations)
- [query\_plan\_execute\_functions\_after\_sorting](https://clickhouse.com/docs/operations/settings/settings#query_plan_execute_functions_after_sorting)
- [query\_plan\_filter\_push\_down](https://clickhouse.com/docs/operations/settings/settings#query_plan_filter_push_down)
- [query\_plan\_join\_shard\_by\_pk\_ranges](https://clickhouse.com/docs/operations/settings/settings#query_plan_join_shard_by_pk_ranges)
- [query\_plan\_join\_swap\_table](https://clickhouse.com/docs/operations/settings/settings#query_plan_join_swap_table)
- [query\_plan\_lift\_up\_array\_join](https://clickhouse.com/docs/operations/settings/settings#query_plan_lift_up_array_join)
- [query\_plan\_lift\_up\_union](https://clickhouse.com/docs/operations/settings/settings#query_plan_lift_up_union)
- [query\_plan\_max\_limit\_for\_lazy\_materialization](https://clickhouse.com/docs/operations/settings/settings#query_plan_max_limit_for_lazy_materialization)
- [query\_plan\_max\_limit\_for\_top\_k\_optimization](https://clickhouse.com/docs/operations/settings/settings#query_plan_max_limit_for_top_k_optimization)
- [query\_plan\_max\_optimizations\_to\_apply](https://clickhouse.com/docs/operations/settings/settings#query_plan_max_optimizations_to_apply)
- [query\_plan\_max\_step\_description\_length](https://clickhouse.com/docs/operations/settings/settings#query_plan_max_step_description_length)
- [query\_plan\_merge\_expressions](https://clickhouse.com/docs/operations/settings/settings#query_plan_merge_expressions)
- [query\_plan\_merge\_filter\_into\_join\_condition](https://clickhouse.com/docs/operations/settings/settings#query_plan_merge_filter_into_join_condition)
- [query\_plan\_merge\_filters](https://clickhouse.com/docs/operations/settings/settings#query_plan_merge_filters)
- [query\_plan\_optimize\_join\_order\_algorithm](https://clickhouse.com/docs/operations/settings/settings#query_plan_optimize_join_order_algorithm)
- [query\_plan\_optimize\_join\_order\_limit](https://clickhouse.com/docs/operations/settings/settings#query_plan_optimize_join_order_limit)
- [query\_plan\_optimize\_join\_order\_randomize](https://clickhouse.com/docs/operations/settings/settings#query_plan_optimize_join_order_randomize)
- [query\_plan\_optimize\_lazy\_materialization](https://clickhouse.com/docs/operations/settings/settings#query_plan_optimize_lazy_materialization)
- [query\_plan\_optimize\_prewhere](https://clickhouse.com/docs/operations/settings/settings#query_plan_optimize_prewhere)
- [query\_plan\_push\_down\_limit](https://clickhouse.com/docs/operations/settings/settings#query_plan_push_down_limit)
- [query\_plan\_read\_in\_order](https://clickhouse.com/docs/operations/settings/settings#query_plan_read_in_order)
- [query\_plan\_read\_in\_order\_through\_join](https://clickhouse.com/docs/operations/settings/settings#query_plan_read_in_order_through_join)
- [query\_plan\_remove\_redundant\_distinct](https://clickhouse.com/docs/operations/settings/settings#query_plan_remove_redundant_distinct)
- [query\_plan\_remove\_redundant\_sorting](https://clickhouse.com/docs/operations/settings/settings#query_plan_remove_redundant_sorting)
- [query\_plan\_remove\_unused\_columns](https://clickhouse.com/docs/operations/settings/settings#query_plan_remove_unused_columns)
- [query\_plan\_reuse\_storage\_ordering\_for\_window\_functions](https://clickhouse.com/docs/operations/settings/settings#query_plan_reuse_storage_ordering_for_window_functions)
- [query\_plan\_split\_filter](https://clickhouse.com/docs/operations/settings/settings#query_plan_split_filter)
- [query\_plan\_text\_index\_add\_hint](https://clickhouse.com/docs/operations/settings/settings#query_plan_text_index_add_hint)
- [query\_plan\_try\_use\_vector\_search](https://clickhouse.com/docs/operations/settings/settings#query_plan_try_use_vector_search)
- [query\_plan\_use\_new\_logical\_join\_step](https://clickhouse.com/docs/operations/settings/settings#query_plan_use_new_logical_join_step)
- [query\_profiler\_cpu\_time\_period\_ns](https://clickhouse.com/docs/operations/settings/settings#query_profiler_cpu_time_period_ns)
- [query\_profiler\_real\_time\_period\_ns](https://clickhouse.com/docs/operations/settings/settings#query_profiler_real_time_period_ns)
- [queue\_max\_wait\_ms](https://clickhouse.com/docs/operations/settings/settings#queue_max_wait_ms)
- [rabbitmq\_max\_wait\_ms](https://clickhouse.com/docs/operations/settings/settings#rabbitmq_max_wait_ms)
- [read\_backoff\_max\_throughput](https://clickhouse.com/docs/operations/settings/settings#read_backoff_max_throughput)
- [read\_backoff\_min\_concurrency](https://clickhouse.com/docs/operations/settings/settings#read_backoff_min_concurrency)
- [read\_backoff\_min\_events](https://clickhouse.com/docs/operations/settings/settings#read_backoff_min_events)
- [read\_backoff\_min\_interval\_between\_events\_ms](https://clickhouse.com/docs/operations/settings/settings#read_backoff_min_interval_between_events_ms)
- [read\_backoff\_min\_latency\_ms](https://clickhouse.com/docs/operations/settings/settings#read_backoff_min_latency_ms)
- [read\_from\_distributed\_cache\_if\_exists\_otherwise\_bypass\_cache](https://clickhouse.com/docs/operations/settings/settings#read_from_distributed_cache_if_exists_otherwise_bypass_cache)
- [read\_from\_filesystem\_cache\_if\_exists\_otherwise\_bypass\_cache](https://clickhouse.com/docs/operations/settings/settings#read_from_filesystem_cache_if_exists_otherwise_bypass_cache)
- [read\_from\_page\_cache\_if\_exists\_otherwise\_bypass\_cache](https://clickhouse.com/docs/operations/settings/settings#read_from_page_cache_if_exists_otherwise_bypass_cache)
- [read\_in\_order\_two\_level\_merge\_threshold](https://clickhouse.com/docs/operations/settings/settings#read_in_order_two_level_merge_threshold)
- [read\_in\_order\_use\_buffering](https://clickhouse.com/docs/operations/settings/settings#read_in_order_use_buffering)
- [read\_in\_order\_use\_virtual\_row](https://clickhouse.com/docs/operations/settings/settings#read_in_order_use_virtual_row)
- [read\_overflow\_mode](https://clickhouse.com/docs/operations/settings/settings#read_overflow_mode)
- [read\_overflow\_mode\_leaf](https://clickhouse.com/docs/operations/settings/settings#read_overflow_mode_leaf)
- [read\_priority](https://clickhouse.com/docs/operations/settings/settings#read_priority)
- [read\_through\_distributed\_cache](https://clickhouse.com/docs/operations/settings/settings#read_through_distributed_cache)
- [readonly](https://clickhouse.com/docs/operations/settings/settings#readonly)
- [receive\_data\_timeout\_ms](https://clickhouse.com/docs/operations/settings/settings#receive_data_timeout_ms)
- [receive\_timeout](https://clickhouse.com/docs/operations/settings/settings#receive_timeout)
- [regexp\_dict\_allow\_hyperscan](https://clickhouse.com/docs/operations/settings/settings#regexp_dict_allow_hyperscan)
- [regexp\_dict\_flag\_case\_insensitive](https://clickhouse.com/docs/operations/settings/settings#regexp_dict_flag_case_insensitive)
- [regexp\_dict\_flag\_dotall](https://clickhouse.com/docs/operations/settings/settings#regexp_dict_flag_dotall)
- [regexp\_max\_matches\_per\_row](https://clickhouse.com/docs/operations/settings/settings#regexp_max_matches_per_row)
- [reject\_expensive\_hyperscan\_regexps](https://clickhouse.com/docs/operations/settings/settings#reject_expensive_hyperscan_regexps)
- [remerge\_sort\_lowered\_memory\_bytes\_ratio](https://clickhouse.com/docs/operations/settings/settings#remerge_sort_lowered_memory_bytes_ratio)
- [remote\_filesystem\_read\_method](https://clickhouse.com/docs/operations/settings/settings#remote_filesystem_read_method)
- [remote\_filesystem\_read\_prefetch](https://clickhouse.com/docs/operations/settings/settings#remote_filesystem_read_prefetch)
- [remote\_fs\_read\_backoff\_max\_tries](https://clickhouse.com/docs/operations/settings/settings#remote_fs_read_backoff_max_tries)
- [remote\_fs\_read\_max\_backoff\_ms](https://clickhouse.com/docs/operations/settings/settings#remote_fs_read_max_backoff_ms)
- [remote\_read\_min\_bytes\_for\_seek](https://clickhouse.com/docs/operations/settings/settings#remote_read_min_bytes_for_seek)
- [rename\_files\_after\_processing](https://clickhouse.com/docs/operations/settings/settings#rename_files_after_processing)
- [replace\_running\_query](https://clickhouse.com/docs/operations/settings/settings#replace_running_query)
- [replace\_running\_query\_max\_wait\_ms](https://clickhouse.com/docs/operations/settings/settings#replace_running_query_max_wait_ms)
- [replication\_wait\_for\_inactive\_replica\_timeout](https://clickhouse.com/docs/operations/settings/settings#replication_wait_for_inactive_replica_timeout)
- [restore\_replace\_external\_dictionary\_source\_to\_null](https://clickhouse.com/docs/operations/settings/settings#restore_replace_external_dictionary_source_to_null)
- [restore\_replace\_external\_engines\_to\_null](https://clickhouse.com/docs/operations/settings/settings#restore_replace_external_engines_to_null)
- [restore\_replace\_external\_table\_functions\_to\_null](https://clickhouse.com/docs/operations/settings/settings#restore_replace_external_table_functions_to_null)
- [restore\_replicated\_merge\_tree\_to\_shared\_merge\_tree](https://clickhouse.com/docs/operations/settings/settings#restore_replicated_merge_tree_to_shared_merge_tree)
- [result\_overflow\_mode](https://clickhouse.com/docs/operations/settings/settings#result_overflow_mode)
- [rewrite\_count\_distinct\_if\_with\_count\_distinct\_implementation](https://clickhouse.com/docs/operations/settings/settings#rewrite_count_distinct_if_with_count_distinct_implementation)
- [rewrite\_in\_to\_join](https://clickhouse.com/docs/operations/settings/settings#rewrite_in_to_join)
- [rows\_before\_aggregation](https://clickhouse.com/docs/operations/settings/settings#rows_before_aggregation)
- [s3\_allow\_multipart\_copy](https://clickhouse.com/docs/operations/settings/settings#s3_allow_multipart_copy)
- [s3\_allow\_parallel\_part\_upload](https://clickhouse.com/docs/operations/settings/settings#s3_allow_parallel_part_upload)
- [s3\_check\_objects\_after\_upload](https://clickhouse.com/docs/operations/settings/settings#s3_check_objects_after_upload)
- [s3\_connect\_timeout\_ms](https://clickhouse.com/docs/operations/settings/settings#s3_connect_timeout_ms)
- [s3\_create\_new\_file\_on\_insert](https://clickhouse.com/docs/operations/settings/settings#s3_create_new_file_on_insert)
- [s3\_disable\_checksum](https://clickhouse.com/docs/operations/settings/settings#s3_disable_checksum)
- [s3\_ignore\_file\_doesnt\_exist](https://clickhouse.com/docs/operations/settings/settings#s3_ignore_file_doesnt_exist)
- [s3\_list\_object\_keys\_size](https://clickhouse.com/docs/operations/settings/settings#s3_list_object_keys_size)
- [s3\_max\_connections](https://clickhouse.com/docs/operations/settings/settings#s3_max_connections)
- [s3\_max\_get\_burst](https://clickhouse.com/docs/operations/settings/settings#s3_max_get_burst)
- [s3\_max\_get\_rps](https://clickhouse.com/docs/operations/settings/settings#s3_max_get_rps)
- [s3\_max\_inflight\_parts\_for\_one\_file](https://clickhouse.com/docs/operations/settings/settings#s3_max_inflight_parts_for_one_file)
- [s3\_max\_part\_number](https://clickhouse.com/docs/operations/settings/settings#s3_max_part_number)
- [s3\_max\_put\_burst](https://clickhouse.com/docs/operations/settings/settings#s3_max_put_burst)
- [s3\_max\_put\_rps](https://clickhouse.com/docs/operations/settings/settings#s3_max_put_rps)
- [s3\_max\_single\_operation\_copy\_size](https://clickhouse.com/docs/operations/settings/settings#s3_max_single_operation_copy_size)
- [s3\_max\_single\_part\_upload\_size](https://clickhouse.com/docs/operations/settings/settings#s3_max_single_part_upload_size)
- [s3\_max\_single\_read\_retries](https://clickhouse.com/docs/operations/settings/settings#s3_max_single_read_retries)
- [s3\_max\_unexpected\_write\_error\_retries](https://clickhouse.com/docs/operations/settings/settings#s3_max_unexpected_write_error_retries)
- [s3\_max\_upload\_part\_size](https://clickhouse.com/docs/operations/settings/settings#s3_max_upload_part_size)
- [s3\_min\_upload\_part\_size](https://clickhouse.com/docs/operations/settings/settings#s3_min_upload_part_size)
- [s3\_path\_filter\_limit](https://clickhouse.com/docs/operations/settings/settings#s3_path_filter_limit)
- [s3\_request\_timeout\_ms](https://clickhouse.com/docs/operations/settings/settings#s3_request_timeout_ms)
- [s3\_skip\_empty\_files](https://clickhouse.com/docs/operations/settings/settings#s3_skip_empty_files)
- [s3\_slow\_all\_threads\_after\_network\_error](https://clickhouse.com/docs/operations/settings/settings#s3_slow_all_threads_after_network_error)
- [s3\_strict\_upload\_part\_size](https://clickhouse.com/docs/operations/settings/settings#s3_strict_upload_part_size)
- [s3\_throw\_on\_zero\_files\_match](https://clickhouse.com/docs/operations/settings/settings#s3_throw_on_zero_files_match)
- [s3\_truncate\_on\_insert](https://clickhouse.com/docs/operations/settings/settings#s3_truncate_on_insert)
- [s3\_upload\_part\_size\_multiply\_factor](https://clickhouse.com/docs/operations/settings/settings#s3_upload_part_size_multiply_factor)
- [s3\_upload\_part\_size\_multiply\_parts\_count\_threshold](https://clickhouse.com/docs/operations/settings/settings#s3_upload_part_size_multiply_parts_count_threshold)
- [s3\_use\_adaptive\_timeouts](https://clickhouse.com/docs/operations/settings/settings#s3_use_adaptive_timeouts)
- [s3\_validate\_request\_settings](https://clickhouse.com/docs/operations/settings/settings#s3_validate_request_settings)
- [s3queue\_default\_zookeeper\_path](https://clickhouse.com/docs/operations/settings/settings#s3queue_default_zookeeper_path)
- [s3queue\_enable\_logging\_to\_s3queue\_log](https://clickhouse.com/docs/operations/settings/settings#s3queue_enable_logging_to_s3queue_log)
- [s3queue\_keeper\_fault\_injection\_probability](https://clickhouse.com/docs/operations/settings/settings#s3queue_keeper_fault_injection_probability)
- [s3queue\_migrate\_old\_metadata\_to\_buckets](https://clickhouse.com/docs/operations/settings/settings#s3queue_migrate_old_metadata_to_buckets)
- [schema\_inference\_cache\_require\_modification\_time\_for\_url](https://clickhouse.com/docs/operations/settings/settings#schema_inference_cache_require_modification_time_for_url)
- [schema\_inference\_use\_cache\_for\_azure](https://clickhouse.com/docs/operations/settings/settings#schema_inference_use_cache_for_azure)
- [schema\_inference\_use\_cache\_for\_file](https://clickhouse.com/docs/operations/settings/settings#schema_inference_use_cache_for_file)
- [schema\_inference\_use\_cache\_for\_hdfs](https://clickhouse.com/docs/operations/settings/settings#schema_inference_use_cache_for_hdfs)
- [schema\_inference\_use\_cache\_for\_s3](https://clickhouse.com/docs/operations/settings/settings#schema_inference_use_cache_for_s3)
- [schema\_inference\_use\_cache\_for\_url](https://clickhouse.com/docs/operations/settings/settings#schema_inference_use_cache_for_url)
- [secondary\_indices\_enable\_bulk\_filtering](https://clickhouse.com/docs/operations/settings/settings#secondary_indices_enable_bulk_filtering)
- [select\_sequential\_consistency](https://clickhouse.com/docs/operations/settings/settings#select_sequential_consistency)
- [send\_logs\_level](https://clickhouse.com/docs/operations/settings/settings#send_logs_level)
- [send\_logs\_source\_regexp](https://clickhouse.com/docs/operations/settings/settings#send_logs_source_regexp)
- [send\_profile\_events](https://clickhouse.com/docs/operations/settings/settings#send_profile_events)
- [send\_progress\_in\_http\_headers](https://clickhouse.com/docs/operations/settings/settings#send_progress_in_http_headers)
- [send\_timeout](https://clickhouse.com/docs/operations/settings/settings#send_timeout)
- [serialize\_query\_plan](https://clickhouse.com/docs/operations/settings/settings#serialize_query_plan)
- [serialize\_string\_in\_memory\_with\_zero\_byte](https://clickhouse.com/docs/operations/settings/settings#serialize_string_in_memory_with_zero_byte)
- [session\_timezone](https://clickhouse.com/docs/operations/settings/settings#session_timezone)
- [set\_overflow\_mode](https://clickhouse.com/docs/operations/settings/settings#set_overflow_mode)
- [shared\_merge\_tree\_sync\_parts\_on\_partition\_operations](https://clickhouse.com/docs/operations/settings/settings#shared_merge_tree_sync_parts_on_partition_operations)
- [short\_circuit\_function\_evaluation](https://clickhouse.com/docs/operations/settings/settings#short_circuit_function_evaluation)
- [short\_circuit\_function\_evaluation\_for\_nulls](https://clickhouse.com/docs/operations/settings/settings#short_circuit_function_evaluation_for_nulls)
- [short\_circuit\_function\_evaluation\_for\_nulls\_threshold](https://clickhouse.com/docs/operations/settings/settings#short_circuit_function_evaluation_for_nulls_threshold)
- [show\_data\_lake\_catalogs\_in\_system\_tables](https://clickhouse.com/docs/operations/settings/settings#show_data_lake_catalogs_in_system_tables)
- [show\_processlist\_include\_internal](https://clickhouse.com/docs/operations/settings/settings#show_processlist_include_internal)
- [show\_table\_uuid\_in\_table\_create\_query\_if\_not\_nil](https://clickhouse.com/docs/operations/settings/settings#show_table_uuid_in_table_create_query_if_not_nil)
- [single\_join\_prefer\_left\_table](https://clickhouse.com/docs/operations/settings/settings#single_join_prefer_left_table)
- [skip\_redundant\_aliases\_in\_udf](https://clickhouse.com/docs/operations/settings/settings#skip_redundant_aliases_in_udf)
- [skip\_unavailable\_shards](https://clickhouse.com/docs/operations/settings/settings#skip_unavailable_shards)
- [sleep\_after\_receiving\_query\_ms](https://clickhouse.com/docs/operations/settings/settings#sleep_after_receiving_query_ms)
- [sleep\_in\_send\_data\_ms](https://clickhouse.com/docs/operations/settings/settings#sleep_in_send_data_ms)
- [sleep\_in\_send\_tables\_status\_ms](https://clickhouse.com/docs/operations/settings/settings#sleep_in_send_tables_status_ms)
- [sort\_overflow\_mode](https://clickhouse.com/docs/operations/settings/settings#sort_overflow_mode)
- [split\_intersecting\_parts\_ranges\_into\_layers\_final](https://clickhouse.com/docs/operations/settings/settings#split_intersecting_parts_ranges_into_layers_final)
- [split\_parts\_ranges\_into\_intersecting\_and\_non\_intersecting\_final](https://clickhouse.com/docs/operations/settings/settings#split_parts_ranges_into_intersecting_and_non_intersecting_final)
- [splitby\_max\_substrings\_includes\_remaining\_string](https://clickhouse.com/docs/operations/settings/settings#splitby_max_substrings_includes_remaining_string)
- [stop\_refreshable\_materialized\_views\_on\_startup](https://clickhouse.com/docs/operations/settings/settings#stop_refreshable_materialized_views_on_startup)
- [storage\_file\_read\_method](https://clickhouse.com/docs/operations/settings/settings#storage_file_read_method)
- [storage\_system\_stack\_trace\_pipe\_read\_timeout\_ms](https://clickhouse.com/docs/operations/settings/settings#storage_system_stack_trace_pipe_read_timeout_ms)
- [stream\_flush\_interval\_ms](https://clickhouse.com/docs/operations/settings/settings#stream_flush_interval_ms)
- [stream\_like\_engine\_allow\_direct\_select](https://clickhouse.com/docs/operations/settings/settings#stream_like_engine_allow_direct_select)
- [stream\_like\_engine\_insert\_queue](https://clickhouse.com/docs/operations/settings/settings#stream_like_engine_insert_queue)
- [stream\_poll\_timeout\_ms](https://clickhouse.com/docs/operations/settings/settings#stream_poll_timeout_ms)
- [system\_events\_show\_zero\_values](https://clickhouse.com/docs/operations/settings/settings#system_events_show_zero_values)
- [table\_engine\_read\_through\_distributed\_cache](https://clickhouse.com/docs/operations/settings/settings#table_engine_read_through_distributed_cache)
- [table\_function\_remote\_max\_addresses](https://clickhouse.com/docs/operations/settings/settings#table_function_remote_max_addresses)
- [tcp\_keep\_alive\_timeout](https://clickhouse.com/docs/operations/settings/settings#tcp_keep_alive_timeout)
- [temporary\_data\_in\_cache\_reserve\_space\_wait\_lock\_timeout\_milliseconds](https://clickhouse.com/docs/operations/settings/settings#temporary_data_in_cache_reserve_space_wait_lock_timeout_milliseconds)
- [temporary\_files\_buffer\_size](https://clickhouse.com/docs/operations/settings/settings#temporary_files_buffer_size)
- [temporary\_files\_codec](https://clickhouse.com/docs/operations/settings/settings#temporary_files_codec)
- [text\_index\_hint\_max\_selectivity](https://clickhouse.com/docs/operations/settings/settings#text_index_hint_max_selectivity)
- [text\_index\_like\_max\_postings\_to\_read](https://clickhouse.com/docs/operations/settings/settings#text_index_like_max_postings_to_read)
- [text\_index\_like\_min\_pattern\_length](https://clickhouse.com/docs/operations/settings/settings#text_index_like_min_pattern_length)
- [throw\_if\_no\_data\_to\_insert](https://clickhouse.com/docs/operations/settings/settings#throw_if_no_data_to_insert)
- [throw\_on\_error\_from\_cache\_on\_write\_operations](https://clickhouse.com/docs/operations/settings/settings#throw_on_error_from_cache_on_write_operations)
- [throw\_on\_max\_partitions\_per\_insert\_block](https://clickhouse.com/docs/operations/settings/settings#throw_on_max_partitions_per_insert_block)
- [throw\_on\_unsupported\_query\_inside\_transaction](https://clickhouse.com/docs/operations/settings/settings#throw_on_unsupported_query_inside_transaction)
- [timeout\_before\_checking\_execution\_speed](https://clickhouse.com/docs/operations/settings/settings#timeout_before_checking_execution_speed)
- [timeout\_overflow\_mode](https://clickhouse.com/docs/operations/settings/settings#timeout_overflow_mode)
- [timeout\_overflow\_mode\_leaf](https://clickhouse.com/docs/operations/settings/settings#timeout_overflow_mode_leaf)
- [totals\_auto\_threshold](https://clickhouse.com/docs/operations/settings/settings#totals_auto_threshold)
- [totals\_mode](https://clickhouse.com/docs/operations/settings/settings#totals_mode)
- [trace\_profile\_events](https://clickhouse.com/docs/operations/settings/settings#trace_profile_events)
- [trace\_profile\_events\_list](https://clickhouse.com/docs/operations/settings/settings#trace_profile_events_list)
- [transfer\_overflow\_mode](https://clickhouse.com/docs/operations/settings/settings#transfer_overflow_mode)
- [transform\_null\_in](https://clickhouse.com/docs/operations/settings/settings#transform_null_in)
- [traverse\_shadow\_remote\_data\_paths](https://clickhouse.com/docs/operations/settings/settings#traverse_shadow_remote_data_paths)
- [union\_default\_mode](https://clickhouse.com/docs/operations/settings/settings#union_default_mode)
- [unknown\_packet\_in\_send\_data](https://clickhouse.com/docs/operations/settings/settings#unknown_packet_in_send_data)
- [update\_parallel\_mode](https://clickhouse.com/docs/operations/settings/settings#update_parallel_mode)
- [update\_sequential\_consistency](https://clickhouse.com/docs/operations/settings/settings#update_sequential_consistency)
- [use\_async\_executor\_for\_materialized\_views](https://clickhouse.com/docs/operations/settings/settings#use_async_executor_for_materialized_views)
- [use\_cache\_for\_count\_from\_files](https://clickhouse.com/docs/operations/settings/settings#use_cache_for_count_from_files)
- [use\_client\_time\_zone](https://clickhouse.com/docs/operations/settings/settings#use_client_time_zone)
- [use\_compact\_format\_in\_distributed\_parts\_names](https://clickhouse.com/docs/operations/settings/settings#use_compact_format_in_distributed_parts_names)
- [use\_concurrency\_control](https://clickhouse.com/docs/operations/settings/settings#use_concurrency_control)
- [use\_hash\_table\_stats\_for\_join\_reordering](https://clickhouse.com/docs/operations/settings/settings#use_hash_table_stats_for_join_reordering)
- [use\_hedged\_requests](https://clickhouse.com/docs/operations/settings/settings#use_hedged_requests)
- [use\_hive\_partitioning](https://clickhouse.com/docs/operations/settings/settings#use_hive_partitioning)
- [use\_iceberg\_metadata\_files\_cache](https://clickhouse.com/docs/operations/settings/settings#use_iceberg_metadata_files_cache)
- [use\_iceberg\_partition\_pruning](https://clickhouse.com/docs/operations/settings/settings#use_iceberg_partition_pruning)
- [use\_index\_for\_in\_with\_subqueries](https://clickhouse.com/docs/operations/settings/settings#use_index_for_in_with_subqueries)
- [use\_index\_for\_in\_with\_subqueries\_max\_values](https://clickhouse.com/docs/operations/settings/settings#use_index_for_in_with_subqueries_max_values)
- [use\_join\_disjunctions\_push\_down](https://clickhouse.com/docs/operations/settings/settings#use_join_disjunctions_push_down)
- [use\_legacy\_to\_time](https://clickhouse.com/docs/operations/settings/settings#use_legacy_to_time)
- [use\_page\_cache\_for\_disks\_without\_file\_cache](https://clickhouse.com/docs/operations/settings/settings#use_page_cache_for_disks_without_file_cache)
- [use\_page\_cache\_for\_local\_disks](https://clickhouse.com/docs/operations/settings/settings#use_page_cache_for_local_disks)
- [use\_page\_cache\_for\_object\_storage](https://clickhouse.com/docs/operations/settings/settings#use_page_cache_for_object_storage)
- [use\_page\_cache\_with\_distributed\_cache](https://clickhouse.com/docs/operations/settings/settings#use_page_cache_with_distributed_cache)
- [use\_paimon\_partition\_pruning](https://clickhouse.com/docs/operations/settings/settings#use_paimon_partition_pruning)
- [use\_parquet\_metadata\_cache](https://clickhouse.com/docs/operations/settings/settings#use_parquet_metadata_cache)
- [use\_partition\_pruning](https://clickhouse.com/docs/operations/settings/settings#use_partition_pruning)
- [use\_primary\_key](https://clickhouse.com/docs/operations/settings/settings#use_primary_key)
- [use\_query\_cache](https://clickhouse.com/docs/operations/settings/settings#use_query_cache)
- [use\_query\_condition\_cache](https://clickhouse.com/docs/operations/settings/settings#use_query_condition_cache)
- [use\_roaring\_bitmap\_iceberg\_positional\_deletes](https://clickhouse.com/docs/operations/settings/settings#use_roaring_bitmap_iceberg_positional_deletes)
- [use\_skip\_indexes](https://clickhouse.com/docs/operations/settings/settings#use_skip_indexes)
- [use\_skip\_indexes\_for\_disjunctions](https://clickhouse.com/docs/operations/settings/settings#use_skip_indexes_for_disjunctions)
- [use\_skip\_indexes\_for\_top\_k](https://clickhouse.com/docs/operations/settings/settings#use_skip_indexes_for_top_k)
- [use\_skip\_indexes\_if\_final](https://clickhouse.com/docs/operations/settings/settings#use_skip_indexes_if_final)
- [use\_skip\_indexes\_if\_final\_exact\_mode](https://clickhouse.com/docs/operations/settings/settings#use_skip_indexes_if_final_exact_mode)
- [use\_skip\_indexes\_on\_data\_read](https://clickhouse.com/docs/operations/settings/settings#use_skip_indexes_on_data_read)
- [use\_statistics](https://clickhouse.com/docs/operations/settings/settings#use_statistics)
- [use\_statistics\_cache](https://clickhouse.com/docs/operations/settings/settings#use_statistics_cache)
- [use\_statistics\_for\_part\_pruning](https://clickhouse.com/docs/operations/settings/settings#use_statistics_for_part_pruning)
- [use\_strict\_insert\_block\_limits](https://clickhouse.com/docs/operations/settings/settings#use_strict_insert_block_limits)
- [use\_structure\_from\_insertion\_table\_in\_table\_functions](https://clickhouse.com/docs/operations/settings/settings#use_structure_from_insertion_table_in_table_functions)
- [use\_text\_index\_header\_cache](https://clickhouse.com/docs/operations/settings/settings#use_text_index_header_cache)
- [use\_text\_index\_like\_evaluation\_by\_dictionary\_scan](https://clickhouse.com/docs/operations/settings/settings#use_text_index_like_evaluation_by_dictionary_scan)
- [use\_text\_index\_postings\_cache](https://clickhouse.com/docs/operations/settings/settings#use_text_index_postings_cache)
- [use\_text\_index\_tokens\_cache](https://clickhouse.com/docs/operations/settings/settings#use_text_index_tokens_cache)
- [use\_top\_k\_dynamic\_filtering](https://clickhouse.com/docs/operations/settings/settings#use_top_k_dynamic_filtering)
- [use\_uncompressed\_cache](https://clickhouse.com/docs/operations/settings/settings#use_uncompressed_cache)
- [use\_variant\_as\_common\_type](https://clickhouse.com/docs/operations/settings/settings#use_variant_as_common_type)
- [use\_variant\_default\_implementation\_for\_comparisons](https://clickhouse.com/docs/operations/settings/settings#use_variant_default_implementation_for_comparisons)
- [use\_with\_fill\_by\_sorting\_prefix](https://clickhouse.com/docs/operations/settings/settings#use_with_fill_by_sorting_prefix)
- [validate\_enum\_literals\_in\_operators](https://clickhouse.com/docs/operations/settings/settings#validate_enum_literals_in_operators)
- [validate\_mutation\_query](https://clickhouse.com/docs/operations/settings/settings#validate_mutation_query)
- [validate\_polygons](https://clickhouse.com/docs/operations/settings/settings#validate_polygons)
- [vector\_search\_filter\_strategy](https://clickhouse.com/docs/operations/settings/settings#vector_search_filter_strategy)
- [vector\_search\_index\_fetch\_multiplier](https://clickhouse.com/docs/operations/settings/settings#vector_search_index_fetch_multiplier)
- [vector\_search\_with\_rescoring](https://clickhouse.com/docs/operations/settings/settings#vector_search_with_rescoring)
- [wait\_changes\_become\_visible\_after\_commit\_mode](https://clickhouse.com/docs/operations/settings/settings#wait_changes_become_visible_after_commit_mode)
- [wait\_for\_async\_insert](https://clickhouse.com/docs/operations/settings/settings#wait_for_async_insert)
- [wait\_for\_async\_insert\_timeout](https://clickhouse.com/docs/operations/settings/settings#wait_for_async_insert_timeout)
- [wait\_for\_window\_view\_fire\_signal\_timeout](https://clickhouse.com/docs/operations/settings/settings#wait_for_window_view_fire_signal_timeout)
- [webassembly\_udf\_max\_fuel](https://clickhouse.com/docs/operations/settings/settings#webassembly_udf_max_fuel)
- [webassembly\_udf\_max\_input\_block\_size](https://clickhouse.com/docs/operations/settings/settings#webassembly_udf_max_input_block_size)
- [webassembly\_udf\_max\_instances](https://clickhouse.com/docs/operations/settings/settings#webassembly_udf_max_instances)
- [webassembly\_udf\_max\_memory](https://clickhouse.com/docs/operations/settings/settings#webassembly_udf_max_memory)
- [window\_view\_clean\_interval](https://clickhouse.com/docs/operations/settings/settings#window_view_clean_interval)
- [window\_view\_heartbeat\_interval](https://clickhouse.com/docs/operations/settings/settings#window_view_heartbeat_interval)
- [workload](https://clickhouse.com/docs/operations/settings/settings#workload)
- [write\_full\_path\_in\_iceberg\_metadata](https://clickhouse.com/docs/operations/settings/settings#write_full_path_in_iceberg_metadata)
- [write\_through\_distributed\_cache](https://clickhouse.com/docs/operations/settings/settings#write_through_distributed_cache)
- [write\_through\_distributed\_cache\_buffer\_size](https://clickhouse.com/docs/operations/settings/settings#write_through_distributed_cache_buffer_size)
- [zstd\_window\_log\_max](https://clickhouse.com/docs/operations/settings/settings#zstd_window_log_max)
Was this page helpful?
###### Try ClickHouse Cloud for FREE
Separation of storage and compute, automatic scaling, built-in SQL console, and lots more. \$300 in free credits when signing up.
[Try it for Free](https://console.clickhouse.cloud/signUp?loc=doc-card-banner&glxid=835388a6-b0a4-45b1-adf9-62c7c3ab88fd&pagePath=%2Fdocs%2Foperations%2Fsettings%2Fsettings&origPath=%2Fdocs%2Foperations%2Fsettings%2Fsettings&utm_ga=GA1.1.1511935395.1775990561)
Β© 2016β2026 ClickHouse, Inc.
[Trademark](https://clickhouse.com/legal/trademark-policy)Β·[Privacy](https://clickhouse.com/legal/privacy-policy)Β·[Security](https://trust.clickhouse.com/)Β·[Terms of Service](https://clickhouse.com/legal/agreements/terms-of-service)

Β© 2016β2026 ClickHouse, Inc.
[Trademark](https://clickhouse.com/legal/trademark-policy)Β·[Privacy](https://clickhouse.com/legal/privacy-policy)Β·[Security](https://trust.clickhouse.com/)Β·[Terms of Service](https://clickhouse.com/legal/agreements/terms-of-service)

[](https://clickhouse.com/)
EN
- Get startedβΌ
- CloudβΌ
- Manage dataβΌ
- Server adminβΌ
- ReferenceβΌ
- IntegrationsβΌ
- ClickStackβΌ
- chDBβΌ
- AboutβΌ
[](https://clickhouse.com/)
EN
main-menu
- Manage and deployβΌ
- SettingsβΌ
- [Settings Overview](https://clickhouse.com/docs/operations/settings/overview)
- [Server Settings](https://clickhouse.com/docs/operations/server-configuration-parameters/settings)
- [Session Settings](https://clickhouse.com/docs/operations/settings/settings)
- [MergeTree tables settings](https://clickhouse.com/docs/operations/settings/merge-tree-settings)
- [Format Settings](https://clickhouse.com/docs/operations/settings/formats)
- [Composable protocols](https://clickhouse.com/docs/operations/settings/composable-protocols)
- [Constraints on settings](https://clickhouse.com/docs/operations/settings/constraints-on-settings)
- [Memory overcommit](https://clickhouse.com/docs/operations/settings/memory-overcommit)
- [Permissions for queries](https://clickhouse.com/docs/operations/settings/permissions-for-queries)
- [Restrictions on query complexity](https://clickhouse.com/docs/operations/settings/query-complexity)
- [Server overload](https://clickhouse.com/docs/operations/settings/server-overload)
- [Query-level Session Settings](https://clickhouse.com/docs/operations/settings/query-level)
- [Settings profiles](https://clickhouse.com/docs/operations/settings/settings-profiles)
- [User Settings](https://clickhouse.com/docs/operations/settings/settings-users)
- [Named collections](https://clickhouse.com/docs/operations/named-collections)
- [Configuration Files](https://clickhouse.com/docs/operations/configuration-files)
- [TCP connection limits](https://clickhouse.com/docs/operations/settings/tcp-connection-limits)
- System tablesβΌ
- Security and authenticationβΌ
- Tools and utilitiesβΌ |
| Readable Markdown | All below settings are also available in table [system.settings](https://clickhouse.com/docs/operations/system-tables/settings). These settings are autogenerated from [source](https://github.com/ClickHouse/ClickHouse/blob/master/src/Core/Settings.cpp).
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Write add http CORS header.
## additional\_result\_filter[β](https://clickhouse.com/docs/operations/settings/settings#additional_result_filter "Direct link to additional_result_filter")
An additional filter expression to apply to the result of `SELECT` query. This setting is not applied to any subquery.
**Example**
```
INSERT INTO table_1 VALUES (1, 'a'), (2, 'bb'), (3, 'ccc'), (4, 'dddd');
SElECT * FROM table_1;
```
```
ββxββ¬βyβββββ
β 1 β a β
β 2 β bb β
β 3 β ccc β
β 4 β dddd β
βββββ΄βββββββ
```
```
SELECT *
FROM table_1
SETTINGS additional_result_filter = 'x != 2'
```
```
ββxββ¬βyβββββ
β 1 β a β
β 3 β ccc β
β 4 β dddd β
βββββ΄βββββββ
```
## additional\_table\_filters[β](https://clickhouse.com/docs/operations/settings/settings#additional_table_filters "Direct link to additional_table_filters")
| Type | Default value |
|---|---|
| TypeMap | Default value{} |
An additional filter expression that is applied after reading from the specified table.
**Example**
```
INSERT INTO table_1 VALUES (1, 'a'), (2, 'bb'), (3, 'ccc'), (4, 'dddd');
SELECT * FROM table_1;
```
```
ββxββ¬βyβββββ
β 1 β a β
β 2 β bb β
β 3 β ccc β
β 4 β dddd β
βββββ΄βββββββ
```
```
SELECT *
FROM table_1
SETTINGS additional_table_filters = {'table_1': 'x != 2'}
```
```
ββxββ¬βyβββββ
β 1 β a β
β 3 β ccc β
β 4 β dddd β
βββββ΄βββββββ
```
## aggregate\_function\_input\_format[β](https://clickhouse.com/docs/operations/settings/settings#aggregate_function_input_format "Direct link to aggregate_function_input_format")
| Type | Default value |
|---|---|
| TypeAggregateFunctionInputFormat | Default valuestate |
Format for AggregateFunction input during INSERT operations.
Possible values:
- `state` β Binary string with the serialized state (the default). This is the default behavior where AggregateFunction values are expected as binary data.
- `value` β The format expects a single value of the argument of the aggregate function, or in the case of multiple arguments, a tuple of them. They will be deserialized using the corresponding IDataType or DataTypeTuple and then aggregated to form the state.
- `array` β The format expects an Array of values, as described in the `value` option above. All elements of the array will be aggregated to form the state.
**Examples**
For a table with structure:
```
CREATE TABLE example (
user_id UInt64,
avg_session_length AggregateFunction(avg, UInt32)
);
```
With `aggregate_function_input_format = 'value'`:
```
INSERT INTO example FORMAT CSV
123,456
```
With `aggregate_function_input_format = 'array'`:
```
INSERT INTO example FORMAT CSV
123,"[456,789,101]"
```
Note: The `value` and `array` formats are slower than the default `state` format as they require creating and aggregating values during insertion.
## aggregate\_functions\_null\_for\_empty[β](https://clickhouse.com/docs/operations/settings/settings#aggregate_functions_null_for_empty "Direct link to aggregate_functions_null_for_empty")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Enables or disables rewriting all aggregate functions in a query, adding [\-OrNull](https://clickhouse.com/docs/sql-reference/aggregate-functions/combinators#-ornull) suffix to them. Enable it for SQL standard compatibility. It is implemented via query rewrite (similar to [count\_distinct\_implementation](https://clickhouse.com/docs/operations/settings/settings#count_distinct_implementation) setting) to get consistent results for distributed queries.
Possible values:
- 0 β Disabled.
- 1 β Enabled.
**Example**
Consider the following query with aggregate functions:
```
SELECT SUM(-1), MAX(0) FROM system.one WHERE 0;
```
With `aggregate_functions_null_for_empty = 0` it would produce:
```
ββSUM(-1)ββ¬βMAX(0)ββ
β 0 β 0 β
βββββββββββ΄βββββββββ
```
With `aggregate_functions_null_for_empty = 1` the result would be:
```
ββSUMOrNull(-1)ββ¬βMAXOrNull(0)ββ
β NULL β NULL β
βββββββββββββββββ΄βββββββββββββββ
```
## aggregation\_in\_order\_max\_block\_bytes[β](https://clickhouse.com/docs/operations/settings/settings#aggregation_in_order_max_block_bytes "Direct link to aggregation_in_order_max_block_bytes")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value50000000 |
Maximal size of block in bytes accumulated during aggregation in order of primary key. Lower block size allows to parallelize more final merge stage of aggregation.
## aggregation\_memory\_efficient\_merge\_threads[β](https://clickhouse.com/docs/operations/settings/settings#aggregation_memory_efficient_merge_threads "Direct link to aggregation_memory_efficient_merge_threads")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Number of threads to use for merge intermediate aggregation results in memory efficient mode. When bigger, then more memory is consumed. 0 means - same as 'max\_threads'.
## allow\_aggregate\_partitions\_independently[β](https://clickhouse.com/docs/operations/settings/settings#allow_aggregate_partitions_independently "Direct link to allow_aggregate_partitions_independently")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Enable independent aggregation of partitions on separate threads when partition key suits group by key. Beneficial when number of partitions close to number of cores and partitions have roughly the same size
## allow\_archive\_path\_syntax[β](https://clickhouse.com/docs/operations/settings/settings#allow_archive_path_syntax "Direct link to allow_archive_path_syntax")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
File/S3 engines/table function will parse paths with '::' as `<archive> :: <file>` if the archive has correct extension.
## allow\_asynchronous\_read\_from\_io\_pool\_for\_merge\_tree[β](https://clickhouse.com/docs/operations/settings/settings#allow_asynchronous_read_from_io_pool_for_merge_tree "Direct link to allow_asynchronous_read_from_io_pool_for_merge_tree")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Use background I/O pool to read from MergeTree tables. This setting may increase performance for I/O bound queries
## allow\_calculating\_subcolumns\_sizes\_for\_merge\_tree\_reading[β](https://clickhouse.com/docs/operations/settings/settings#allow_calculating_subcolumns_sizes_for_merge_tree_reading "Direct link to allow_calculating_subcolumns_sizes_for_merge_tree_reading")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
When enabled, ClickHouse will calculate the size of files required for each subcolumn reading for better task and block sizes calculation.
## allow\_changing\_replica\_until\_first\_data\_packet[β](https://clickhouse.com/docs/operations/settings/settings#allow_changing_replica_until_first_data_packet "Direct link to allow_changing_replica_until_first_data_packet")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
If it's enabled, in hedged requests we can start new connection until receiving first data packet even if we have already made some progress (but progress haven't updated for `receive_data_timeout` timeout), otherwise we disable changing replica after the first time we made progress.
## allow\_create\_index\_without\_type[β](https://clickhouse.com/docs/operations/settings/settings#allow_create_index_without_type "Direct link to allow_create_index_without_type")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Allow CREATE INDEX query without TYPE. Query will be ignored. Made for SQL compatibility tests.
## allow\_custom\_error\_code\_in\_throwif[β](https://clickhouse.com/docs/operations/settings/settings#allow_custom_error_code_in_throwif "Direct link to allow_custom_error_code_in_throwif")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Enable custom error code in function throwIf(). If true, thrown exceptions may have unexpected error codes.
## allow\_ddl[β](https://clickhouse.com/docs/operations/settings/settings#allow_ddl "Direct link to allow_ddl")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
If it is set to true, then a user is allowed to executed DDL queries.
## allow\_deprecated\_database\_ordinary[β](https://clickhouse.com/docs/operations/settings/settings#allow_deprecated_database_ordinary "Direct link to allow_deprecated_database_ordinary")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Allow to create databases with deprecated Ordinary engine
## allow\_deprecated\_error\_prone\_window\_functions[β](https://clickhouse.com/docs/operations/settings/settings#allow_deprecated_error_prone_window_functions "Direct link to allow_deprecated_error_prone_window_functions")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Allow usage of deprecated error prone window functions (neighbor, runningAccumulate, runningDifferenceStartingWithFirstValue, runningDifference)
## allow\_deprecated\_snowflake\_conversion\_functions[β](https://clickhouse.com/docs/operations/settings/settings#allow_deprecated_snowflake_conversion_functions "Direct link to allow_deprecated_snowflake_conversion_functions")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Functions `snowflakeToDateTime`, `snowflakeToDateTime64`, `dateTimeToSnowflake`, and `dateTime64ToSnowflake` are deprecated and disabled by default. Please use functions `snowflakeIDToDateTime`, `snowflakeIDToDateTime64`, `dateTimeToSnowflakeID`, and `dateTime64ToSnowflakeID` instead.
To re-enable the deprecated functions (e.g., during a transition period), please set this setting to `true`.
## allow\_deprecated\_syntax\_for\_merge\_tree[β](https://clickhouse.com/docs/operations/settings/settings#allow_deprecated_syntax_for_merge_tree "Direct link to allow_deprecated_syntax_for_merge_tree")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Allow to create \*MergeTree tables with deprecated engine definition syntax
## allow\_distributed\_ddl[β](https://clickhouse.com/docs/operations/settings/settings#allow_distributed_ddl "Direct link to allow_distributed_ddl")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
If it is set to true, then a user is allowed to executed distributed DDL queries.
## allow\_drop\_detached[β](https://clickhouse.com/docs/operations/settings/settings#allow_drop_detached "Direct link to allow_drop_detached")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Allow ALTER TABLE ... DROP DETACHED PART\[ITION\] ... queries
## allow\_dynamic\_type\_in\_join\_keys[β](https://clickhouse.com/docs/operations/settings/settings#allow_dynamic_type_in_join_keys "Direct link to allow_dynamic_type_in_join_keys")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Allows using Dynamic type in JOIN keys. Added for compatibility. It's not recommended to use Dynamic type in JOIN keys because comparison with other types may lead to unexpected results.
## allow\_execute\_multiif\_columnar[β](https://clickhouse.com/docs/operations/settings/settings#allow_execute_multiif_columnar "Direct link to allow_execute_multiif_columnar")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Allow execute multiIf function columnar
## allow\_experimental\_alias\_table\_engine[β](https://clickhouse.com/docs/operations/settings/settings#allow_experimental_alias_table_engine "Direct link to allow_experimental_alias_table_engine")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Allow to create table with the Alias engine.
## allow\_experimental\_analyzer[β](https://clickhouse.com/docs/operations/settings/settings#allow_experimental_analyzer "Direct link to allow_experimental_analyzer")
**Aliases**: `enable_analyzer`
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Allow new query analyzer.
## allow\_experimental\_codecs[β](https://clickhouse.com/docs/operations/settings/settings#allow_experimental_codecs "Direct link to allow_experimental_codecs")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
If it is set to true, allow to specify experimental compression codecs (but we don't have those yet and this option does nothing).
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Allow to execute correlated subqueries.
## allow\_experimental\_database\_glue\_catalog[β](https://clickhouse.com/docs/operations/settings/settings#allow_experimental_database_glue_catalog "Direct link to allow_experimental_database_glue_catalog")
**Aliases**: `allow_database_glue_catalog`
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Allow experimental database engine DataLakeCatalog with catalog\_type = 'glue'
Cloud default value: `1`.
## allow\_experimental\_database\_hms\_catalog[β](https://clickhouse.com/docs/operations/settings/settings#allow_experimental_database_hms_catalog "Direct link to allow_experimental_database_hms_catalog")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Allow experimental database engine DataLakeCatalog with catalog\_type = 'hms'
## allow\_experimental\_database\_iceberg[β](https://clickhouse.com/docs/operations/settings/settings#allow_experimental_database_iceberg "Direct link to allow_experimental_database_iceberg")
**Aliases**: `allow_database_iceberg`
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Allow experimental database engine DataLakeCatalog with catalog\_type = 'iceberg'
Cloud default value: `1`.
## allow\_experimental\_database\_materialized\_postgresql[β](https://clickhouse.com/docs/operations/settings/settings#allow_experimental_database_materialized_postgresql "Direct link to allow_experimental_database_materialized_postgresql")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Allow to create database with Engine=MaterializedPostgreSQL(...).
## allow\_experimental\_database\_paimon\_rest\_catalog[β](https://clickhouse.com/docs/operations/settings/settings#allow_experimental_database_paimon_rest_catalog "Direct link to allow_experimental_database_paimon_rest_catalog")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Allow experimental database engine DataLakeCatalog with catalog\_type = 'paimon\_rest'
## allow\_experimental\_database\_unity\_catalog[β](https://clickhouse.com/docs/operations/settings/settings#allow_experimental_database_unity_catalog "Direct link to allow_experimental_database_unity_catalog")
**Aliases**: `allow_database_unity_catalog`
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Allow experimental database engine DataLakeCatalog with catalog\_type = 'unity'
Cloud default value: `1`.
## allow\_experimental\_delta\_kernel\_rs[β](https://clickhouse.com/docs/operations/settings/settings#allow_experimental_delta_kernel_rs "Direct link to allow_experimental_delta_kernel_rs")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Allow experimental delta-kernel-rs implementation.
## allow\_experimental\_delta\_lake\_writes[β](https://clickhouse.com/docs/operations/settings/settings#allow_experimental_delta_lake_writes "Direct link to allow_experimental_delta_lake_writes")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Enables delta-kernel writes feature.
## allow\_experimental\_expire\_snapshots[β](https://clickhouse.com/docs/operations/settings/settings#allow_experimental_expire_snapshots "Direct link to allow_experimental_expire_snapshots")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Allow to execute experimental Iceberg command `ALTER TABLE ... EXECUTE expire_snapshots`.
## allow\_experimental\_funnel\_functions[β](https://clickhouse.com/docs/operations/settings/settings#allow_experimental_funnel_functions "Direct link to allow_experimental_funnel_functions")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Enable experimental functions for funnel analysis.
## allow\_experimental\_hash\_functions[β](https://clickhouse.com/docs/operations/settings/settings#allow_experimental_hash_functions "Direct link to allow_experimental_hash_functions")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Enable experimental hash functions
## allow\_experimental\_iceberg\_compaction[β](https://clickhouse.com/docs/operations/settings/settings#allow_experimental_iceberg_compaction "Direct link to allow_experimental_iceberg_compaction")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Allow to explicitly use 'OPTIMIZE' for iceberg tables.
## allow\_experimental\_join\_right\_table\_sorting[β](https://clickhouse.com/docs/operations/settings/settings#allow_experimental_join_right_table_sorting "Direct link to allow_experimental_join_right_table_sorting")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
If it is set to true, and the conditions of `join_to_sort_minimum_perkey_rows` and `join_to_sort_maximum_table_rows` are met, rerange the right table by key to improve the performance in left or inner hash join.
## allow\_experimental\_json\_lazy\_type\_hints[β](https://clickhouse.com/docs/operations/settings/settings#allow_experimental_json_lazy_type_hints "Direct link to allow_experimental_json_lazy_type_hints")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Enable experimental lazy type hints for JSON type. This feature allows optimizing JSON type conversions by deferring type hint evaluation.
## allow\_experimental\_kafka\_offsets\_storage\_in\_keeper[β](https://clickhouse.com/docs/operations/settings/settings#allow_experimental_kafka_offsets_storage_in_keeper "Direct link to allow_experimental_kafka_offsets_storage_in_keeper")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Allow experimental feature to store Kafka related offsets in ClickHouse Keeper. When enabled a ClickHouse Keeper path and replica name can be specified to the Kafka table engine. As a result instead of the regular Kafka engine, a new type of storage engine will be used that stores the committed offsets primarily in ClickHouse Keeper
## allow\_experimental\_kusto\_dialect[β](https://clickhouse.com/docs/operations/settings/settings#allow_experimental_kusto_dialect "Direct link to allow_experimental_kusto_dialect")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Enable Kusto Query Language (KQL) - an alternative to SQL.
## allow\_experimental\_materialized\_postgresql\_table[β](https://clickhouse.com/docs/operations/settings/settings#allow_experimental_materialized_postgresql_table "Direct link to allow_experimental_materialized_postgresql_table")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Allows to use the MaterializedPostgreSQL table engine. Disabled by default, because this feature is experimental
## allow\_experimental\_nlp\_functions[β](https://clickhouse.com/docs/operations/settings/settings#allow_experimental_nlp_functions "Direct link to allow_experimental_nlp_functions")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Enable experimental functions for natural language processing.
## allow\_experimental\_nullable\_tuple\_type[β](https://clickhouse.com/docs/operations/settings/settings#allow_experimental_nullable_tuple_type "Direct link to allow_experimental_nullable_tuple_type")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Allows creation of [Nullable](https://clickhouse.com/docs/sql-reference/data-types/nullable) [Tuple](https://clickhouse.com/docs/sql-reference/data-types/tuple) columns in tables.
This setting does not control whether extracted tuple subcolumns can be `Nullable` (for example, from Dynamic, Variant, JSON, or Tuple columns). Use `allow_nullable_tuple_in_extracted_subcolumns` to control whether extracted tuple subcolumns can be `Nullable`.
## allow\_experimental\_object\_storage\_queue\_hive\_partitioning[β](https://clickhouse.com/docs/operations/settings/settings#allow_experimental_object_storage_queue_hive_partitioning "Direct link to allow_experimental_object_storage_queue_hive_partitioning")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Allow to use hive partitioning with S3Queue/AzureQueue engines
## allow\_experimental\_parallel\_reading\_from\_replicas[β](https://clickhouse.com/docs/operations/settings/settings#allow_experimental_parallel_reading_from_replicas "Direct link to allow_experimental_parallel_reading_from_replicas")
**Aliases**: `enable_parallel_replicas`
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Use up to `max_parallel_replicas` the number of replicas from each shard for SELECT query execution. Reading is parallelized and coordinated dynamically. 0 - disabled, 1 - enabled, silently disable them in case of failure, 2 - enabled, throw an exception in case of failure
## allow\_experimental\_polyglot\_dialect[β](https://clickhouse.com/docs/operations/settings/settings#allow_experimental_polyglot_dialect "Direct link to allow_experimental_polyglot_dialect")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Enable polyglot SQL transpiler - transpiles SQL from 30+ dialects (MySQL, PostgreSQL, SQLite, Snowflake, DuckDB, etc.) into ClickHouse SQL.
## allow\_experimental\_prql\_dialect[β](https://clickhouse.com/docs/operations/settings/settings#allow_experimental_prql_dialect "Direct link to allow_experimental_prql_dialect")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Enable PRQL - an alternative to SQL.
## allow\_experimental\_query\_deduplication[β](https://clickhouse.com/docs/operations/settings/settings#allow_experimental_query_deduplication "Direct link to allow_experimental_query_deduplication")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Experimental data deduplication for SELECT queries based on part UUIDs
## allow\_experimental\_time\_series\_aggregate\_functions[β](https://clickhouse.com/docs/operations/settings/settings#allow_experimental_time_series_aggregate_functions "Direct link to allow_experimental_time_series_aggregate_functions")
**Aliases**: `allow_experimental_ts_to_grid_aggregate_function`
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Experimental timeSeries\* aggregate functions for Prometheus-like timeseries resampling, rate, delta calculation.
## allow\_experimental\_time\_series\_table[β](https://clickhouse.com/docs/operations/settings/settings#allow_experimental_time_series_table "Direct link to allow_experimental_time_series_table")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Allows creation of tables with the [TimeSeries](https://clickhouse.com/docs/engines/table-engines/special/time_series) table engine. Possible values:
- 0 β the [TimeSeries](https://clickhouse.com/docs/engines/table-engines/special/time_series) table engine is disabled.
- 1 β the [TimeSeries](https://clickhouse.com/docs/engines/table-engines/special/time_series) table engine is enabled.
## allow\_experimental\_window\_view[β](https://clickhouse.com/docs/operations/settings/settings#allow_experimental_window_view "Direct link to allow_experimental_window_view")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Enable WINDOW VIEW. Not mature enough.
## allow\_experimental\_ytsaurus\_dictionary\_source[β](https://clickhouse.com/docs/operations/settings/settings#allow_experimental_ytsaurus_dictionary_source "Direct link to allow_experimental_ytsaurus_dictionary_source")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Experimental dictionary source for integration with YTsaurus.
## allow\_experimental\_ytsaurus\_table\_engine[β](https://clickhouse.com/docs/operations/settings/settings#allow_experimental_ytsaurus_table_engine "Direct link to allow_experimental_ytsaurus_table_engine")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Experimental table engine for integration with YTsaurus.
## allow\_experimental\_ytsaurus\_table\_function[β](https://clickhouse.com/docs/operations/settings/settings#allow_experimental_ytsaurus_table_function "Direct link to allow_experimental_ytsaurus_table_function")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Experimental table engine for integration with YTsaurus.
## allow\_fuzz\_query\_functions[β](https://clickhouse.com/docs/operations/settings/settings#allow_fuzz_query_functions "Direct link to allow_fuzz_query_functions")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Enables the `fuzzQuery` function that applies random AST mutations to a query string.
## allow\_general\_join\_planning[β](https://clickhouse.com/docs/operations/settings/settings#allow_general_join_planning "Direct link to allow_general_join_planning")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Allows a more general join planning algorithm that can handle more complex conditions, but only works with hash join. If hash join is not enabled, then the usual join planning algorithm is used regardless of the value of this setting.
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Allow to use the function `getClientHTTPHeader` which lets to obtain a value of an the current HTTP request's header. It is not enabled by default for security reasons, because some headers, such as `Cookie`, could contain sensitive info. Note that the `X-ClickHouse-*` and `Authentication` headers are always restricted and cannot be obtained with this function.
## allow\_hyperscan[β](https://clickhouse.com/docs/operations/settings/settings#allow_hyperscan "Direct link to allow_hyperscan")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Allow functions that use Hyperscan library. Disable to avoid potentially long compilation times and excessive resource usage.
## allow\_insert\_into\_iceberg[β](https://clickhouse.com/docs/operations/settings/settings#allow_insert_into_iceberg "Direct link to allow_insert_into_iceberg")
**Aliases**: `allow_experimental_insert_into_iceberg`
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Allow to execute `insert` queries into iceberg.
## allow\_introspection\_functions[β](https://clickhouse.com/docs/operations/settings/settings#allow_introspection_functions "Direct link to allow_introspection_functions")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Enables or disables [introspection functions](https://clickhouse.com/docs/sql-reference/functions/introspection) for query profiling.
Possible values:
- 1 β Introspection functions enabled.
- 0 β Introspection functions disabled.
**See Also**
- [Sampling Query Profiler](https://clickhouse.com/docs/operations/optimizing-performance/sampling-query-profiler)
- System table [trace\_log](https://clickhouse.com/docs/operations/system-tables/trace_log)
## allow\_materialized\_view\_with\_bad\_select[β](https://clickhouse.com/docs/operations/settings/settings#allow_materialized_view_with_bad_select "Direct link to allow_materialized_view_with_bad_select")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Allow CREATE MATERIALIZED VIEW with SELECT query that references nonexistent tables or columns. It must still be syntactically valid. Doesn't apply to refreshable MVs. Doesn't apply if the MV schema needs to be inferred from the SELECT query (i.e. if the CREATE has no column list and no TO table). Can be used for creating MV before its source table.
## allow\_named\_collection\_override\_by\_default[β](https://clickhouse.com/docs/operations/settings/settings#allow_named_collection_override_by_default "Direct link to allow_named_collection_override_by_default")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Allow named collections' fields override by default.
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Allow to execute alters which affects not only tables metadata, but also data on disk
## allow\_nonconst\_timezone\_arguments[β](https://clickhouse.com/docs/operations/settings/settings#allow_nonconst_timezone_arguments "Direct link to allow_nonconst_timezone_arguments")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Allow non-const timezone arguments in certain time-related functions like toTimeZone(), fromUnixTimestamp\*(), snowflakeToDateTime\*(). This setting exists only for compatibility reasons. In ClickHouse, the time zone is a property of the data type, respectively of the column. Enabling this setting gives the wrong impression that different values within a column can have different timezones. Therefore, please do not enable this setting.
## allow\_nondeterministic\_mutations[β](https://clickhouse.com/docs/operations/settings/settings#allow_nondeterministic_mutations "Direct link to allow_nondeterministic_mutations")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
User-level setting that allows mutations on replicated tables to make use of non-deterministic functions such as `dictGet`.
Given that, for example, dictionaries, can be out of sync across nodes, mutations that pull values from them are disallowed on replicated tables by default. Enabling this setting allows this behavior, making it the user's responsibility to ensure that the data used is in sync across all nodes.
**Example**
```
<profiles>
<default>
<allow_nondeterministic_mutations>1</allow_nondeterministic_mutations>
<!-- ... -->
</default>
<!-- ... -->
</profiles>
```
## allow\_nondeterministic\_optimize\_skip\_unused\_shards[β](https://clickhouse.com/docs/operations/settings/settings#allow_nondeterministic_optimize_skip_unused_shards "Direct link to allow_nondeterministic_optimize_skip_unused_shards")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Allow nondeterministic (like `rand` or `dictGet`, since later has some caveats with updates) functions in sharding key.
Possible values:
- 0 β Disallowed.
- 1 β Allowed.
## allow\_nullable\_tuple\_in\_extracted\_subcolumns[β](https://clickhouse.com/docs/operations/settings/settings#allow_nullable_tuple_in_extracted_subcolumns "Direct link to allow_nullable_tuple_in_extracted_subcolumns")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Controls whether extracted subcolumns of type `Tuple(...)` can be typed as `Nullable(Tuple(...))`.
- `false`: Return `Tuple(...)` and use default tuple values for rows where the subcolumn is missing.
- `true`: Return `Nullable(Tuple(...))` and use `NULL` for rows where the subcolumn is missing.
This setting controls extracted subcolumn behavior only. It does not control whether `Nullable(Tuple(...))` columns can be created in tables; that is controlled by `allow_experimental_nullable_tuple_type`.
ClickHouse uses the value for this setting loaded at server startup. Changes made with `SET` or query-level `SETTINGS` do not change extracted subcolumn behavior. To change extracted subcolumn behavior, update `allow_nullable_tuple_in_extracted_subcolumns` in startup profile configuration (for example, users.xml) and restart the server.
## allow\_prefetched\_read\_pool\_for\_local\_filesystem[β](https://clickhouse.com/docs/operations/settings/settings#allow_prefetched_read_pool_for_local_filesystem "Direct link to allow_prefetched_read_pool_for_local_filesystem")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Prefer prefetched threadpool if all parts are on local filesystem
## allow\_prefetched\_read\_pool\_for\_remote\_filesystem[β](https://clickhouse.com/docs/operations/settings/settings#allow_prefetched_read_pool_for_remote_filesystem "Direct link to allow_prefetched_read_pool_for_remote_filesystem")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Prefer prefetched threadpool if all parts are on remote filesystem
## allow\_push\_predicate\_ast\_for\_distributed\_subqueries[β](https://clickhouse.com/docs/operations/settings/settings#allow_push_predicate_ast_for_distributed_subqueries "Direct link to allow_push_predicate_ast_for_distributed_subqueries")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Allows push predicate on AST level for distributed subqueries with enabled anlyzer
## allow\_push\_predicate\_when\_subquery\_contains\_with[β](https://clickhouse.com/docs/operations/settings/settings#allow_push_predicate_when_subquery_contains_with "Direct link to allow_push_predicate_when_subquery_contains_with")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Allows push predicate when subquery contains WITH clause
## allow\_reorder\_prewhere\_conditions[β](https://clickhouse.com/docs/operations/settings/settings#allow_reorder_prewhere_conditions "Direct link to allow_reorder_prewhere_conditions")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
When moving conditions from WHERE to PREWHERE, allow reordering them to optimize filtering
## allow\_settings\_after\_format\_in\_insert[β](https://clickhouse.com/docs/operations/settings/settings#allow_settings_after_format_in_insert "Direct link to allow_settings_after_format_in_insert")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Control whether `SETTINGS` after `FORMAT` in `INSERT` queries is allowed or not. It is not recommended to use this, since this may interpret part of `SETTINGS` as values.
Example:
```
INSERT INTO FUNCTION null('foo String') SETTINGS max_threads=1 VALUES ('bar');
```
But the following query will work only with `allow_settings_after_format_in_insert`:
```
SET allow_settings_after_format_in_insert=1;
INSERT INTO FUNCTION null('foo String') VALUES ('bar') SETTINGS max_threads=1;
```
Possible values:
- 0 β Disallow.
- 1 β Allow.
Note
Use this setting only for backward compatibility if your use cases depend on old syntax.
## allow\_simdjson[β](https://clickhouse.com/docs/operations/settings/settings#allow_simdjson "Direct link to allow_simdjson")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Allow using simdjson library in 'JSON\*' functions if AVX2 instructions are available. If disabled rapidjson will be used.
## allow\_special\_serialization\_kinds\_in\_output\_formats[β](https://clickhouse.com/docs/operations/settings/settings#allow_special_serialization_kinds_in_output_formats "Direct link to allow_special_serialization_kinds_in_output_formats")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Allows to output columns with special serialization kinds like Sparse and Replicated without converting them to full column representation. It helps to avoid unnecessary data copy during formatting.
## allow\_statistics[β](https://clickhouse.com/docs/operations/settings/settings#allow_statistics "Direct link to allow_statistics")
**Aliases**: `allow_experimental_statistics`
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Allows defining columns with [statistics](https://clickhouse.com/docs/engines/table-engines/mergetree-family/mergetree#table_engine-mergetree-creating-a-table) and [manipulate statistics](https://clickhouse.com/docs/engines/table-engines/mergetree-family/mergetree#column-statistics).
## allow\_statistics\_optimize[β](https://clickhouse.com/docs/operations/settings/settings#allow_statistics_optimize "Direct link to allow_statistics_optimize")
**Aliases**: `allow_statistic_optimize`
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Allows using statistics to optimize queries
## allow\_suspicious\_codecs[β](https://clickhouse.com/docs/operations/settings/settings#allow_suspicious_codecs "Direct link to allow_suspicious_codecs")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
If it is set to true, allow to specify meaningless compression codecs.
## allow\_suspicious\_fixed\_string\_types[β](https://clickhouse.com/docs/operations/settings/settings#allow_suspicious_fixed_string_types "Direct link to allow_suspicious_fixed_string_types")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
In CREATE TABLE statement allows creating columns of type FixedString(n) with n \> 256. FixedString with length \>= 256 is suspicious and most likely indicates a misuse
## allow\_suspicious\_indices[β](https://clickhouse.com/docs/operations/settings/settings#allow_suspicious_indices "Direct link to allow_suspicious_indices")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Reject primary/secondary indexes and sorting keys with identical expressions
## allow\_suspicious\_low\_cardinality\_types[β](https://clickhouse.com/docs/operations/settings/settings#allow_suspicious_low_cardinality_types "Direct link to allow_suspicious_low_cardinality_types")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Allows or restricts using [LowCardinality](https://clickhouse.com/docs/sql-reference/data-types/lowcardinality) with data types with fixed size of 8 bytes or less: numeric data types and `FixedString(8_bytes_or_less)`.
For small fixed values using of `LowCardinality` is usually inefficient, because ClickHouse stores a numeric index for each row. As a result:
- Disk space usage can rise.
- RAM consumption can be higher, depending on a dictionary size.
- Some functions can work slower due to extra coding/encoding operations.
Merge times in [MergeTree](https://clickhouse.com/docs/engines/table-engines/mergetree-family/mergetree)\-engine tables can grow due to all the reasons described above.
Possible values:
- 1 β Usage of `LowCardinality` is not restricted.
- 0 β Usage of `LowCardinality` is restricted.
## allow\_suspicious\_primary\_key[β](https://clickhouse.com/docs/operations/settings/settings#allow_suspicious_primary_key "Direct link to allow_suspicious_primary_key")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Allow suspicious `PRIMARY KEY`/`ORDER BY` for MergeTree (i.e. SimpleAggregateFunction).
## allow\_suspicious\_ttl\_expressions[β](https://clickhouse.com/docs/operations/settings/settings#allow_suspicious_ttl_expressions "Direct link to allow_suspicious_ttl_expressions")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Reject TTL expressions that don't depend on any of table's columns. It indicates a user error most of the time.
## allow\_suspicious\_types\_in\_group\_by[β](https://clickhouse.com/docs/operations/settings/settings#allow_suspicious_types_in_group_by "Direct link to allow_suspicious_types_in_group_by")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Allows or restricts using [Variant](https://clickhouse.com/docs/sql-reference/data-types/variant) and [Dynamic](https://clickhouse.com/docs/sql-reference/data-types/dynamic) types in GROUP BY keys.
## allow\_suspicious\_types\_in\_order\_by[β](https://clickhouse.com/docs/operations/settings/settings#allow_suspicious_types_in_order_by "Direct link to allow_suspicious_types_in_order_by")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Allows or restricts using [Variant](https://clickhouse.com/docs/sql-reference/data-types/variant) and [Dynamic](https://clickhouse.com/docs/sql-reference/data-types/dynamic) types in ORDER BY keys.
## allow\_suspicious\_variant\_types[β](https://clickhouse.com/docs/operations/settings/settings#allow_suspicious_variant_types "Direct link to allow_suspicious_variant_types")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
In CREATE TABLE statement allows specifying Variant type with similar variant types (for example, with different numeric or date types). Enabling this setting may introduce some ambiguity when working with values with similar types.
## allow\_unrestricted\_reads\_from\_keeper[β](https://clickhouse.com/docs/operations/settings/settings#allow_unrestricted_reads_from_keeper "Direct link to allow_unrestricted_reads_from_keeper")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Allow unrestricted (without condition on path) reads from system.zookeeper table, can be handy, but is not safe for zookeeper
## alter\_move\_to\_space\_execute\_async[β](https://clickhouse.com/docs/operations/settings/settings#alter_move_to_space_execute_async "Direct link to alter_move_to_space_execute_async")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Execute ALTER TABLE MOVE ... TO \[DISK\|VOLUME\] asynchronously
## alter\_partition\_verbose\_result[β](https://clickhouse.com/docs/operations/settings/settings#alter_partition_verbose_result "Direct link to alter_partition_verbose_result")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Enables or disables the display of information about the parts to which the manipulation operations with partitions and parts have been successfully applied. Applicable to [ATTACH PARTITION\|PART](https://clickhouse.com/docs/sql-reference/statements/alter/partition#attach-partitionpart) and to [FREEZE PARTITION](https://clickhouse.com/docs/sql-reference/statements/alter/partition#freeze-partition).
Possible values:
- 0 β disable verbosity.
- 1 β enable verbosity.
**Example**
```
CREATE TABLE test(a Int64, d Date, s String) ENGINE = MergeTree PARTITION BY toYYYYMDECLARE(d) ORDER BY a;
INSERT INTO test VALUES(1, '2021-01-01', '');
INSERT INTO test VALUES(1, '2021-01-01', '');
ALTER TABLE test DETACH PARTITION ID '202101';
ALTER TABLE test ATTACH PARTITION ID '202101' SETTINGS alter_partition_verbose_result = 1;
ββcommand_typeββββββ¬βpartition_idββ¬βpart_nameβββββ¬βold_part_nameββ
β ATTACH PARTITION β 202101 β 202101_7_7_0 β 202101_5_5_0 β
β ATTACH PARTITION β 202101 β 202101_8_8_0 β 202101_6_6_0 β
ββββββββββββββββββββ΄βββββββββββββββ΄βββββββββββββββ΄ββββββββββββββββ
ALTER TABLE test FREEZE SETTINGS alter_partition_verbose_result = 1;
ββcommand_typeββ¬βpartition_idββ¬βpart_nameβββββ¬βbackup_nameββ¬βbackup_pathββββββββββββββββββββ¬βpart_backup_pathβββββββββββββββββββββββββββββββββββββββββββββ
β FREEZE ALL β 202101 β 202101_7_7_0 β 8 β /var/lib/clickhouse/shadow/8/ β /var/lib/clickhouse/shadow/8/data/default/test/202101_7_7_0 β
β FREEZE ALL β 202101 β 202101_8_8_0 β 8 β /var/lib/clickhouse/shadow/8/ β /var/lib/clickhouse/shadow/8/data/default/test/202101_8_8_0 β
ββββββββββββββββ΄βββββββββββββββ΄βββββββββββββββ΄ββββββββββββββ΄ββββββββββββββββββββββββββββββββ΄ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
```
## alter\_sync[β](https://clickhouse.com/docs/operations/settings/settings#alter_sync "Direct link to alter_sync")
**Aliases**: `replication_alter_partitions_sync`
| Type | Default value |
|---|---|
| TypeUInt64 | Default value1 |
Allows you to specify the wait behavior for actions that are to be executed on replicas by [`ALTER`](https://clickhouse.com/docs/sql-reference/statements/alter), [`OPTIMIZE`](https://clickhouse.com/docs/sql-reference/statements/optimize) or [`TRUNCATE`](https://clickhouse.com/docs/sql-reference/statements/truncate) queries.
Possible values:
- `0` β Do not wait.
- `1` β Wait for own execution.
- `2` β Wait for everyone.
- `3` - Only wait for active replicas.
Cloud default value: `0`.
Note
`alter_sync` is applicable to `Replicated` and `SharedMergeTree` tables only, it does nothing to alter non `Replicated` or `Shared` tables.
## alter\_update\_mode[β](https://clickhouse.com/docs/operations/settings/settings#alter_update_mode "Direct link to alter_update_mode")
| Type | Default value |
|---|---|
| TypeAlterUpdateMode | Default valueheavy |
A mode for `ALTER` queries that have the `UPDATE` commands.
Possible values:
- `heavy` - run regular mutation.
- `lightweight` - run lightweight update if possible, run regular mutation otherwise.
- `lightweight_force` - run lightweight update if possible, throw otherwise.
## analyze\_index\_with\_space\_filling\_curves[β](https://clickhouse.com/docs/operations/settings/settings#analyze_index_with_space_filling_curves "Direct link to analyze_index_with_space_filling_curves")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
If a table has a space-filling curve in its index, e.g. `ORDER BY mortonEncode(x, y)` or `ORDER BY hilbertEncode(x, y)`, and the query has conditions on its arguments, e.g. `x >= 10 AND x <= 20 AND y >= 20 AND y <= 30`, use the space-filling curve for index analysis.
## analyzer\_compatibility\_allow\_compound\_identifiers\_in\_unflatten\_nested[β](https://clickhouse.com/docs/operations/settings/settings#analyzer_compatibility_allow_compound_identifiers_in_unflatten_nested "Direct link to analyzer_compatibility_allow_compound_identifiers_in_unflatten_nested")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Allow to add compound identifiers to nested. This is a compatibility setting because it changes the query result. When disabled, `SELECT a.b.c FROM table ARRAY JOIN a` does not work, and `SELECT a FROM table` does not include `a.b.c` column into `Nested a` result.
## analyzer\_compatibility\_join\_using\_top\_level\_identifier[β](https://clickhouse.com/docs/operations/settings/settings#analyzer_compatibility_join_using_top_level_identifier "Direct link to analyzer_compatibility_join_using_top_level_identifier")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Force to resolve identifier in JOIN USING from projection (for example, in `SELECT a + 1 AS b FROM t1 JOIN t2 USING (b)` join will be performed by `t1.a + 1 = t2.b`, rather then `t1.b = t2.b`).
## analyzer\_inline\_views[β](https://clickhouse.com/docs/operations/settings/settings#analyzer_inline_views "Direct link to analyzer_inline_views")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
When enabled, the analyzer substitutes ordinary (non-materialized, non-parameterized) views with their defining subqueries, enabling cross-boundary optimizations such as predicate pushdown and column pruning.
## any\_join\_distinct\_right\_table\_keys[β](https://clickhouse.com/docs/operations/settings/settings#any_join_distinct_right_table_keys "Direct link to any_join_distinct_right_table_keys")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Enables legacy ClickHouse server behaviour in `ANY INNER|LEFT JOIN` operations.
Note
Use this setting only for backward compatibility if your use cases depend on legacy `JOIN` behaviour.
When the legacy behaviour is enabled:
- Results of `t1 ANY LEFT JOIN t2` and `t2 ANY RIGHT JOIN t1` operations are not equal because ClickHouse uses the logic with many-to-one left-to-right table keys mapping.
- Results of `ANY INNER JOIN` operations contain all rows from the left table like the `SEMI LEFT JOIN` operations do.
When the legacy behaviour is disabled:
- Results of `t1 ANY LEFT JOIN t2` and `t2 ANY RIGHT JOIN t1` operations are equal because ClickHouse uses the logic which provides one-to-many keys mapping in `ANY RIGHT JOIN` operations.
- Results of `ANY INNER JOIN` operations contain one row per key from both the left and right tables.
Possible values:
- 0 β Legacy behaviour is disabled.
- 1 β Legacy behaviour is enabled.
See also:
- [JOIN strictness](https://clickhouse.com/docs/sql-reference/statements/select/join#settings)
## apply\_deleted\_mask[β](https://clickhouse.com/docs/operations/settings/settings#apply_deleted_mask "Direct link to apply_deleted_mask")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Enables filtering out rows deleted with lightweight DELETE. If disabled, a query will be able to read those rows. This is useful for debugging and "undelete" scenarios
## apply\_mutations\_on\_fly[β](https://clickhouse.com/docs/operations/settings/settings#apply_mutations_on_fly "Direct link to apply_mutations_on_fly")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
If true, mutations (UPDATEs and DELETEs) which are not materialized in data part will be applied on SELECTs.
## apply\_patch\_parts[β](https://clickhouse.com/docs/operations/settings/settings#apply_patch_parts "Direct link to apply_patch_parts")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
If true, patch parts (that represent lightweight updates) are applied on SELECTs.
## apply\_patch\_parts\_join\_cache\_buckets[β](https://clickhouse.com/docs/operations/settings/settings#apply_patch_parts_join_cache_buckets "Direct link to apply_patch_parts_join_cache_buckets")
| Type | Default value |
|---|---|
| TypeNonZeroUInt64 | Default value8 |
The number of buckets in the temporary cache for applying patch parts in Join mode.
## apply\_prewhere\_after\_final[β](https://clickhouse.com/docs/operations/settings/settings#apply_prewhere_after_final "Direct link to apply_prewhere_after_final")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
When enabled, PREWHERE conditions are applied after FINAL processing for ReplacingMergeTree and similar engines. This can be useful when PREWHERE references columns that may have different values across duplicate rows, and you want FINAL to select the winning row before filtering. When disabled, PREWHERE is applied during reading. Note: If apply\_row\_level\_security\_after\_final is enabled and row policy uses non-sorting-key columns, PREWHERE will also be deferred to maintain correct execution order (row policy must be applied before PREWHERE).
## apply\_row\_policy\_after\_final[β](https://clickhouse.com/docs/operations/settings/settings#apply_row_policy_after_final "Direct link to apply_row_policy_after_final")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
When enabled, row policies and PREWHERE are applied after FINAL processing for \*MergeTree tables. (Especially for ReplacingMergeTree) When disabled, row policies are applied before FINAL, which can cause different results when the policy filters out rows that should be used for deduplication in ReplacingMergeTree or similar engines.
If the row policy expression depends only on columns in ORDER BY, it will still be applied before FINAL as an optimization, since such filtering cannot affect the deduplication result.
Possible values:
- 0 β Row policy and PREWHERE are applied before FINAL (default).
- 1 β Row policy and PREWHERE are applied after FINAL.
## apply\_settings\_from\_server[β](https://clickhouse.com/docs/operations/settings/settings#apply_settings_from_server "Direct link to apply_settings_from_server")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Whether the client should accept settings from server.
This only affects operations performed on the client side, in particular parsing the INSERT input data and formatting the query result. Most of query execution happens on the server and is not affected by this setting.
Normally this setting should be set in user profile (users.xml or queries like `ALTER USER`), not through the client (client command line arguments, `SET` query, or `SETTINGS` section of `SELECT` query). Through the client it can be changed to false, but can't be changed to true (because the server won't send the settings if user profile has `apply_settings_from_server = false`).
Note that initially (24.12) there was a server setting (`send_settings_to_client`), but latter it got replaced with this client setting, for better usability.
## archive\_adaptive\_buffer\_max\_size\_bytes[β](https://clickhouse.com/docs/operations/settings/settings#archive_adaptive_buffer_max_size_bytes "Direct link to archive_adaptive_buffer_max_size_bytes")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value8388608 |
Limits the maximum size of the adaptive buffer used when writing to archive files (for example, tar archives
## arrow\_flight\_request\_descriptor\_type[β](https://clickhouse.com/docs/operations/settings/settings#arrow_flight_request_descriptor_type "Direct link to arrow_flight_request_descriptor_type")
| Type | Default value |
|---|---|
| TypeArrowFlightDescriptorType | Default valuepath |
Type of descriptor to use for Arrow Flight requests. 'path' sends the dataset name as a path descriptor. 'command' sends a SQL query as a command descriptor (required for Dremio).
Possible values:
- 'path' β Use FlightDescriptor::Path (default, works with most Arrow Flight servers)
- 'command' β Use FlightDescriptor::Command with a SELECT query (required for Dremio)
## ast\_fuzzer\_any\_query[β](https://clickhouse.com/docs/operations/settings/settings#ast_fuzzer_any_query "Direct link to ast_fuzzer_any_query")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
When false (default), the server-side AST fuzzer (controlled by `ast_fuzzer_runs`) only fuzzes read-only queries (SELECT, EXPLAIN, SHOW, DESCRIBE, EXISTS). When true, all query types including DDL and INSERT are fuzzed.
## ast\_fuzzer\_runs[β](https://clickhouse.com/docs/operations/settings/settings#ast_fuzzer_runs "Direct link to ast_fuzzer_runs")
| Type | Default value |
|---|---|
| TypeFloat | Default value0 |
Enables the server-side AST fuzzer that runs randomized queries after each normal query, discarding their results.
- 0: disabled (default).
- A value between 0 and 1 (exclusive): probability of running a single fuzzed query.
- A value \>= 1: the number of fuzzed queries to run per normal query.
The fuzzer accumulates AST fragments from all queries across all sessions, producing increasingly interesting mutations over time. Fuzzed queries that fail are silently discarded; results are never returned to the client.
## asterisk\_include\_alias\_columns[β](https://clickhouse.com/docs/operations/settings/settings#asterisk_include_alias_columns "Direct link to asterisk_include_alias_columns")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Include [ALIAS](https://clickhouse.com/docs/sql-reference/statements/create/table#alias) columns for wildcard query (`SELECT *`).
Possible values:
- 0 - disabled
- 1 - enabled
## asterisk\_include\_materialized\_columns[β](https://clickhouse.com/docs/operations/settings/settings#asterisk_include_materialized_columns "Direct link to asterisk_include_materialized_columns")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Include [MATERIALIZED](https://clickhouse.com/docs/sql-reference/statements/create/view#materialized-view) columns for wildcard query (`SELECT *`).
Possible values:
- 0 - disabled
- 1 - enabled
## async\_insert[β](https://clickhouse.com/docs/operations/settings/settings#async_insert "Direct link to async_insert")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
If true, data from INSERT query is stored in queue and later flushed to table in background. If wait\_for\_async\_insert is false, INSERT query is processed almost instantly, otherwise client will wait until data will be flushed to table
## async\_insert\_busy\_timeout\_decrease\_rate[β](https://clickhouse.com/docs/operations/settings/settings#async_insert_busy_timeout_decrease_rate "Direct link to async_insert_busy_timeout_decrease_rate")
| Type | Default value |
|---|---|
| TypeDouble | Default value0\.2 |
The exponential growth rate at which the adaptive asynchronous insert timeout decreases
## async\_insert\_busy\_timeout\_increase\_rate[β](https://clickhouse.com/docs/operations/settings/settings#async_insert_busy_timeout_increase_rate "Direct link to async_insert_busy_timeout_increase_rate")
| Type | Default value |
|---|---|
| TypeDouble | Default value0\.2 |
The exponential growth rate at which the adaptive asynchronous insert timeout increases
## async\_insert\_busy\_timeout\_max\_ms[β](https://clickhouse.com/docs/operations/settings/settings#async_insert_busy_timeout_max_ms "Direct link to async_insert_busy_timeout_max_ms")
**Aliases**: `async_insert_busy_timeout_ms`
| Type | Default value |
|---|---|
| TypeMilliseconds | Default value200 |
Maximum time to wait before dumping collected data per query since the first data appeared.
Cloud default value: `1000` (1s).
## async\_insert\_busy\_timeout\_min\_ms[β](https://clickhouse.com/docs/operations/settings/settings#async_insert_busy_timeout_min_ms "Direct link to async_insert_busy_timeout_min_ms")
| Type | Default value |
|---|---|
| TypeMilliseconds | Default value50 |
If auto-adjusting is enabled through async\_insert\_use\_adaptive\_busy\_timeout, minimum time to wait before dumping collected data per query since the first data appeared. It also serves as the initial value for the adaptive algorithm
## async\_insert\_deduplicate[β](https://clickhouse.com/docs/operations/settings/settings#async_insert_deduplicate "Direct link to async_insert_deduplicate")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
For async INSERT queries in the replicated table, specifies that deduplication of inserting blocks should be performed
## async\_insert\_max\_data\_size[β](https://clickhouse.com/docs/operations/settings/settings#async_insert_max_data_size "Direct link to async_insert_max_data_size")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value10485760 |
Maximum size in bytes of unparsed data collected per query before being inserted
Cloud default value: `104857600` (100 MiB).
## async\_insert\_max\_query\_number[β](https://clickhouse.com/docs/operations/settings/settings#async_insert_max_query_number "Direct link to async_insert_max_query_number")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value450 |
Maximum number of insert queries before being inserted. Only takes effect if setting [`async_insert_deduplicate`](https://clickhouse.com/docs/operations/settings/settings#async_insert_deduplicate) is 1.
## async\_insert\_poll\_timeout\_ms[β](https://clickhouse.com/docs/operations/settings/settings#async_insert_poll_timeout_ms "Direct link to async_insert_poll_timeout_ms")
| Type | Default value |
|---|---|
| TypeMilliseconds | Default value10 |
Timeout for polling data from asynchronous insert queue
## async\_insert\_use\_adaptive\_busy\_timeout[β](https://clickhouse.com/docs/operations/settings/settings#async_insert_use_adaptive_busy_timeout "Direct link to async_insert_use_adaptive_busy_timeout")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
If it is set to true, use adaptive busy timeout for asynchronous inserts
## async\_query\_sending\_for\_remote[β](https://clickhouse.com/docs/operations/settings/settings#async_query_sending_for_remote "Direct link to async_query_sending_for_remote")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Enables asynchronous connection creation and query sending while executing remote query.
Enabled by default.
## async\_socket\_for\_remote[β](https://clickhouse.com/docs/operations/settings/settings#async_socket_for_remote "Direct link to async_socket_for_remote")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Enables asynchronous read from socket while executing remote query.
Enabled by default.
## automatic\_parallel\_replicas\_min\_bytes\_per\_replica[β](https://clickhouse.com/docs/operations/settings/settings#automatic_parallel_replicas_min_bytes_per_replica "Direct link to automatic_parallel_replicas_min_bytes_per_replica")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value1048576 |
Threshold of bytes to read per replica to enable parallel replicas automatically (applies only when `automatic_parallel_replicas_mode`\=1). 0 means no threshold. The total number of bytes to read is estimated based on the collected statistics.
## automatic\_parallel\_replicas\_mode[β](https://clickhouse.com/docs/operations/settings/settings#automatic_parallel_replicas_mode "Direct link to automatic_parallel_replicas_mode")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Enable automatic switching to execution with parallel replicas based on collected statistics. Requires `enable_analyzer = 1`, `enable_parallel_replicas != 0`, `parallel_replicas_local_plan = 1` and providing `cluster_for_parallel_replicas`. 0 - disabled, 1 - enabled, 2 - only statistics collection is enabled (switching to execution with parallel replicas is disabled).
## azure\_allow\_parallel\_part\_upload[β](https://clickhouse.com/docs/operations/settings/settings#azure_allow_parallel_part_upload "Direct link to azure_allow_parallel_part_upload")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Use multiple threads for azure multipart upload.
## azure\_check\_objects\_after\_upload[β](https://clickhouse.com/docs/operations/settings/settings#azure_check_objects_after_upload "Direct link to azure_check_objects_after_upload")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Check each uploaded object in azure blob storage to be sure that upload was successful
## azure\_connect\_timeout\_ms[β](https://clickhouse.com/docs/operations/settings/settings#azure_connect_timeout_ms "Direct link to azure_connect_timeout_ms")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value1000 |
Connection timeout for host from azure disks.
## azure\_create\_new\_file\_on\_insert[β](https://clickhouse.com/docs/operations/settings/settings#azure_create_new_file_on_insert "Direct link to azure_create_new_file_on_insert")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Enables or disables creating a new file on each insert in azure engine tables
## azure\_ignore\_file\_doesnt\_exist[β](https://clickhouse.com/docs/operations/settings/settings#azure_ignore_file_doesnt_exist "Direct link to azure_ignore_file_doesnt_exist")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Ignore absence of file if it does not exist when reading certain keys.
Possible values:
- 1 β `SELECT` returns empty result.
- 0 β `SELECT` throws an exception.
## azure\_list\_object\_keys\_size[β](https://clickhouse.com/docs/operations/settings/settings#azure_list_object_keys_size "Direct link to azure_list_object_keys_size")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value1000 |
Maximum number of files that could be returned in batch by ListObject request
## azure\_max\_blocks\_in\_multipart\_upload[β](https://clickhouse.com/docs/operations/settings/settings#azure_max_blocks_in_multipart_upload "Direct link to azure_max_blocks_in_multipart_upload")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value50000 |
Maximum number of blocks in multipart upload for Azure.
## azure\_max\_get\_burst[β](https://clickhouse.com/docs/operations/settings/settings#azure_max_get_burst "Direct link to azure_max_get_burst")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Max number of requests that can be issued simultaneously before hitting request per second limit. By default (0) equals to `azure_max_get_rps`
## azure\_max\_get\_rps[β](https://clickhouse.com/docs/operations/settings/settings#azure_max_get_rps "Direct link to azure_max_get_rps")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Limit on Azure GET request per second rate before throttling. Zero means unlimited.
## azure\_max\_inflight\_parts\_for\_one\_file[β](https://clickhouse.com/docs/operations/settings/settings#azure_max_inflight_parts_for_one_file "Direct link to azure_max_inflight_parts_for_one_file")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value20 |
The maximum number of a concurrent loaded parts in multipart upload request. 0 means unlimited.
## azure\_max\_put\_burst[β](https://clickhouse.com/docs/operations/settings/settings#azure_max_put_burst "Direct link to azure_max_put_burst")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Max number of requests that can be issued simultaneously before hitting request per second limit. By default (0) equals to `azure_max_put_rps`
## azure\_max\_put\_rps[β](https://clickhouse.com/docs/operations/settings/settings#azure_max_put_rps "Direct link to azure_max_put_rps")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Limit on Azure PUT request per second rate before throttling. Zero means unlimited.
## azure\_max\_redirects[β](https://clickhouse.com/docs/operations/settings/settings#azure_max_redirects "Direct link to azure_max_redirects")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value10 |
Max number of azure redirects hops allowed.
## azure\_max\_single\_part\_copy\_size[β](https://clickhouse.com/docs/operations/settings/settings#azure_max_single_part_copy_size "Direct link to azure_max_single_part_copy_size")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value268435456 |
The maximum size of object to copy using single part copy to Azure blob storage.
## azure\_max\_single\_part\_upload\_size[β](https://clickhouse.com/docs/operations/settings/settings#azure_max_single_part_upload_size "Direct link to azure_max_single_part_upload_size")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value33554432 |
The maximum size of object to upload using singlepart upload to Azure blob storage.
## azure\_max\_single\_read\_retries[β](https://clickhouse.com/docs/operations/settings/settings#azure_max_single_read_retries "Direct link to azure_max_single_read_retries")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value4 |
The maximum number of retries during single Azure blob storage read.
## azure\_max\_unexpected\_write\_error\_retries[β](https://clickhouse.com/docs/operations/settings/settings#azure_max_unexpected_write_error_retries "Direct link to azure_max_unexpected_write_error_retries")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value4 |
The maximum number of retries in case of unexpected errors during Azure blob storage write
## azure\_max\_upload\_part\_size[β](https://clickhouse.com/docs/operations/settings/settings#azure_max_upload_part_size "Direct link to azure_max_upload_part_size")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value5368709120 |
The maximum size of part to upload during multipart upload to Azure blob storage.
## azure\_min\_upload\_part\_size[β](https://clickhouse.com/docs/operations/settings/settings#azure_min_upload_part_size "Direct link to azure_min_upload_part_size")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value16777216 |
The minimum size of part to upload during multipart upload to Azure blob storage.
## azure\_request\_timeout\_ms[β](https://clickhouse.com/docs/operations/settings/settings#azure_request_timeout_ms "Direct link to azure_request_timeout_ms")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value30000 |
Idleness timeout for sending and receiving data to/from azure. Fail if a single TCP read or write call blocks for this long.
## azure\_sdk\_max\_retries[β](https://clickhouse.com/docs/operations/settings/settings#azure_sdk_max_retries "Direct link to azure_sdk_max_retries")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value10 |
Maximum number of retries in azure sdk
## azure\_sdk\_retry\_initial\_backoff\_ms[β](https://clickhouse.com/docs/operations/settings/settings#azure_sdk_retry_initial_backoff_ms "Direct link to azure_sdk_retry_initial_backoff_ms")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value10 |
Minimal backoff between retries in azure sdk
## azure\_sdk\_retry\_max\_backoff\_ms[β](https://clickhouse.com/docs/operations/settings/settings#azure_sdk_retry_max_backoff_ms "Direct link to azure_sdk_retry_max_backoff_ms")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value1000 |
Maximal backoff between retries in azure sdk
## azure\_skip\_empty\_files[β](https://clickhouse.com/docs/operations/settings/settings#azure_skip_empty_files "Direct link to azure_skip_empty_files")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Enables or disables skipping empty files in S3 engine.
Possible values:
- 0 β `SELECT` throws an exception if empty file is not compatible with requested format.
- 1 β `SELECT` returns empty result for empty file.
## azure\_strict\_upload\_part\_size[β](https://clickhouse.com/docs/operations/settings/settings#azure_strict_upload_part_size "Direct link to azure_strict_upload_part_size")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
The exact size of part to upload during multipart upload to Azure blob storage.
## azure\_throw\_on\_zero\_files\_match[β](https://clickhouse.com/docs/operations/settings/settings#azure_throw_on_zero_files_match "Direct link to azure_throw_on_zero_files_match")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Throw an error if matched zero files according to glob expansion rules.
Possible values:
- 1 β `SELECT` throws an exception.
- 0 β `SELECT` returns empty result.
## azure\_truncate\_on\_insert[β](https://clickhouse.com/docs/operations/settings/settings#azure_truncate_on_insert "Direct link to azure_truncate_on_insert")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Enables or disables truncate before insert in azure engine tables.
## azure\_upload\_part\_size\_multiply\_factor[β](https://clickhouse.com/docs/operations/settings/settings#azure_upload_part_size_multiply_factor "Direct link to azure_upload_part_size_multiply_factor")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value2 |
Multiply azure\_min\_upload\_part\_size by this factor each time azure\_multiply\_parts\_count\_threshold parts were uploaded from a single write to Azure blob storage.
## azure\_upload\_part\_size\_multiply\_parts\_count\_threshold[β](https://clickhouse.com/docs/operations/settings/settings#azure_upload_part_size_multiply_parts_count_threshold "Direct link to azure_upload_part_size_multiply_parts_count_threshold")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value500 |
Each time this number of parts was uploaded to Azure blob storage, azure\_min\_upload\_part\_size is multiplied by azure\_upload\_part\_size\_multiply\_factor.
## azure\_use\_adaptive\_timeouts[β](https://clickhouse.com/docs/operations/settings/settings#azure_use_adaptive_timeouts "Direct link to azure_use_adaptive_timeouts")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
When set to `true` than for all azure requests first two attempts are made with low send and receive timeouts. When set to `false` than all attempts are made with identical timeouts.
## backup\_restore\_batch\_size\_for\_keeper\_multi[β](https://clickhouse.com/docs/operations/settings/settings#backup_restore_batch_size_for_keeper_multi "Direct link to backup_restore_batch_size_for_keeper_multi")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value1000 |
Maximum size of batch for multi request to \[Zoo\]Keeper during backup or restore
## backup\_restore\_batch\_size\_for\_keeper\_multiread[β](https://clickhouse.com/docs/operations/settings/settings#backup_restore_batch_size_for_keeper_multiread "Direct link to backup_restore_batch_size_for_keeper_multiread")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value10000 |
Maximum size of batch for multiread request to \[Zoo\]Keeper during backup or restore
## backup\_restore\_failure\_after\_host\_disconnected\_for\_seconds[β](https://clickhouse.com/docs/operations/settings/settings#backup_restore_failure_after_host_disconnected_for_seconds "Direct link to backup_restore_failure_after_host_disconnected_for_seconds")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value3600 |
If a host during a BACKUP ON CLUSTER or RESTORE ON CLUSTER operation doesn't recreate its ephemeral 'alive' node in ZooKeeper for this amount of time then the whole backup or restore is considered as failed. This value should be bigger than any reasonable time for a host to reconnect to ZooKeeper after a failure. Zero means unlimited.
## backup\_restore\_finish\_timeout\_after\_error\_sec[β](https://clickhouse.com/docs/operations/settings/settings#backup_restore_finish_timeout_after_error_sec "Direct link to backup_restore_finish_timeout_after_error_sec")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value180 |
How long the initiator should wait for other host to react to the 'error' node and stop their work on the current BACKUP ON CLUSTER or RESTORE ON CLUSTER operation.
## backup\_restore\_keeper\_fault\_injection\_probability[β](https://clickhouse.com/docs/operations/settings/settings#backup_restore_keeper_fault_injection_probability "Direct link to backup_restore_keeper_fault_injection_probability")
| Type | Default value |
|---|---|
| TypeFloat | Default value0 |
Approximate probability of failure for a keeper request during backup or restore. Valid value is in interval \[0.0f, 1.0f\]
## backup\_restore\_keeper\_fault\_injection\_seed[β](https://clickhouse.com/docs/operations/settings/settings#backup_restore_keeper_fault_injection_seed "Direct link to backup_restore_keeper_fault_injection_seed")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
0 - random seed, otherwise the setting value
## backup\_restore\_keeper\_max\_retries[β](https://clickhouse.com/docs/operations/settings/settings#backup_restore_keeper_max_retries "Direct link to backup_restore_keeper_max_retries")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value1000 |
Max retries for \[Zoo\]Keeper operations in the middle of a BACKUP or RESTORE operation. Should be big enough so the whole operation won't fail because of a temporary \[Zoo\]Keeper failure.
## backup\_restore\_keeper\_max\_retries\_while\_handling\_error[β](https://clickhouse.com/docs/operations/settings/settings#backup_restore_keeper_max_retries_while_handling_error "Direct link to backup_restore_keeper_max_retries_while_handling_error")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value20 |
Max retries for \[Zoo\]Keeper operations while handling an error of a BACKUP ON CLUSTER or RESTORE ON CLUSTER operation.
## backup\_restore\_keeper\_max\_retries\_while\_initializing[β](https://clickhouse.com/docs/operations/settings/settings#backup_restore_keeper_max_retries_while_initializing "Direct link to backup_restore_keeper_max_retries_while_initializing")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value20 |
Max retries for \[Zoo\]Keeper operations during the initialization of a BACKUP ON CLUSTER or RESTORE ON CLUSTER operation.
## backup\_restore\_keeper\_retry\_initial\_backoff\_ms[β](https://clickhouse.com/docs/operations/settings/settings#backup_restore_keeper_retry_initial_backoff_ms "Direct link to backup_restore_keeper_retry_initial_backoff_ms")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value100 |
Initial backoff timeout for \[Zoo\]Keeper operations during backup or restore
## backup\_restore\_keeper\_retry\_max\_backoff\_ms[β](https://clickhouse.com/docs/operations/settings/settings#backup_restore_keeper_retry_max_backoff_ms "Direct link to backup_restore_keeper_retry_max_backoff_ms")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value5000 |
Max backoff timeout for \[Zoo\]Keeper operations during backup or restore
Cloud default value: `60000`.
## backup\_restore\_keeper\_value\_max\_size[β](https://clickhouse.com/docs/operations/settings/settings#backup_restore_keeper_value_max_size "Direct link to backup_restore_keeper_value_max_size")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value1048576 |
Maximum size of data of a \[Zoo\]Keeper's node during backup
## backup\_restore\_s3\_retry\_attempts[β](https://clickhouse.com/docs/operations/settings/settings#backup_restore_s3_retry_attempts "Direct link to backup_restore_s3_retry_attempts")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value1000 |
Setting for Aws::Client::RetryStrategy, Aws::Client does retries itself, 0 means no retries. It takes place only for backup/restore.
## backup\_restore\_s3\_retry\_initial\_backoff\_ms[β](https://clickhouse.com/docs/operations/settings/settings#backup_restore_s3_retry_initial_backoff_ms "Direct link to backup_restore_s3_retry_initial_backoff_ms")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value25 |
Initial backoff delay in milliseconds before the first retry attempt during backup and restore. Each subsequent retry increases the delay exponentially, up to the maximum specified by `backup_restore_s3_retry_max_backoff_ms`
## backup\_restore\_s3\_retry\_jitter\_factor[β](https://clickhouse.com/docs/operations/settings/settings#backup_restore_s3_retry_jitter_factor "Direct link to backup_restore_s3_retry_jitter_factor")
| Type | Default value |
|---|---|
| TypeFloat | Default value0\.1 |
Jitter factor applied to the retry backoff delay in Aws::Client::RetryStrategy during backup and restore operations. The computed backoff delay is multiplied by a random factor in the range \[1.0, 1.0 + jitter\], up to the maximum `backup_restore_s3_retry_max_backoff_ms`. Must be in \[0.0, 1.0\] interval
## backup\_restore\_s3\_retry\_max\_backoff\_ms[β](https://clickhouse.com/docs/operations/settings/settings#backup_restore_s3_retry_max_backoff_ms "Direct link to backup_restore_s3_retry_max_backoff_ms")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value5000 |
Maximum delay in milliseconds between retries during backup and restore operations.
## backup\_slow\_all\_threads\_after\_retryable\_s3\_error[β](https://clickhouse.com/docs/operations/settings/settings#backup_slow_all_threads_after_retryable_s3_error "Direct link to backup_slow_all_threads_after_retryable_s3_error")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
When set to `true`, all threads executing S3 requests to the same backup endpoint are slowed down after any single S3 request encounters a retryable S3 error, such as 'Slow Down'. When set to `false`, each thread handles s3 request backoff independently of the others.
## cache\_warmer\_threads[β](https://clickhouse.com/docs/operations/settings/settings#cache_warmer_threads "Direct link to cache_warmer_threads")
ClickHouse Cloud only
| Type | Default value |
|---|---|
| TypeUInt64 | Default value4 |
Only has an effect in ClickHouse Cloud. Number of background threads for speculatively downloading new data parts into the filesystem cache, when [cache\_populated\_by\_fetch](https://clickhouse.com/docs/operations/settings/merge-tree-settings#cache_populated_by_fetch) is enabled. Zero to disable.
## calculate\_text\_stack\_trace[β](https://clickhouse.com/docs/operations/settings/settings#calculate_text_stack_trace "Direct link to calculate_text_stack_trace")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Calculate text stack trace in case of exceptions during query execution. This is the default. It requires symbol lookups that may slow down fuzzing tests when a huge amount of wrong queries are executed. In normal cases, you should not disable this option.
## cancel\_http\_readonly\_queries\_on\_client\_close[β](https://clickhouse.com/docs/operations/settings/settings#cancel_http_readonly_queries_on_client_close "Direct link to cancel_http_readonly_queries_on_client_close")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Cancels HTTP read-only queries (e.g. SELECT) when a client closes the connection without waiting for the response.
Cloud default value: `1`.
## cast\_ipv4\_ipv6\_default\_on\_conversion\_error[β](https://clickhouse.com/docs/operations/settings/settings#cast_ipv4_ipv6_default_on_conversion_error "Direct link to cast_ipv4_ipv6_default_on_conversion_error")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
CAST operator into IPv4, CAST operator into IPV6 type, toIPv4, toIPv6 functions will return default value instead of throwing exception on conversion error.
## cast\_keep\_nullable[β](https://clickhouse.com/docs/operations/settings/settings#cast_keep_nullable "Direct link to cast_keep_nullable")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Enables or disables keeping of the `Nullable` data type in [CAST](https://clickhouse.com/docs/sql-reference/functions/type-conversion-functions#CAST) operations.
When the setting is enabled and the argument of `CAST` function is `Nullable`, the result is also transformed to `Nullable` type. When the setting is disabled, the result always has the destination type exactly.
Possible values:
- 0 β The `CAST` result has exactly the destination type specified.
- 1 β If the argument type is `Nullable`, the `CAST` result is transformed to `Nullable(DestinationDataType)`.
**Examples**
The following query results in the destination data type exactly:
```
SET cast_keep_nullable = 0;
SELECT CAST(toNullable(toInt32(0)) AS Int32) as x, toTypeName(x);
```
Result:
```
ββxββ¬βtoTypeName(CAST(toNullable(toInt32(0)), 'Int32'))ββ
β 0 β Int32 β
βββββ΄ββββββββββββββββββββββββββββββββββββββββββββββββββββ
```
The following query results in the `Nullable` modification on the destination data type:
```
SET cast_keep_nullable = 1;
SELECT CAST(toNullable(toInt32(0)) AS Int32) as x, toTypeName(x);
```
Result:
```
ββxββ¬βtoTypeName(CAST(toNullable(toInt32(0)), 'Int32'))ββ
β 0 β Nullable(Int32) β
βββββ΄ββββββββββββββββββββββββββββββββββββββββββββββββββββ
```
**See Also**
- [CAST](https://clickhouse.com/docs/sql-reference/functions/type-conversion-functions#CAST) functio
## cast\_string\_to\_date\_time\_mode[β](https://clickhouse.com/docs/operations/settings/settings#cast_string_to_date_time_mode "Direct link to cast_string_to_date_time_mode")
| Type | Default value |
|---|---|
| TypeDateTimeInputFormat | Default valuebasic |
Allows choosing a parser of the text representation of date and time during cast from String.
Possible values:
- `'best_effort'` β Enables extended parsing.
ClickHouse can parse the basic `YYYY-MM-DD HH:MM:SS` format and all [ISO 8601](https://en.wikipedia.org/wiki/ISO_8601) date and time formats. For example, `'2018-06-08T01:02:03.000Z'`.
- `'best_effort_us'` β Similar to `best_effort` (see the difference in [parseDateTimeBestEffortUS](https://clickhouse.com/docs/sql-reference/functions/type-conversion-functions#parseDateTimeBestEffortUS)
- `'basic'` β Use basic parser.
ClickHouse can parse only the basic `YYYY-MM-DD HH:MM:SS` or `YYYY-MM-DD` format. For example, `2019-08-20 10:18:56` or `2019-08-20`.
See also:
- [DateTime data type.](https://clickhouse.com/docs/sql-reference/data-types/datetime)
- [Functions for working with dates and times.](https://clickhouse.com/docs/sql-reference/functions/date-time-functions)
## cast\_string\_to\_dynamic\_use\_inference[β](https://clickhouse.com/docs/operations/settings/settings#cast_string_to_dynamic_use_inference "Direct link to cast_string_to_dynamic_use_inference")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Use types inference during String to Dynamic conversio
## cast\_string\_to\_variant\_use\_inference[β](https://clickhouse.com/docs/operations/settings/settings#cast_string_to_variant_use_inference "Direct link to cast_string_to_variant_use_inference")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Use types inference during String to Variant conversion.
## check\_named\_collection\_dependencies[β](https://clickhouse.com/docs/operations/settings/settings#check_named_collection_dependencies "Direct link to check_named_collection_dependencies")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Check that DROP NAMED COLLECTION will not break tables that depend on it
## check\_query\_single\_value\_result[β](https://clickhouse.com/docs/operations/settings/settings#check_query_single_value_result "Direct link to check_query_single_value_result")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Defines the level of detail for the [CHECK TABLE](https://clickhouse.com/docs/sql-reference/statements/check-table) query result for `MergeTree` family engines .
Possible values:
- 0 β the query shows a check status for every individual data part of a table.
- 1 β the query shows the general table check status.
## check\_referential\_table\_dependencies[β](https://clickhouse.com/docs/operations/settings/settings#check_referential_table_dependencies "Direct link to check_referential_table_dependencies")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Check that DDL query (such as DROP TABLE or RENAME) will not break referential dependencies
## check\_table\_dependencies[β](https://clickhouse.com/docs/operations/settings/settings#check_table_dependencies "Direct link to check_table_dependencies")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Check that DDL query (such as DROP TABLE or RENAME) will not break dependencies
## checksum\_on\_read[β](https://clickhouse.com/docs/operations/settings/settings#checksum_on_read "Direct link to checksum_on_read")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Validate checksums on reading. It is enabled by default and should be always enabled in production. Please do not expect any benefits in disabling this setting. It may only be used for experiments and benchmarks. The setting is only applicable for tables of MergeTree family. Checksums are always validated for other table engines and when receiving data over the network.
## cloud\_mode[β](https://clickhouse.com/docs/operations/settings/settings#cloud_mode "Direct link to cloud_mode")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Cloud mode
Cloud default value: `1`.
## cloud\_mode\_database\_engine[β](https://clickhouse.com/docs/operations/settings/settings#cloud_mode_database_engine "Direct link to cloud_mode_database_engine")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value1 |
The database engine allowed in Cloud. 1 - rewrite DDLs to use Replicated database, 2 - rewrite DDLs to use Shared database
Cloud default value: `2`.
## cloud\_mode\_engine[β](https://clickhouse.com/docs/operations/settings/settings#cloud_mode_engine "Direct link to cloud_mode_engine")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value1 |
The engine family allowed in Cloud.
- 0 - allow everything
- 1 - rewrite DDLs to use \*ReplicatedMergeTree
- 2 - rewrite DDLs to use SharedMergeTree
- 3 - rewrite DDLs to use SharedMergeTree except when explicitly passed remote disk is specified
- 4 - same as 3, plus additionally use Alias instead of Distributed (the Alias table will point to the destination table of the Distributed table, so it will use the corresponding local table)
UInt64 to minimize public part
Cloud default value: `2`.
## cluster\_for\_parallel\_replicas[β](https://clickhouse.com/docs/operations/settings/settings#cluster_for_parallel_replicas "Direct link to cluster_for_parallel_replicas")
Cluster for a shard in which current server is located
Cloud default value: `default`.
## cluster\_function\_process\_archive\_on\_multiple\_nodes[β](https://clickhouse.com/docs/operations/settings/settings#cluster_function_process_archive_on_multiple_nodes "Direct link to cluster_function_process_archive_on_multiple_nodes")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
If set to `true`, increases performance of processing archives in cluster functions. Should be set to `false` for compatibility and to avoid errors during upgrade to 25.7+ if using cluster functions with archives on earlier versions.
## cluster\_table\_function\_buckets\_batch\_size[β](https://clickhouse.com/docs/operations/settings/settings#cluster_table_function_buckets_batch_size "Direct link to cluster_table_function_buckets_batch_size")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Defines the approximate size of a batch (in bytes) used in distributed processing of tasks in cluster table functions with `bucket` split granularity. The system accumulates data until at least this amount is reached. The actual size may be slightly larger to align with data boundaries.
## cluster\_table\_function\_split\_granularity[β](https://clickhouse.com/docs/operations/settings/settings#cluster_table_function_split_granularity "Direct link to cluster_table_function_split_granularity")
| Type | Default value |
|---|---|
| TypeObjectStorageGranularityLevel | Default valuefile |
Controls how data is split into tasks when executing a CLUSTER TABLE FUNCTION.
This setting defines the granularity of work distribution across the cluster:
- `file` β each task processes an entire file.
- `bucket` β tasks are created per internal data block within a file (for example, Parquet row groups).
Choosing finer granularity (like `bucket`) can improve parallelism when working with a small number of large files. For instance, if a Parquet file contains multiple row groups, enabling `bucket` granularity allows each group to be processed independently by different workers.
## collect\_hash\_table\_stats\_during\_aggregation[β](https://clickhouse.com/docs/operations/settings/settings#collect_hash_table_stats_during_aggregation "Direct link to collect_hash_table_stats_during_aggregation")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Enable collecting hash table statistics to optimize memory allocatio
## collect\_hash\_table\_stats\_during\_joins[β](https://clickhouse.com/docs/operations/settings/settings#collect_hash_table_stats_during_joins "Direct link to collect_hash_table_stats_during_joins")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Enable collecting hash table statistics to optimize memory allocatio
## compatibility[β](https://clickhouse.com/docs/operations/settings/settings#compatibility "Direct link to compatibility")
The `compatibility` setting causes ClickHouse to use the default settings of a previous version of ClickHouse, where the previous version is provided as the setting.
If settings are set to non-default values, then those settings are honored (only settings that have not been modified are affected by the `compatibility` setting).
This setting takes a ClickHouse version number as a string, like `22.3`, `22.8`. An empty value means that this setting is disabled.
Disabled by default.
Note
In ClickHouse Cloud, the service-level default compatibility setting must be set by ClickHouse Cloud support. Please [open a case](https://clickhouse.cloud/support?glxid=835388a6-b0a4-45b1-adf9-62c7c3ab88fd&pagePath=%2Fdocs%2Foperations%2Fsettings%2Fsettings&origPath=%2Fdocs%2Foperations%2Fsettings%2Fsettings&utm_ga=GA1.1.1511935395.1775990561) to have it set. However, the compatibility setting can be overridden at the user, role, profile, query, or session level using standard ClickHouse setting mechanisms such as `SET compatibility = '22.3'` in a session or `SETTINGS compatibility = '22.3'` in a query.
## compatibility\_ignore\_auto\_increment\_in\_create\_table[β](https://clickhouse.com/docs/operations/settings/settings#compatibility_ignore_auto_increment_in_create_table "Direct link to compatibility_ignore_auto_increment_in_create_table")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Ignore AUTO\_INCREMENT keyword in column declaration if true, otherwise return error. It simplifies migration from MySQL
## compatibility\_ignore\_collation\_in\_create\_table[β](https://clickhouse.com/docs/operations/settings/settings#compatibility_ignore_collation_in_create_table "Direct link to compatibility_ignore_collation_in_create_table")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Compatibility ignore collation in create table
## compatibility\_s3\_presigned\_url\_query\_in\_path[β](https://clickhouse.com/docs/operations/settings/settings#compatibility_s3_presigned_url_query_in_path "Direct link to compatibility_s3_presigned_url_query_in_path")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Compatibility: when enabled, folds pre-signed URL query parameters (e.g. X-Amz-\*) into the S3 key (legacy behavior), so '?' acts as a wildcard in the path. When disabled (default), pre-signed URL query parameters are kept in the URL query to avoid interpreting '?' as a wildcard.
## compile\_aggregate\_expressions[β](https://clickhouse.com/docs/operations/settings/settings#compile_aggregate_expressions "Direct link to compile_aggregate_expressions")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Enables or disables JIT-compilation of aggregate functions to native code. Enabling this setting can improve the performance.
Possible values:
- 0 β Aggregation is done without JIT compilation.
- 1 β Aggregation is done using JIT compilation.
**See Also**
- [min\_count\_to\_compile\_aggregate\_expression](https://clickhouse.com/docs/operations/settings/settings#min_count_to_compile_aggregate_expression)
## compile\_expressions[β](https://clickhouse.com/docs/operations/settings/settings#compile_expressions "Direct link to compile_expressions")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Compile some scalar functions and operators to native code.
## compile\_sort\_description[β](https://clickhouse.com/docs/operations/settings/settings#compile_sort_description "Direct link to compile_sort_description")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Compile sort description to native code.
## connect\_timeout[β](https://clickhouse.com/docs/operations/settings/settings#connect_timeout "Direct link to connect_timeout")
| Type | Default value |
|---|---|
| TypeSeconds | Default value10 |
Connection timeout if there are no replicas.
## connect\_timeout\_with\_failover\_ms[β](https://clickhouse.com/docs/operations/settings/settings#connect_timeout_with_failover_ms "Direct link to connect_timeout_with_failover_ms")
| Type | Default value |
|---|---|
| TypeMilliseconds | Default value1000 |
The timeout in milliseconds for connecting to a remote server for a Distributed table engine, if the 'shard' and 'replica' sections are used in the cluster definition. If unsuccessful, several attempts are made to connect to various replicas.
## connect\_timeout\_with\_failover\_secure\_ms[β](https://clickhouse.com/docs/operations/settings/settings#connect_timeout_with_failover_secure_ms "Direct link to connect_timeout_with_failover_secure_ms")
| Type | Default value |
|---|---|
| TypeMilliseconds | Default value1000 |
Connection timeout for selecting first healthy replica (for secure connections).
## connection\_pool\_max\_wait\_ms[β](https://clickhouse.com/docs/operations/settings/settings#connection_pool_max_wait_ms "Direct link to connection_pool_max_wait_ms")
| Type | Default value |
|---|---|
| TypeMilliseconds | Default value0 |
The wait time in milliseconds for a connection when the connection pool is full.
Possible values:
- Positive integer.
- 0 β Infinite timeout.
## connections\_with\_failover\_max\_tries[β](https://clickhouse.com/docs/operations/settings/settings#connections_with_failover_max_tries "Direct link to connections_with_failover_max_tries")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value3 |
The maximum number of connection attempts with each replica for the Distributed table engine.
## convert\_query\_to\_cnf[β](https://clickhouse.com/docs/operations/settings/settings#convert_query_to_cnf "Direct link to convert_query_to_cnf")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
When set to `true`, a `SELECT` query will be converted to conjuctive normal form (CNF). There are scenarios where rewriting a query in CNF may execute faster (view this [Github issue](https://github.com/ClickHouse/ClickHouse/issues/11749) for an explanation).
For example, notice how the following `SELECT` query is not modified (the default behavior):
```
EXPLAIN SYNTAX
SELECT *
FROM
(
SELECT number AS x
FROM numbers(20)
) AS a
WHERE ((x >= 1) AND (x <= 5)) OR ((x >= 10) AND (x <= 15))
SETTINGS convert_query_to_cnf = false;
```
The result is:
```
ββexplainβββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β SELECT x β
β FROM β
β ( β
β SELECT number AS x β
β FROM numbers(20) β
β WHERE ((x >= 1) AND (x <= 5)) OR ((x >= 10) AND (x <= 15)) β
β ) AS a β
β WHERE ((x >= 1) AND (x <= 5)) OR ((x >= 10) AND (x <= 15)) β
β SETTINGS convert_query_to_cnf = 0 β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
```
Let's set `convert_query_to_cnf` to `true` and see what changes:
```
EXPLAIN SYNTAX
SELECT *
FROM
(
SELECT number AS x
FROM numbers(20)
) AS a
WHERE ((x >= 1) AND (x <= 5)) OR ((x >= 10) AND (x <= 15))
SETTINGS convert_query_to_cnf = true;
```
Notice the `WHERE` clause is rewritten in CNF, but the result set is the identical - the Boolean logic is unchanged:
```
ββexplainββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β SELECT x β
β FROM β
β ( β
β SELECT number AS x β
β FROM numbers(20) β
β WHERE ((x <= 15) OR (x <= 5)) AND ((x <= 15) OR (x >= 1)) AND ((x >= 10) OR (x <= 5)) AND ((x >= 10) OR (x >= 1)) β
β ) AS a β
β WHERE ((x >= 10) OR (x >= 1)) AND ((x >= 10) OR (x <= 5)) AND ((x <= 15) OR (x >= 1)) AND ((x <= 15) OR (x <= 5)) β
β SETTINGS convert_query_to_cnf = 1 β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
```
Possible values: true, false
| Type | Default value |
|---|---|
| TypeDecorrelationJoinKind | Default valueright |
Controls the kind of joins in the decorrelated query plan. The default value is `right`, which means that decorrelated plan will contain RIGHT JOINs with subquery input on the right side.
Possible values:
- `left` - Decorrelation process will produce LEFT JOINs and input table will appear on the left side.
- `right` - Decorrelation process will produce RIGHT JOINs and input table will appear on the right side.
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Use filter expressions to inference equivalent expressions and substitute them instead of creating a CROSS JOIN.
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Use in-memory buffer for correlated subquery input to avoid its repeated evaluation.
## count\_distinct\_implementation[β](https://clickhouse.com/docs/operations/settings/settings#count_distinct_implementation "Direct link to count_distinct_implementation")
| Type | Default value |
|---|---|
| TypeString | Default valueuniqExact |
Specifies which of the `uniq*` functions should be used to perform the [COUNT(DISTINCT ...)](https://clickhouse.com/docs/sql-reference/aggregate-functions/reference/count) construction.
Possible values:
- [uniq](https://clickhouse.com/docs/sql-reference/aggregate-functions/reference/uniq)
- [uniqCombined](https://clickhouse.com/docs/sql-reference/aggregate-functions/reference/uniqcombined)
- [uniqCombined64](https://clickhouse.com/docs/sql-reference/aggregate-functions/reference/uniqcombined64)
- [uniqHLL12](https://clickhouse.com/docs/sql-reference/aggregate-functions/reference/uniqhll12)
- [uniqExact](https://clickhouse.com/docs/sql-reference/aggregate-functions/reference/uniqexact)
## count\_distinct\_optimization[β](https://clickhouse.com/docs/operations/settings/settings#count_distinct_optimization "Direct link to count_distinct_optimization")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Rewrite count distinct to subquery of group by
## count\_matches\_stop\_at\_empty\_match[β](https://clickhouse.com/docs/operations/settings/settings#count_matches_stop_at_empty_match "Direct link to count_matches_stop_at_empty_match")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Stop counting once a pattern matches zero-length in the `countMatches` function.
## create\_if\_not\_exists[β](https://clickhouse.com/docs/operations/settings/settings#create_if_not_exists "Direct link to create_if_not_exists")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Enable `IF NOT EXISTS` for `CREATE` statement by default. If either this setting or `IF NOT EXISTS` is specified and a table with the provided name already exists, no exception will be thrown.
## create\_index\_ignore\_unique[β](https://clickhouse.com/docs/operations/settings/settings#create_index_ignore_unique "Direct link to create_index_ignore_unique")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Ignore UNIQUE keyword in CREATE UNIQUE INDEX. Made for SQL compatibility tests.
## create\_replicated\_merge\_tree\_fault\_injection\_probability[β](https://clickhouse.com/docs/operations/settings/settings#create_replicated_merge_tree_fault_injection_probability "Direct link to create_replicated_merge_tree_fault_injection_probability")
| Type | Default value |
|---|---|
| TypeFloat | Default value0 |
The probability of a fault injection during table creation after creating metadata in ZooKeeper
## create\_table\_empty\_primary\_key\_by\_default[β](https://clickhouse.com/docs/operations/settings/settings#create_table_empty_primary_key_by_default "Direct link to create_table_empty_primary_key_by_default")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Allow to create \*MergeTree tables with empty primary key when ORDER BY and PRIMARY KEY not specified
## cross\_join\_min\_bytes\_to\_compress[β](https://clickhouse.com/docs/operations/settings/settings#cross_join_min_bytes_to_compress "Direct link to cross_join_min_bytes_to_compress")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value1073741824 |
Minimal size of block to compress in CROSS JOIN. Zero value means - disable this threshold. This block is compressed when any of the two thresholds (by rows or by bytes) are reached.
## cross\_join\_min\_rows\_to\_compress[β](https://clickhouse.com/docs/operations/settings/settings#cross_join_min_rows_to_compress "Direct link to cross_join_min_rows_to_compress")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value10000000 |
Minimal count of rows to compress block in CROSS JOIN. Zero value means - disable this threshold. This block is compressed when any of the two thresholds (by rows or by bytes) are reached.
## cross\_to\_inner\_join\_rewrite[β](https://clickhouse.com/docs/operations/settings/settings#cross_to_inner_join_rewrite "Direct link to cross_to_inner_join_rewrite")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value1 |
Use inner join instead of comma/cross join if there are joining expressions in the WHERE section. Values: 0 - no rewrite, 1 - apply if possible for comma/cross, 2 - force rewrite all comma joins, cross - if possible
## data\_type\_default\_nullable[β](https://clickhouse.com/docs/operations/settings/settings#data_type_default_nullable "Direct link to data_type_default_nullable")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Allows data types without explicit modifiers [NULL or NOT NULL](https://clickhouse.com/docs/sql-reference/statements/create/table#null-or-not-null-modifiers) in column definition will be [Nullable](https://clickhouse.com/docs/sql-reference/data-types/nullable).
Possible values:
- 1 β The data types in column definitions are set to `Nullable` by default.
- 0 β The data types in column definitions are set to not `Nullable` by default.
## database\_atomic\_wait\_for\_drop\_and\_detach\_synchronously[β](https://clickhouse.com/docs/operations/settings/settings#database_atomic_wait_for_drop_and_detach_synchronously "Direct link to database_atomic_wait_for_drop_and_detach_synchronously")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Adds a modifier `SYNC` to all `DROP` and `DETACH` queries.
Possible values:
- 0 β Queries will be executed with delay.
- 1 β Queries will be executed without delay.
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Either to throw error or not if we don't have rights to get table's metadata in database engine DataLakeCatalog.
## database\_replicated\_allow\_explicit\_uuid[β](https://clickhouse.com/docs/operations/settings/settings#database_replicated_allow_explicit_uuid "Direct link to database_replicated_allow_explicit_uuid")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
0 - Don't allow to explicitly specify UUIDs for tables in Replicated databases. 1 - Allow. 2 - Allow, but ignore the specified UUID and generate a random one instead.
## database\_replicated\_allow\_heavy\_create[β](https://clickhouse.com/docs/operations/settings/settings#database_replicated_allow_heavy_create "Direct link to database_replicated_allow_heavy_create")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Allow long-running DDL queries (CREATE AS SELECT and POPULATE) in Replicated database engine. Note that it can block DDL queue for a long time.
## database\_replicated\_allow\_only\_replicated\_engine[β](https://clickhouse.com/docs/operations/settings/settings#database_replicated_allow_only_replicated_engine "Direct link to database_replicated_allow_only_replicated_engine")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Allow to create only Replicated tables in database with engine Replicated
Cloud default value: `1`.
## database\_replicated\_allow\_replicated\_engine\_arguments[β](https://clickhouse.com/docs/operations/settings/settings#database_replicated_allow_replicated_engine_arguments "Direct link to database_replicated_allow_replicated_engine_arguments")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
0 - Don't allow to explicitly specify ZooKeeper path and replica name for \*MergeTree tables in Replicated databases. 1 - Allow. 2 - Allow, but ignore the specified path and use default one instead. 3 - Allow and don't log a warning.
## database\_replicated\_always\_detach\_permanently[β](https://clickhouse.com/docs/operations/settings/settings#database_replicated_always_detach_permanently "Direct link to database_replicated_always_detach_permanently")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Execute DETACH TABLE as DETACH TABLE PERMANENTLY if database engine is Replicated
## database\_replicated\_enforce\_synchronous\_settings[β](https://clickhouse.com/docs/operations/settings/settings#database_replicated_enforce_synchronous_settings "Direct link to database_replicated_enforce_synchronous_settings")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Enforces synchronous waiting for some queries (see also database\_atomic\_wait\_for\_drop\_and\_detach\_synchronously, mutations\_sync, alter\_sync). Not recommended to enable these settings.
## database\_replicated\_initial\_query\_timeout\_sec[β](https://clickhouse.com/docs/operations/settings/settings#database_replicated_initial_query_timeout_sec "Direct link to database_replicated_initial_query_timeout_sec")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value300 |
Sets how long initial DDL query should wait for Replicated database to process previous DDL queue entries in seconds.
Possible values:
- Positive integer.
- 0 β Unlimited.
| Type | Default value |
|---|---|
| TypeUInt64 | Default value28800 |
The delay in seconds before a dropped table is actually removed from a Shared database. This allows to recover the table within this time using `UNDROP TABLE` statement.
## decimal\_check\_overflow[β](https://clickhouse.com/docs/operations/settings/settings#decimal_check_overflow "Direct link to decimal_check_overflow")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Check overflow of decimal arithmetic/comparison operations
## deduplicate\_blocks\_in\_dependent\_materialized\_views[β](https://clickhouse.com/docs/operations/settings/settings#deduplicate_blocks_in_dependent_materialized_views "Direct link to deduplicate_blocks_in_dependent_materialized_views")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Enables or disables the deduplication check for materialized views that receive data from Replicated\* tables.
Possible values:
0 β Disabled. 1 β Enabled.
When enabled, ClickHouse performs deduplication of blocks in materialized views that depend on Replicated\* tables. This setting is useful for ensuring that materialized views do not contain duplicate data when the insertion operation is being retried due to a failure.
**See Also**
- [NULL Processing in IN Operators](https://clickhouse.com/docs/guides/developer/deduplicating-inserts-on-retries#insert-deduplication-with-materialized-views)
## deduplicate\_insert[β](https://clickhouse.com/docs/operations/settings/settings#deduplicate_insert "Direct link to deduplicate_insert")
| Type | Default value |
|---|---|
| TypeDeduplicateInsertMode | Default valueenable |
Enables or disables block deduplication of `INSERT INTO` (for Replicated\* tables). The setting overrides `insert_deduplicate` and `async_insert_deduplicate` settings. That setting has three possible values:
- disable β Deduplication is disabled for `INSERT INTO` query.
- enable β Deduplication is enabled for `INSERT INTO` query.
- backward\_compatible\_choice β Deduplication is enabled if `insert_deduplicate` or `async_insert_deduplicate` are enabled for specific insert type.
## deduplicate\_insert\_select[β](https://clickhouse.com/docs/operations/settings/settings#deduplicate_insert_select "Direct link to deduplicate_insert_select")
| Type | Default value |
|---|---|
| TypeDeduplicateInsertSelectMode | Default valueenable\_when\_possible |
Enables or disables block deduplication of `INSERT SELECT` (for Replicated\* tables). The setting overrids `insert_deduplicate` and `deduplicate_insert` for `INSERT SELECT` queries. That setting has four possible values:
- disable β Deduplication is disabled for `INSERT SELECT` query.
- force\_enable β Deduplication is enabled for `INSERT SELECT` query. If select result is not stable, exception is thrown.
- enable\_when\_possible β Deduplication is enabled if `insert_deduplicate` is enable and select result is stable, otherwise disabled.
- enable\_even\_for\_bad\_queries - Deduplication is enabled if `insert_deduplicate` is enable. If select result is not stable, warning is logged, but query is executed with deduplication. This option is for backward compatibility. Consider to use other options instead as it may lead to unexpected results.
## default\_materialized\_view\_sql\_security[β](https://clickhouse.com/docs/operations/settings/settings#default_materialized_view_sql_security "Direct link to default_materialized_view_sql_security")
| Type | Default value |
|---|---|
| TypeSQLSecurityType | Default valueDEFINER |
Allows to set a default value for SQL SECURITY option when creating a materialized view. [More about SQL security](https://clickhouse.com/docs/sql-reference/statements/create/view#sql_security).
The default value is `DEFINER`.
## default\_max\_bytes\_in\_join[β](https://clickhouse.com/docs/operations/settings/settings#default_max_bytes_in_join "Direct link to default_max_bytes_in_join")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value1000000000 |
Maximum size of right-side table if limit is required but `max_bytes_in_join` is not set.
## default\_normal\_view\_sql\_security[β](https://clickhouse.com/docs/operations/settings/settings#default_normal_view_sql_security "Direct link to default_normal_view_sql_security")
| Type | Default value |
|---|---|
| TypeSQLSecurityType | Default valueINVOKER |
Allows to set default `SQL SECURITY` option while creating a normal view. [More about SQL security](https://clickhouse.com/docs/sql-reference/statements/create/view#sql_security).
The default value is `INVOKER`.
## default\_table\_engine[β](https://clickhouse.com/docs/operations/settings/settings#default_table_engine "Direct link to default_table_engine")
| Type | Default value |
|---|---|
| TypeDefaultTableEngine | Default valueMergeTree |
Default table engine to use when `ENGINE` is not set in a `CREATE` statement.
Possible values:
- a string representing any valid table engine name
Cloud default value: `SharedMergeTree`.
**Example**
Query:
```
SET default_table_engine = 'Log';
SELECT name, value, changed FROM system.settings WHERE name = 'default_table_engine';
```
Result:
```
ββnameββββββββββββββββββ¬βvalueββ¬βchangedββ
β default_table_engine β Log β 1 β
ββββββββββββββββββββββββ΄ββββββββ΄ββββββββββ
```
In this example, any new table that does not specify an `Engine` will use the `Log` table engine:
Query:
```
CREATE TABLE my_table (
x UInt32,
y UInt32
);
SHOW CREATE TABLE my_table;
```
Result:
```
ββstatementβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β CREATE TABLE default.my_table
(
`x` UInt32,
`y` UInt32
)
ENGINE = Log
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
```
## default\_temporary\_table\_engine[β](https://clickhouse.com/docs/operations/settings/settings#default_temporary_table_engine "Direct link to default_temporary_table_engine")
| Type | Default value |
|---|---|
| TypeDefaultTableEngine | Default valueMemory |
Same as [default\_table\_engine](https://clickhouse.com/docs/operations/settings/settings#default_table_engine) but for temporary tables.
In this example, any new temporary table that does not specify an `Engine` will use the `Log` table engine:
Query:
```
SET default_temporary_table_engine = 'Log';
CREATE TEMPORARY TABLE my_table (
x UInt32,
y UInt32
);
SHOW CREATE TEMPORARY TABLE my_table;
```
Result:
```
ββstatementβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β CREATE TEMPORARY TABLE default.my_table
(
`x` UInt32,
`y` UInt32
)
ENGINE = Log
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
```
## default\_view\_definer[β](https://clickhouse.com/docs/operations/settings/settings#default_view_definer "Direct link to default_view_definer")
| Type | Default value |
|---|---|
| TypeString | Default valueCURRENT\_USER |
Allows to set default `DEFINER` option while creating a view. [More about SQL security](https://clickhouse.com/docs/sql-reference/statements/create/view#sql_security).
The default value is `CURRENT_USER`.
## delta\_lake\_enable\_engine\_predicate[β](https://clickhouse.com/docs/operations/settings/settings#delta_lake_enable_engine_predicate "Direct link to delta_lake_enable_engine_predicate")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Enables delta-kernel internal data pruning.
## delta\_lake\_enable\_expression\_visitor\_logging[β](https://clickhouse.com/docs/operations/settings/settings#delta_lake_enable_expression_visitor_logging "Direct link to delta_lake_enable_expression_visitor_logging")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Enables Test level logs of DeltaLake expression visitor. These logs can be too verbose even for test logging.
## delta\_lake\_insert\_max\_bytes\_in\_data\_file[β](https://clickhouse.com/docs/operations/settings/settings#delta_lake_insert_max_bytes_in_data_file "Direct link to delta_lake_insert_max_bytes_in_data_file")
| Type | Default value |
|---|---|
| TypeNonZeroUInt64 | Default value1073741824 |
Defines a bytes limit for a single inserted data file in delta lake.
## delta\_lake\_insert\_max\_rows\_in\_data\_file[β](https://clickhouse.com/docs/operations/settings/settings#delta_lake_insert_max_rows_in_data_file "Direct link to delta_lake_insert_max_rows_in_data_file")
| Type | Default value |
|---|---|
| TypeNonZeroUInt64 | Default value1000000 |
Defines a rows limit for a single inserted data file in delta lake.
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Enables logging delta lake metadata files into system table.
## delta\_lake\_reload\_schema\_for\_consistency[β](https://clickhouse.com/docs/operations/settings/settings#delta_lake_reload_schema_for_consistency "Direct link to delta_lake_reload_schema_for_consistency")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
If enabled, schema is reloaded from the DeltaLake metadata before each query execution to ensure consistency between the schema used during query analysis and the schema used during execution.
## delta\_lake\_snapshot\_end\_version[β](https://clickhouse.com/docs/operations/settings/settings#delta_lake_snapshot_end_version "Direct link to delta_lake_snapshot_end_version")
| Type | Default value |
|---|---|
| TypeInt64 | Default value\-1 |
End version of delta lake snapshot to read. Value -1 means to read latest version (value 0 is a valid snapshot version).
## delta\_lake\_snapshot\_start\_version[β](https://clickhouse.com/docs/operations/settings/settings#delta_lake_snapshot_start_version "Direct link to delta_lake_snapshot_start_version")
| Type | Default value |
|---|---|
| TypeInt64 | Default value\-1 |
Start version of delta lake snapshot to read. Value -1 means to read latest version (value 0 is a valid snapshot version).
## delta\_lake\_snapshot\_version[β](https://clickhouse.com/docs/operations/settings/settings#delta_lake_snapshot_version "Direct link to delta_lake_snapshot_version")
| Type | Default value |
|---|---|
| TypeInt64 | Default value\-1 |
Version of delta lake snapshot to read. Value -1 means to read latest version (value 0 is a valid snapshot version).
## delta\_lake\_throw\_on\_engine\_predicate\_error[β](https://clickhouse.com/docs/operations/settings/settings#delta_lake_throw_on_engine_predicate_error "Direct link to delta_lake_throw_on_engine_predicate_error")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Enables throwing an exception if there was an error when analyzing scan predicate in delta-kernel.
## describe\_compact\_output[β](https://clickhouse.com/docs/operations/settings/settings#describe_compact_output "Direct link to describe_compact_output")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
If true, include only column names and types into result of DESCRIBE query
## describe\_include\_subcolumns[β](https://clickhouse.com/docs/operations/settings/settings#describe_include_subcolumns "Direct link to describe_include_subcolumns")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Enables describing subcolumns for a [DESCRIBE](https://clickhouse.com/docs/sql-reference/statements/describe-table) query. For example, members of a [Tuple](https://clickhouse.com/docs/sql-reference/data-types/tuple) or subcolumns of a [Map](https://clickhouse.com/docs/sql-reference/data-types/map#reading-subcolumns-of-map), [Nullable](https://clickhouse.com/docs/sql-reference/data-types/nullable#finding-null) or an [Array](https://clickhouse.com/docs/sql-reference/data-types/array#array-size) data type.
Possible values:
- 0 β Subcolumns are not included in `DESCRIBE` queries.
- 1 β Subcolumns are included in `DESCRIBE` queries.
**Example**
See an example for the [DESCRIBE](https://clickhouse.com/docs/sql-reference/statements/describe-table) statement.
## describe\_include\_virtual\_columns[β](https://clickhouse.com/docs/operations/settings/settings#describe_include_virtual_columns "Direct link to describe_include_virtual_columns")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
If true, virtual columns of table will be included into result of DESCRIBE query
## dialect[β](https://clickhouse.com/docs/operations/settings/settings#dialect "Direct link to dialect")
| Type | Default value |
|---|---|
| TypeDialect | Default valueclickhouse |
Which dialect will be used to parse query
## dictionary\_use\_async\_executor[β](https://clickhouse.com/docs/operations/settings/settings#dictionary_use_async_executor "Direct link to dictionary_use_async_executor")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Execute a pipeline for reading dictionary source in several threads. It's supported only by dictionaries with local CLICKHOUSE source.
## dictionary\_validate\_primary\_key\_type[β](https://clickhouse.com/docs/operations/settings/settings#dictionary_validate_primary_key_type "Direct link to dictionary_validate_primary_key_type")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Validate primary key type for dictionaries. By default id type for simple layouts will be implicitly converted to UInt64.
## distinct\_overflow\_mode[β](https://clickhouse.com/docs/operations/settings/settings#distinct_overflow_mode "Direct link to distinct_overflow_mode")
| Type | Default value |
|---|---|
| TypeOverflowMode | Default valuethrow |
Sets what happens when the amount of data exceeds one of the limits.
Possible values:
- `throw`: throw an exception (default).
- `break`: stop executing the query and return the partial result, as if the source data ran out.
## distributed\_aggregation\_memory\_efficient[β](https://clickhouse.com/docs/operations/settings/settings#distributed_aggregation_memory_efficient "Direct link to distributed_aggregation_memory_efficient")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Is the memory-saving mode of distributed aggregation enabled.
## distributed\_background\_insert\_batch[β](https://clickhouse.com/docs/operations/settings/settings#distributed_background_insert_batch "Direct link to distributed_background_insert_batch")
**Aliases**: `distributed_directory_monitor_batch_inserts`
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Enables/disables inserted data sending in batches.
When batch sending is enabled, the [Distributed](https://clickhouse.com/docs/engines/table-engines/special/distributed) table engine tries to send multiple files of inserted data in one operation instead of sending them separately. Batch sending improves cluster performance by better-utilizing server and network resources.
Possible values:
- 1 β Enabled.
- 0 β Disabled.
## distributed\_background\_insert\_max\_sleep\_time\_ms[β](https://clickhouse.com/docs/operations/settings/settings#distributed_background_insert_max_sleep_time_ms "Direct link to distributed_background_insert_max_sleep_time_ms")
**Aliases**: `distributed_directory_monitor_max_sleep_time_ms`
| Type | Default value |
|---|---|
| TypeMilliseconds | Default value30000 |
Maximum interval for the [Distributed](https://clickhouse.com/docs/engines/table-engines/special/distributed) table engine to send data. Limits exponential growth of the interval set in the [distributed\_background\_insert\_sleep\_time\_ms](https://clickhouse.com/docs/operations/settings/settings#distributed_background_insert_sleep_time_ms) setting.
Possible values:
- A positive integer number of milliseconds.
## distributed\_background\_insert\_sleep\_time\_ms[β](https://clickhouse.com/docs/operations/settings/settings#distributed_background_insert_sleep_time_ms "Direct link to distributed_background_insert_sleep_time_ms")
**Aliases**: `distributed_directory_monitor_sleep_time_ms`
| Type | Default value |
|---|---|
| TypeMilliseconds | Default value100 |
Base interval for the [Distributed](https://clickhouse.com/docs/engines/table-engines/special/distributed) table engine to send data. The actual interval grows exponentially in the event of errors.
Possible values:
- A positive integer number of milliseconds.
## distributed\_background\_insert\_split\_batch\_on\_failure[β](https://clickhouse.com/docs/operations/settings/settings#distributed_background_insert_split_batch_on_failure "Direct link to distributed_background_insert_split_batch_on_failure")
**Aliases**: `distributed_directory_monitor_split_batch_on_failure`
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Enables/disables splitting batches on failures.
Sometimes sending particular batch to the remote shard may fail, because of some complex pipeline after (i.e. `MATERIALIZED VIEW` with `GROUP BY`) due to `Memory limit exceeded` or similar errors. In this case, retrying will not help (and this will stuck distributed sends for the table) but sending files from that batch one by one may succeed INSERT.
So installing this setting to `1` will disable batching for such batches (i.e. temporary disables `distributed_background_insert_batch` for failed batches).
Possible values:
- 1 β Enabled.
- 0 β Disabled.
Note
This setting also affects broken batches (that may appears because of abnormal server (machine) termination and no `fsync_after_insert`/`fsync_directories` for [Distributed](https://clickhouse.com/docs/engines/table-engines/special/distributed) table engine).
Note
You should not rely on automatic batch splitting, since this may hurt performance.
## distributed\_background\_insert\_timeout[β](https://clickhouse.com/docs/operations/settings/settings#distributed_background_insert_timeout "Direct link to distributed_background_insert_timeout")
**Aliases**: `insert_distributed_timeout`
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Timeout for insert query into distributed. Setting is used only with insert\_distributed\_sync enabled. Zero value means no timeout.
## distributed\_cache\_alignment[β](https://clickhouse.com/docs/operations/settings/settings#distributed_cache_alignment "Direct link to distributed_cache_alignment")
ClickHouse Cloud only
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Only has an effect in ClickHouse Cloud. A setting for testing purposes, do not change it
## distributed\_cache\_bypass\_connection\_pool[β](https://clickhouse.com/docs/operations/settings/settings#distributed_cache_bypass_connection_pool "Direct link to distributed_cache_bypass_connection_pool")
ClickHouse Cloud only
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Only has an effect in ClickHouse Cloud. Allow to bypass distributed cache connection pool
## distributed\_cache\_connect\_backoff\_max\_ms[β](https://clickhouse.com/docs/operations/settings/settings#distributed_cache_connect_backoff_max_ms "Direct link to distributed_cache_connect_backoff_max_ms")
ClickHouse Cloud only
| Type | Default value |
|---|---|
| TypeUInt64 | Default value50 |
Only has an effect in ClickHouse Cloud. Maximum backoff milliseconds for distributed cache connection creation.
## distributed\_cache\_connect\_backoff\_min\_ms[β](https://clickhouse.com/docs/operations/settings/settings#distributed_cache_connect_backoff_min_ms "Direct link to distributed_cache_connect_backoff_min_ms")
ClickHouse Cloud only
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Only has an effect in ClickHouse Cloud. Minimum backoff milliseconds for distributed cache connection creation.
## distributed\_cache\_connect\_max\_tries[β](https://clickhouse.com/docs/operations/settings/settings#distributed_cache_connect_max_tries "Direct link to distributed_cache_connect_max_tries")
ClickHouse Cloud only
| Type | Default value |
|---|---|
| TypeUInt64 | Default value5 |
Only has an effect in ClickHouse Cloud. Number of tries to connect to distributed cache if unsuccessful
## distributed\_cache\_connect\_timeout\_ms[β](https://clickhouse.com/docs/operations/settings/settings#distributed_cache_connect_timeout_ms "Direct link to distributed_cache_connect_timeout_ms")
ClickHouse Cloud only
| Type | Default value |
|---|---|
| TypeUInt64 | Default value50 |
Only has an effect in ClickHouse Cloud. Connection timeout when connecting to distributed cache server.
## distributed\_cache\_credentials\_refresh\_period\_seconds[β](https://clickhouse.com/docs/operations/settings/settings#distributed_cache_credentials_refresh_period_seconds "Direct link to distributed_cache_credentials_refresh_period_seconds")
ClickHouse Cloud only
| Type | Default value |
|---|---|
| TypeUInt64 | Default value5 |
Only has an effect in ClickHouse Cloud. A period of credentials refresh.
## distributed\_cache\_data\_packet\_ack\_window[β](https://clickhouse.com/docs/operations/settings/settings#distributed_cache_data_packet_ack_window "Direct link to distributed_cache_data_packet_ack_window")
ClickHouse Cloud only
| Type | Default value |
|---|---|
| TypeUInt64 | Default value5 |
Only has an effect in ClickHouse Cloud. A window for sending ACK for DataPacket sequence in a single distributed cache read request
## distributed\_cache\_discard\_connection\_if\_unread\_data[β](https://clickhouse.com/docs/operations/settings/settings#distributed_cache_discard_connection_if_unread_data "Direct link to distributed_cache_discard_connection_if_unread_data")
ClickHouse Cloud only
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Only has an effect in ClickHouse Cloud. Discard connection if some data is unread.
## distributed\_cache\_fetch\_metrics\_only\_from\_current\_az[β](https://clickhouse.com/docs/operations/settings/settings#distributed_cache_fetch_metrics_only_from_current_az "Direct link to distributed_cache_fetch_metrics_only_from_current_az")
ClickHouse Cloud only
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Only has an effect in ClickHouse Cloud. Fetch metrics only from current availability zone in system.distributed\_cache\_metrics, system.distributed\_cache\_events
## distributed\_cache\_file\_cache\_name[β](https://clickhouse.com/docs/operations/settings/settings#distributed_cache_file_cache_name "Direct link to distributed_cache_file_cache_name")
ClickHouse Cloud only
Only has an effect in ClickHouse Cloud. A setting used only for CI tests - filesystem cache name to use on distributed cache.
## distributed\_cache\_log\_mode[β](https://clickhouse.com/docs/operations/settings/settings#distributed_cache_log_mode "Direct link to distributed_cache_log_mode")
ClickHouse Cloud only
| Type | Default value |
|---|---|
| TypeDistributedCacheLogMode | Default valueon\_error |
Only has an effect in ClickHouse Cloud. Mode for writing to system.distributed\_cache\_log
## distributed\_cache\_max\_unacked\_inflight\_packets[β](https://clickhouse.com/docs/operations/settings/settings#distributed_cache_max_unacked_inflight_packets "Direct link to distributed_cache_max_unacked_inflight_packets")
ClickHouse Cloud only
| Type | Default value |
|---|---|
| TypeUInt64 | Default value10 |
Only has an effect in ClickHouse Cloud. A maximum number of unacknowledged in-flight packets in a single distributed cache read request
## distributed\_cache\_min\_bytes\_for\_seek[β](https://clickhouse.com/docs/operations/settings/settings#distributed_cache_min_bytes_for_seek "Direct link to distributed_cache_min_bytes_for_seek")
ClickHouse Cloud only
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Only has an effect in ClickHouse Cloud. Minimum number of bytes to do seek in distributed cache.
## distributed\_cache\_pool\_behaviour\_on\_limit[β](https://clickhouse.com/docs/operations/settings/settings#distributed_cache_pool_behaviour_on_limit "Direct link to distributed_cache_pool_behaviour_on_limit")
ClickHouse Cloud only
| Type | Default value |
|---|---|
| TypeDistributedCachePoolBehaviourOnLimit | Default valuewait |
Only has an effect in ClickHouse Cloud. Identifies behaviour of distributed cache connection on pool limit reached
## distributed\_cache\_prefer\_bigger\_buffer\_size[β](https://clickhouse.com/docs/operations/settings/settings#distributed_cache_prefer_bigger_buffer_size "Direct link to distributed_cache_prefer_bigger_buffer_size")
ClickHouse Cloud only
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Only has an effect in ClickHouse Cloud. Same as filesystem\_cache\_prefer\_bigger\_buffer\_size, but for distributed cache.
## distributed\_cache\_read\_only\_from\_current\_az[β](https://clickhouse.com/docs/operations/settings/settings#distributed_cache_read_only_from_current_az "Direct link to distributed_cache_read_only_from_current_az")
ClickHouse Cloud only
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Only has an effect in ClickHouse Cloud. Allow to read only from current availability zone. If disabled, will read from all cache servers in all availability zones.
## distributed\_cache\_read\_request\_max\_tries[β](https://clickhouse.com/docs/operations/settings/settings#distributed_cache_read_request_max_tries "Direct link to distributed_cache_read_request_max_tries")
ClickHouse Cloud only
| Type | Default value |
|---|---|
| TypeUInt64 | Default value10 |
Only has an effect in ClickHouse Cloud. Number of tries to do distributed cache request if unsuccessful
## distributed\_cache\_receive\_response\_wait\_milliseconds[β](https://clickhouse.com/docs/operations/settings/settings#distributed_cache_receive_response_wait_milliseconds "Direct link to distributed_cache_receive_response_wait_milliseconds")
ClickHouse Cloud only
| Type | Default value |
|---|---|
| TypeUInt64 | Default value60000 |
Only has an effect in ClickHouse Cloud. Wait time in milliseconds to receive data for request from distributed cache
## distributed\_cache\_receive\_timeout\_milliseconds[β](https://clickhouse.com/docs/operations/settings/settings#distributed_cache_receive_timeout_milliseconds "Direct link to distributed_cache_receive_timeout_milliseconds")
ClickHouse Cloud only
| Type | Default value |
|---|---|
| TypeUInt64 | Default value10000 |
Only has an effect in ClickHouse Cloud. Wait time in milliseconds to receive any kind of response from distributed cache
Cloud default value: `20000`.
## distributed\_cache\_receive\_timeout\_ms[β](https://clickhouse.com/docs/operations/settings/settings#distributed_cache_receive_timeout_ms "Direct link to distributed_cache_receive_timeout_ms")
ClickHouse Cloud only
| Type | Default value |
|---|---|
| TypeUInt64 | Default value3000 |
Only has an effect in ClickHouse Cloud. Timeout for receiving data from distributed cache server, in milliseconds. If no bytes were received in this interval, the exception is thrown.
## distributed\_cache\_send\_timeout\_ms[β](https://clickhouse.com/docs/operations/settings/settings#distributed_cache_send_timeout_ms "Direct link to distributed_cache_send_timeout_ms")
ClickHouse Cloud only
| Type | Default value |
|---|---|
| TypeUInt64 | Default value3000 |
Only has an effect in ClickHouse Cloud. Timeout for sending data to istributed cache server, in milliseconds. If a client needs to send some data but is not able to send any bytes in this interval, the exception is thrown.
## distributed\_cache\_tcp\_keep\_alive\_timeout\_ms[β](https://clickhouse.com/docs/operations/settings/settings#distributed_cache_tcp_keep_alive_timeout_ms "Direct link to distributed_cache_tcp_keep_alive_timeout_ms")
ClickHouse Cloud only
| Type | Default value |
|---|---|
| TypeUInt64 | Default value2900 |
Only has an effect in ClickHouse Cloud. The time in milliseconds the connection to distributed cache server needs to remain idle before TCP starts sending keepalive probes.
## distributed\_cache\_throw\_on\_error[β](https://clickhouse.com/docs/operations/settings/settings#distributed_cache_throw_on_error "Direct link to distributed_cache_throw_on_error")
ClickHouse Cloud only
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Only has an effect in ClickHouse Cloud. Rethrow exception happened during communication with distributed cache or exception received from distributed cache. Otherwise fallback to skipping distributed cache on error
## distributed\_cache\_use\_clients\_cache\_for\_read[β](https://clickhouse.com/docs/operations/settings/settings#distributed_cache_use_clients_cache_for_read "Direct link to distributed_cache_use_clients_cache_for_read")
ClickHouse Cloud only
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Only has an effect in ClickHouse Cloud. Use clients cache for read requests.
## distributed\_cache\_use\_clients\_cache\_for\_write[β](https://clickhouse.com/docs/operations/settings/settings#distributed_cache_use_clients_cache_for_write "Direct link to distributed_cache_use_clients_cache_for_write")
ClickHouse Cloud only
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Only has an effect in ClickHouse Cloud. Use clients cache for write requests.
## distributed\_cache\_wait\_connection\_from\_pool\_milliseconds[β](https://clickhouse.com/docs/operations/settings/settings#distributed_cache_wait_connection_from_pool_milliseconds "Direct link to distributed_cache_wait_connection_from_pool_milliseconds")
ClickHouse Cloud only
| Type | Default value |
|---|---|
| TypeUInt64 | Default value100 |
Only has an effect in ClickHouse Cloud. Wait time in milliseconds to receive connection from connection pool if distributed\_cache\_pool\_behaviour\_on\_limit is wait
## distributed\_connections\_pool\_size[β](https://clickhouse.com/docs/operations/settings/settings#distributed_connections_pool_size "Direct link to distributed_connections_pool_size")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value1024 |
The maximum number of simultaneous connections with remote servers for distributed processing of all queries to a single Distributed table. We recommend setting a value no less than the number of servers in the cluster.
## distributed\_ddl\_entry\_format\_version[β](https://clickhouse.com/docs/operations/settings/settings#distributed_ddl_entry_format_version "Direct link to distributed_ddl_entry_format_version")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value5 |
Compatibility version of distributed DDL (ON CLUSTER) queries
Cloud default value: `6`.
## distributed\_ddl\_output\_mode[β](https://clickhouse.com/docs/operations/settings/settings#distributed_ddl_output_mode "Direct link to distributed_ddl_output_mode")
| Type | Default value |
|---|---|
| TypeDistributedDDLOutputMode | Default valuethrow |
Sets format of distributed DDL query result.
Possible values:
- `throw` β Returns result set with query execution status for all hosts where query is finished. If query has failed on some hosts, then it will rethrow the first exception. If query is not finished yet on some hosts and [distributed\_ddl\_task\_timeout](https://clickhouse.com/docs/operations/settings/settings#distributed_ddl_task_timeout) exceeded, then it throws `TIMEOUT_EXCEEDED` exception.
- `none` β Is similar to throw, but distributed DDL query returns no result set.
- `null_status_on_timeout` β Returns `NULL` as execution status in some rows of result set instead of throwing `TIMEOUT_EXCEEDED` if query is not finished on the corresponding hosts.
- `never_throw` β Do not throw `TIMEOUT_EXCEEDED` and do not rethrow exceptions if query has failed on some hosts.
- `none_only_active` - similar to `none`, but doesn't wait for inactive replicas of the `Replicated` database. Note: with this mode it's impossible to figure out that the query was not executed on some replica and will be executed in background.
- `null_status_on_timeout_only_active` β similar to `null_status_on_timeout`, but doesn't wait for inactive replicas of the `Replicated` database
- `throw_only_active` β similar to `throw`, but doesn't wait for inactive replicas of the `Replicated` database
Cloud default value: `none_only_active`.
## distributed\_ddl\_task\_timeout[β](https://clickhouse.com/docs/operations/settings/settings#distributed_ddl_task_timeout "Direct link to distributed_ddl_task_timeout")
| Type | Default value |
|---|---|
| TypeInt64 | Default value180 |
Sets timeout for DDL query responses from all hosts in cluster. If a DDL request has not been performed on all hosts, a response will contain a timeout error and a request will be executed in an async mode. Negative value means infinite.
Possible values:
- Positive integer.
- 0 β Async mode.
- Negative integer β infinite timeout.
## distributed\_foreground\_insert[β](https://clickhouse.com/docs/operations/settings/settings#distributed_foreground_insert "Direct link to distributed_foreground_insert")
**Aliases**: `insert_distributed_sync`
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Enables or disables synchronous data insertion into a [Distributed](https://clickhouse.com/docs/engines/table-engines/special/distributed) table.
By default, when inserting data into a `Distributed` table, the ClickHouse server sends data to cluster nodes in background mode. When `distributed_foreground_insert=1`, the data is processed synchronously, and the `INSERT` operation succeeds only after all the data is saved on all shards (at least one replica for each shard if `internal_replication` is true).
Possible values:
- `0` β Data is inserted in background mode.
- `1` β Data is inserted in synchronous mode.
Cloud default value: `1`.
**See Also**
- [Distributed Table Engine](https://clickhouse.com/docs/engines/table-engines/special/distributed)
- [Managing Distributed Tables](https://clickhouse.com/docs/sql-reference/statements/system#managing-distributed-tables)
## distributed\_group\_by\_no\_merge[β](https://clickhouse.com/docs/operations/settings/settings#distributed_group_by_no_merge "Direct link to distributed_group_by_no_merge")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Do not merge aggregation states from different servers for distributed query processing, you can use this in case it is for certain that there are different keys on different shards
Possible values:
- `0` β Disabled (final query processing is done on the initiator node).
- `1` - Do not merge aggregation states from different servers for distributed query processing (query completely processed on the shard, initiator only proxy the data), can be used in case it is for certain that there are different keys on different shards.
- `2` - Same as `1` but applies `ORDER BY` and `LIMIT` (it is not possible when the query processed completely on the remote node, like for `distributed_group_by_no_merge=1`) on the initiator (can be used for queries with `ORDER BY` and/or `LIMIT`).
**Example**
```
SELECT *
FROM remote('127.0.0.{2,3}', system.one)
GROUP BY dummy
LIMIT 1
SETTINGS distributed_group_by_no_merge = 1
FORMAT PrettyCompactMonoBlock
ββdummyββ
β 0 β
β 0 β
βββββββββ
```
```
SELECT *
FROM remote('127.0.0.{2,3}', system.one)
GROUP BY dummy
LIMIT 1
SETTINGS distributed_group_by_no_merge = 2
FORMAT PrettyCompactMonoBlock
ββdummyββ
β 0 β
βββββββββ
```
## distributed\_index\_analysis[β](https://clickhouse.com/docs/operations/settings/settings#distributed_index_analysis "Direct link to distributed_index_analysis")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Index analysis will be distributed across replicas. Beneficial for shared storage and huge amount of data in cluster. Uses replicas from cluster\_for\_parallel\_replicas.
**See also**
- [distributed\_index\_analysis\_for\_non\_shared\_merge\_tree](https://clickhouse.com/docs/operations/settings/settings#distributed_index_analysis_for_non_shared_merge_tree)
- [distributed\_index\_analysis\_min\_parts\_to\_activate](https://clickhouse.com/docs/operations/settings/merge-tree-settings#distributed_index_analysis_min_parts_to_activate)
- [distributed\_index\_analysis\_min\_indexes\_bytes\_to\_activate](https://clickhouse.com/docs/operations/settings/merge-tree-settings#distributed_index_analysis_min_indexes_bytes_to_activate)
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Enable distributed index analysis even for non SharedMergeTree (cloud only engine).
## distributed\_index\_analysis\_only\_on\_coordinator[β](https://clickhouse.com/docs/operations/settings/settings#distributed_index_analysis_only_on_coordinator "Direct link to distributed_index_analysis_only_on_coordinator")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
If enabled, distributed index analysis runs only on the coordinator. This prevents O(N^2) spawned queries when the predicate contains subqueries (e.g., `IN (SELECT ...)`), because each follower replica would otherwise independently trigger its own distributed index analysis, but makes distributed index analysis less efficient if large tables are used in the subqueries.
## distributed\_insert\_skip\_read\_only\_replicas[β](https://clickhouse.com/docs/operations/settings/settings#distributed_insert_skip_read_only_replicas "Direct link to distributed_insert_skip_read_only_replicas")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Enables skipping read-only replicas for INSERT queries into Distributed.
Possible values:
- 0 β INSERT was as usual, if it will go to read-only replica it will fail
- 1 β Initiator will skip read-only replicas before sending data to shards.
## distributed\_plan\_default\_reader\_bucket\_count[β](https://clickhouse.com/docs/operations/settings/settings#distributed_plan_default_reader_bucket_count "Direct link to distributed_plan_default_reader_bucket_count")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value8 |
Default number of tasks for parallel reading in distributed query. Tasks are spread across between replicas.
## distributed\_plan\_default\_shuffle\_join\_bucket\_count[β](https://clickhouse.com/docs/operations/settings/settings#distributed_plan_default_shuffle_join_bucket_count "Direct link to distributed_plan_default_shuffle_join_bucket_count")
| Type | Default value |
|---|---|
| TypeNonZeroUInt64 | Default value8 |
Default number of buckets for distributed shuffle-hash-join.
## distributed\_plan\_execute\_locally[β](https://clickhouse.com/docs/operations/settings/settings#distributed_plan_execute_locally "Direct link to distributed_plan_execute_locally")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Run all tasks of a distributed query plan locally. Useful for testing and debugging.
## distributed\_plan\_force\_exchange\_kind[β](https://clickhouse.com/docs/operations/settings/settings#distributed_plan_force_exchange_kind "Direct link to distributed_plan_force_exchange_kind")
Force specified kind of Exchange operators between distributed query stages.
Possible values:
- '' - do not force any kind of Exchange operators, let the optimizer choose,
- 'Persisted' - use temporary files in object storage,
- 'Streaming' - stream exchange data over network.
## distributed\_plan\_force\_shuffle\_aggregation[β](https://clickhouse.com/docs/operations/settings/settings#distributed_plan_force_shuffle_aggregation "Direct link to distributed_plan_force_shuffle_aggregation")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Use Shuffle aggregation strategy instead of PartialAggregation + Merge in distributed query plan.
## distributed\_plan\_max\_rows\_to\_broadcast[β](https://clickhouse.com/docs/operations/settings/settings#distributed_plan_max_rows_to_broadcast "Direct link to distributed_plan_max_rows_to_broadcast")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value20000 |
Maximum rows to use broadcast join instead of shuffle join in distributed query plan.
## distributed\_plan\_optimize\_exchanges[β](https://clickhouse.com/docs/operations/settings/settings#distributed_plan_optimize_exchanges "Direct link to distributed_plan_optimize_exchanges")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Removes unnecessary exchanges in distributed query plan. Disable it for debugging.
## distributed\_plan\_prefer\_replicas\_over\_workers[β](https://clickhouse.com/docs/operations/settings/settings#distributed_plan_prefer_replicas_over_workers "Direct link to distributed_plan_prefer_replicas_over_workers")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Serialize the distributed query plan for execution at replicas.
## distributed\_product\_mode[β](https://clickhouse.com/docs/operations/settings/settings#distributed_product_mode "Direct link to distributed_product_mode")
| Type | Default value |
|---|---|
| TypeDistributedProductMode | Default valuedeny |
Changes the behaviour of [distributed subqueries](https://clickhouse.com/docs/sql-reference/operators/in).
ClickHouse applies this setting when the query contains the product of distributed tables, i.e. when the query for a distributed table contains a non-GLOBAL subquery for the distributed table.
Restrictions:
- Only applied for IN and JOIN subqueries.
- Only if the FROM section uses a distributed table containing more than one shard.
- If the subquery concerns a distributed table containing more than one shard.
- Not used for a table-valued [remote](https://clickhouse.com/docs/sql-reference/table-functions/remote) function.
Possible values:
- `deny` β Default value. Prohibits using these types of subqueries (returns the "Double-distributed in/JOIN subqueries is denied" exception).
- `local` β Replaces the database and table in the subquery with local ones for the destination server (shard), leaving the normal `IN`/`JOIN.`
- `global` β Replaces the `IN`/`JOIN` query with `GLOBAL IN`/`GLOBAL JOIN.`
- `allow` β Allows the use of these types of subqueries.
## distributed\_push\_down\_limit[β](https://clickhouse.com/docs/operations/settings/settings#distributed_push_down_limit "Direct link to distributed_push_down_limit")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value1 |
Enables or disables [LIMIT](https://clickhouse.com/docs/operations/settings/settings#limit) applying on each shard separately.
This will allow to avoid:
- Sending extra rows over network;
- Processing rows behind the limit on the initiator.
Starting from 21.9 version you cannot get inaccurate results anymore, since `distributed_push_down_limit` changes query execution only if at least one of the conditions met:
- [distributed\_group\_by\_no\_merge](https://clickhouse.com/docs/operations/settings/settings#distributed_group_by_no_merge) \> 0.
- Query **does not have** `GROUP BY`/`DISTINCT`/`LIMIT BY`, but it has `ORDER BY`/`LIMIT`.
- Query **has** `GROUP BY`/`DISTINCT`/`LIMIT BY` with `ORDER BY`/`LIMIT` and:
- [optimize\_skip\_unused\_shards](https://clickhouse.com/docs/operations/settings/settings#optimize_skip_unused_shards) is enabled.
- [optimize\_distributed\_group\_by\_sharding\_key](https://clickhouse.com/docs/operations/settings/settings#optimize_distributed_group_by_sharding_key) is enabled.
Possible values:
- 0 β Disabled.
- 1 β Enabled.
See also:
- [distributed\_group\_by\_no\_merge](https://clickhouse.com/docs/operations/settings/settings#distributed_group_by_no_merge)
- [optimize\_skip\_unused\_shards](https://clickhouse.com/docs/operations/settings/settings#optimize_skip_unused_shards)
- [optimize\_distributed\_group\_by\_sharding\_key](https://clickhouse.com/docs/operations/settings/settings#optimize_distributed_group_by_sharding_key)
## distributed\_replica\_error\_cap[β](https://clickhouse.com/docs/operations/settings/settings#distributed_replica_error_cap "Direct link to distributed_replica_error_cap")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value1000 |
- Type: unsigned int
- Default value: 1000
The error count of each replica is capped at this value, preventing a single replica from accumulating too many errors.
See also:
- [load\_balancing](https://clickhouse.com/docs/operations/settings/settings#load_balancing-round_robin)
- [Table engine Distributed](https://clickhouse.com/docs/engines/table-engines/special/distributed)
- [distributed\_replica\_error\_half\_life](https://clickhouse.com/docs/operations/settings/settings#distributed_replica_error_half_life)
- [distributed\_replica\_max\_ignored\_errors](https://clickhouse.com/docs/operations/settings/settings#distributed_replica_max_ignored_errors)
## distributed\_replica\_error\_half\_life[β](https://clickhouse.com/docs/operations/settings/settings#distributed_replica_error_half_life "Direct link to distributed_replica_error_half_life")
| Type | Default value |
|---|---|
| TypeSeconds | Default value60 |
- Type: seconds
- Default value: 60 seconds
Controls how fast errors in distributed tables are zeroed. If a replica is unavailable for some time, accumulates 5 errors, and distributed\_replica\_error\_half\_life is set to 1 second, then the replica is considered normal 3 seconds after the last error.
See also:
- [load\_balancing](https://clickhouse.com/docs/operations/settings/settings#load_balancing-round_robin)
- [Table engine Distributed](https://clickhouse.com/docs/engines/table-engines/special/distributed)
- [distributed\_replica\_error\_cap](https://clickhouse.com/docs/operations/settings/settings#distributed_replica_error_cap)
- [distributed\_replica\_max\_ignored\_errors](https://clickhouse.com/docs/operations/settings/settings#distributed_replica_max_ignored_errors)
## distributed\_replica\_max\_ignored\_errors[β](https://clickhouse.com/docs/operations/settings/settings#distributed_replica_max_ignored_errors "Direct link to distributed_replica_max_ignored_errors")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
- Type: unsigned int
- Default value: 0
The number of errors that will be ignored while choosing replicas (according to `load_balancing` algorithm).
See also:
- [load\_balancing](https://clickhouse.com/docs/operations/settings/settings#load_balancing-round_robin)
- [Table engine Distributed](https://clickhouse.com/docs/engines/table-engines/special/distributed)
- [distributed\_replica\_error\_cap](https://clickhouse.com/docs/operations/settings/settings#distributed_replica_error_cap)
- [distributed\_replica\_error\_half\_life](https://clickhouse.com/docs/operations/settings/settings#distributed_replica_error_half_life)
## do\_not\_merge\_across\_partitions\_select\_final[β](https://clickhouse.com/docs/operations/settings/settings#do_not_merge_across_partitions_select_final "Direct link to do_not_merge_across_partitions_select_final")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Improve FINAL queries by avoiding merges across different partitions.
When enabled, during SELECT FINAL queries, parts from different partitions will not be merged together. Instead, merging will only occur within each partition separately. This can significantly improve query performance when working with partitioned tables.
## empty\_result\_for\_aggregation\_by\_constant\_keys\_on\_empty\_set[β](https://clickhouse.com/docs/operations/settings/settings#empty_result_for_aggregation_by_constant_keys_on_empty_set "Direct link to empty_result_for_aggregation_by_constant_keys_on_empty_set")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Return empty result when aggregating by constant keys on empty set.
## empty\_result\_for\_aggregation\_by\_empty\_set[β](https://clickhouse.com/docs/operations/settings/settings#empty_result_for_aggregation_by_empty_set "Direct link to empty_result_for_aggregation_by_empty_set")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Return empty result when aggregating without keys on empty set.
## enable\_adaptive\_memory\_spill\_scheduler[β](https://clickhouse.com/docs/operations/settings/settings#enable_adaptive_memory_spill_scheduler "Direct link to enable_adaptive_memory_spill_scheduler")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Trigger processor to spill data into external storage adpatively. grace join is supported at present.
## enable\_add\_distinct\_to\_in\_subqueries[β](https://clickhouse.com/docs/operations/settings/settings#enable_add_distinct_to_in_subqueries "Direct link to enable_add_distinct_to_in_subqueries")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Enable `DISTINCT` in `IN` subqueries. This is a trade-off setting: enabling it can greatly reduce the size of temporary tables transferred for distributed IN subqueries and significantly speed up data transfer between shards, by ensuring only unique values are sent. However, enabling this setting adds extra merging effort on each node, as deduplication (DISTINCT) must be performed. Use this setting when network transfer is a bottleneck and the additional merging cost is acceptable.
## enable\_automatic\_decision\_for\_merging\_across\_partitions\_for\_final[β](https://clickhouse.com/docs/operations/settings/settings#enable_automatic_decision_for_merging_across_partitions_for_final "Direct link to enable_automatic_decision_for_merging_across_partitions_for_final")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
If set, ClickHouse will automatically enable this optimization when the partition key expression is deterministic and all columns used in the partition key expression are included in the primary key. This automatic derivation ensures that rows with the same primary key values will always belong to the same partition, making it safe to avoid cross-partition merges.
## enable\_blob\_storage\_log[β](https://clickhouse.com/docs/operations/settings/settings#enable_blob_storage_log "Direct link to enable_blob_storage_log")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Write information about blob storage operations to system.blob\_storage\_log table
## enable\_early\_constant\_folding[β](https://clickhouse.com/docs/operations/settings/settings#enable_early_constant_folding "Direct link to enable_early_constant_folding")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Enable query optimization where we analyze function and subqueries results and rewrite query if there are constants there
## enable\_extended\_results\_for\_datetime\_functions[β](https://clickhouse.com/docs/operations/settings/settings#enable_extended_results_for_datetime_functions "Direct link to enable_extended_results_for_datetime_functions")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Enables or disables returning results of type `Date32` with extended range (compared to type `Date`) or `DateTime64` with extended range (compared to type `DateTime`).
Possible values:
- `0` β Functions return `Date` or `DateTime` for all types of arguments.
- `1` β Functions return `Date32` or `DateTime64` for `Date32` or `DateTime64` arguments and `Date` or `DateTime` otherwise.
The table below shows the behavior of this setting for various date-time functions.
| Function | `enable_extended_results_for_datetime_functions = 0` | `enable_extended_results_for_datetime_functions = 1` |
|---|---|---|
| `toStartOfYear` | Returns `Date` or `DateTime` | Returns `Date`/`DateTime` for `Date`/`DateTime` input Returns `Date32`/`DateTime64` for `Date32`/`DateTime64` input |
| `toStartOfISOYear` | Returns `Date` or `DateTime` | Returns `Date`/`DateTime` for `Date`/`DateTime` input Returns `Date32`/`DateTime64` for `Date32`/`DateTime64` input |
| `toStartOfQuarter` | Returns `Date` or `DateTime` | Returns `Date`/`DateTime` for `Date`/`DateTime` input Returns `Date32`/`DateTime64` for `Date32`/`DateTime64` input |
| `toStartOfMonth` | Returns `Date` or `DateTime` | Returns `Date`/`DateTime` for `Date`/`DateTime` input Returns `Date32`/`DateTime64` for `Date32`/`DateTime64` input |
| `toStartOfWeek` | Returns `Date` or `DateTime` | Returns `Date`/`DateTime` for `Date`/`DateTime` input Returns `Date32`/`DateTime64` for `Date32`/`DateTime64` input |
| `toLastDayOfWeek` | Returns `Date` or `DateTime` | Returns `Date`/`DateTime` for `Date`/`DateTime` input Returns `Date32`/`DateTime64` for `Date32`/`DateTime64` input |
| `toLastDayOfMonth` | Returns `Date` or `DateTime` | Returns `Date`/`DateTime` for `Date`/`DateTime` input Returns `Date32`/`DateTime64` for `Date32`/`DateTime64` input |
| `toMonday` | Returns `Date` or `DateTime` | Returns `Date`/`DateTime` for `Date`/`DateTime` input Returns `Date32`/`DateTime64` for `Date32`/`DateTime64` input |
| `toStartOfDay` | Returns `DateTime` *Note: Wrong results for values outside 1970-2149 range* | Returns `DateTime` for `Date`/`DateTime` input Returns `DateTime64` for `Date32`/`DateTime64` input |
| `toStartOfHour` | Returns `DateTime` *Note: Wrong results for values outside 1970-2149 range* | Returns `DateTime` for `Date`/`DateTime` input Returns `DateTime64` for `Date32`/`DateTime64` input |
| `toStartOfFifteenMinutes` | Returns `DateTime` *Note: Wrong results for values outside 1970-2149 range* | Returns `DateTime` for `Date`/`DateTime` input Returns `DateTime64` for `Date32`/`DateTime64` input |
| `toStartOfTenMinutes` | Returns `DateTime` *Note: Wrong results for values outside 1970-2149 range* | Returns `DateTime` for `Date`/`DateTime` input Returns `DateTime64` for `Date32`/`DateTime64` input |
| `toStartOfFiveMinutes` | Returns `DateTime` *Note: Wrong results for values outside 1970-2149 range* | Returns `DateTime` for `Date`/`DateTime` input Returns `DateTime64` for `Date32`/`DateTime64` input |
| `toStartOfMinute` | Returns `DateTime` *Note: Wrong results for values outside 1970-2149 range* | Returns `DateTime` for `Date`/`DateTime` input Returns `DateTime64` for `Date32`/`DateTime64` input |
| `timeSlot` | Returns `DateTime` *Note: Wrong results for values outside 1970-2149 range* | Returns `DateTime` for `Date`/`DateTime` input Returns `DateTime64` for `Date32`/`DateTime64` input |
## enable\_filesystem\_cache[β](https://clickhouse.com/docs/operations/settings/settings#enable_filesystem_cache "Direct link to enable_filesystem_cache")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Use cache for remote filesystem. This setting does not turn on/off cache for disks (must be done via disk config), but allows to bypass cache for some queries if intended
## enable\_filesystem\_cache\_log[β](https://clickhouse.com/docs/operations/settings/settings#enable_filesystem_cache_log "Direct link to enable_filesystem_cache_log")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Allows to record the filesystem caching log for each query
## enable\_filesystem\_cache\_on\_write\_operations[β](https://clickhouse.com/docs/operations/settings/settings#enable_filesystem_cache_on_write_operations "Direct link to enable_filesystem_cache_on_write_operations")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Enables or disables `write-through` cache. If set to `false`, the `write-through` cache is disabled for write operations. If set to `true`, `write-through` cache is enabled as long as `cache_on_write_operations` is turned on in the server config's cache disk configuration section. See ["Using local cache"](https://clickhouse.com/docs/operations/storing-data#using-local-cache) for more details.
Cloud default value: `1`.
## enable\_filesystem\_read\_prefetches\_log[β](https://clickhouse.com/docs/operations/settings/settings#enable_filesystem_read_prefetches_log "Direct link to enable_filesystem_read_prefetches_log")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Log to system.filesystem prefetch\_log during query. Should be used only for testing or debugging, not recommended to be turned on by default
## enable\_full\_text\_index[β](https://clickhouse.com/docs/operations/settings/settings#enable_full_text_index "Direct link to enable_full_text_index")
**Aliases**: `allow_experimental_full_text_index`
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
If set to true, allow using the text index.
## enable\_global\_with\_statement[β](https://clickhouse.com/docs/operations/settings/settings#enable_global_with_statement "Direct link to enable_global_with_statement")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Propagate WITH statements to UNION queries and all subqueries
## enable\_hdfs\_pread[β](https://clickhouse.com/docs/operations/settings/settings#enable_hdfs_pread "Direct link to enable_hdfs_pread")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Enable or disables pread for HDFS files. By default, `hdfsPread` is used. If disabled, `hdfsRead` and `hdfsSeek` will be used to read hdfs files.
## enable\_http\_compression[β](https://clickhouse.com/docs/operations/settings/settings#enable_http_compression "Direct link to enable_http_compression")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Enables or disables data compression in the response to an HTTP request.
For more information, read the [HTTP interface description](https://clickhouse.com/docs/interfaces/http).
Possible values:
- 0 β Disabled.
- 1 β Enabled.
## enable\_job\_stack\_trace[β](https://clickhouse.com/docs/operations/settings/settings#enable_job_stack_trace "Direct link to enable_job_stack_trace")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Output stack trace of a job creator when job results in exception. Disabled by default to avoid performance overhead.
## enable\_join\_runtime\_filters[β](https://clickhouse.com/docs/operations/settings/settings#enable_join_runtime_filters "Direct link to enable_join_runtime_filters")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Filter left side by set of JOIN keys collected from the right side at runtime.
## enable\_join\_transitive\_predicates[β](https://clickhouse.com/docs/operations/settings/settings#enable_join_transitive_predicates "Direct link to enable_join_transitive_predicates")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Infer transitive equi-join predicates from existing join conditions. For example, given `A.x = B.x` and `B.x = C.x`, a synthetic `A.x = C.x` predicate is added so the join order optimizer can consider direct (A JOIN C) plans.
## enable\_lazy\_columns\_replication[β](https://clickhouse.com/docs/operations/settings/settings#enable_lazy_columns_replication "Direct link to enable_lazy_columns_replication")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Enables lazy columns replication in JOIN and ARRAY JOIN, it allows to avoid unnecessary copy of the same rows multiple times in memory.
## enable\_lightweight\_delete[β](https://clickhouse.com/docs/operations/settings/settings#enable_lightweight_delete "Direct link to enable_lightweight_delete")
**Aliases**: `allow_experimental_lightweight_delete`
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Enable lightweight DELETE mutations for mergetree tables.
## enable\_lightweight\_update[β](https://clickhouse.com/docs/operations/settings/settings#enable_lightweight_update "Direct link to enable_lightweight_update")
**Aliases**: `allow_experimental_lightweight_update`
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Allow to use lightweight updates.
## enable\_materialized\_cte[β](https://clickhouse.com/docs/operations/settings/settings#enable_materialized_cte "Direct link to enable_materialized_cte")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Enable materialized common table expressions, it will be preferred over enable\_global\_with\_statement
## enable\_memory\_bound\_merging\_of\_aggregation\_results[β](https://clickhouse.com/docs/operations/settings/settings#enable_memory_bound_merging_of_aggregation_results "Direct link to enable_memory_bound_merging_of_aggregation_results")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Enable memory bound merging strategy for aggregation.
## enable\_multiple\_prewhere\_read\_steps[β](https://clickhouse.com/docs/operations/settings/settings#enable_multiple_prewhere_read_steps "Direct link to enable_multiple_prewhere_read_steps")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Move more conditions from WHERE to PREWHERE and do reads from disk and filtering in multiple steps if there are multiple conditions combined with AND
## enable\_named\_columns\_in\_function\_tuple[β](https://clickhouse.com/docs/operations/settings/settings#enable_named_columns_in_function_tuple "Direct link to enable_named_columns_in_function_tuple")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Generate named tuples in function tuple() when all names are unique and can be treated as unquoted identifiers.
## enable\_optimize\_predicate\_expression[β](https://clickhouse.com/docs/operations/settings/settings#enable_optimize_predicate_expression "Direct link to enable_optimize_predicate_expression")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Turns on predicate pushdown in `SELECT` queries.
Predicate pushdown may significantly reduce network traffic for distributed queries.
Possible values:
- 0 β Disabled.
- 1 β Enabled.
Usage
Consider the following queries:
1. `SELECT count() FROM test_table WHERE date = '2018-10-10'`
2. `SELECT count() FROM (SELECT * FROM test_table) WHERE date = '2018-10-10'`
If `enable_optimize_predicate_expression = 1`, then the execution time of these queries is equal because ClickHouse applies `WHERE` to the subquery when processing it.
If `enable_optimize_predicate_expression = 0`, then the execution time of the second query is much longer because the `WHERE` clause applies to all the data after the subquery finishes.
## enable\_optimize\_predicate\_expression\_to\_final\_subquery[β](https://clickhouse.com/docs/operations/settings/settings#enable_optimize_predicate_expression_to_final_subquery "Direct link to enable_optimize_predicate_expression_to_final_subquery")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Allow push predicate to final subquery.
## enable\_order\_by\_all[β](https://clickhouse.com/docs/operations/settings/settings#enable_order_by_all "Direct link to enable_order_by_all")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Enables or disables sorting with `ORDER BY ALL` syntax, see [ORDER BY](https://clickhouse.com/docs/sql-reference/statements/select/order-by).
Possible values:
- 0 β Disable ORDER BY ALL.
- 1 β Enable ORDER BY ALL.
**Example**
Query:
```
CREATE TABLE TAB(C1 Int, C2 Int, ALL Int) ENGINE=Memory();
INSERT INTO TAB VALUES (10, 20, 30), (20, 20, 10), (30, 10, 20);
SELECT * FROM TAB ORDER BY ALL; -- returns an error that ALL is ambiguous
SELECT * FROM TAB ORDER BY ALL SETTINGS enable_order_by_all = 0;
```
Result:
```
ββC1ββ¬βC2ββ¬βALLββ
β 20 β 20 β 10 β
β 30 β 10 β 20 β
β 10 β 20 β 30 β
ββββββ΄βββββ΄ββββββ
```
## enable\_parallel\_blocks\_marshalling[β](https://clickhouse.com/docs/operations/settings/settings#enable_parallel_blocks_marshalling "Direct link to enable_parallel_blocks_marshalling")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Affects only distributed queries. If enabled, blocks will be (de)serialized and (de)compressed on pipeline threads (i.e. with higher parallelism that what we have by default) before/after sending to the initiator.
## enable\_parsing\_to\_custom\_serialization[β](https://clickhouse.com/docs/operations/settings/settings#enable_parsing_to_custom_serialization "Direct link to enable_parsing_to_custom_serialization")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
If true then data can be parsed directly to columns with custom serialization (e.g. Sparse) according to hints for serialization got from the table.
## enable\_positional\_arguments[β](https://clickhouse.com/docs/operations/settings/settings#enable_positional_arguments "Direct link to enable_positional_arguments")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Enables or disables supporting positional arguments for [GROUP BY](https://clickhouse.com/docs/sql-reference/statements/select/group-by), [LIMIT BY](https://clickhouse.com/docs/sql-reference/statements/select/limit-by), [ORDER BY](https://clickhouse.com/docs/sql-reference/statements/select/order-by) statements.
Possible values:
- 0 β Positional arguments aren't supported.
- 1 β Positional arguments are supported: column numbers can use instead of column names.
**Example**
Query:
```
CREATE TABLE positional_arguments(one Int, two Int, three Int) ENGINE=Memory();
INSERT INTO positional_arguments VALUES (10, 20, 30), (20, 20, 10), (30, 10, 20);
SELECT * FROM positional_arguments ORDER BY 2,3;
```
Result:
```
ββoneββ¬βtwoββ¬βthreeββ
β 30 β 10 β 20 β
β 20 β 20 β 10 β
β 10 β 20 β 30 β
βββββββ΄ββββββ΄ββββββββ
```
## enable\_positional\_arguments\_for\_projections[β](https://clickhouse.com/docs/operations/settings/settings#enable_positional_arguments_for_projections "Direct link to enable_positional_arguments_for_projections")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Enables or disables supporting positional arguments in PROJECTION definitions. See also [enable\_positional\_arguments](https://clickhouse.com/docs/operations/settings/settings#enable_positional_arguments) setting.
Note
This is an expert-level setting, and you shouldn't change it if you're just getting started with ClickHouse.
Possible values:
- 0 β Positional arguments aren't supported.
- 1 β Positional arguments are supported: column numbers can use instead of column names.
## enable\_producing\_buckets\_out\_of\_order\_in\_aggregation[β](https://clickhouse.com/docs/operations/settings/settings#enable_producing_buckets_out_of_order_in_aggregation "Direct link to enable_producing_buckets_out_of_order_in_aggregation")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Allow memory-efficient aggregation (see `distributed_aggregation_memory_efficient`) to produce buckets out of order. It may improve performance when aggregation bucket sizes are skewed by letting a replica to send buckets with higher id-s to the initiator while it is still processing some heavy buckets with lower id-s. The downside is potentially higher memory usage.
## enable\_reads\_from\_query\_cache[β](https://clickhouse.com/docs/operations/settings/settings#enable_reads_from_query_cache "Direct link to enable_reads_from_query_cache")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
If turned on, results of `SELECT` queries are retrieved from the [query cache](https://clickhouse.com/docs/operations/query-cache).
Possible values:
- 0 - Disabled
- 1 - Enabled
## enable\_s3\_requests\_logging[β](https://clickhouse.com/docs/operations/settings/settings#enable_s3_requests_logging "Direct link to enable_s3_requests_logging")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Enable very explicit logging of S3 requests. Makes sense for debug only.
## enable\_scalar\_subquery\_optimization[β](https://clickhouse.com/docs/operations/settings/settings#enable_scalar_subquery_optimization "Direct link to enable_scalar_subquery_optimization")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
If it is set to true, prevent scalar subqueries from (de)serializing large scalar values and possibly avoid running the same subquery more than once.
## enable\_scopes\_for\_with\_statement[β](https://clickhouse.com/docs/operations/settings/settings#enable_scopes_for_with_statement "Direct link to enable_scopes_for_with_statement")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
If disabled, declarations in parent WITH cluases will behave the same scope as they declared in the current scope.
Note that this is a compatibility setting for the analyzer to allow running some invalid queries that old analyzer could execute.
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
If enabled, all subqueries within a single query will share the same StorageSnapshot for each table. This ensures a consistent view of the data across the entire query, even if the same table is accessed multiple times.
This is required for queries where internal consistency of data parts is important. Example:
```
SELECT
count()
FROM events
WHERE (_part, _part_offset) IN (
SELECT _part, _part_offset
FROM events
WHERE user_id = 42
)
```
Without this setting, the outer and inner queries may operate on different data snapshots, leading to incorrect results.
Note
Enabling this setting disables the optimization which removes unnecessary data parts from snapshots once the planning stage is complete. As a result, long-running queries may hold onto obsolete parts for their entire duration, delaying part cleanup and increasing storage pressure.
This setting currently applies only to tables from the MergeTree family.
Possible values:
- 0 - Disabled
- 1 - Enabled
## enable\_sharing\_sets\_for\_mutations[β](https://clickhouse.com/docs/operations/settings/settings#enable_sharing_sets_for_mutations "Direct link to enable_sharing_sets_for_mutations")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Allow sharing set objects build for IN subqueries between different tasks of the same mutation. This reduces memory usage and CPU consumptio
## enable\_software\_prefetch\_in\_aggregation[β](https://clickhouse.com/docs/operations/settings/settings#enable_software_prefetch_in_aggregation "Direct link to enable_software_prefetch_in_aggregation")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Enable use of software prefetch in aggregatio
## enable\_time\_time64\_type[β](https://clickhouse.com/docs/operations/settings/settings#enable_time_time64_type "Direct link to enable_time_time64_type")
**Aliases**: `allow_experimental_time_time64_type`
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Allows creation of [Time](https://clickhouse.com/docs/sql-reference/data-types/time) and [Time64](https://clickhouse.com/docs/sql-reference/data-types/time64) data types.
## enable\_unaligned\_array\_join[β](https://clickhouse.com/docs/operations/settings/settings#enable_unaligned_array_join "Direct link to enable_unaligned_array_join")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Allow ARRAY JOIN with multiple arrays that have different sizes. When this settings is enabled, arrays will be resized to the longest one.
## enable\_url\_encoding[β](https://clickhouse.com/docs/operations/settings/settings#enable_url_encoding "Direct link to enable_url_encoding")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Allows to enable/disable decoding/encoding path in uri in [URL](https://clickhouse.com/docs/engines/table-engines/special/url) engine tables.
Disabled by default.
## enable\_vertical\_final[β](https://clickhouse.com/docs/operations/settings/settings#enable_vertical_final "Direct link to enable_vertical_final")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
If enable, remove duplicated rows during FINAL by marking rows as deleted and filtering them later instead of merging rows
## enable\_writes\_to\_query\_cache[β](https://clickhouse.com/docs/operations/settings/settings#enable_writes_to_query_cache "Direct link to enable_writes_to_query_cache")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
If turned on, results of `SELECT` queries are stored in the [query cache](https://clickhouse.com/docs/operations/query-cache).
Possible values:
- 0 - Disabled
- 1 - Enabled
## enforce\_strict\_identifier\_format[β](https://clickhouse.com/docs/operations/settings/settings#enforce_strict_identifier_format "Direct link to enforce_strict_identifier_format")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
If enabled, only allow identifiers containing alphanumeric characters and underscores.
## engine\_file\_allow\_create\_multiple\_files[β](https://clickhouse.com/docs/operations/settings/settings#engine_file_allow_create_multiple_files "Direct link to engine_file_allow_create_multiple_files")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Enables or disables creating a new file on each insert in file engine tables if the format has the suffix (`JSON`, `ORC`, `Parquet`, etc.). If enabled, on each insert a new file will be created with a name following this pattern:
`data.Parquet` -\> `data.1.Parquet` -\> `data.2.Parquet`, etc.
Possible values:
- 0 β `INSERT` query appends new data to the end of the file.
- 1 β `INSERT` query creates a new file.
## engine\_file\_empty\_if\_not\_exists[β](https://clickhouse.com/docs/operations/settings/settings#engine_file_empty_if_not_exists "Direct link to engine_file_empty_if_not_exists")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Allows to select data from a file engine table without file.
Possible values:
- 0 β `SELECT` throws exception.
- 1 β `SELECT` returns empty result.
## engine\_file\_skip\_empty\_files[β](https://clickhouse.com/docs/operations/settings/settings#engine_file_skip_empty_files "Direct link to engine_file_skip_empty_files")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Enables or disables skipping empty files in [File](https://clickhouse.com/docs/engines/table-engines/special/file) engine tables.
Possible values:
- 0 β `SELECT` throws an exception if empty file is not compatible with requested format.
- 1 β `SELECT` returns empty result for empty file.
## engine\_file\_truncate\_on\_insert[β](https://clickhouse.com/docs/operations/settings/settings#engine_file_truncate_on_insert "Direct link to engine_file_truncate_on_insert")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Enables or disables truncate before insert in [File](https://clickhouse.com/docs/engines/table-engines/special/file) engine tables.
Possible values:
- 0 β `INSERT` query appends new data to the end of the file.
- 1 β `INSERT` query replaces existing content of the file with the new data.
## engine\_url\_skip\_empty\_files[β](https://clickhouse.com/docs/operations/settings/settings#engine_url_skip_empty_files "Direct link to engine_url_skip_empty_files")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Enables or disables skipping empty files in [URL](https://clickhouse.com/docs/engines/table-engines/special/url) engine tables.
Possible values:
- 0 β `SELECT` throws an exception if empty file is not compatible with requested format.
- 1 β `SELECT` returns empty result for empty file.
## exact\_rows\_before\_limit[β](https://clickhouse.com/docs/operations/settings/settings#exact_rows_before_limit "Direct link to exact_rows_before_limit")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
When enabled, ClickHouse will provide exact value for rows\_before\_limit\_at\_least statistic, but with the cost that the data before limit will have to be read completely
## except\_default\_mode[β](https://clickhouse.com/docs/operations/settings/settings#except_default_mode "Direct link to except_default_mode")
| Type | Default value |
|---|---|
| TypeSetOperationMode | Default valueALL |
Set default mode in EXCEPT query. Possible values: empty string, 'ALL', 'DISTINCT'. If empty, query without mode will throw exception.
## exclude\_materialize\_skip\_indexes\_on\_insert[β](https://clickhouse.com/docs/operations/settings/settings#exclude_materialize_skip_indexes_on_insert "Direct link to exclude_materialize_skip_indexes_on_insert")
Excludes specified skip indexes from being built and stored during INSERTs. The excluded skip indexes will still be built and stored [during merges](https://clickhouse.com/docs/operations/settings/merge-tree-settings#materialize_skip_indexes_on_merge) or by an explicit [MATERIALIZE INDEX](https://clickhouse.com/docs/sql-reference/statements/alter/skipping-index#materialize-index) query.
Has no effect if [materialize\_skip\_indexes\_on\_insert](https://clickhouse.com/docs/operations/settings/settings#materialize_skip_indexes_on_insert) is false.
Example:
```
CREATE TABLE tab
(
a UInt64,
b UInt64,
INDEX idx_a a TYPE minmax,
INDEX idx_b b TYPE set(3)
)
ENGINE = MergeTree ORDER BY tuple();
SET exclude_materialize_skip_indexes_on_insert='idx_a'; -- idx_a will be not be updated upon insert
--SET exclude_materialize_skip_indexes_on_insert='idx_a, idx_b'; -- neither index would be updated on insert
INSERT INTO tab SELECT number, number / 50 FROM numbers(100); -- only idx_b is updated
-- since it is a session setting it can be set on a per-query level
INSERT INTO tab SELECT number, number / 50 FROM numbers(100, 100) SETTINGS exclude_materialize_skip_indexes_on_insert='idx_b';
ALTER TABLE tab MATERIALIZE INDEX idx_a; -- this query can be used to explicitly materialize the index
SET exclude_materialize_skip_indexes_on_insert = DEFAULT; -- reset setting to default
```
## execute\_exists\_as\_scalar\_subquery[β](https://clickhouse.com/docs/operations/settings/settings#execute_exists_as_scalar_subquery "Direct link to execute_exists_as_scalar_subquery")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Execute non-correlated EXISTS subqueries as scalar subqueries. As for scalar subqueries, the cache is used, and the constant folding applies to the result.
Cloud default value: `0`.
## external\_storage\_connect\_timeout\_sec[β](https://clickhouse.com/docs/operations/settings/settings#external_storage_connect_timeout_sec "Direct link to external_storage_connect_timeout_sec")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value10 |
Connect timeout in seconds. Now supported only for MySQL
## external\_storage\_max\_read\_bytes[β](https://clickhouse.com/docs/operations/settings/settings#external_storage_max_read_bytes "Direct link to external_storage_max_read_bytes")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Limit maximum number of bytes when table with external engine should flush history data. Now supported only for MySQL table engine, database engine, and dictionary. If equal to 0, this setting is disabled
## external\_storage\_max\_read\_rows[β](https://clickhouse.com/docs/operations/settings/settings#external_storage_max_read_rows "Direct link to external_storage_max_read_rows")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Limit maximum number of rows when table with external engine should flush history data. Now supported only for MySQL table engine, database engine, and dictionary. If equal to 0, this setting is disabled
## external\_storage\_rw\_timeout\_sec[β](https://clickhouse.com/docs/operations/settings/settings#external_storage_rw_timeout_sec "Direct link to external_storage_rw_timeout_sec")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value300 |
Read/write timeout in seconds. Now supported only for MySQL
## external\_table\_functions\_use\_nulls[β](https://clickhouse.com/docs/operations/settings/settings#external_table_functions_use_nulls "Direct link to external_table_functions_use_nulls")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Defines how [mysql](https://clickhouse.com/docs/sql-reference/table-functions/mysql), [postgresql](https://clickhouse.com/docs/sql-reference/table-functions/postgresql) and [odbc](https://clickhouse.com/docs/sql-reference/table-functions/odbc) table functions use Nullable columns.
Possible values:
- 0 β The table function explicitly uses Nullable columns.
- 1 β The table function implicitly uses Nullable columns.
**Usage**
If the setting is set to `0`, the table function does not make Nullable columns and inserts default values instead of NULL. This is also applicable for NULL values inside arrays.
## external\_table\_strict\_query[β](https://clickhouse.com/docs/operations/settings/settings#external_table_strict_query "Direct link to external_table_strict_query")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
If it is set to true, transforming expression to local filter is forbidden for queries to external tables.
**Aliases**: `extract_kvp_max_pairs_per_row`
| Type | Default value |
|---|---|
| TypeUInt64 | Default value1000 |
Max number of pairs that can be produced by the `extractKeyValuePairs` function. Used as a safeguard against consuming too much memory.
## extremes[β](https://clickhouse.com/docs/operations/settings/settings#extremes "Direct link to extremes")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Whether to count extreme values (the minimums and maximums in columns of a query result). Accepts 0 or 1. By default, 0 (disabled). For more information, see the section "Extreme values".
## fallback\_to\_stale\_replicas\_for\_distributed\_queries[β](https://clickhouse.com/docs/operations/settings/settings#fallback_to_stale_replicas_for_distributed_queries "Direct link to fallback_to_stale_replicas_for_distributed_queries")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Forces a query to an out-of-date replica if updated data is not available. See [Replication](https://clickhouse.com/docs/engines/table-engines/mergetree-family/replication).
ClickHouse selects the most relevant from the outdated replicas of the table.
Used when performing `SELECT` from a distributed table that points to replicated tables.
By default, 1 (enabled).
## filesystem\_cache\_allow\_background\_download[β](https://clickhouse.com/docs/operations/settings/settings#filesystem_cache_allow_background_download "Direct link to filesystem_cache_allow_background_download")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Allow filesystem cache to enqueue background downloads for data read from remote storage. Disable to keep downloads in the foreground for the current query/session.
## filesystem\_cache\_boundary\_alignment[β](https://clickhouse.com/docs/operations/settings/settings#filesystem_cache_boundary_alignment "Direct link to filesystem_cache_boundary_alignment")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Filesystem cache boundary alignment. This setting is applied only for non-disk read (e.g. for cache of remote table engines / table functions, but not for storage configuration of MergeTree tables). Value 0 means no alignment.
## filesystem\_cache\_enable\_background\_download\_during\_fetch[β](https://clickhouse.com/docs/operations/settings/settings#filesystem_cache_enable_background_download_during_fetch "Direct link to filesystem_cache_enable_background_download_during_fetch")
ClickHouse Cloud only
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Only has an effect in ClickHouse Cloud. Wait time to lock cache for space reservation in filesystem cache
ClickHouse Cloud only
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Only has an effect in ClickHouse Cloud. Wait time to lock cache for space reservation in filesystem cache
## filesystem\_cache\_max\_download\_size[β](https://clickhouse.com/docs/operations/settings/settings#filesystem_cache_max_download_size "Direct link to filesystem_cache_max_download_size")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value137438953472 |
Max remote filesystem cache size that can be downloaded by a single query
## filesystem\_cache\_name[β](https://clickhouse.com/docs/operations/settings/settings#filesystem_cache_name "Direct link to filesystem_cache_name")
Filesystem cache name to use for stateless table engines or data lakes
## filesystem\_cache\_prefer\_bigger\_buffer\_size[β](https://clickhouse.com/docs/operations/settings/settings#filesystem_cache_prefer_bigger_buffer_size "Direct link to filesystem_cache_prefer_bigger_buffer_size")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Prefer bigger buffer size if filesystem cache is enabled to avoid writing small file segments which deteriorate cache performance. On the other hand, enabling this setting might increase memory usage.
## filesystem\_cache\_reserve\_space\_wait\_lock\_timeout\_milliseconds[β](https://clickhouse.com/docs/operations/settings/settings#filesystem_cache_reserve_space_wait_lock_timeout_milliseconds "Direct link to filesystem_cache_reserve_space_wait_lock_timeout_milliseconds")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value1000 |
Wait time to lock cache for space reservation in filesystem cache
## filesystem\_cache\_segments\_batch\_size[β](https://clickhouse.com/docs/operations/settings/settings#filesystem_cache_segments_batch_size "Direct link to filesystem_cache_segments_batch_size")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value20 |
Limit on size of a single batch of file segments that a read buffer can request from cache. Too low value will lead to excessive requests to cache, too large may slow down eviction from cache
## filesystem\_cache\_skip\_download\_if\_exceeds\_per\_query\_cache\_write\_limit[β](https://clickhouse.com/docs/operations/settings/settings#filesystem_cache_skip_download_if_exceeds_per_query_cache_write_limit "Direct link to filesystem_cache_skip_download_if_exceeds_per_query_cache_write_limit")
**Aliases**: `skip_download_if_exceeds_query_cache`
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Skip download from remote filesystem if exceeds query cache size
## filesystem\_prefetch\_max\_memory\_usage[β](https://clickhouse.com/docs/operations/settings/settings#filesystem_prefetch_max_memory_usage "Direct link to filesystem_prefetch_max_memory_usage")
| Type | Default value |
|---|---|
| TypeNonZeroUInt64 | Default value1073741824 |
Maximum memory usage for prefetches.
Cloud default value: 10% of total memory.
## filesystem\_prefetch\_step\_bytes[β](https://clickhouse.com/docs/operations/settings/settings#filesystem_prefetch_step_bytes "Direct link to filesystem_prefetch_step_bytes")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Prefetch step in bytes. Zero means `auto` - approximately the best prefetch step will be auto deduced, but might not be 100% the best. The actual value might be different because of setting filesystem\_prefetch\_min\_bytes\_for\_single\_read\_task
## filesystem\_prefetch\_step\_marks[β](https://clickhouse.com/docs/operations/settings/settings#filesystem_prefetch_step_marks "Direct link to filesystem_prefetch_step_marks")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Prefetch step in marks. Zero means `auto` - approximately the best prefetch step will be auto deduced, but might not be 100% the best. The actual value might be different because of setting filesystem\_prefetch\_min\_bytes\_for\_single\_read\_task
## filesystem\_prefetches\_limit[β](https://clickhouse.com/docs/operations/settings/settings#filesystem_prefetches_limit "Direct link to filesystem_prefetches_limit")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value200 |
Maximum number of prefetches. Zero means unlimited. A setting `filesystem_prefetches_max_memory_usage` is more recommended if you want to limit the number of prefetches
## final[β](https://clickhouse.com/docs/operations/settings/settings#final "Direct link to final")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Automatically applies [FINAL](https://clickhouse.com/docs/sql-reference/statements/select/from#final-modifier) modifier to all tables in a query, to tables where [FINAL](https://clickhouse.com/docs/sql-reference/statements/select/from#final-modifier) is applicable, including joined tables and tables in sub-queries, and distributed tables.
Possible values:
- 0 - disabled
- 1 - enabled
Example:
```
CREATE TABLE test
(
key Int64,
some String
)
ENGINE = ReplacingMergeTree
ORDER BY key;
INSERT INTO test FORMAT Values (1, 'first');
INSERT INTO test FORMAT Values (1, 'second');
SELECT * FROM test;
ββkeyββ¬βsomeββββ
β 1 β second β
βββββββ΄βββββββββ
ββkeyββ¬βsomeβββ
β 1 β first β
βββββββ΄ββββββββ
SELECT * FROM test SETTINGS final = 1;
ββkeyββ¬βsomeββββ
β 1 β second β
βββββββ΄βββββββββ
SET final = 1;
SELECT * FROM test;
ββkeyββ¬βsomeββββ
β 1 β second β
βββββββ΄βββββββββ
```
## finalize\_projection\_parts\_synchronously[β](https://clickhouse.com/docs/operations/settings/settings#finalize_projection_parts_synchronously "Direct link to finalize_projection_parts_synchronously")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
When enabled, projection parts are finalized synchronously during INSERT, reducing peak memory usage at the cost of reduced S3 upload parallelism. By default, each projection's output stream is kept alive until the entire part (including all projections) is finalized, which allows overlapping S3 uploads but increases peak memory proportional to the number of projections. This setting only affects the INSERT path; merge and mutation already finalize projections synchronously.
## flatten\_nested[β](https://clickhouse.com/docs/operations/settings/settings#flatten_nested "Direct link to flatten_nested")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Sets the data format of a [nested](https://clickhouse.com/docs/sql-reference/data-types/nested-data-structures/nested) columns.
Possible values:
- 1 β Nested column is flattened to separate arrays.
- 0 β Nested column stays a single array of tuples.
**Usage**
If the setting is set to `0`, it is possible to use an arbitrary level of nesting.
**Examples**
Query:
```
SET flatten_nested = 1;
CREATE TABLE t_nest (`n` Nested(a UInt32, b UInt32)) ENGINE = MergeTree ORDER BY tuple();
SHOW CREATE TABLE t_nest;
```
Result:
```
ββstatementββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β CREATE TABLE default.t_nest
(
`n.a` Array(UInt32),
`n.b` Array(UInt32)
)
ENGINE = MergeTree
ORDER BY tuple()
SETTINGS index_granularity = 8192 β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
```
Query:
```
SET flatten_nested = 0;
CREATE TABLE t_nest (`n` Nested(a UInt32, b UInt32)) ENGINE = MergeTree ORDER BY tuple();
SHOW CREATE TABLE t_nest;
```
Result:
```
ββstatementβββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β CREATE TABLE default.t_nest
(
`n` Nested(a UInt32, b UInt32)
)
ENGINE = MergeTree
ORDER BY tuple()
SETTINGS index_granularity = 8192 β
ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
```
## force\_aggregate\_partitions\_independently[β](https://clickhouse.com/docs/operations/settings/settings#force_aggregate_partitions_independently "Direct link to force_aggregate_partitions_independently")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Force the use of optimization when it is applicable, but heuristics decided not to use it
## force\_aggregation\_in\_order[β](https://clickhouse.com/docs/operations/settings/settings#force_aggregation_in_order "Direct link to force_aggregation_in_order")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
The setting is used by the server itself to support distributed queries. Do not change it manually, because it will break normal operations. (Forces use of aggregation in order on remote nodes during distributed aggregation).
## force\_data\_skipping\_indices[β](https://clickhouse.com/docs/operations/settings/settings#force_data_skipping_indices "Direct link to force_data_skipping_indices")
Disables query execution if passed data skipping indices wasn't used.
Consider the following example:
```
CREATE TABLE data
(
key Int,
d1 Int,
d1_null Nullable(Int),
INDEX d1_idx d1 TYPE minmax GRANULARITY 1,
INDEX d1_null_idx assumeNotNull(d1_null) TYPE minmax GRANULARITY 1
)
Engine=MergeTree()
ORDER BY key;
SELECT * FROM data_01515;
SELECT * FROM data_01515 SETTINGS force_data_skipping_indices=''; -- query will produce CANNOT_PARSE_TEXT error.
SELECT * FROM data_01515 SETTINGS force_data_skipping_indices='d1_idx'; -- query will produce INDEX_NOT_USED error.
SELECT * FROM data_01515 WHERE d1 = 0 SETTINGS force_data_skipping_indices='d1_idx'; -- Ok.
SELECT * FROM data_01515 WHERE d1 = 0 SETTINGS force_data_skipping_indices='`d1_idx`'; -- Ok (example of full featured parser).
SELECT * FROM data_01515 WHERE d1 = 0 SETTINGS force_data_skipping_indices='`d1_idx`, d1_null_idx'; -- query will produce INDEX_NOT_USED error, since d1_null_idx is not used.
SELECT * FROM data_01515 WHERE d1 = 0 AND assumeNotNull(d1_null) = 0 SETTINGS force_data_skipping_indices='`d1_idx`, d1_null_idx'; -- Ok.
```
## force\_grouping\_standard\_compatibility[β](https://clickhouse.com/docs/operations/settings/settings#force_grouping_standard_compatibility "Direct link to force_grouping_standard_compatibility")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Make GROUPING function to return 1 when argument is not used as an aggregation key
## force\_index\_by\_date[β](https://clickhouse.com/docs/operations/settings/settings#force_index_by_date "Direct link to force_index_by_date")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Disables query execution if the index can't be used by date.
Works with tables in the MergeTree family.
If `force_index_by_date=1`, ClickHouse checks whether the query has a date key condition that can be used for restricting data ranges. If there is no suitable condition, it throws an exception. However, it does not check whether the condition reduces the amount of data to read. For example, the condition `Date != ' 2000-01-01 '` is acceptable even when it matches all the data in the table (i.e., running the query requires a full scan). For more information about ranges of data in MergeTree tables, see [MergeTree](https://clickhouse.com/docs/engines/table-engines/mergetree-family/mergetree).
## force\_optimize\_projection[β](https://clickhouse.com/docs/operations/settings/settings#force_optimize_projection "Direct link to force_optimize_projection")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Enables or disables the obligatory use of [projections](https://clickhouse.com/docs/engines/table-engines/mergetree-family/mergetree#projections) in `SELECT` queries, when projection optimization is enabled (see [optimize\_use\_projections](https://clickhouse.com/docs/operations/settings/settings#optimize_use_projections) setting).
Possible values:
- 0 β Projection optimization is not obligatory.
- 1 β Projection optimization is obligatory.
## force\_optimize\_projection\_name[β](https://clickhouse.com/docs/operations/settings/settings#force_optimize_projection_name "Direct link to force_optimize_projection_name")
If it is set to a non-empty string, check that this projection is used in the query at least once.
Possible values:
- string: name of projection that used in a query
## force\_optimize\_skip\_unused\_shards[β](https://clickhouse.com/docs/operations/settings/settings#force_optimize_skip_unused_shards "Direct link to force_optimize_skip_unused_shards")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Enables or disables query execution if [optimize\_skip\_unused\_shards](https://clickhouse.com/docs/operations/settings/settings#optimize_skip_unused_shards) is enabled and skipping of unused shards is not possible. If the skipping is not possible and the setting is enabled, an exception will be thrown.
Possible values:
- 0 β Disabled. ClickHouse does not throw an exception.
- 1 β Enabled. Query execution is disabled only if the table has a sharding key.
- 2 β Enabled. Query execution is disabled regardless of whether a sharding key is defined for the table.
## force\_optimize\_skip\_unused\_shards\_nesting[β](https://clickhouse.com/docs/operations/settings/settings#force_optimize_skip_unused_shards_nesting "Direct link to force_optimize_skip_unused_shards_nesting")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Controls [`force_optimize_skip_unused_shards`](https://clickhouse.com/docs/operations/settings/settings#force_optimize_skip_unused_shards) (hence still requires [`force_optimize_skip_unused_shards`](https://clickhouse.com/docs/operations/settings/settings#force_optimize_skip_unused_shards)) depends on the nesting level of the distributed query (case when you have `Distributed` table that look into another `Distributed` table).
Possible values:
- 0 - Disabled, `force_optimize_skip_unused_shards` works always.
- 1 β Enables `force_optimize_skip_unused_shards` only for the first level.
- 2 β Enables `force_optimize_skip_unused_shards` up to the second level.
## force\_primary\_key[β](https://clickhouse.com/docs/operations/settings/settings#force_primary_key "Direct link to force_primary_key")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Disables query execution if indexing by the primary key is not possible.
Works with tables in the MergeTree family.
If `force_primary_key=1`, ClickHouse checks to see if the query has a primary key condition that can be used for restricting data ranges. If there is no suitable condition, it throws an exception. However, it does not check whether the condition reduces the amount of data to read. For more information about data ranges in MergeTree tables, see [MergeTree](https://clickhouse.com/docs/engines/table-engines/mergetree-family/mergetree).
## force\_remove\_data\_recursively\_on\_drop[β](https://clickhouse.com/docs/operations/settings/settings#force_remove_data_recursively_on_drop "Direct link to force_remove_data_recursively_on_drop")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Recursively remove data on DROP query. Avoids 'Directory not empty' error, but may silently remove detached data
## formatdatetime\_e\_with\_space\_padding[β](https://clickhouse.com/docs/operations/settings/settings#formatdatetime_e_with_space_padding "Direct link to formatdatetime_e_with_space_padding")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Formatter '%e' in function 'formatDateTime' prints single-digit days with a leading space, e.g. ' 2' instead of '2'.
## formatdatetime\_f\_prints\_scale\_number\_of\_digits[β](https://clickhouse.com/docs/operations/settings/settings#formatdatetime_f_prints_scale_number_of_digits "Direct link to formatdatetime_f_prints_scale_number_of_digits")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Formatter '%f' in function 'formatDateTime' prints only the scale amount of digits for a DateTime64 instead of fixed 6 digits.
## formatdatetime\_f\_prints\_single\_zero[β](https://clickhouse.com/docs/operations/settings/settings#formatdatetime_f_prints_single_zero "Direct link to formatdatetime_f_prints_single_zero")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Formatter '%f' in function 'formatDateTime' prints a single zero instead of six zeros if the formatted value has no fractional seconds.
## formatdatetime\_format\_without\_leading\_zeros[β](https://clickhouse.com/docs/operations/settings/settings#formatdatetime_format_without_leading_zeros "Direct link to formatdatetime_format_without_leading_zeros")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Formatters '%c', '%l' and '%k' in function 'formatDateTime' print months and hours without leading zeros.
## formatdatetime\_parsedatetime\_m\_is\_month\_name[β](https://clickhouse.com/docs/operations/settings/settings#formatdatetime_parsedatetime_m_is_month_name "Direct link to formatdatetime_parsedatetime_m_is_month_name")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Formatter '%M' in functions 'formatDateTime' and 'parseDateTime' print/parse the month name instead of minutes.
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Enables or disables [fsync](http://pubs.opengroup.org/onlinepubs/9699919799/functions/fsync.html) when writing `.sql` files. Enabled by default.
It makes sense to disable it if the server has millions of tiny tables that are constantly being created and destroyed.
## function\_date\_trunc\_return\_type\_behavior[β](https://clickhouse.com/docs/operations/settings/settings#function_date_trunc_return_type_behavior "Direct link to function_date_trunc_return_type_behavior")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Allows to change the behaviour of the result type of `dateTrunc` function.
Possible values:
- 0 - When the second argument is `DateTime64/Date32` the return type will be `DateTime64/Date32` regardless of the time unit in the first argument.
- 1 - For `Date32` the result is always `Date`. For `DateTime64` the result is `DateTime` for time units `second` and higher.
## function\_implementation[β](https://clickhouse.com/docs/operations/settings/settings#function_implementation "Direct link to function_implementation")
Choose function implementation for specific target or variant (experimental). If empty enable all of them.
## function\_json\_value\_return\_type\_allow\_complex[β](https://clickhouse.com/docs/operations/settings/settings#function_json_value_return_type_allow_complex "Direct link to function_json_value_return_type_allow_complex")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Control whether allow to return complex type (such as: struct, array, map) for json\_value function.
```
SELECT JSON_VALUE('{"hello":{"world":"!"}}', '$.hello') settings function_json_value_return_type_allow_complex=true
ββJSON_VALUE('{"hello":{"world":"!"}}', '$.hello')ββ
β {"world":"!"} β
ββββββββββββββββββββββββββββββββββββββββββββββββββββ
1 row in set. Elapsed: 0.001 sec.
```
Possible values:
- true β Allow.
- false β Disallow.
## function\_json\_value\_return\_type\_allow\_nullable[β](https://clickhouse.com/docs/operations/settings/settings#function_json_value_return_type_allow_nullable "Direct link to function_json_value_return_type_allow_nullable")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Control whether allow to return `NULL` when value is not exist for JSON\_VALUE function.
```
SELECT JSON_VALUE('{"hello":"world"}', '$.b') settings function_json_value_return_type_allow_nullable=true;
ββJSON_VALUE('{"hello":"world"}', '$.b')ββ
β α΄Ία΅α΄Έα΄Έ β
ββββββββββββββββββββββββββββββββββββββββββ
1 row in set. Elapsed: 0.001 sec.
```
Possible values:
- true β Allow.
- false β Disallow.
## function\_locate\_has\_mysql\_compatible\_argument\_order[β](https://clickhouse.com/docs/operations/settings/settings#function_locate_has_mysql_compatible_argument_order "Direct link to function_locate_has_mysql_compatible_argument_order")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Controls the order of arguments in function [locate](https://clickhouse.com/docs/sql-reference/functions/string-search-functions#locate).
Possible values:
- 0 β Function `locate` accepts arguments `(haystack, needle[, start_pos])`.
- 1 β Function `locate` accepts arguments `(needle, haystack, [, start_pos])` (MySQL-compatible behavior)
## function\_range\_max\_elements\_in\_block[β](https://clickhouse.com/docs/operations/settings/settings#function_range_max_elements_in_block "Direct link to function_range_max_elements_in_block")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value500000000 |
Sets the safety threshold for data volume generated by function [range](https://clickhouse.com/docs/sql-reference/functions/array-functions#range). Defines the maximum number of values generated by function per block of data (sum of array sizes for every row in a block).
Possible values:
- Positive integer.
**See Also**
- [`max_block_size`](https://clickhouse.com/docs/operations/settings/settings#max_block_size)
- [`min_insert_block_size_rows`](https://clickhouse.com/docs/operations/settings/settings#min_insert_block_size_rows)
## function\_sleep\_max\_microseconds\_per\_block[β](https://clickhouse.com/docs/operations/settings/settings#function_sleep_max_microseconds_per_block "Direct link to function_sleep_max_microseconds_per_block")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value3000000 |
Maximum number of microseconds the function `sleep` is allowed to sleep for each block. If a user called it with a larger value, it throws an exception. It is a safety threshold.
## function\_visible\_width\_behavior[β](https://clickhouse.com/docs/operations/settings/settings#function_visible_width_behavior "Direct link to function_visible_width_behavior")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value1 |
The version of `visibleWidth` behavior. 0 - only count the number of code points; 1 - correctly count zero-width and combining characters, count full-width characters as two, estimate the tab width, count delete characters.
## functions\_h3\_default\_if\_invalid[β](https://clickhouse.com/docs/operations/settings/settings#functions_h3_default_if_invalid "Direct link to functions_h3_default_if_invalid")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
If false, h3 functions, e.g. h3CellAreaM2, throw an exception if input is invalid. If true, they return 0 or default value.
## geo\_distance\_returns\_float64\_on\_float64\_arguments[β](https://clickhouse.com/docs/operations/settings/settings#geo_distance_returns_float64_on_float64_arguments "Direct link to geo_distance_returns_float64_on_float64_arguments")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
If all four arguments to `geoDistance`, `greatCircleDistance`, `greatCircleAngle` functions are Float64, return Float64 and use double precision for internal calculations. In previous ClickHouse versions, the functions always returned Float32.
## geotoh3\_argument\_order[β](https://clickhouse.com/docs/operations/settings/settings#geotoh3_argument_order "Direct link to geotoh3_argument_order")
| Type | Default value |
|---|---|
| TypeGeoToH3ArgumentOrder | Default valuelat\_lon |
Function 'geoToH3' accepts (lon, lat) if set to 'lon\_lat' and (lat, lon) if set to 'lat\_lon'.
## glob\_expansion\_max\_elements[β](https://clickhouse.com/docs/operations/settings/settings#glob_expansion_max_elements "Direct link to glob_expansion_max_elements")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value1000 |
Maximum number of allowed addresses (For external storages, table functions, etc).
## grace\_hash\_join\_initial\_buckets[β](https://clickhouse.com/docs/operations/settings/settings#grace_hash_join_initial_buckets "Direct link to grace_hash_join_initial_buckets")
| Type | Default value |
|---|---|
| TypeNonZeroUInt64 | Default value1 |
Initial number of grace hash join buckets
## grace\_hash\_join\_max\_buckets[β](https://clickhouse.com/docs/operations/settings/settings#grace_hash_join_max_buckets "Direct link to grace_hash_join_max_buckets")
| Type | Default value |
|---|---|
| TypeNonZeroUInt64 | Default value1024 |
Limit on the number of grace hash join buckets
## group\_by\_overflow\_mode[β](https://clickhouse.com/docs/operations/settings/settings#group_by_overflow_mode "Direct link to group_by_overflow_mode")
| Type | Default value |
|---|---|
| TypeOverflowModeGroupBy | Default valuethrow |
Sets what happens when the number of unique keys for aggregation exceeds the limit:
- `throw`: throw an exception
- `break`: stop executing the query and return the partial result
- `any`: continue aggregation for the keys that got into the set, but do not add new keys to the set.
Using the 'any' value lets you run an approximation of GROUP BY. The quality of this approximation depends on the statistical nature of the data.
## group\_by\_two\_level\_threshold[β](https://clickhouse.com/docs/operations/settings/settings#group_by_two_level_threshold "Direct link to group_by_two_level_threshold")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value100000 |
From what number of keys, a two-level aggregation starts. 0 - the threshold is not set.
## group\_by\_two\_level\_threshold\_bytes[β](https://clickhouse.com/docs/operations/settings/settings#group_by_two_level_threshold_bytes "Direct link to group_by_two_level_threshold_bytes")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value50000000 |
From what size of the aggregation state in bytes, a two-level aggregation begins to be used. 0 - the threshold is not set. Two-level aggregation is used when at least one of the thresholds is triggered.
## group\_by\_use\_nulls[β](https://clickhouse.com/docs/operations/settings/settings#group_by_use_nulls "Direct link to group_by_use_nulls")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Changes the way the [GROUP BY clause](https://clickhouse.com/docs/sql-reference/statements/select/group-by) treats the types of aggregation keys. When the `ROLLUP`, `CUBE`, or `GROUPING SETS` specifiers are used, some aggregation keys may not be used to produce some result rows. Columns for these keys are filled with either default value or `NULL` in corresponding rows depending on this setting.
Possible values:
- 0 β The default value for the aggregation key type is used to produce missing values.
- 1 β ClickHouse executes `GROUP BY` the same way as the SQL standard says. The types of aggregation keys are converted to [Nullable](https://clickhouse.com/docs/sql-reference/data-types/nullable). Columns for corresponding aggregation keys are filled with [NULL](https://clickhouse.com/docs/sql-reference/syntax#null) for rows that didn't use it.
See also:
- [GROUP BY clause](https://clickhouse.com/docs/sql-reference/statements/select/group-by)
## h3togeo\_lon\_lat\_result\_order[β](https://clickhouse.com/docs/operations/settings/settings#h3togeo_lon_lat_result_order "Direct link to h3togeo_lon_lat_result_order")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Function 'h3ToGeo' returns (lon, lat) if true, otherwise (lat, lon).
## handshake\_timeout\_ms[β](https://clickhouse.com/docs/operations/settings/settings#handshake_timeout_ms "Direct link to handshake_timeout_ms")
| Type | Default value |
|---|---|
| TypeMilliseconds | Default value10000 |
Timeout in milliseconds for receiving Hello packet from replicas during handshake.
## hdfs\_create\_new\_file\_on\_insert[β](https://clickhouse.com/docs/operations/settings/settings#hdfs_create_new_file_on_insert "Direct link to hdfs_create_new_file_on_insert")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Enables or disables creating a new file on each insert in HDFS engine tables. If enabled, on each insert a new HDFS file will be created with the name, similar to this pattern:
initial: `data.Parquet.gz` -\> `data.1.Parquet.gz` -\> `data.2.Parquet.gz`, etc.
Possible values:
- 0 β `INSERT` query appends new data to the end of the file.
- 1 β `INSERT` query creates a new file.
## hdfs\_ignore\_file\_doesnt\_exist[β](https://clickhouse.com/docs/operations/settings/settings#hdfs_ignore_file_doesnt_exist "Direct link to hdfs_ignore_file_doesnt_exist")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Ignore absence of file if it does not exist when reading certain keys.
Possible values:
- 1 β `SELECT` returns empty result.
- 0 β `SELECT` throws an exception.
## hdfs\_replication[β](https://clickhouse.com/docs/operations/settings/settings#hdfs_replication "Direct link to hdfs_replication")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
The actual number of replications can be specified when the hdfs file is created.
## hdfs\_skip\_empty\_files[β](https://clickhouse.com/docs/operations/settings/settings#hdfs_skip_empty_files "Direct link to hdfs_skip_empty_files")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Enables or disables skipping empty files in [HDFS](https://clickhouse.com/docs/engines/table-engines/integrations/hdfs) engine tables.
Possible values:
- 0 β `SELECT` throws an exception if empty file is not compatible with requested format.
- 1 β `SELECT` returns empty result for empty file.
## hdfs\_throw\_on\_zero\_files\_match[β](https://clickhouse.com/docs/operations/settings/settings#hdfs_throw_on_zero_files_match "Direct link to hdfs_throw_on_zero_files_match")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Throw an error if matched zero files according to glob expansion rules.
Possible values:
- 1 β `SELECT` throws an exception.
- 0 β `SELECT` returns empty result.
## hdfs\_truncate\_on\_insert[β](https://clickhouse.com/docs/operations/settings/settings#hdfs_truncate_on_insert "Direct link to hdfs_truncate_on_insert")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Enables or disables truncation before an insert in hdfs engine tables. If disabled, an exception will be thrown on an attempt to insert if a file in HDFS already exists.
Possible values:
- 0 β `INSERT` query appends new data to the end of the file.
- 1 β `INSERT` query replaces existing content of the file with the new data.
## hedged\_connection\_timeout\_ms[β](https://clickhouse.com/docs/operations/settings/settings#hedged_connection_timeout_ms "Direct link to hedged_connection_timeout_ms")
| Type | Default value |
|---|---|
| TypeMilliseconds | Default value50 |
Connection timeout for establishing connection with replica for Hedged requests
## highlight\_max\_matches\_per\_row[β](https://clickhouse.com/docs/operations/settings/settings#highlight_max_matches_per_row "Direct link to highlight_max_matches_per_row")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value10000 |
Sets the maximum number of highlight matches per row in the [highlight](https://clickhouse.com/docs/sql-reference/functions/string-search-functions#highlight) function. Use it to protect against excessive memory usage when highlighting highly repetitive patterns in large texts.
Possible values:
- Positive integer.
## hnsw\_candidate\_list\_size\_for\_search[β](https://clickhouse.com/docs/operations/settings/settings#hnsw_candidate_list_size_for_search "Direct link to hnsw_candidate_list_size_for_search")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value256 |
The size of the dynamic candidate list when searching the vector similarity index, also known as 'ef\_search'.
## hsts\_max\_age[β](https://clickhouse.com/docs/operations/settings/settings#hsts_max_age "Direct link to hsts_max_age")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Expired time for HSTS. 0 means disable HSTS.
## http\_connection\_timeout[β](https://clickhouse.com/docs/operations/settings/settings#http_connection_timeout "Direct link to http_connection_timeout")
| Type | Default value |
|---|---|
| TypeSeconds | Default value1 |
HTTP connection timeout (in seconds).
Possible values:
- Any positive integer.
- 0 - Disabled (infinite timeout).
| Type | Default value |
|---|---|
| TypeUInt64 | Default value100 |
Do not send HTTP headers X-ClickHouse-Progress more frequently than at each specified interval.
## http\_make\_head\_request[β](https://clickhouse.com/docs/operations/settings/settings#http_make_head_request "Direct link to http_make_head_request")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
The `http_make_head_request` setting allows the execution of a `HEAD` request while reading data from HTTP to retrieve information about the file to be read, such as its size. Since it's enabled by default, it may be desirable to disable this setting in cases where the server does not support `HEAD` requests.
## http\_max\_field\_name\_size[β](https://clickhouse.com/docs/operations/settings/settings#http_max_field_name_size "Direct link to http_max_field_name_size")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value131072 |
Maximum length of field name in HTTP header
## http\_max\_field\_value\_size[β](https://clickhouse.com/docs/operations/settings/settings#http_max_field_value_size "Direct link to http_max_field_value_size")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value131072 |
Maximum length of field value in HTTP header
## http\_max\_fields[β](https://clickhouse.com/docs/operations/settings/settings#http_max_fields "Direct link to http_max_fields")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value1000000 |
Maximum number of fields in HTTP header
## http\_max\_multipart\_form\_data\_size[β](https://clickhouse.com/docs/operations/settings/settings#http_max_multipart_form_data_size "Direct link to http_max_multipart_form_data_size")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value1073741824 |
Limit on size of multipart/form-data content. This setting cannot be parsed from URL parameters and should be set in a user profile. Note that content is parsed and external tables are created in memory before the start of query execution. And this is the only limit that has an effect on that stage (limits on max memory usage and max execution time have no effect while reading HTTP form data).
## http\_max\_request\_param\_data\_size[β](https://clickhouse.com/docs/operations/settings/settings#http_max_request_param_data_size "Direct link to http_max_request_param_data_size")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value10485760 |
Limit on size of request data used as a query parameter in predefined HTTP requests.
## http\_max\_tries[β](https://clickhouse.com/docs/operations/settings/settings#http_max_tries "Direct link to http_max_tries")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value10 |
Max attempts to read via http.
## http\_max\_uri\_size[β](https://clickhouse.com/docs/operations/settings/settings#http_max_uri_size "Direct link to http_max_uri_size")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value1048576 |
Sets the maximum URI length of an HTTP request.
Possible values:
- Positive integer.
## http\_native\_compression\_disable\_checksumming\_on\_decompress[β](https://clickhouse.com/docs/operations/settings/settings#http_native_compression_disable_checksumming_on_decompress "Direct link to http_native_compression_disable_checksumming_on_decompress")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Enables or disables checksum verification when decompressing the HTTP POST data from the client. Used only for ClickHouse native compression format (not used with `gzip` or `deflate`).
For more information, read the [HTTP interface description](https://clickhouse.com/docs/interfaces/http).
Possible values:
- 0 β Disabled.
- 1 β Enabled.
## http\_receive\_timeout[β](https://clickhouse.com/docs/operations/settings/settings#http_receive_timeout "Direct link to http_receive_timeout")
| Type | Default value |
|---|---|
| TypeSeconds | Default value30 |
HTTP receive timeout (in seconds).
Possible values:
- Any positive integer.
- 0 - Disabled (infinite timeout).
## http\_response\_buffer\_size[β](https://clickhouse.com/docs/operations/settings/settings#http_response_buffer_size "Direct link to http_response_buffer_size")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
The number of bytes to buffer in the server memory before sending a HTTP response to the client or flushing to disk (when http\_wait\_end\_of\_query is enabled).
| Type | Default value |
|---|---|
| TypeMap | Default value{} |
Allows to add or override HTTP headers which the server will return in the response with a successful query result. This only affects the HTTP interface.
If the header is already set by default, the provided value will override it. If the header was not set by default, it will be added to the list of headers. Headers that are set by the server by default and not overridden by this setting, will remain.
The setting allows you to set a header to a constant value. Currently there is no way to set a header to a dynamically calculated value.
Neither names or values can contain ASCII control characters.
If you implement a UI application which allows users to modify settings but at the same time makes decisions based on the returned headers, it is recommended to restrict this setting to readonly.
Example: `SET http_response_headers = '{"Content-Type": "image/png"}'`
## http\_retry\_initial\_backoff\_ms[β](https://clickhouse.com/docs/operations/settings/settings#http_retry_initial_backoff_ms "Direct link to http_retry_initial_backoff_ms")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value100 |
Min milliseconds for backoff, when retrying read via http
## http\_retry\_max\_backoff\_ms[β](https://clickhouse.com/docs/operations/settings/settings#http_retry_max_backoff_ms "Direct link to http_retry_max_backoff_ms")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value10000 |
Max milliseconds for backoff, when retrying read via http
## http\_send\_timeout[β](https://clickhouse.com/docs/operations/settings/settings#http_send_timeout "Direct link to http_send_timeout")
| Type | Default value |
|---|---|
| TypeSeconds | Default value30 |
HTTP send timeout (in seconds).
Possible values:
- Any positive integer.
- 0 - Disabled (infinite timeout).
Note
It's applicable only to the default profile. A server reboot is required for the changes to take effect.
## http\_skip\_not\_found\_url\_for\_globs[β](https://clickhouse.com/docs/operations/settings/settings#http_skip_not_found_url_for_globs "Direct link to http_skip_not_found_url_for_globs")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Skip URLs for globs with HTTP\_NOT\_FOUND error
## http\_wait\_end\_of\_query[β](https://clickhouse.com/docs/operations/settings/settings#http_wait_end_of_query "Direct link to http_wait_end_of_query")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Enable HTTP response buffering on the server-side.
## http\_write\_exception\_in\_output\_format[β](https://clickhouse.com/docs/operations/settings/settings#http_write_exception_in_output_format "Direct link to http_write_exception_in_output_format")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Write exception in output format to produce valid output. Works with JSON and XML formats.
## http\_zlib\_compression\_level[β](https://clickhouse.com/docs/operations/settings/settings#http_zlib_compression_level "Direct link to http_zlib_compression_level")
| Type | Default value |
|---|---|
| TypeInt64 | Default value3 |
Sets the level of data compression in the response to an HTTP request if [enable\_http\_compression = 1](https://clickhouse.com/docs/operations/settings/settings#enable_http_compression).
Possible values: Numbers from 1 to 9.
## iceberg\_delete\_data\_on\_drop[β](https://clickhouse.com/docs/operations/settings/settings#iceberg_delete_data_on_drop "Direct link to iceberg_delete_data_on_drop")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Whether to delete all iceberg files on drop or not.
## iceberg\_expire\_default\_max\_ref\_age\_ms[β](https://clickhouse.com/docs/operations/settings/settings#iceberg_expire_default_max_ref_age_ms "Direct link to iceberg_expire_default_max_ref_age_ms")
| Type | Default value |
|---|---|
| TypeInt64 | Default value9223372036854775807 |
Default value for Iceberg table property `history.expire.max-ref-age-ms` used by `expire_snapshots` when that property is absent.
## iceberg\_expire\_default\_max\_snapshot\_age\_ms[β](https://clickhouse.com/docs/operations/settings/settings#iceberg_expire_default_max_snapshot_age_ms "Direct link to iceberg_expire_default_max_snapshot_age_ms")
| Type | Default value |
|---|---|
| TypeInt64 | Default value432000000 |
Default value for Iceberg table property `history.expire.max-snapshot-age-ms` used by `expire_snapshots` when that property is absent.
## iceberg\_expire\_default\_min\_snapshots\_to\_keep[β](https://clickhouse.com/docs/operations/settings/settings#iceberg_expire_default_min_snapshots_to_keep "Direct link to iceberg_expire_default_min_snapshots_to_keep")
| Type | Default value |
|---|---|
| TypeInt64 | Default value1 |
Default value for Iceberg table property `history.expire.min-snapshots-to-keep` used by `expire_snapshots` when that property is absent.
## iceberg\_insert\_max\_bytes\_in\_data\_file[β](https://clickhouse.com/docs/operations/settings/settings#iceberg_insert_max_bytes_in_data_file "Direct link to iceberg_insert_max_bytes_in_data_file")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value1073741824 |
Max bytes of iceberg parquet data file on insert operation.
## iceberg\_insert\_max\_partitions[β](https://clickhouse.com/docs/operations/settings/settings#iceberg_insert_max_partitions "Direct link to iceberg_insert_max_partitions")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value100 |
Max allowed partitions count per one insert operation for Iceberg table engine.
## iceberg\_insert\_max\_rows\_in\_data\_file[β](https://clickhouse.com/docs/operations/settings/settings#iceberg_insert_max_rows_in_data_file "Direct link to iceberg_insert_max_rows_in_data_file")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value1000000 |
Max rows of iceberg parquet data file on insert operation.
Method to compress `.metadata.json` file.
| Type | Default value |
|---|---|
| TypeIcebergMetadataLogLevel | Default valuenone |
Controls the level of metadata logging for Iceberg tables to system.iceberg\_metadata\_log. Usually this setting can be modified for debugging purposes.
Possible values:
- none - No metadata log.
- metadata - Root metadata.json file.
- manifest\_list\_metadata - Everything above + metadata from avro manifest list which corresponds to a snapshot.
- manifest\_list\_entry - Everything above + avro manifest list entries.
- manifest\_file\_metadata - Everything above + metadata from traversed avro manifest files.
- manifest\_file\_entry - Everything above + traversed avro manifest files entries.
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
If non-zero, skip fetching iceberg metadata from remote catalog if there is a cached metadata snapshot, more recent than the given staleness window. Zero means to always fetch the latest metadata version from the remote catalog. Setting this a non-zero trades staleness to a lower latency of read operations.
## iceberg\_snapshot\_id[β](https://clickhouse.com/docs/operations/settings/settings#iceberg_snapshot_id "Direct link to iceberg_snapshot_id")
| Type | Default value |
|---|---|
| TypeInt64 | Default value0 |
Query Iceberg table using the specific snapshot id.
## iceberg\_timestamp\_ms[β](https://clickhouse.com/docs/operations/settings/settings#iceberg_timestamp_ms "Direct link to iceberg_timestamp_ms")
| Type | Default value |
|---|---|
| TypeInt64 | Default value0 |
Query Iceberg table using the snapshot that was current at a specific timestamp.
## idle\_connection\_timeout[β](https://clickhouse.com/docs/operations/settings/settings#idle_connection_timeout "Direct link to idle_connection_timeout")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value3600 |
Timeout to close idle TCP connections after specified number of seconds.
Possible values:
- Positive integer (0 - close immediately, after 0 seconds).
## ignore\_cold\_parts\_seconds[β](https://clickhouse.com/docs/operations/settings/settings#ignore_cold_parts_seconds "Direct link to ignore_cold_parts_seconds")
ClickHouse Cloud only
| Type | Default value |
|---|---|
| TypeInt64 | Default value0 |
Only has an effect in ClickHouse Cloud. Exclude new data parts from SELECT queries until they're either pre-warmed (see [cache\_populated\_by\_fetch](https://clickhouse.com/docs/operations/settings/merge-tree-settings#cache_populated_by_fetch)) or this many seconds old. Only for Replicated-/SharedMergeTree.
## ignore\_data\_skipping\_indices[β](https://clickhouse.com/docs/operations/settings/settings#ignore_data_skipping_indices "Direct link to ignore_data_skipping_indices")
Ignores the skipping indexes specified if used by the query.
Consider the following example:
```
CREATE TABLE data
(
key Int,
x Int,
y Int,
INDEX x_idx x TYPE minmax GRANULARITY 1,
INDEX y_idx y TYPE minmax GRANULARITY 1,
INDEX xy_idx (x,y) TYPE minmax GRANULARITY 1
)
Engine=MergeTree()
ORDER BY key;
INSERT INTO data VALUES (1, 2, 3);
SELECT * FROM data;
SELECT * FROM data SETTINGS ignore_data_skipping_indices=''; -- query will produce CANNOT_PARSE_TEXT error.
SELECT * FROM data SETTINGS ignore_data_skipping_indices='x_idx'; -- Ok.
SELECT * FROM data SETTINGS ignore_data_skipping_indices='na_idx'; -- Ok.
SELECT * FROM data WHERE x = 1 AND y = 1 SETTINGS ignore_data_skipping_indices='xy_idx',force_data_skipping_indices='xy_idx' ; -- query will produce INDEX_NOT_USED error, since xy_idx is explicitly ignored.
SELECT * FROM data WHERE x = 1 AND y = 2 SETTINGS ignore_data_skipping_indices='xy_idx';
```
The query without ignoring any indexes:
```
EXPLAIN indexes = 1 SELECT * FROM data WHERE x = 1 AND y = 2;
Expression ((Projection + Before ORDER BY))
Filter (WHERE)
ReadFromMergeTree (default.data)
Indexes:
PrimaryKey
Condition: true
Parts: 1/1
Granules: 1/1
Skip
Name: x_idx
Description: minmax GRANULARITY 1
Parts: 0/1
Granules: 0/1
Skip
Name: y_idx
Description: minmax GRANULARITY 1
Parts: 0/0
Granules: 0/0
Skip
Name: xy_idx
Description: minmax GRANULARITY 1
Parts: 0/0
Granules: 0/0
```
Ignoring the `xy_idx` index:
```
EXPLAIN indexes = 1 SELECT * FROM data WHERE x = 1 AND y = 2 SETTINGS ignore_data_skipping_indices='xy_idx';
Expression ((Projection + Before ORDER BY))
Filter (WHERE)
ReadFromMergeTree (default.data)
Indexes:
PrimaryKey
Condition: true
Parts: 1/1
Granules: 1/1
Skip
Name: x_idx
Description: minmax GRANULARITY 1
Parts: 0/1
Granules: 0/1
Skip
Name: y_idx
Description: minmax GRANULARITY 1
Parts: 0/0
Granules: 0/0
```
Works with tables in the MergeTree family.
## ignore\_drop\_queries\_probability[β](https://clickhouse.com/docs/operations/settings/settings#ignore_drop_queries_probability "Direct link to ignore_drop_queries_probability")
| Type | Default value |
|---|---|
| TypeFloat | Default value0 |
If enabled, server will ignore all DROP table queries with specified probability (for Memory and JOIN engines it will replace DROP to TRUNCATE). Used for testing purposes
## ignore\_format\_null\_for\_explain[β](https://clickhouse.com/docs/operations/settings/settings#ignore_format_null_for_explain "Direct link to ignore_format_null_for_explain")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
If enabled, `FORMAT Null` will be ignored for `EXPLAIN` queries and default output format will be used instead. When disabled, `EXPLAIN` queries with `FORMAT Null` will produce no output (backward compatible behavior).
## ignore\_materialized\_views\_with\_dropped\_target\_table[β](https://clickhouse.com/docs/operations/settings/settings#ignore_materialized_views_with_dropped_target_table "Direct link to ignore_materialized_views_with_dropped_target_table")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Ignore MVs with dropped target table during pushing to views
## ignore\_on\_cluster\_for\_replicated\_access\_entities\_queries[β](https://clickhouse.com/docs/operations/settings/settings#ignore_on_cluster_for_replicated_access_entities_queries "Direct link to ignore_on_cluster_for_replicated_access_entities_queries")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Ignore ON CLUSTER clause for replicated access entities management queries.
## ignore\_on\_cluster\_for\_replicated\_database[β](https://clickhouse.com/docs/operations/settings/settings#ignore_on_cluster_for_replicated_database "Direct link to ignore_on_cluster_for_replicated_database")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Always ignore ON CLUSTER clause for DDL queries with replicated databases.
## ignore\_on\_cluster\_for\_replicated\_named\_collections\_queries[β](https://clickhouse.com/docs/operations/settings/settings#ignore_on_cluster_for_replicated_named_collections_queries "Direct link to ignore_on_cluster_for_replicated_named_collections_queries")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Ignore ON CLUSTER clause for replicated named collections management queries.
## ignore\_on\_cluster\_for\_replicated\_udf\_queries[β](https://clickhouse.com/docs/operations/settings/settings#ignore_on_cluster_for_replicated_udf_queries "Direct link to ignore_on_cluster_for_replicated_udf_queries")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Ignore ON CLUSTER clause for replicated UDF management queries.
## implicit\_select[β](https://clickhouse.com/docs/operations/settings/settings#implicit_select "Direct link to implicit_select")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Allow writing simple SELECT queries without the leading SELECT keyword, which makes it simple for calculator-style usage, e.g. `1 + 2` becomes a valid query.
In `clickhouse-local` it is enabled by default and can be explicitly disabled.
## implicit\_table\_at\_top\_level[β](https://clickhouse.com/docs/operations/settings/settings#implicit_table_at_top_level "Direct link to implicit_table_at_top_level")
If not empty, queries without FROM at the top level will read from this table instead of system.one.
This is used in clickhouse-local for input data processing. The setting could be set explicitly by a user but is not intended for this type of usage.
Subqueries are not affected by this setting (neither scalar, FROM, or IN subqueries). SELECTs at the top level of UNION, INTERSECT, EXCEPT chains are treated uniformly and affected by this setting, regardless of their grouping in parentheses. It is unspecified how this setting affects views and distributed queries.
The setting accepts a table name (then the table is resolved from the current database) or a qualified name in the form of 'database.table'. Both database and table names have to be unquoted - only simple identifiers are allowed.
## implicit\_transaction[β](https://clickhouse.com/docs/operations/settings/settings#implicit_transaction "Direct link to implicit_transaction")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
If enabled and not already inside a transaction, wraps the query inside a full transaction (begin + commit or rollback)
## inject\_random\_order\_for\_select\_without\_order\_by[β](https://clickhouse.com/docs/operations/settings/settings#inject_random_order_for_select_without_order_by "Direct link to inject_random_order_for_select_without_order_by")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
If enabled, injects 'ORDER BY rand()' into SELECT queries without ORDER BY clause. Applied only for subquery depth = 0. Subqueries and INSERT INTO ... SELECT are not affected. If the top-level construct is UNION, 'ORDER BY rand()' is injected into all children independently. Only useful for testing and development (missing ORDER BY is a source of non-deterministic query results).
## insert\_allow\_materialized\_columns[β](https://clickhouse.com/docs/operations/settings/settings#insert_allow_materialized_columns "Direct link to insert_allow_materialized_columns")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
If setting is enabled, Allow materialized columns in INSERT.
## insert\_deduplicate[β](https://clickhouse.com/docs/operations/settings/settings#insert_deduplicate "Direct link to insert_deduplicate")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Enables or disables block deduplication of `INSERT` (for Replicated\* tables).
Possible values:
- 0 β Disabled.
- 1 β Enabled.
By default, blocks inserted into replicated tables by the `INSERT` statement are deduplicated (see [Data Replication](https://clickhouse.com/docs/engines/table-engines/mergetree-family/replication)). For the replicated tables by default the only 100 of the most recent blocks for each partition are deduplicated (see [replicated\_deduplication\_window](https://clickhouse.com/docs/operations/settings/merge-tree-settings#replicated_deduplication_window), [replicated\_deduplication\_window\_seconds](https://clickhouse.com/docs/operations/settings/merge-tree-settings#replicated_deduplication_window_seconds)). For not replicated tables see [non\_replicated\_deduplication\_window](https://clickhouse.com/docs/operations/settings/merge-tree-settings#non_replicated_deduplication_window).
## insert\_deduplication\_token[β](https://clickhouse.com/docs/operations/settings/settings#insert_deduplication_token "Direct link to insert_deduplication_token")
The setting allows a user to provide own deduplication semantic in MergeTree/ReplicatedMergeTree For example, by providing a unique value for the setting in each INSERT statement, user can avoid the same inserted data being deduplicated.
Possible values:
- Any string
`insert_deduplication_token` is used for deduplication *only* when not empty.
For the replicated tables by default the only 100 of the most recent inserts for each partition are deduplicated (see [replicated\_deduplication\_window](https://clickhouse.com/docs/operations/settings/merge-tree-settings#replicated_deduplication_window), [replicated\_deduplication\_window\_seconds](https://clickhouse.com/docs/operations/settings/merge-tree-settings#replicated_deduplication_window_seconds)). For not replicated tables see [non\_replicated\_deduplication\_window](https://clickhouse.com/docs/operations/settings/merge-tree-settings#non_replicated_deduplication_window).
Note
`insert_deduplication_token` works on a partition level (the same as `insert_deduplication` checksum). Multiple partitions can have the same `insert_deduplication_token`.
Example:
```
CREATE TABLE test_table
( A Int64 )
ENGINE = MergeTree
ORDER BY A
SETTINGS non_replicated_deduplication_window = 100;
INSERT INTO test_table SETTINGS insert_deduplication_token = 'test' VALUES (1);
-- the next insert won't be deduplicated because insert_deduplication_token is different
INSERT INTO test_table SETTINGS insert_deduplication_token = 'test1' VALUES (1);
-- the next insert will be deduplicated because insert_deduplication_token
-- is the same as one of the previous
INSERT INTO test_table SETTINGS insert_deduplication_token = 'test' VALUES (2);
SELECT * FROM test_table
ββAββ
β 1 β
βββββ
ββAββ
β 1 β
βββββ
```
## insert\_keeper\_fault\_injection\_probability[β](https://clickhouse.com/docs/operations/settings/settings#insert_keeper_fault_injection_probability "Direct link to insert_keeper_fault_injection_probability")
| Type | Default value |
|---|---|
| TypeFloat | Default value0 |
Approximate probability of failure for a keeper request during insert. Valid value is in interval \[0.0f, 1.0f\]
## insert\_keeper\_fault\_injection\_seed[β](https://clickhouse.com/docs/operations/settings/settings#insert_keeper_fault_injection_seed "Direct link to insert_keeper_fault_injection_seed")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
0 - random seed, otherwise the setting value
## insert\_keeper\_max\_retries[β](https://clickhouse.com/docs/operations/settings/settings#insert_keeper_max_retries "Direct link to insert_keeper_max_retries")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value20 |
The setting sets the maximum number of retries for ClickHouse Keeper (or ZooKeeper) requests during insert into replicated MergeTree. Only Keeper requests which failed due to network error, Keeper session timeout, or request timeout are considered for retries.
Possible values:
- Positive integer.
- 0 β Retries are disabled
Cloud default value: `20`.
Keeper request retries are done after some timeout. The timeout is controlled by the following settings: `insert_keeper_retry_initial_backoff_ms`, `insert_keeper_retry_max_backoff_ms`. The first retry is done after `insert_keeper_retry_initial_backoff_ms` timeout. The consequent timeouts will be calculated as follows:
```
timeout = min(insert_keeper_retry_max_backoff_ms, latest_timeout * 2)
```
For example, if `insert_keeper_retry_initial_backoff_ms=100`, `insert_keeper_retry_max_backoff_ms=10000` and `insert_keeper_max_retries=8` then timeouts will be `100, 200, 400, 800, 1600, 3200, 6400, 10000`.
Apart from fault tolerance, the retries aim to provide a better user experience - they allow to avoid returning an error during INSERT execution if Keeper is restarted, for example, due to an upgrade.
## insert\_keeper\_retry\_initial\_backoff\_ms[β](https://clickhouse.com/docs/operations/settings/settings#insert_keeper_retry_initial_backoff_ms "Direct link to insert_keeper_retry_initial_backoff_ms")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value100 |
Initial timeout(in milliseconds) to retry a failed Keeper request during INSERT query execution
Possible values:
- Positive integer.
- 0 β No timeout
## insert\_keeper\_retry\_max\_backoff\_ms[β](https://clickhouse.com/docs/operations/settings/settings#insert_keeper_retry_max_backoff_ms "Direct link to insert_keeper_retry_max_backoff_ms")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value10000 |
Maximum timeout (in milliseconds) to retry a failed Keeper request during INSERT query execution
Possible values:
- Positive integer.
- 0 β Maximum timeout is not limited
## insert\_null\_as\_default[β](https://clickhouse.com/docs/operations/settings/settings#insert_null_as_default "Direct link to insert_null_as_default")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Enables or disables the insertion of [default values](https://clickhouse.com/docs/sql-reference/statements/create/table#default_values) instead of [NULL](https://clickhouse.com/docs/sql-reference/syntax#null) into columns with not [nullable](https://clickhouse.com/docs/sql-reference/data-types/nullable) data type. If column type is not nullable and this setting is disabled, then inserting `NULL` causes an exception. If column type is nullable, then `NULL` values are inserted as is, regardless of this setting.
This setting is applicable to [INSERT ... SELECT](https://clickhouse.com/docs/sql-reference/statements/insert-into#inserting-the-results-of-select) queries. Note that `SELECT` subqueries may be concatenated with `UNION ALL` clause.
Possible values:
- 0 β Inserting `NULL` into a not nullable column causes an exception.
- 1 β Default column value is inserted instead of `NULL`.
## insert\_quorum[β](https://clickhouse.com/docs/operations/settings/settings#insert_quorum "Direct link to insert_quorum")
| Type | Default value |
|---|---|
| TypeUInt64Auto | Default value0 |
Enables the quorum writes.
- If `insert_quorum < 2`, the quorum writes are disabled.
- If `insert_quorum >= 2`, the quorum writes are enabled.
- If `insert_quorum = 'auto'`, use majority number (`number_of_replicas / 2 + 1`) as quorum number.
Quorum writes
`INSERT` succeeds only when ClickHouse manages to correctly write data to the `insert_quorum` of replicas during the `insert_quorum_timeout`. If for any reason the number of replicas with successful writes does not reach the `insert_quorum`, the write is considered failed and ClickHouse will delete the inserted block from all the replicas where data has already been written.
When `insert_quorum_parallel` is disabled, all replicas in the quorum are consistent, i.e. they contain data from all previous `INSERT` queries (the `INSERT` sequence is linearized). When reading data written using `insert_quorum` and `insert_quorum_parallel` is disabled, you can turn on sequential consistency for `SELECT` queries using [select\_sequential\_consistency](https://clickhouse.com/docs/operations/settings/settings#select_sequential_consistency).
ClickHouse generates an exception:
- If the number of available replicas at the time of the query is less than the `insert_quorum`.
- When `insert_quorum_parallel` is disabled and an attempt to write data is made when the previous block has not yet been inserted in `insert_quorum` of replicas. This situation may occur if the user tries to perform another `INSERT` query to the same table before the previous one with `insert_quorum` is completed.
See also:
- [insert\_quorum\_timeout](https://clickhouse.com/docs/operations/settings/settings#insert_quorum_timeout)
- [insert\_quorum\_parallel](https://clickhouse.com/docs/operations/settings/settings#insert_quorum_parallel)
- [select\_sequential\_consistency](https://clickhouse.com/docs/operations/settings/settings#select_sequential_consistency)
## insert\_quorum\_parallel[β](https://clickhouse.com/docs/operations/settings/settings#insert_quorum_parallel "Direct link to insert_quorum_parallel")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Enables or disables parallelism for quorum `INSERT` queries. If enabled, additional `INSERT` queries can be sent while previous queries have not yet finished. If disabled, additional writes to the same table will be rejected.
Possible values:
- 0 β Disabled.
- 1 β Enabled.
See also:
- [insert\_quorum](https://clickhouse.com/docs/operations/settings/settings#insert_quorum)
- [insert\_quorum\_timeout](https://clickhouse.com/docs/operations/settings/settings#insert_quorum_timeout)
- [select\_sequential\_consistency](https://clickhouse.com/docs/operations/settings/settings#select_sequential_consistency)
## insert\_quorum\_timeout[β](https://clickhouse.com/docs/operations/settings/settings#insert_quorum_timeout "Direct link to insert_quorum_timeout")
| Type | Default value |
|---|---|
| TypeMilliseconds | Default value600000 |
Write to a quorum timeout in milliseconds. If the timeout has passed and no write has taken place yet, ClickHouse will generate an exception and the client must repeat the query to write the same block to the same or any other replica.
See also:
- [insert\_quorum](https://clickhouse.com/docs/operations/settings/settings#insert_quorum)
- [insert\_quorum\_parallel](https://clickhouse.com/docs/operations/settings/settings#insert_quorum_parallel)
- [select\_sequential\_consistency](https://clickhouse.com/docs/operations/settings/settings#select_sequential_consistency)
## insert\_shard\_id[β](https://clickhouse.com/docs/operations/settings/settings#insert_shard_id "Direct link to insert_shard_id")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
If not `0`, specifies the shard of [Distributed](https://clickhouse.com/docs/engines/table-engines/special/distributed) table into which the data will be inserted synchronously.
If `insert_shard_id` value is incorrect, the server will throw an exception.
To get the number of shards on `requested_cluster`, you can check server config or use this query:
```
SELECT uniq(shard_num) FROM system.clusters WHERE cluster = 'requested_cluster';
```
Possible values:
- 0 β Disabled.
- Any number from `1` to `shards_num` of corresponding [Distributed](https://clickhouse.com/docs/engines/table-engines/special/distributed) table.
**Example**
Query:
```
CREATE TABLE x AS system.numbers ENGINE = MergeTree ORDER BY number;
CREATE TABLE x_dist AS x ENGINE = Distributed('test_cluster_two_shards_localhost', currentDatabase(), x);
INSERT INTO x_dist SELECT * FROM numbers(5) SETTINGS insert_shard_id = 1;
SELECT * FROM x_dist ORDER BY number ASC;
```
Result:
```
ββnumberββ
β 0 β
β 0 β
β 1 β
β 1 β
β 2 β
β 2 β
β 3 β
β 3 β
β 4 β
β 4 β
ββββββββββ
```
## interactive\_delay[β](https://clickhouse.com/docs/operations/settings/settings#interactive_delay "Direct link to interactive_delay")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value100000 |
The interval in microseconds for checking whether request execution has been canceled and sending the progress.
## intersect\_default\_mode[β](https://clickhouse.com/docs/operations/settings/settings#intersect_default_mode "Direct link to intersect_default_mode")
| Type | Default value |
|---|---|
| TypeSetOperationMode | Default valueALL |
Set default mode in INTERSECT query. Possible values: empty string, 'ALL', 'DISTINCT'. If empty, query without mode will throw exception.
## jemalloc\_collect\_profile\_samples\_in\_trace\_log[β](https://clickhouse.com/docs/operations/settings/settings#jemalloc_collect_profile_samples_in_trace_log "Direct link to jemalloc_collect_profile_samples_in_trace_log")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Collect jemalloc allocation and deallocation samples in trace log.
## jemalloc\_enable\_profiler[β](https://clickhouse.com/docs/operations/settings/settings#jemalloc_enable_profiler "Direct link to jemalloc_enable_profiler")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Enable jemalloc profiler for the query. Jemalloc will sample allocations and all deallocations for sampled allocations. Profiles can be flushed using SYSTEM JEMALLOC FLUSH PROFILE which can be used for allocation analysis. Samples can also be stored in system.trace\_log using config jemalloc\_collect\_global\_profile\_samples\_in\_trace\_log or with query setting jemalloc\_collect\_profile\_samples\_in\_trace\_log. See [Allocation Profiling](https://clickhouse.com/docs/operations/allocation-profiling)
## jemalloc\_profile\_text\_collapsed\_use\_count[β](https://clickhouse.com/docs/operations/settings/settings#jemalloc_profile_text_collapsed_use_count "Direct link to jemalloc_profile_text_collapsed_use_count")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
When using the 'collapsed' output format for jemalloc heap profile, aggregate by allocation count instead of bytes. When false (default), each stack is weighted by live bytes; when true, by live allocation count.
## jemalloc\_profile\_text\_output\_format[β](https://clickhouse.com/docs/operations/settings/settings#jemalloc_profile_text_output_format "Direct link to jemalloc_profile_text_output_format")
| Type | Default value |
|---|---|
| TypeJemallocProfileFormat | Default valuecollapsed |
Output format for jemalloc heap profile in system.jemalloc\_profile\_text table. Can be: 'raw' (raw profile), 'symbolized' (jeprof format with symbols), or 'collapsed' (FlameGraph format).
## jemalloc\_profile\_text\_symbolize\_with\_inline[β](https://clickhouse.com/docs/operations/settings/settings#jemalloc_profile_text_symbolize_with_inline "Direct link to jemalloc_profile_text_symbolize_with_inline")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Whether to include inline frames when symbolizing jemalloc heap profile. When enabled, inline frames are included which can slow down symbolization process drastically; when disabled, they are skipped. Only affects 'symbolized' and 'collapsed' output formats.
## join\_algorithm[β](https://clickhouse.com/docs/operations/settings/settings#join_algorithm "Direct link to join_algorithm")
| Type | Default value |
|---|---|
| TypeJoinAlgorithm | Default valuedirect,parallel\_hash,hash |
Specifies which [JOIN](https://clickhouse.com/docs/sql-reference/statements/select/join) algorithm is used.
Several algorithms can be specified, and an available one would be chosen for a particular query based on kind/strictness and table engine.
Possible values:
- grace\_hash
[Grace hash join](https://en.wikipedia.org/wiki/Hash_join#Grace_hash_join) is used. Grace hash provides an algorithm option that provides performant complex joins while limiting memory use.
The first phase of a grace join reads the right table and splits it into N buckets depending on the hash value of key columns (initially, N is `grace_hash_join_initial_buckets`). This is done in a way to ensure that each bucket can be processed independently. Rows from the first bucket are added to an in-memory hash table while the others are saved to disk. If the hash table grows beyond the memory limit (e.g., as set by [`max_bytes_in_join`](https://clickhouse.com/docs/operations/settings/settings#max_bytes_in_join), the number of buckets is increased and the assigned bucket for each row. Any rows which don't belong to the current bucket are flushed and reassigned.
Supports `INNER/LEFT/RIGHT/FULL ALL/ANY JOIN`.
- hash
[Hash join algorithm](https://en.wikipedia.org/wiki/Hash_join) is used. The most generic implementation that supports all combinations of kind and strictness and multiple join keys that are combined with `OR` in the `JOIN ON` section.
When using the `hash` algorithm, the right part of `JOIN` is uploaded into RAM.
- parallel\_hash
A variation of `hash` join that splits the data into buckets and builds several hashtables instead of one concurrently to speed up this process.
When using the `parallel_hash` algorithm, the right part of `JOIN` is uploaded into RAM.
- partial\_merge
A variation of the [sort-merge algorithm](https://en.wikipedia.org/wiki/Sort-merge_join), where only the right table is fully sorted.
The `RIGHT JOIN` and `FULL JOIN` are supported only with `ALL` strictness (`SEMI`, `ANTI`, `ANY`, and `ASOF` are not supported).
When using the `partial_merge` algorithm, ClickHouse sorts the data and dumps it to the disk. The `partial_merge` algorithm in ClickHouse differs slightly from the classic realization. First, ClickHouse sorts the right table by joining keys in blocks and creates a min-max index for sorted blocks. Then it sorts parts of the left table by the `join key` and joins them over the right table. The min-max index is also used to skip unneeded right table blocks.
- direct
The `direct` (also known as nested loop) algorithm performs a lookup in the right table using rows from the left table as keys. It's supported by special storages such as [Dictionary](https://clickhouse.com/docs/engines/table-engines/special/dictionary), [EmbeddedRocksDB](https://clickhouse.com/docs/engines/table-engines/integrations/embedded-rocksdb), and [MergeTree](https://clickhouse.com/docs/engines/table-engines/mergetree-family/mergetree) tables.
For MergeTree tables, the algorithm pushes join key filters directly to the storage layer. This can be more efficient when the key can use the table's primary key index for lookups, otherwise it performs full scans of the right table for each left table block.
Supports `INNER` and `LEFT` joins and only single-column equality join keys without other conditions.
- auto
When set to `auto`, `hash` join is tried first, and the algorithm is switched on the fly to another algorithm if the memory limit is violated.
- full\_sorting\_merge
[Sort-merge algorithm](https://en.wikipedia.org/wiki/Sort-merge_join) with full sorting of joined tables before joining.
- prefer\_partial\_merge
ClickHouse always tries to use `partial_merge` join if possible, otherwise, it uses `hash`. *Deprecated*, same as `partial_merge,hash`.
- default (deprecated)
Legacy value, please don't use anymore. Same as `direct,hash`, i.e. try to use direct join and hash join (in this order).
## join\_any\_take\_last\_row[β](https://clickhouse.com/docs/operations/settings/settings#join_any_take_last_row "Direct link to join_any_take_last_row")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Changes the behaviour of join operations with `ANY` strictness.
Note
This setting applies only for `JOIN` operations with [Join](https://clickhouse.com/docs/engines/table-engines/special/join) engine tables.
Possible values:
- 0 β If the right table has more than one matching row, only the first one found is joined.
- 1 β If the right table has more than one matching row, only the last one found is joined.
See also:
- [JOIN clause](https://clickhouse.com/docs/sql-reference/statements/select/join)
- [Join table engine](https://clickhouse.com/docs/engines/table-engines/special/join)
- [join\_default\_strictness](https://clickhouse.com/docs/operations/settings/settings#join_default_strictness)
## join\_default\_strictness[β](https://clickhouse.com/docs/operations/settings/settings#join_default_strictness "Direct link to join_default_strictness")
| Type | Default value |
|---|---|
| TypeJoinStrictness | Default valueALL |
Sets default strictness for [JOIN clauses](https://clickhouse.com/docs/sql-reference/statements/select/join).
Possible values:
- `ALL` β If the right table has several matching rows, ClickHouse creates a [Cartesian product](https://en.wikipedia.org/wiki/Cartesian_product) from matching rows. This is the normal `JOIN` behaviour from standard SQL.
- `ANY` β If the right table has several matching rows, only the first one found is joined. If the right table has only one matching row, the results of `ANY` and `ALL` are the same.
- `ASOF` β For joining sequences with an uncertain match.
- `Empty string` β If `ALL` or `ANY` is not specified in the query, ClickHouse throws an exception.
## join\_on\_disk\_max\_files\_to\_merge[β](https://clickhouse.com/docs/operations/settings/settings#join_on_disk_max_files_to_merge "Direct link to join_on_disk_max_files_to_merge")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value64 |
Limits the number of files allowed for parallel sorting in MergeJoin operations when they are executed on disk.
The bigger the value of the setting, the more RAM is used and the less disk I/O is needed.
Possible values:
- Any positive integer, starting from 2.
## join\_output\_by\_rowlist\_perkey\_rows\_threshold[β](https://clickhouse.com/docs/operations/settings/settings#join_output_by_rowlist_perkey_rows_threshold "Direct link to join_output_by_rowlist_perkey_rows_threshold")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value5 |
The lower limit of per-key average rows in the right table to determine whether to output by row list in hash join.
## join\_overflow\_mode[β](https://clickhouse.com/docs/operations/settings/settings#join_overflow_mode "Direct link to join_overflow_mode")
| Type | Default value |
|---|---|
| TypeOverflowMode | Default valuethrow |
Defines what action ClickHouse performs when any of the following join limits is reached:
- [max\_bytes\_in\_join](https://clickhouse.com/docs/operations/settings/settings#max_bytes_in_join)
- [max\_rows\_in\_join](https://clickhouse.com/docs/operations/settings/settings#max_rows_in_join)
Possible values:
- `THROW` β ClickHouse throws an exception and breaks operation.
- `BREAK` β ClickHouse breaks operation and does not throw an exception.
Default value: `THROW`.
**See Also**
- [JOIN clause](https://clickhouse.com/docs/sql-reference/statements/select/join)
- [Join table engine](https://clickhouse.com/docs/engines/table-engines/special/join)
## join\_runtime\_bloom\_filter\_bytes[β](https://clickhouse.com/docs/operations/settings/settings#join_runtime_bloom_filter_bytes "Direct link to join_runtime_bloom_filter_bytes")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value524288 |
Size in bytes of a bloom filter used as JOIN runtime filter (see enable\_join\_runtime\_filters setting).
## join\_runtime\_bloom\_filter\_hash\_functions[β](https://clickhouse.com/docs/operations/settings/settings#join_runtime_bloom_filter_hash_functions "Direct link to join_runtime_bloom_filter_hash_functions")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value3 |
Number of hash functions in a bloom filter used as JOIN runtime filter (see enable\_join\_runtime\_filters setting).
## join\_runtime\_bloom\_filter\_max\_ratio\_of\_set\_bits[β](https://clickhouse.com/docs/operations/settings/settings#join_runtime_bloom_filter_max_ratio_of_set_bits "Direct link to join_runtime_bloom_filter_max_ratio_of_set_bits")
| Type | Default value |
|---|---|
| TypeDouble | Default value0\.7 |
If the number of set bits in a runtime bloom filter exceeds this ratio the filter is completely disabled to reduce the overhead.
## join\_runtime\_filter\_blocks\_to\_skip\_before\_reenabling[β](https://clickhouse.com/docs/operations/settings/settings#join_runtime_filter_blocks_to_skip_before_reenabling "Direct link to join_runtime_filter_blocks_to_skip_before_reenabling")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value30 |
Number of blocks that are skipped before trying to dynamically re-enable a runtime filter that previously was disabled due to poor filtering ratio.
## join\_runtime\_filter\_exact\_values\_limit[β](https://clickhouse.com/docs/operations/settings/settings#join_runtime_filter_exact_values_limit "Direct link to join_runtime_filter_exact_values_limit")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value10000 |
Maximum number of elements in runtime filter that are stored as is in a set, when this threshold is exceeded it switches to bloom filter.
## join\_runtime\_filter\_pass\_ratio\_threshold\_for\_disabling[β](https://clickhouse.com/docs/operations/settings/settings#join_runtime_filter_pass_ratio_threshold_for_disabling "Direct link to join_runtime_filter_pass_ratio_threshold_for_disabling")
| Type | Default value |
|---|---|
| TypeDouble | Default value0\.7 |
If ratio of passed rows to checked rows is greater than this threshold the runtime filter is considered as poorly performing and is disabled for the next `join_runtime_filter_blocks_to_skip_before_reenabling` blocks to reduce the overhead.
## join\_to\_sort\_maximum\_table\_rows[β](https://clickhouse.com/docs/operations/settings/settings#join_to_sort_maximum_table_rows "Direct link to join_to_sort_maximum_table_rows")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value10000 |
The maximum number of rows in the right table to determine whether to rerange the right table by key in left or inner join.
## join\_to\_sort\_minimum\_perkey\_rows[β](https://clickhouse.com/docs/operations/settings/settings#join_to_sort_minimum_perkey_rows "Direct link to join_to_sort_minimum_perkey_rows")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value40 |
The lower limit of per-key average rows in the right table to determine whether to rerange the right table by key in left or inner join. This setting ensures that the optimization is not applied for sparse table keys
## join\_use\_nulls[β](https://clickhouse.com/docs/operations/settings/settings#join_use_nulls "Direct link to join_use_nulls")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Sets the type of [JOIN](https://clickhouse.com/docs/sql-reference/statements/select/join) behaviour. When merging tables, empty cells may appear. ClickHouse fills them differently based on this setting.
Possible values:
- 0 β The empty cells are filled with the default value of the corresponding field type.
- 1 β `JOIN` behaves the same way as in standard SQL. The type of the corresponding field is converted to [Nullable](https://clickhouse.com/docs/sql-reference/data-types/nullable), and empty cells are filled with [NULL](https://clickhouse.com/docs/sql-reference/syntax).
## joined\_block\_split\_single\_row[β](https://clickhouse.com/docs/operations/settings/settings#joined_block_split_single_row "Direct link to joined_block_split_single_row")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Allow to chunk hash join result by rows corresponding to single row from left table. This may reduce memory usage in case of row with many matches in right table, but may increase CPU usage. Note that `max_joined_block_size_rows != 0` is mandatory for this setting to have effect. The `max_joined_block_size_bytes` combined with this setting is helpful to avoid excessive memory usage in case of skewed data with some large rows having many matches in right table.
## joined\_subquery\_requires\_alias[β](https://clickhouse.com/docs/operations/settings/settings#joined_subquery_requires_alias "Direct link to joined_subquery_requires_alias")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Force joined subqueries and table functions to have aliases for correct name qualification.
## kafka\_disable\_num\_consumers\_limit[β](https://clickhouse.com/docs/operations/settings/settings#kafka_disable_num_consumers_limit "Direct link to kafka_disable_num_consumers_limit")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Disable limit on kafka\_num\_consumers that depends on the number of available CPU cores.
## kafka\_max\_wait\_ms[β](https://clickhouse.com/docs/operations/settings/settings#kafka_max_wait_ms "Direct link to kafka_max_wait_ms")
| Type | Default value |
|---|---|
| TypeMilliseconds | Default value5000 |
The wait time in milliseconds for reading messages from [Kafka](https://clickhouse.com/docs/engines/table-engines/integrations/kafka) before retry.
Possible values:
- Positive integer.
- 0 β Infinite timeout.
See also:
- [Apache Kafka](https://kafka.apache.org/)
## keeper\_map\_strict\_mode[β](https://clickhouse.com/docs/operations/settings/settings#keeper_map_strict_mode "Direct link to keeper_map_strict_mode")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Enforce additional checks during operations on KeeperMap. E.g. throw an exception on an insert for already existing key
## keeper\_max\_retries[β](https://clickhouse.com/docs/operations/settings/settings#keeper_max_retries "Direct link to keeper_max_retries")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value10 |
Max retries for general keeper operations
## keeper\_retry\_initial\_backoff\_ms[β](https://clickhouse.com/docs/operations/settings/settings#keeper_retry_initial_backoff_ms "Direct link to keeper_retry_initial_backoff_ms")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value100 |
Initial backoff timeout for general keeper operations
## keeper\_retry\_max\_backoff\_ms[β](https://clickhouse.com/docs/operations/settings/settings#keeper_retry_max_backoff_ms "Direct link to keeper_retry_max_backoff_ms")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value5000 |
Max backoff timeout for general keeper operations
## least\_greatest\_legacy\_null\_behavior[β](https://clickhouse.com/docs/operations/settings/settings#least_greatest_legacy_null_behavior "Direct link to least_greatest_legacy_null_behavior")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
If enabled, functions 'least' and 'greatest' return NULL if one of their arguments is NULL.
## legacy\_column\_name\_of\_tuple\_literal[β](https://clickhouse.com/docs/operations/settings/settings#legacy_column_name_of_tuple_literal "Direct link to legacy_column_name_of_tuple_literal")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
List all names of element of large tuple literals in their column names instead of hash. This settings exists only for compatibility reasons. It makes sense to set to 'true', while doing rolling update of cluster from version lower than 21.7 to higher.
## lightweight\_delete\_mode[β](https://clickhouse.com/docs/operations/settings/settings#lightweight_delete_mode "Direct link to lightweight_delete_mode")
| Type | Default value |
|---|---|
| TypeLightweightDeleteMode | Default valuealter\_update |
A mode of internal update query that is executed as a part of lightweight delete.
Possible values:
- `alter_update` - run `ALTER UPDATE` query that creates a heavyweight mutation.
- `lightweight_update` - run lightweight update if possible, run `ALTER UPDATE` otherwise.
- `lightweight_update_force` - run lightweight update if possible, throw otherwise.
## lightweight\_deletes\_sync[β](https://clickhouse.com/docs/operations/settings/settings#lightweight_deletes_sync "Direct link to lightweight_deletes_sync")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value2 |
The same as [`mutations_sync`](https://clickhouse.com/docs/operations/settings/settings#mutations_sync), but controls only execution of lightweight deletes.
Possible values:
| Value | Description |
|---|---|
| `0` | Mutations execute asynchronously. |
| `1` | The query waits for the lightweight deletes to complete on the current server. |
| `2` | The query waits for the lightweight deletes to complete on all replicas (if they exist). |
| `3` | The query waits only for active replicas. Supported only for `SharedMergeTree`. For `ReplicatedMergeTree` it behaves the same as `mutations_sync = 2`. |
**See Also**
- [Synchronicity of ALTER Queries](https://clickhouse.com/docs/sql-reference/statements/alter#synchronicity-of-alter-queries)
- [Mutations](https://clickhouse.com/docs/sql-reference/statements/alter#mutations)
Cloud default value: `1`.
## limit[β](https://clickhouse.com/docs/operations/settings/settings#limit "Direct link to limit")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Sets the maximum number of rows to get from the query result. It adjusts the value set by the [LIMIT](https://clickhouse.com/docs/sql-reference/statements/select/limit) clause, so that the limit, specified in the query, cannot exceed the limit, set by this setting.
Possible values:
- 0 β The number of rows is not limited.
- Positive integer.
## load\_balancing[β](https://clickhouse.com/docs/operations/settings/settings#load_balancing "Direct link to load_balancing")
| Type | Default value |
|---|---|
| TypeLoadBalancing | Default valuerandom |
Specifies the algorithm of replicas selection that is used for distributed query processing.
ClickHouse supports the following algorithms of choosing replicas:
- [Random](https://clickhouse.com/docs/operations/settings/settings#load_balancing-random) (by default)
- [Nearest hostname](https://clickhouse.com/docs/operations/settings/settings#load_balancing-nearest_hostname)
- [Hostname levenshtein distance](https://clickhouse.com/docs/operations/settings/settings#load_balancing-hostname_levenshtein_distance)
- [In order](https://clickhouse.com/docs/operations/settings/settings#load_balancing-in_order)
- [First or random](https://clickhouse.com/docs/operations/settings/settings#load_balancing-first_or_random)
- [Round robin](https://clickhouse.com/docs/operations/settings/settings#load_balancing-round_robin)
See also:
- [distributed\_replica\_max\_ignored\_errors](https://clickhouse.com/docs/operations/settings/settings#distributed_replica_max_ignored_errors)
### Random (by Default)[β](https://clickhouse.com/docs/operations/settings/settings#load_balancing-random "Direct link to Random (by Default)")
```
load_balancing = random
```
The number of errors is counted for each replica. The query is sent to the replica with the fewest errors, and if there are several of these, to anyone of them. Disadvantages: Server proximity is not accounted for; if the replicas have different data, you will also get different data.
### Nearest Hostname[β](https://clickhouse.com/docs/operations/settings/settings#load_balancing-nearest_hostname "Direct link to Nearest Hostname")
```
load_balancing = nearest_hostname
```
The number of errors is counted for each replica. Every 5 minutes, the number of errors is integrally divided by 2. Thus, the number of errors is calculated for a recent time with exponential smoothing. If there is one replica with a minimal number of errors (i.e. errors occurred recently on the other replicas), the query is sent to it. If there are multiple replicas with the same minimal number of errors, the query is sent to the replica with a hostname that is most similar to the server's hostname in the config file (for the number of different characters in identical positions, up to the minimum length of both hostnames).
For instance, example01-01-1 and example01-01-2 are different in one position, while example01-01-1 and example01-02-2 differ in two places. This method might seem primitive, but it does not require external data about network topology, and it does not compare IP addresses, which would be complicated for our IPv6 addresses.
Thus, if there are equivalent replicas, the closest one by name is preferred. We can also assume that when sending a query to the same server, in the absence of failures, a distributed query will also go to the same servers. So even if different data is placed on the replicas, the query will return mostly the same results.
### Hostname levenshtein distance[β](https://clickhouse.com/docs/operations/settings/settings#load_balancing-hostname_levenshtein_distance "Direct link to Hostname levenshtein distance")
```
load_balancing = hostname_levenshtein_distance
```
Just like `nearest_hostname`, but it compares hostname in a [levenshtein distance](https://en.wikipedia.org/wiki/Levenshtein_distance) manner. For example:
```
example-clickhouse-0-0 ample-clickhouse-0-0
1
example-clickhouse-0-0 example-clickhouse-1-10
2
example-clickhouse-0-0 example-clickhouse-12-0
3
```
### In Order[β](https://clickhouse.com/docs/operations/settings/settings#load_balancing-in_order "Direct link to In Order")
```
load_balancing = in_order
```
Replicas with the same number of errors are accessed in the same order as they are specified in the configuration. This method is appropriate when you know exactly which replica is preferable.
### First or Random[β](https://clickhouse.com/docs/operations/settings/settings#load_balancing-first_or_random "Direct link to First or Random")
```
load_balancing = first_or_random
```
This algorithm chooses the first replica in the set or a random replica if the first is unavailable. It's effective in cross-replication topology setups, but useless in other configurations.
The `first_or_random` algorithm solves the problem of the `in_order` algorithm. With `in_order`, if one replica goes down, the next one gets a double load while the remaining replicas handle the usual amount of traffic. When using the `first_or_random` algorithm, the load is evenly distributed among replicas that are still available.
It's possible to explicitly define what the first replica is by using the setting `load_balancing_first_offset`. This gives more control to rebalance query workloads among replicas.
### Round Robin[β](https://clickhouse.com/docs/operations/settings/settings#load_balancing-round_robin "Direct link to Round Robin")
```
load_balancing = round_robin
```
This algorithm uses a round-robin policy across replicas with the same number of errors (only the queries with `round_robin` policy is accounted).
## load\_balancing\_first\_offset[β](https://clickhouse.com/docs/operations/settings/settings#load_balancing_first_offset "Direct link to load_balancing_first_offset")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Which replica to preferably send a query when FIRST\_OR\_RANDOM load balancing strategy is used.
## load\_marks\_asynchronously[β](https://clickhouse.com/docs/operations/settings/settings#load_marks_asynchronously "Direct link to load_marks_asynchronously")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Load MergeTree marks asynchronously
Cloud default value: `1`.
## local\_filesystem\_read\_method[β](https://clickhouse.com/docs/operations/settings/settings#local_filesystem_read_method "Direct link to local_filesystem_read_method")
| Type | Default value |
|---|---|
| TypeString | Default valuepread\_threadpool |
Method of reading data from local filesystem, one of: read, pread, mmap, io\_uring, pread\_threadpool.
The 'io\_uring' method is experimental and does not work for Log, TinyLog, StripeLog, File, Set and Join, and other tables with append-able files in presence of concurrent reads and writes. If you read various articles about 'io\_uring' on the Internet, don't be blinded by them. It is not a better method of reading files, unless the case of a large amount of small IO requests, which is not the case in ClickHouse. There are no reasons to enable 'io\_uring'.
## local\_filesystem\_read\_prefetch[β](https://clickhouse.com/docs/operations/settings/settings#local_filesystem_read_prefetch "Direct link to local_filesystem_read_prefetch")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Should use prefetching when reading data from local filesystem.
## lock\_acquire\_timeout[β](https://clickhouse.com/docs/operations/settings/settings#lock_acquire_timeout "Direct link to lock_acquire_timeout")
| Type | Default value |
|---|---|
| TypeSeconds | Default value120 |
Defines how many seconds a locking request waits before failing.
Locking timeout is used to protect from deadlocks while executing read/write operations with tables. When the timeout expires and the locking request fails, the ClickHouse server throws an exception "Locking attempt timed out! Possible deadlock avoided. Client should retry." with error code `DEADLOCK_AVOIDED`.
Possible values:
- Positive integer (in seconds).
- 0 β No locking timeout.
Specifies the value for the `log_comment` field of the [system.query\_log](https://clickhouse.com/docs/operations/system-tables/query_log) table and comment text for the server log.
It can be used to improve the readability of server logs. Additionally, it helps to select queries related to the test from the `system.query_log` after running [clickhouse-test](https://clickhouse.com/docs/development/tests).
Possible values:
- Any string no longer than [max\_query\_size](https://clickhouse.com/docs/operations/settings/settings#max_query_size). If the max\_query\_size is exceeded, the server throws an exception.
**Example**
Query:
```
SET log_comment = 'log_comment test', log_queries = 1;
SELECT 1;
SYSTEM FLUSH LOGS;
SELECT type, query FROM system.query_log WHERE log_comment = 'log_comment test' AND event_date >= yesterday() ORDER BY event_time DESC LIMIT 2;
```
Result:
```
ββtypeβββββββββ¬βqueryββββββ
β QueryStart β SELECT 1; β
β QueryFinish β SELECT 1; β
βββββββββββββββ΄ββββββββββββ
```
## log\_formatted\_queries[β](https://clickhouse.com/docs/operations/settings/settings#log_formatted_queries "Direct link to log_formatted_queries")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Allows to log formatted queries to the [system.query\_log](https://clickhouse.com/docs/operations/system-tables/query_log) system table (populates `formatted_query` column in the [system.query\_log](https://clickhouse.com/docs/operations/system-tables/query_log)).
Possible values:
- 0 β Formatted queries are not logged in the system table.
- 1 β Formatted queries are logged in the system table.
## log\_processors\_profiles[β](https://clickhouse.com/docs/operations/settings/settings#log_processors_profiles "Direct link to log_processors_profiles")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Write time that processor spent during execution/waiting for data to `system.processors_profile_log` table.
See also:
- [`system.processors_profile_log`](https://clickhouse.com/docs/operations/system-tables/processors_profile_log)
- [`EXPLAIN PIPELINE`](https://clickhouse.com/docs/sql-reference/statements/explain#explain-pipeline)
## log\_profile\_events[β](https://clickhouse.com/docs/operations/settings/settings#log_profile_events "Direct link to log_profile_events")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Log query performance statistics into the query\_log, query\_thread\_log and query\_views\_log.
## log\_queries[β](https://clickhouse.com/docs/operations/settings/settings#log_queries "Direct link to log_queries")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Setting up query logging.
Queries sent to ClickHouse with this setup are logged according to the rules in the [query\_log](https://clickhouse.com/docs/operations/server-configuration-parameters/settings#query_log) server configuration parameter.
Example:
```
log_queries=1
```
## log\_queries\_cut\_to\_length[β](https://clickhouse.com/docs/operations/settings/settings#log_queries_cut_to_length "Direct link to log_queries_cut_to_length")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value100000 |
If query length is greater than a specified threshold (in bytes), then cut query when writing to query log. Also limit the length of printed query in ordinary text log.
## log\_queries\_min\_query\_duration\_ms[β](https://clickhouse.com/docs/operations/settings/settings#log_queries_min_query_duration_ms "Direct link to log_queries_min_query_duration_ms")
| Type | Default value |
|---|---|
| TypeMilliseconds | Default value0 |
If enabled (non-zero), queries faster than the value of this setting will not be logged (you can think about this as a `long_query_time` for [MySQL Slow Query Log](https://dev.mysql.com/doc/refman/5.7/slow-query-log.html)), and this basically means that you will not find them in the following tables:
- `system.query_log`
- `system.query_thread_log`
Only the queries with the following type will get to the log:
- `QUERY_FINISH`
- `EXCEPTION_WHILE_PROCESSING`
- Type: milliseconds
- Default value: 0 (any query)
## log\_queries\_min\_type[β](https://clickhouse.com/docs/operations/settings/settings#log_queries_min_type "Direct link to log_queries_min_type")
| Type | Default value |
|---|---|
| TypeLogQueriesType | Default valueQUERY\_START |
`query_log` minimal type to log.
Possible values:
- `QUERY_START` (`=1`)
- `QUERY_FINISH` (`=2`)
- `EXCEPTION_BEFORE_START` (`=3`)
- `EXCEPTION_WHILE_PROCESSING` (`=4`)
Can be used to limit which entities will go to `query_log`, say you are interested only in errors, then you can use `EXCEPTION_WHILE_PROCESSING`:
```
log_queries_min_type='EXCEPTION_WHILE_PROCESSING'
```
## log\_queries\_probability[β](https://clickhouse.com/docs/operations/settings/settings#log_queries_probability "Direct link to log_queries_probability")
| Type | Default value |
|---|---|
| TypeFloat | Default value1 |
Allows a user to write to [query\_log](https://clickhouse.com/docs/operations/system-tables/query_log), [query\_thread\_log](https://clickhouse.com/docs/operations/system-tables/query_thread_log), and [query\_views\_log](https://clickhouse.com/docs/operations/system-tables/query_views_log) system tables only a sample of queries selected randomly with the specified probability. It helps to reduce the load with a large volume of queries in a second.
Possible values:
- 0 β Queries are not logged in the system tables.
- Positive floating-point number in the range \[0..1\]. For example, if the setting value is `0.5`, about half of the queries are logged in the system tables.
- 1 β All queries are logged in the system tables.
## log\_query\_settings[β](https://clickhouse.com/docs/operations/settings/settings#log_query_settings "Direct link to log_query_settings")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Log query settings into the query\_log and OpenTelemetry span log.
## log\_query\_threads[β](https://clickhouse.com/docs/operations/settings/settings#log_query_threads "Direct link to log_query_threads")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Setting up query threads logging.
Query threads log into the [system.query\_thread\_log](https://clickhouse.com/docs/operations/system-tables/query_thread_log) table. This setting has effect only when [log\_queries](https://clickhouse.com/docs/operations/settings/settings#log_queries) is true. Queries' threads run by ClickHouse with this setup are logged according to the rules in the [query\_thread\_log](https://clickhouse.com/docs/operations/server-configuration-parameters/settings#query_thread_log) server configuration parameter.
Possible values:
- 0 β Disabled.
- 1 β Enabled.
**Example**
```
log_query_threads=1
```
## log\_query\_views[β](https://clickhouse.com/docs/operations/settings/settings#log_query_views "Direct link to log_query_views")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Setting up query views logging.
When a query run by ClickHouse with this setting enabled has associated views (materialized or live views), they are logged in the [query\_views\_log](https://clickhouse.com/docs/operations/server-configuration-parameters/settings#query_views_log) server configuration parameter.
Example:
```
log_query_views=1
```
## low\_cardinality\_allow\_in\_native\_format[β](https://clickhouse.com/docs/operations/settings/settings#low_cardinality_allow_in_native_format "Direct link to low_cardinality_allow_in_native_format")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Allows or restricts using the [LowCardinality](https://clickhouse.com/docs/sql-reference/data-types/lowcardinality) data type with the [Native](https://clickhouse.com/docs/interfaces/formats/Native) format.
If usage of `LowCardinality` is restricted, ClickHouse server converts `LowCardinality`\-columns to ordinary ones for `SELECT` queries, and convert ordinary columns to `LowCardinality`\-columns for `INSERT` queries.
This setting is required mainly for third-party clients which do not support `LowCardinality` data type.
Possible values:
- 1 β Usage of `LowCardinality` is not restricted.
- 0 β Usage of `LowCardinality` is restricted.
## low\_cardinality\_max\_dictionary\_size[β](https://clickhouse.com/docs/operations/settings/settings#low_cardinality_max_dictionary_size "Direct link to low_cardinality_max_dictionary_size")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value8192 |
Sets a maximum size in rows of a shared global dictionary for the [LowCardinality](https://clickhouse.com/docs/sql-reference/data-types/lowcardinality) data type that can be written to a storage file system. This setting prevents issues with RAM in case of unlimited dictionary growth. All the data that can't be encoded due to maximum dictionary size limitation ClickHouse writes in an ordinary method.
Possible values:
- Any positive integer.
## low\_cardinality\_use\_single\_dictionary\_for\_part[β](https://clickhouse.com/docs/operations/settings/settings#low_cardinality_use_single_dictionary_for_part "Direct link to low_cardinality_use_single_dictionary_for_part")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Turns on or turns off using of single dictionary for the data part.
By default, the ClickHouse server monitors the size of dictionaries and if a dictionary overflows then the server starts to write the next one. To prohibit creating several dictionaries set `low_cardinality_use_single_dictionary_for_part = 1`.
Possible values:
- 1 β Creating several dictionaries for the data part is prohibited.
- 0 β Creating several dictionaries for the data part is not prohibited.
## low\_priority\_query\_wait\_time\_ms[β](https://clickhouse.com/docs/operations/settings/settings#low_priority_query_wait_time_ms "Direct link to low_priority_query_wait_time_ms")
| Type | Default value |
|---|---|
| TypeMilliseconds | Default value1000 |
When the query prioritization mechanism is employed (see setting `priority`), low-priority queries wait for higher-priority queries to finish. This setting specifies the duration of waiting.
## make\_distributed\_plan[β](https://clickhouse.com/docs/operations/settings/settings#make_distributed_plan "Direct link to make_distributed_plan")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Make distributed query plan.
## materialize\_skip\_indexes\_on\_insert[β](https://clickhouse.com/docs/operations/settings/settings#materialize_skip_indexes_on_insert "Direct link to materialize_skip_indexes_on_insert")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
If INSERTs build and store skip indexes. If disabled, skip indexes will only be built and stored [during merges](https://clickhouse.com/docs/operations/settings/merge-tree-settings#materialize_skip_indexes_on_merge) or by explicit [MATERIALIZE INDEX](https://clickhouse.com/docs/sql-reference/statements/alter/skipping-index#materialize-index).
See also [exclude\_materialize\_skip\_indexes\_on\_insert](https://clickhouse.com/docs/operations/settings/settings#exclude_materialize_skip_indexes_on_insert).
## materialize\_statistics\_on\_insert[β](https://clickhouse.com/docs/operations/settings/settings#materialize_statistics_on_insert "Direct link to materialize_statistics_on_insert")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
If INSERTs build and insert statistics. If disabled, statistics will be build and stored during merges or by explicit MATERIALIZE STATISTICS
## materialize\_ttl\_after\_modify[β](https://clickhouse.com/docs/operations/settings/settings#materialize_ttl_after_modify "Direct link to materialize_ttl_after_modify")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Apply TTL for old data, after ALTER MODIFY TTL query
## materialized\_views\_ignore\_errors[β](https://clickhouse.com/docs/operations/settings/settings#materialized_views_ignore_errors "Direct link to materialized_views_ignore_errors")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Allows to ignore errors for MATERIALIZED VIEW, and deliver original block to the table regardless of MVs
## materialized\_views\_squash\_parallel\_inserts[β](https://clickhouse.com/docs/operations/settings/settings#materialized_views_squash_parallel_inserts "Direct link to materialized_views_squash_parallel_inserts")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Squash inserts to materialized views destination table of a single INSERT query from parallel inserts to reduce amount of generated parts. If set to false and `parallel_view_processing` is enabled, INSERT query will generate part in the destination table for each `max_insert_thread`.
## max\_analyze\_depth[β](https://clickhouse.com/docs/operations/settings/settings#max_analyze_depth "Direct link to max_analyze_depth")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value5000 |
Maximum number of analyses performed by interpreter.
## max\_ast\_depth[β](https://clickhouse.com/docs/operations/settings/settings#max_ast_depth "Direct link to max_ast_depth")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value1000 |
The maximum nesting depth of a query syntactic tree. If exceeded, an exception is thrown.
Note
At this time, it isn't checked during parsing, but only after parsing the query. This means that a syntactic tree that is too deep can be created during parsing, but the query will fail.
## max\_ast\_elements[β](https://clickhouse.com/docs/operations/settings/settings#max_ast_elements "Direct link to max_ast_elements")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value50000 |
The maximum number of elements in a query syntactic tree. If exceeded, an exception is thrown.
Note
At this time, it isn't checked during parsing, but only after parsing the query. This means that a syntactic tree that is too deep can be created during parsing, but the query will fail.
## max\_autoincrement\_series[β](https://clickhouse.com/docs/operations/settings/settings#max_autoincrement_series "Direct link to max_autoincrement_series")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value1000 |
The limit on the number of series created by the `generateSerialID` function.
As each series represents a node in Keeper, it is recommended to have no more than a couple of millions of them.
## max\_backup\_bandwidth[β](https://clickhouse.com/docs/operations/settings/settings#max_backup_bandwidth "Direct link to max_backup_bandwidth")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
The maximum read speed in bytes per second for particular backup on server. Zero means unlimited.
## max\_block\_size[β](https://clickhouse.com/docs/operations/settings/settings#max_block_size "Direct link to max_block_size")
| Type | Default value |
|---|---|
| TypeNonZeroUInt64 | Default value65409 |
In ClickHouse, data is processed by blocks, which are sets of column parts. The internal processing cycles for a single block are efficient but there are noticeable costs when processing each block.
The `max_block_size` setting indicates the recommended maximum number of rows to include in a single block when loading data from tables. Blocks the size of `max_block_size` are not always loaded from the table: if ClickHouse determines that less data needs to be retrieved, a smaller block is processed.
The block size should not be too small to avoid noticeable costs when processing each block. It should also not be too large to ensure that queries with a LIMIT clause execute quickly after processing the first block. When setting `max_block_size`, the goal should be to avoid consuming too much memory when extracting a large number of columns in multiple threads and to preserve at least some cache locality.
## max\_bytes\_before\_external\_group\_by[β](https://clickhouse.com/docs/operations/settings/settings#max_bytes_before_external_group_by "Direct link to max_bytes_before_external_group_by")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Cloud default value: half the memory amount per replica.
Enables or disables execution of `GROUP BY` clauses in external memory. (See [GROUP BY in external memory](https://clickhouse.com/docs/sql-reference/statements/select/group-by#group-by-in-external-memory))
Possible values:
- Maximum volume of RAM (in bytes) that can be used by the single [GROUP BY](https://clickhouse.com/docs/sql-reference/statements/select/group-by) operation.
- `0` β `GROUP BY` in external memory disabled.
Note
If memory usage during GROUP BY operations is exceeding this threshold in bytes, activate the 'external aggregation' mode (spill data to disk).
The recommended value is half of the available system memory.
## max\_bytes\_before\_external\_sort[β](https://clickhouse.com/docs/operations/settings/settings#max_bytes_before_external_sort "Direct link to max_bytes_before_external_sort")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Cloud default value: half the memory amount per replica.
Enables or disables execution of `ORDER BY` clauses in external memory. See [ORDER BY Implementation Details](https://clickhouse.com/docs/sql-reference/statements/select/order-by#implementation-details) If memory usage during ORDER BY operation exceeds this threshold in bytes, the 'external sorting' mode (spill data to disk) is activated.
Possible values:
- Maximum volume of RAM (in bytes) that can be used by the single [ORDER BY](https://clickhouse.com/docs/sql-reference/statements/select/order-by) operation. The recommended value is half of available system memory
- `0` β `ORDER BY` in external memory disabled.
## max\_bytes\_before\_remerge\_sort[β](https://clickhouse.com/docs/operations/settings/settings#max_bytes_before_remerge_sort "Direct link to max_bytes_before_remerge_sort")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value1000000000 |
In case of ORDER BY with LIMIT, when memory usage is higher than specified threshold, perform additional steps of merging blocks before final merge to keep just top LIMIT rows.
## max\_bytes\_in\_distinct[β](https://clickhouse.com/docs/operations/settings/settings#max_bytes_in_distinct "Direct link to max_bytes_in_distinct")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
The maximum number of bytes of the state (in uncompressed bytes) in memory, which is used by a hash table when using DISTINCT.
## max\_bytes\_in\_join[β](https://clickhouse.com/docs/operations/settings/settings#max_bytes_in_join "Direct link to max_bytes_in_join")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
The maximum size in number of bytes of the hash table used when joining tables.
This setting applies to [SELECT ... JOIN](https://clickhouse.com/docs/sql-reference/statements/select/join) operations and the [Join table engine](https://clickhouse.com/docs/engines/table-engines/special/join).
If the query contains joins, ClickHouse checks this setting for every intermediate result.
ClickHouse can proceed with different actions when the limit is reached. Use the [join\_overflow\_mode](https://clickhouse.com/docs/operations/settings/settings#join_overflow_mode) settings to choose the action.
Possible values:
- Positive integer.
- 0 β Memory control is disabled.
## max\_bytes\_in\_set[β](https://clickhouse.com/docs/operations/settings/settings#max_bytes_in_set "Direct link to max_bytes_in_set")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
The maximum number of bytes (of uncompressed data) used by a set in the IN clause created from a subquery.
## max\_bytes\_ratio\_before\_external\_group\_by[β](https://clickhouse.com/docs/operations/settings/settings#max_bytes_ratio_before_external_group_by "Direct link to max_bytes_ratio_before_external_group_by")
| Type | Default value |
|---|---|
| TypeDouble | Default value0\.5 |
The ratio of available memory that is allowed for `GROUP BY`. Once reached, external memory is used for aggregation.
For example, if set to `0.6`, `GROUP BY` will allow using 60% of the available memory (to server/user/merges) at the beginning of the execution, after that, it will start using external aggregation.
## max\_bytes\_ratio\_before\_external\_sort[β](https://clickhouse.com/docs/operations/settings/settings#max_bytes_ratio_before_external_sort "Direct link to max_bytes_ratio_before_external_sort")
| Type | Default value |
|---|---|
| TypeDouble | Default value0\.5 |
The ratio of available memory that is allowed for `ORDER BY`. Once reached, external sort is used.
For example, if set to `0.6`, `ORDER BY` will allow using `60%` of available memory (to server/user/merges) at the beginning of the execution, after that, it will start using external sort.
Note, that `max_bytes_before_external_sort` is still respected, spilling to disk will be done only if the sorting block is bigger then `max_bytes_before_external_sort`.
## max\_bytes\_to\_read[β](https://clickhouse.com/docs/operations/settings/settings#max_bytes_to_read "Direct link to max_bytes_to_read")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
The maximum number of bytes (of uncompressed data) that can be read from a table when running a query. The restriction is checked for each processed chunk of data, applied only to the deepest table expression and when reading from a remote server, checked only on the remote server.
## max\_bytes\_to\_read\_leaf[β](https://clickhouse.com/docs/operations/settings/settings#max_bytes_to_read_leaf "Direct link to max_bytes_to_read_leaf")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
The maximum number of bytes (of uncompressed data) that can be read from a local table on a leaf node when running a distributed query. While distributed queries can issue a multiple sub-queries to each shard (leaf) - this limit will be checked only on the read stage on the leaf nodes and will be ignored on the merging of results stage on the root node.
For example, a cluster consists of 2 shards and each shard contains a table with 100 bytes of data. A distributed query which is supposed to read all the data from both tables with setting `max_bytes_to_read=150` will fail as in total it will be 200 bytes. A query with `max_bytes_to_read_leaf=150` will succeed since leaf nodes will read 100 bytes at max.
The restriction is checked for each processed chunk of data.
Note
This setting is unstable with `prefer_localhost_replica=1`.
## max\_bytes\_to\_sort[β](https://clickhouse.com/docs/operations/settings/settings#max_bytes_to_sort "Direct link to max_bytes_to_sort")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
The maximum number of bytes before sorting. If more than the specified amount of uncompressed bytes have to be processed for ORDER BY operation, the behavior will be determined by the `sort_overflow_mode` which by default is set to `throw`.
## max\_bytes\_to\_transfer[β](https://clickhouse.com/docs/operations/settings/settings#max_bytes_to_transfer "Direct link to max_bytes_to_transfer")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
The maximum number of bytes (uncompressed data) that can be passed to a remote server or saved in a temporary table when the GLOBAL IN/JOIN section is executed.
## max\_columns\_to\_read[β](https://clickhouse.com/docs/operations/settings/settings#max_columns_to_read "Direct link to max_columns_to_read")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
The maximum number of columns that can be read from a table in a single query. If a query requires reading more than the specified number of columns, an exception is thrown.
Tip
This setting is useful for preventing overly complex queries.
`0` value means unlimited.
## max\_compress\_block\_size[β](https://clickhouse.com/docs/operations/settings/settings#max_compress_block_size "Direct link to max_compress_block_size")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value1048576 |
The maximum size of blocks of uncompressed data before compressing for writing to a table. By default, 1,048,576 (1 MiB). Specifying a smaller block size generally leads to slightly reduced compression ratio, the compression and decompression speed increases slightly due to cache locality, and memory consumption is reduced.
Note
This is an expert-level setting, and you shouldn't change it if you're just getting started with ClickHouse.
Don't confuse blocks for compression (a chunk of memory consisting of bytes) with blocks for query processing (a set of rows from a table).
## max\_concurrent\_queries\_for\_all\_users[β](https://clickhouse.com/docs/operations/settings/settings#max_concurrent_queries_for_all_users "Direct link to max_concurrent_queries_for_all_users")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Throw exception if the value of this setting is less or equal than the current number of simultaneously processed queries.
Example: `max_concurrent_queries_for_all_users` can be set to 99 for all users and database administrator can set it to 100 for itself to run queries for investigation even when the server is overloaded.
Modifying the setting for one query or user does not affect other queries.
Possible values:
- Positive integer.
- 0 β No limit.
**Example**
```
<max_concurrent_queries_for_all_users>99</max_concurrent_queries_for_all_users>
```
**See Also**
- [max\_concurrent\_queries](https://clickhouse.com/docs/operations/server-configuration-parameters/settings#max_concurrent_queries)
Cloud default value: `1000`.
## max\_concurrent\_queries\_for\_user[β](https://clickhouse.com/docs/operations/settings/settings#max_concurrent_queries_for_user "Direct link to max_concurrent_queries_for_user")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
The maximum number of simultaneously processed queries per user.
Possible values:
- Positive integer.
- 0 β No limit.
**Example**
```
<max_concurrent_queries_for_user>5</max_concurrent_queries_for_user>
```
## max\_distributed\_connections[β](https://clickhouse.com/docs/operations/settings/settings#max_distributed_connections "Direct link to max_distributed_connections")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value1024 |
The maximum number of simultaneous connections with remote servers for distributed processing of a single query to a single Distributed table. We recommend setting a value no less than the number of servers in the cluster.
The following parameters are only used when creating Distributed tables (and when launching a server), so there is no reason to change them at runtime.
## max\_distributed\_depth[β](https://clickhouse.com/docs/operations/settings/settings#max_distributed_depth "Direct link to max_distributed_depth")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value5 |
Limits the maximum depth of recursive queries for [Distributed](https://clickhouse.com/docs/engines/table-engines/special/distributed) tables.
If the value is exceeded, the server throws an exception.
Possible values:
- Positive integer.
- 0 β Unlimited depth.
## max\_download\_buffer\_size[β](https://clickhouse.com/docs/operations/settings/settings#max_download_buffer_size "Direct link to max_download_buffer_size")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value10485760 |
The maximal size of buffer for parallel downloading (e.g. for URL engine) per each thread.
## max\_download\_threads[β](https://clickhouse.com/docs/operations/settings/settings#max_download_threads "Direct link to max_download_threads")
| Type | Default value |
|---|---|
| TypeMaxThreads | Default value4 |
The maximum number of threads to download data (e.g. for URL engine).
## max\_estimated\_execution\_time[β](https://clickhouse.com/docs/operations/settings/settings#max_estimated_execution_time "Direct link to max_estimated_execution_time")
| Type | Default value |
|---|---|
| TypeSeconds | Default value0 |
Maximum query estimate execution time in seconds. Checked on every data block when [`timeout_before_checking_execution_speed`](https://clickhouse.com/docs/operations/settings/settings#timeout_before_checking_execution_speed) expires.
## max\_execution\_speed[β](https://clickhouse.com/docs/operations/settings/settings#max_execution_speed "Direct link to max_execution_speed")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
The maximum number of execution rows per second. Checked on every data block when [`timeout_before_checking_execution_speed`](https://clickhouse.com/docs/operations/settings/settings#timeout_before_checking_execution_speed) expires. If the execution speed is high, the execution speed will be reduced.
## max\_execution\_speed\_bytes[β](https://clickhouse.com/docs/operations/settings/settings#max_execution_speed_bytes "Direct link to max_execution_speed_bytes")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
The maximum number of execution bytes per second. Checked on every data block when [`timeout_before_checking_execution_speed`](https://clickhouse.com/docs/operations/settings/settings#timeout_before_checking_execution_speed) expires. If the execution speed is high, the execution speed will be reduced.
## max\_execution\_time[β](https://clickhouse.com/docs/operations/settings/settings#max_execution_time "Direct link to max_execution_time")
| Type | Default value |
|---|---|
| TypeSeconds | Default value0 |
The maximum query execution time in seconds.
The `max_execution_time` parameter can be a bit tricky to understand. It operates based on interpolation relative to the current query execution speed (this behaviour is controlled by [`timeout_before_checking_execution_speed`](https://clickhouse.com/docs/operations/settings/settings#timeout_before_checking_execution_speed)).
ClickHouse will interrupt a query if the projected execution time exceeds the specified `max_execution_time`. By default, the `timeout_before_checking_execution_speed` is set to 10 seconds. This means that after 10 seconds of query execution, ClickHouse will begin estimating the total execution time. If, for example, `max_execution_time` is set to 3600 seconds (1 hour), ClickHouse will terminate the query if the estimated time exceeds this 3600-second limit. If you set `timeout_before_checking_execution_speed` to 0, ClickHouse will use the clock time as the basis for `max_execution_time`.
If query runtime exceeds the specified number of seconds, the behavior will be determined by the 'timeout\_overflow\_mode', which by default is set to `throw`.
Note
The timeout is checked and the query can stop only in designated places during data processing. It currently cannot stop during merging of aggregation states or during query analysis, and the actual run time will be higher than the value of this setting.
## max\_execution\_time\_leaf[β](https://clickhouse.com/docs/operations/settings/settings#max_execution_time_leaf "Direct link to max_execution_time_leaf")
| Type | Default value |
|---|---|
| TypeSeconds | Default value0 |
Similar semantically to [`max_execution_time`](https://clickhouse.com/docs/operations/settings/settings#max_execution_time) but only applied on leaf nodes for distributed or remote queries.
For example, if we want to limit the execution time on a leaf node to `10s` but have no limit on the initial node, instead of having `max_execution_time` in the nested subquery settings:
```
SELECT count()
FROM cluster(cluster, view(SELECT * FROM t SETTINGS max_execution_time = 10));
```
We can use `max_execution_time_leaf` as the query settings:
```
SELECT count()
FROM cluster(cluster, view(SELECT * FROM t)) SETTINGS max_execution_time_leaf = 10;
```
## max\_expanded\_ast\_elements[β](https://clickhouse.com/docs/operations/settings/settings#max_expanded_ast_elements "Direct link to max_expanded_ast_elements")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value500000 |
Maximum size of query syntax tree in number of nodes after expansion of aliases and the asterisk.
## max\_fetch\_partition\_retries\_count[β](https://clickhouse.com/docs/operations/settings/settings#max_fetch_partition_retries_count "Direct link to max_fetch_partition_retries_count")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value5 |
Amount of retries while fetching partition from another host.
## max\_final\_threads[β](https://clickhouse.com/docs/operations/settings/settings#max_final_threads "Direct link to max_final_threads")
| Type | Default value |
|---|---|
| TypeMaxThreads | Default value'auto(N)' |
Sets the maximum number of parallel threads for the `SELECT` query data read phase with the [FINAL](https://clickhouse.com/docs/sql-reference/statements/select/from#final-modifier) modifier.
Possible values:
- Positive integer.
- 0 or 1 β Disabled. `SELECT` queries are executed in a single thread.
## max\_http\_get\_redirects[β](https://clickhouse.com/docs/operations/settings/settings#max_http_get_redirects "Direct link to max_http_get_redirects")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Max number of HTTP GET redirects hops allowed. Ensures additional security measures are in place to prevent a malicious server from redirecting your requests to unexpected services.\\n\\nIt is the case when an external server redirects to another address, but that address appears to be internal to the company's infrastructure, and by sending an HTTP request to an internal server, you could request an internal API from the internal network, bypassing the auth, or even query other services, such as Redis or Memcached. When you don't have an internal infrastructure (including something running on your localhost), or you trust the server, it is safe to allow redirects. Although keep in mind, that if the URL uses HTTP instead of HTTPS, and you will have to trust not only the remote server but also your ISP and every network in the middle.
Cloud default value: `10`.
## max\_hyperscan\_regexp\_length[β](https://clickhouse.com/docs/operations/settings/settings#max_hyperscan_regexp_length "Direct link to max_hyperscan_regexp_length")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Defines the maximum length for each regular expression in the [hyperscan multi-match functions](https://clickhouse.com/docs/sql-reference/functions/string-search-functions#multiMatchAny).
Possible values:
- Positive integer.
- 0 - The length is not limited.
**Example**
Query:
```
SELECT multiMatchAny('abcd', ['ab','bcd','c','d']) SETTINGS max_hyperscan_regexp_length = 3;
```
Result:
```
ββmultiMatchAny('abcd', ['ab', 'bcd', 'c', 'd'])ββ
β 1 β
ββββββββββββββββββββββββββββββββββββββββββββββββββ
```
Query:
```
SELECT multiMatchAny('abcd', ['ab','bcd','c','d']) SETTINGS max_hyperscan_regexp_length = 2;
```
Result:
```
Exception: Regexp length too large.
```
**See Also**
- [max\_hyperscan\_regexp\_total\_length](https://clickhouse.com/docs/operations/settings/settings#max_hyperscan_regexp_total_length)
## max\_hyperscan\_regexp\_total\_length[β](https://clickhouse.com/docs/operations/settings/settings#max_hyperscan_regexp_total_length "Direct link to max_hyperscan_regexp_total_length")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Sets the maximum length total of all regular expressions in each [hyperscan multi-match function](https://clickhouse.com/docs/sql-reference/functions/string-search-functions#multiMatchAny).
Possible values:
- Positive integer.
- 0 - The length is not limited.
**Example**
Query:
```
SELECT multiMatchAny('abcd', ['a','b','c','d']) SETTINGS max_hyperscan_regexp_total_length = 5;
```
Result:
```
ββmultiMatchAny('abcd', ['a', 'b', 'c', 'd'])ββ
β 1 β
βββββββββββββββββββββββββββββββββββββββββββββββ
```
Query:
```
SELECT multiMatchAny('abcd', ['ab','bc','c','d']) SETTINGS max_hyperscan_regexp_total_length = 5;
```
Result:
```
Exception: Total regexp lengths too large.
```
**See Also**
- [max\_hyperscan\_regexp\_length](https://clickhouse.com/docs/operations/settings/settings#max_hyperscan_regexp_length)
## max\_insert\_block\_size[β](https://clickhouse.com/docs/operations/settings/settings#max_insert_block_size "Direct link to max_insert_block_size")
**Aliases**: `max_insert_block_size_rows`
| Type | Default value |
|---|---|
| TypeNonZeroUInt64 | Default value1048449 |
The maximum size of blocks (in a count of rows) to form for insertion into a table.
This setting controls block formation in two contexts:
1. Format parsing: When the server parses row-based input formats (CSV, TSV, JSONEachRow, etc.) from any interface (HTTP, clickhouse-client with inline data, gRPC, PostgreSQL wire protocol), blocks are emitted when:
- Both min\_insert\_block\_size\_rows AND min\_insert\_block\_size\_bytes are reached, OR
- Either max\_insert\_block\_size\_rows OR max\_insert\_block\_size\_bytes is reached
Note: When using clickhouse-client or clickhouse-local to read from a file, the client itself parses the data and this setting applies on the client side.
2. INSERT operations: During INSERT queries and when data flows through materialized views, this setting's behavior depends on `use_strict_insert_block_limits`:
- When enabled: Blocks are emitted when:
- Min thresholds (AND): Both min\_insert\_block\_size\_rows AND min\_insert\_block\_size\_bytes are reached
- Max thresholds (OR): Either max\_insert\_block\_size\_rows OR max\_insert\_block\_size\_bytes is reached
- When disabled: Blocks are emitted when min\_insert\_block\_size\_rows OR min\_insert\_block\_size\_bytes is reached. The max\_insert\_block\_size settings are not enforced.
Possible values:
- Positive integer.
## max\_insert\_block\_size\_bytes[β](https://clickhouse.com/docs/operations/settings/settings#max_insert_block_size_bytes "Direct link to max_insert_block_size_bytes")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
The maximum size of blocks (in bytes) to form for insertion into a table.
This setting works together with max\_insert\_block\_size\_rows and controls block formation in the same context. See max\_insert\_block\_size\_rows for detailed information about when and how these settings are applied.
Possible values:
- Positive integer.
- 0 β setting does not participate in block formation.
## max\_insert\_delayed\_streams\_for\_parallel\_write[β](https://clickhouse.com/docs/operations/settings/settings#max_insert_delayed_streams_for_parallel_write "Direct link to max_insert_delayed_streams_for_parallel_write")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
The maximum number of streams (columns) to delay final part flush. Default - auto (100 in case of underlying storage supports parallel write, for example S3 and disabled otherwise)
Cloud default value: `50`.
## max\_insert\_threads[β](https://clickhouse.com/docs/operations/settings/settings#max_insert_threads "Direct link to max_insert_threads")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
The maximum number of threads to execute the `INSERT SELECT` query.
Possible values:
- 0 (or 1) β `INSERT SELECT` no parallel execution.
- Positive integer. Bigger than 1.
Cloud default value:
- `1` for nodes with 8 GiB memory
- `2` for nodes with 16 GiB memory
- `4` for larger nodes
Parallel `INSERT SELECT` has effect only if the `SELECT` part is executed in parallel, see [`max_threads`](https://clickhouse.com/docs/operations/settings/settings#max_threads) setting. Higher values will lead to higher memory usage.
## max\_joined\_block\_size\_bytes[β](https://clickhouse.com/docs/operations/settings/settings#max_joined_block_size_bytes "Direct link to max_joined_block_size_bytes")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value4194304 |
Maximum block size in bytes for JOIN result (if join algorithm supports it). 0 means unlimited.
## max\_joined\_block\_size\_rows[β](https://clickhouse.com/docs/operations/settings/settings#max_joined_block_size_rows "Direct link to max_joined_block_size_rows")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value65409 |
Maximum block size for JOIN result (if join algorithm supports it). 0 means unlimited.
## max\_limit\_for\_vector\_search\_queries[β](https://clickhouse.com/docs/operations/settings/settings#max_limit_for_vector_search_queries "Direct link to max_limit_for_vector_search_queries")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value1000 |
SELECT queries with LIMIT bigger than this setting cannot use vector similarity indices. Helps to prevent memory overflows in vector similarity indices.
## max\_local\_read\_bandwidth[β](https://clickhouse.com/docs/operations/settings/settings#max_local_read_bandwidth "Direct link to max_local_read_bandwidth")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
The maximum speed of local reads in bytes per second.
## max\_local\_write\_bandwidth[β](https://clickhouse.com/docs/operations/settings/settings#max_local_write_bandwidth "Direct link to max_local_write_bandwidth")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
The maximum speed of local writes in bytes per second.
## max\_memory\_usage[β](https://clickhouse.com/docs/operations/settings/settings#max_memory_usage "Direct link to max_memory_usage")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Cloud default value: depends on the amount of RAM on the replica.
The maximum amount of RAM to use for running a query on a single server. A value of `0` means unlimited.
This setting does not consider the volume of available memory or the total volume of memory on the machine. The restriction applies to a single query within a single server.
You can use `SHOW PROCESSLIST` to see the current memory consumption for each query. Peak memory consumption is tracked for each query and written to the log.
Memory usage is not fully tracked for states of the following aggregate functions from `String` and `Array` arguments:
- `min`
- `max`
- `any`
- `anyLast`
- `argMin`
- `argMax`
Memory consumption is also restricted by the parameters [`max_memory_usage_for_user`](https://clickhouse.com/docs/operations/settings/settings#max_memory_usage_for_user) and [`max_server_memory_usage`](https://clickhouse.com/docs/operations/server-configuration-parameters/settings#max_server_memory_usage).
## max\_memory\_usage\_for\_user[β](https://clickhouse.com/docs/operations/settings/settings#max_memory_usage_for_user "Direct link to max_memory_usage_for_user")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
The maximum amount of RAM to use for running a user's queries on a single server. Zero means unlimited.
By default, the amount is not restricted (`max_memory_usage_for_user = 0`).
Also see the description of [`max_memory_usage`](https://clickhouse.com/docs/operations/settings/settings#max_memory_usage).
For example if you want to set `max_memory_usage_for_user` to 1000 bytes for a user named `clickhouse_read`, you can use the statement
```
ALTER USER clickhouse_read SETTINGS max_memory_usage_for_user = 1000;
```
You can verify it worked by logging out of your client, logging back in, then use the `getSetting` function:
```
SELECT getSetting('max_memory_usage_for_user');
```
## max\_network\_bandwidth[β](https://clickhouse.com/docs/operations/settings/settings#max_network_bandwidth "Direct link to max_network_bandwidth")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Limits the speed of the data exchange over the network in bytes per second. This setting applies to every query.
Possible values:
- Positive integer.
- 0 β Bandwidth control is disabled.
## max\_network\_bandwidth\_for\_all\_users[β](https://clickhouse.com/docs/operations/settings/settings#max_network_bandwidth_for_all_users "Direct link to max_network_bandwidth_for_all_users")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Limits the speed that data is exchanged at over the network in bytes per second. This setting applies to all concurrently running queries on the server.
Possible values:
- Positive integer.
- 0 β Control of the data speed is disabled.
## max\_network\_bandwidth\_for\_user[β](https://clickhouse.com/docs/operations/settings/settings#max_network_bandwidth_for_user "Direct link to max_network_bandwidth_for_user")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Limits the speed of the data exchange over the network in bytes per second. This setting applies to all concurrently running queries performed by a single user.
Possible values:
- Positive integer.
- 0 β Control of the data speed is disabled.
## max\_network\_bytes[β](https://clickhouse.com/docs/operations/settings/settings#max_network_bytes "Direct link to max_network_bytes")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Limits the data volume (in bytes) that is received or transmitted over the network when executing a query. This setting applies to every individual query.
Possible values:
- Positive integer.
- 0 β Data volume control is disabled.
## max\_number\_of\_partitions\_for\_independent\_aggregation[β](https://clickhouse.com/docs/operations/settings/settings#max_number_of_partitions_for_independent_aggregation "Direct link to max_number_of_partitions_for_independent_aggregation")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value128 |
Maximal number of partitions in table to apply optimizatio
## max\_os\_cpu\_wait\_time\_ratio\_to\_throw[β](https://clickhouse.com/docs/operations/settings/settings#max_os_cpu_wait_time_ratio_to_throw "Direct link to max_os_cpu_wait_time_ratio_to_throw")
| Type | Default value |
|---|---|
| TypeFloat | Default value0 |
Max ratio between OS CPU wait (OSCPUWaitMicroseconds metric) and busy (OSCPUVirtualTimeMicroseconds metric) times to consider rejecting queries. Linear interpolation between min and max ratio is used to calculate the probability, the probability is 1 at this point.
## max\_parallel\_replicas[β](https://clickhouse.com/docs/operations/settings/settings#max_parallel_replicas "Direct link to max_parallel_replicas")
| Type | Default value |
|---|---|
| TypeNonZeroUInt64 | Default value1000 |
The maximum number of replicas for each shard when executing a query.
Possible values:
- Positive integer.
**Additional Info**
This options will produce different results depending on the settings used.
### Parallel processing using `SAMPLE` key[β](https://clickhouse.com/docs/operations/settings/settings#parallel-processing-using-sample-key "Direct link to parallel-processing-using-sample-key")
A query may be processed faster if it is executed on several servers in parallel. But the query performance may degrade in the following cases:
- The position of the sampling key in the partitioning key does not allow efficient range scans.
- Adding a sampling key to the table makes filtering by other columns less efficient.
- The sampling key is an expression that is expensive to calculate.
- The cluster latency distribution has a long tail, so that querying more servers increases the query overall latency.
### Parallel processing using [parallel\_replicas\_custom\_key](https://clickhouse.com/docs/operations/settings/settings#parallel_replicas_custom_key)[β](https://clickhouse.com/docs/operations/settings/settings#parallel-processing-using-parallel_replicas_custom_key "Direct link to parallel-processing-using-parallel_replicas_custom_key")
This setting is useful for any replicated table.
## max\_parser\_backtracks[β](https://clickhouse.com/docs/operations/settings/settings#max_parser_backtracks "Direct link to max_parser_backtracks")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value1000000 |
Maximum parser backtracking (how many times it tries different alternatives in the recursive descend parsing process).
## max\_parser\_depth[β](https://clickhouse.com/docs/operations/settings/settings#max_parser_depth "Direct link to max_parser_depth")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value1000 |
Limits maximum recursion depth in the recursive descent parser. Allows controlling the stack size.
Possible values:
- Positive integer.
- 0 β Recursion depth is unlimited.
## max\_parsing\_threads[β](https://clickhouse.com/docs/operations/settings/settings#max_parsing_threads "Direct link to max_parsing_threads")
| Type | Default value |
|---|---|
| TypeMaxThreads | Default value'auto(N)' |
The maximum number of threads to parse data in input formats that support parallel parsing. By default, it is determined automatically.
## max\_partition\_size\_to\_drop[β](https://clickhouse.com/docs/operations/settings/settings#max_partition_size_to_drop "Direct link to max_partition_size_to_drop")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value50000000000 |
Restriction on dropping partitions in query time. The value `0` means that you can drop partitions without any restrictions.
Cloud default value: 1 TB.
## max\_partitions\_per\_insert\_block[β](https://clickhouse.com/docs/operations/settings/settings#max_partitions_per_insert_block "Direct link to max_partitions_per_insert_block")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value100 |
Limits the maximum number of partitions in a single inserted block and an exception is thrown if the block contains too many partitions.
- Positive integer.
- `0` β Unlimited number of partitions.
**Details**
When inserting data, ClickHouse calculates the number of partitions in the inserted block. If the number of partitions is more than `max_partitions_per_insert_block`, ClickHouse either logs a warning or throws an exception based on `throw_on_max_partitions_per_insert_block`. Exceptions have the following text:
> "Too many partitions for a single INSERT block (`partitions_count` partitions, limit is " + toString(max\_partitions) + "). The limit is controlled by the 'max\_partitions\_per\_insert\_block' setting. A large number of partitions is a common misconception. It will lead to severe negative performance impact, including slow server startup, slow INSERT queries and slow SELECT queries. Recommended total number of partitions for a table is under 1000..10000. Please note, that partitioning is not intended to speed up SELECT queries (ORDER BY key is sufficient to make range queries fast). Partitions are intended for data manipulation (DROP PARTITION, etc)."
Note
This setting is a safety threshold because using a large number of partitions is a common misconception.
## max\_partitions\_to\_read[β](https://clickhouse.com/docs/operations/settings/settings#max_partitions_to_read "Direct link to max_partitions_to_read")
| Type | Default value |
|---|---|
| TypeInt64 | Default value\-1 |
Limits the maximum number of partitions that can be accessed in a single query.
The setting value specified when the table is created can be overridden via query-level setting.
Possible values:
- Positive integer
- `-1` - unlimited (default)
## max\_parts\_to\_move[β](https://clickhouse.com/docs/operations/settings/settings#max_parts_to_move "Direct link to max_parts_to_move")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value1000 |
Limit the number of parts that can be moved in one query. Zero means unlimited.
## max\_projection\_rows\_to\_use\_projection\_index[β](https://clickhouse.com/docs/operations/settings/settings#max_projection_rows_to_use_projection_index "Direct link to max_projection_rows_to_use_projection_index")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value1000000 |
If the number of rows to read from the projection index is less than or equal to this threshold, ClickHouse will try to apply the projection index during query execution.
## max\_query\_size[β](https://clickhouse.com/docs/operations/settings/settings#max_query_size "Direct link to max_query_size")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value262144 |
The maximum number of bytes of a query string parsed by the SQL parser. Data in the VALUES clause of INSERT queries is processed by a separate stream parser (that consumes O(1) RAM) and not affected by this restriction.
Note
`max_query_size` cannot be set within an SQL query (e.g., `SELECT now() SETTINGS max_query_size=10000`) because ClickHouse needs to allocate a buffer to parse the query, and this buffer size is determined by the `max_query_size` setting, which must be configured before the query is executed.
## max\_rand\_distribution\_parameter[β](https://clickhouse.com/docs/operations/settings/settings#max_rand_distribution_parameter "Direct link to max_rand_distribution_parameter")
| Type | Default value |
|---|---|
| TypeFloat | Default value1000000 |
Maximum value for distribution shape parameters in random distribution functions such as `randChiSquared`, `randStudentT`, and `randFisherF`. This prevents extremely long computation times with extreme parameter values.
## max\_rand\_distribution\_trials[β](https://clickhouse.com/docs/operations/settings/settings#max_rand_distribution_trials "Direct link to max_rand_distribution_trials")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value1000000000 |
Maximum number of trials allowed for random distribution functions such as `randBinomial` and `randNegativeBinomial`. This prevents extremely long computation times with large trial counts.
## max\_read\_buffer\_size[β](https://clickhouse.com/docs/operations/settings/settings#max_read_buffer_size "Direct link to max_read_buffer_size")
| Type | Default value |
|---|---|
| TypeNonZeroUInt64 | Default value1048576 |
The maximum size of the buffer to read from the filesystem.
## max\_read\_buffer\_size\_local\_fs[β](https://clickhouse.com/docs/operations/settings/settings#max_read_buffer_size_local_fs "Direct link to max_read_buffer_size_local_fs")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value131072 |
The maximum size of the buffer to read from local filesystem. If set to 0 then max\_read\_buffer\_size will be used.
## max\_read\_buffer\_size\_remote\_fs[β](https://clickhouse.com/docs/operations/settings/settings#max_read_buffer_size_remote_fs "Direct link to max_read_buffer_size_remote_fs")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
The maximum size of the buffer to read from remote filesystem. If set to 0 then max\_read\_buffer\_size will be used.
## max\_recursive\_cte\_evaluation\_depth[β](https://clickhouse.com/docs/operations/settings/settings#max_recursive_cte_evaluation_depth "Direct link to max_recursive_cte_evaluation_depth")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value1000 |
Maximum limit on recursive CTE evaluation depth
## max\_remote\_read\_network\_bandwidth[β](https://clickhouse.com/docs/operations/settings/settings#max_remote_read_network_bandwidth "Direct link to max_remote_read_network_bandwidth")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
The maximum speed of data exchange over the network in bytes per second for read.
## max\_remote\_write\_network\_bandwidth[β](https://clickhouse.com/docs/operations/settings/settings#max_remote_write_network_bandwidth "Direct link to max_remote_write_network_bandwidth")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
The maximum speed of data exchange over the network in bytes per second for write.
## max\_replica\_delay\_for\_distributed\_queries[β](https://clickhouse.com/docs/operations/settings/settings#max_replica_delay_for_distributed_queries "Direct link to max_replica_delay_for_distributed_queries")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value300 |
Disables lagging replicas for distributed queries. See [Replication](https://clickhouse.com/docs/engines/table-engines/mergetree-family/replication).
Sets the time in seconds. If a replica's lag is greater than or equal to the set value, this replica is not used.
Possible values:
- Positive integer.
- 0 β Replica lags are not checked.
To prevent the use of any replica with a non-zero lag, set this parameter to 1.
Used when performing `SELECT` from a distributed table that points to replicated tables.
## max\_result\_bytes[β](https://clickhouse.com/docs/operations/settings/settings#max_result_bytes "Direct link to max_result_bytes")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Limits the result size in bytes (uncompressed). The query will stop after processing a block of data if the threshold is met, but it will not cut the last block of the result, therefore the result size can be larger than the threshold.
**Caveats**
The result size in memory is taken into account for this threshold. Even if the result size is small, it can reference larger data structures in memory, representing dictionaries of LowCardinality columns, and Arenas of AggregateFunction columns, so the threshold can be exceeded despite the small result size.
Note
The setting is fairly low level and should be used with caution
## max\_result\_rows[β](https://clickhouse.com/docs/operations/settings/settings#max_result_rows "Direct link to max_result_rows")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Cloud default value: `0`.
Limits the number of rows in the result. Also checked for subqueries, and on remote servers when running parts of a distributed query. No limit is applied when the value is `0`.
The query will stop after processing a block of data if the threshold is met, but it will not cut the last block of the result, therefore the result size can be larger than the threshold.
## max\_reverse\_dictionary\_lookup\_cache\_size\_bytes[β](https://clickhouse.com/docs/operations/settings/settings#max_reverse_dictionary_lookup_cache_size_bytes "Direct link to max_reverse_dictionary_lookup_cache_size_bytes")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value104857600 |
Maximum size in bytes of the per-query reverse dictionary lookup cache used by the function `dictGetKeys`. The cache stores serialized key tuples per attribute value to avoid re-scanning the dictionary within the same query. When the limit is reached, entries are evicted using LRU. Set to 0 to disable caching.
## max\_rows\_in\_distinct[β](https://clickhouse.com/docs/operations/settings/settings#max_rows_in_distinct "Direct link to max_rows_in_distinct")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
The maximum number of different rows when using DISTINCT.
## max\_rows\_in\_join[β](https://clickhouse.com/docs/operations/settings/settings#max_rows_in_join "Direct link to max_rows_in_join")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Limits the number of rows in the hash table that is used when joining tables.
This settings applies to [SELECT ... JOIN](https://clickhouse.com/docs/sql-reference/statements/select/join) operations and the [Join](https://clickhouse.com/docs/engines/table-engines/special/join) table engine.
If a query contains multiple joins, ClickHouse checks this setting for every intermediate result.
ClickHouse can proceed with different actions when the limit is reached. Use the [`join_overflow_mode`](https://clickhouse.com/docs/operations/settings/settings#join_overflow_mode) setting to choose the action.
Possible values:
- Positive integer.
- `0` β Unlimited number of rows.
## max\_rows\_in\_set[β](https://clickhouse.com/docs/operations/settings/settings#max_rows_in_set "Direct link to max_rows_in_set")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
The maximum number of rows for a data set in the IN clause created from a subquery.
## max\_rows\_in\_set\_to\_optimize\_join[β](https://clickhouse.com/docs/operations/settings/settings#max_rows_in_set_to_optimize_join "Direct link to max_rows_in_set_to_optimize_join")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Maximal size of the set to filter joined tables by each other's row sets before joining.
Possible values:
- 0 β Disable.
- Any positive integer.
## max\_rows\_to\_group\_by[β](https://clickhouse.com/docs/operations/settings/settings#max_rows_to_group_by "Direct link to max_rows_to_group_by")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
The maximum number of unique keys received from aggregation. This setting lets you limit memory consumption when aggregating.
If aggregation during GROUP BY is generating more than the specified number of rows (unique GROUP BY keys), the behavior will be determined by the 'group\_by\_overflow\_mode' which by default is `throw`, but can be also switched to an approximate GROUP BY mode.
## max\_rows\_to\_read[β](https://clickhouse.com/docs/operations/settings/settings#max_rows_to_read "Direct link to max_rows_to_read")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
The maximum number of rows that can be read from a table when running a query. The restriction is checked for each processed chunk of data, applied only to the deepest table expression and when reading from a remote server, checked only on the remote server.
## max\_rows\_to\_read\_leaf[β](https://clickhouse.com/docs/operations/settings/settings#max_rows_to_read_leaf "Direct link to max_rows_to_read_leaf")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
The maximum number of rows that can be read from a local table on a leaf node when running a distributed query. While distributed queries can issue multiple sub-queries to each shard (leaf) - this limit will be checked only on the read stage on the leaf nodes and ignored on the merging of results stage on the root node.
For example, a cluster consists of 2 shards and each shard contains a table with 100 rows. The distributed query which is supposed to read all the data from both tables with setting `max_rows_to_read=150` will fail, as in total there will be 200 rows. A query with `max_rows_to_read_leaf=150` will succeed, since leaf nodes will read at max 100 rows.
The restriction is checked for each processed chunk of data.
Note
This setting is unstable with `prefer_localhost_replica=1`.
## max\_rows\_to\_sort[β](https://clickhouse.com/docs/operations/settings/settings#max_rows_to_sort "Direct link to max_rows_to_sort")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
The maximum number of rows before sorting. This allows you to limit memory consumption when sorting. If more than the specified amount of records have to be processed for the ORDER BY operation, the behavior will be determined by the `sort_overflow_mode` which by default is set to `throw`.
## max\_rows\_to\_transfer[β](https://clickhouse.com/docs/operations/settings/settings#max_rows_to_transfer "Direct link to max_rows_to_transfer")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Maximum size (in rows) that can be passed to a remote server or saved in a temporary table when the GLOBAL IN/JOIN section is executed.
## max\_sessions\_for\_user[β](https://clickhouse.com/docs/operations/settings/settings#max_sessions_for_user "Direct link to max_sessions_for_user")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Maximum number of simultaneous sessions per authenticated user to the ClickHouse server.
Example:
```
<profiles>
<single_session_profile>
<max_sessions_for_user>1</max_sessions_for_user>
</single_session_profile>
<two_sessions_profile>
<max_sessions_for_user>2</max_sessions_for_user>
</two_sessions_profile>
<unlimited_sessions_profile>
<max_sessions_for_user>0</max_sessions_for_user>
</unlimited_sessions_profile>
</profiles>
<users>
<!-- User Alice can connect to a ClickHouse server no more than once at a time. -->
<Alice>
<profile>single_session_user</profile>
</Alice>
<!-- User Bob can use 2 simultaneous sessions. -->
<Bob>
<profile>two_sessions_profile</profile>
</Bob>
<!-- User Charles can use arbitrarily many of simultaneous sessions. -->
<Charles>
<profile>unlimited_sessions_profile</profile>
</Charles>
</users>
```
Possible values:
- Positive integer
- `0` - infinite count of simultaneous sessions (default)
## max\_size\_to\_preallocate\_for\_aggregation[β](https://clickhouse.com/docs/operations/settings/settings#max_size_to_preallocate_for_aggregation "Direct link to max_size_to_preallocate_for_aggregation")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value1000000000000 |
For how many elements it is allowed to preallocate space in all hash tables in total before aggregatio
## max\_size\_to\_preallocate\_for\_joins[β](https://clickhouse.com/docs/operations/settings/settings#max_size_to_preallocate_for_joins "Direct link to max_size_to_preallocate_for_joins")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value1000000000000 |
For how many elements it is allowed to preallocate space in all hash tables in total before joi
## max\_skip\_unavailable\_shards\_num[β](https://clickhouse.com/docs/operations/settings/settings#max_skip_unavailable_shards_num "Direct link to max_skip_unavailable_shards_num")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
When `skip_unavailable_shards` is enabled, limits the maximum number of shards that can be silently skipped. If the number of unavailable shards exceeds this value, an exception is thrown instead of silently skipping.
A value of 0 means no limit (default behavior β all unavailable shards can be skipped).
## max\_skip\_unavailable\_shards\_ratio[β](https://clickhouse.com/docs/operations/settings/settings#max_skip_unavailable_shards_ratio "Direct link to max_skip_unavailable_shards_ratio")
| Type | Default value |
|---|---|
| TypeFloat | Default value0 |
When `skip_unavailable_shards` is enabled, limits the maximum ratio (0 to 1) of shards that can be silently skipped. If the ratio of unavailable shards to total shards exceeds this value, an exception is thrown instead of silently skipping.
A value of 0 means no limit (default behavior β all unavailable shards can be skipped).
## max\_streams\_for\_files\_processing\_in\_cluster\_functions[β](https://clickhouse.com/docs/operations/settings/settings#max_streams_for_files_processing_in_cluster_functions "Direct link to max_streams_for_files_processing_in_cluster_functions")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
If is not zero, limit the number of threads reading data from files in \*Cluster table functions.
## max\_streams\_for\_merge\_tree\_reading[β](https://clickhouse.com/docs/operations/settings/settings#max_streams_for_merge_tree_reading "Direct link to max_streams_for_merge_tree_reading")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
If is not zero, limit the number of reading streams for MergeTree table.
## max\_streams\_multiplier\_for\_merge\_tables[β](https://clickhouse.com/docs/operations/settings/settings#max_streams_multiplier_for_merge_tables "Direct link to max_streams_multiplier_for_merge_tables")
| Type | Default value |
|---|---|
| TypeFloat | Default value5 |
Ask more streams when reading from Merge table. Streams will be spread across tables that Merge table will use. This allows more even distribution of work across threads and is especially helpful when merged tables differ in size.
## max\_streams\_to\_max\_threads\_ratio[β](https://clickhouse.com/docs/operations/settings/settings#max_streams_to_max_threads_ratio "Direct link to max_streams_to_max_threads_ratio")
| Type | Default value |
|---|---|
| TypeFloat | Default value1 |
Allows you to use more sources than the number of threads - to more evenly distribute work across threads. It is assumed that this is a temporary solution since it will be possible in the future to make the number of sources equal to the number of threads, but for each source to dynamically select available work for itself.
## max\_subquery\_depth[β](https://clickhouse.com/docs/operations/settings/settings#max_subquery_depth "Direct link to max_subquery_depth")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value100 |
If a query has more than the specified number of nested subqueries, throws an exception.
Tip
This allows you to have a sanity check to protect against the users of your cluster from writing overly complex queries.
## max\_table\_size\_to\_drop[β](https://clickhouse.com/docs/operations/settings/settings#max_table_size_to_drop "Direct link to max_table_size_to_drop")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value50000000000 |
Restriction on deleting tables in query time. The value `0` means that you can delete all tables without any restrictions.
Cloud default value: 1 TB.
## max\_temporary\_columns[β](https://clickhouse.com/docs/operations/settings/settings#max_temporary_columns "Direct link to max_temporary_columns")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
The maximum number of temporary columns that must be kept in RAM simultaneously when running a query, including constant columns. If a query generates more than the specified number of temporary columns in memory as a result of intermediate calculation, then an exception is thrown.
Tip
This setting is useful for preventing overly complex queries.
`0` value means unlimited.
## max\_temporary\_data\_on\_disk\_size\_for\_query[β](https://clickhouse.com/docs/operations/settings/settings#max_temporary_data_on_disk_size_for_query "Direct link to max_temporary_data_on_disk_size_for_query")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
The maximum amount of data consumed by temporary files on disk in bytes for all concurrently running queries.
Possible values:
- Positive integer.
- `0` β unlimited (default)
## max\_temporary\_data\_on\_disk\_size\_for\_user[β](https://clickhouse.com/docs/operations/settings/settings#max_temporary_data_on_disk_size_for_user "Direct link to max_temporary_data_on_disk_size_for_user")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
The maximum amount of data consumed by temporary files on disk in bytes for all concurrently running user queries.
Possible values:
- Positive integer.
- `0` β unlimited (default)
## max\_temporary\_non\_const\_columns[β](https://clickhouse.com/docs/operations/settings/settings#max_temporary_non_const_columns "Direct link to max_temporary_non_const_columns")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Like `max_temporary_columns`, the maximum number of temporary columns that must be kept in RAM simultaneously when running a query, but without counting constant columns.
Note
Constant columns are formed fairly often when running a query, but they require approximately zero computing resources.
## max\_threads[β](https://clickhouse.com/docs/operations/settings/settings#max_threads "Direct link to max_threads")
| Type | Default value |
|---|---|
| TypeMaxThreads | Default value'auto(N)' |
The maximum number of query processing threads, excluding threads for retrieving data from remote servers (see the ['max\_distributed\_connections'](https://clickhouse.com/docs/operations/settings/settings#max_distributed_connections) parameter).
This parameter applies to threads that perform the same stages of the query processing pipeline in parallel. For example, when reading from a table, if it is possible to evaluate expressions with functions, filter with `WHERE` and pre-aggregate for `GROUP BY` in parallel using at least 'max\_threads' number of threads, then 'max\_threads' are used.
For queries that are completed quickly because of a LIMIT, you can set a lower 'max\_threads'. For example, if the necessary number of entries are located in every block and max\_threads = 8, then 8 blocks are retrieved, although it would have been enough to read just one. The smaller the `max_threads` value, the less memory is consumed.
The `max_threads` setting by default matches the number of hardware threads (number of CPU cores) available to ClickHouse. As a special case, for x86 processors with less than 32 CPU cores and SMT (e.g. Intel HyperThreading), ClickHouse uses the number of logical cores (= 2 x physical core count) by default.
Without SMT (e.g. Intel HyperThreading), this corresponds to the number of CPU cores.
For ClickHouse Cloud users, the default value will display as `auto(N)` where N matches the vCPU size of your service e.g. 2vCPU/8GiB, 4vCPU/16GiB etc. See the settings tab in the Cloud console for a list of all service sizes.
## max\_threads\_for\_indexes[β](https://clickhouse.com/docs/operations/settings/settings#max_threads_for_indexes "Direct link to max_threads_for_indexes")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
The maximum number of threads process indices.
## max\_untracked\_memory[β](https://clickhouse.com/docs/operations/settings/settings#max_untracked_memory "Direct link to max_untracked_memory")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value4194304 |
Small allocations and deallocations are grouped in thread local variable and tracked or profiled only when an amount (in absolute value) becomes larger than the specified value. If the value is higher than 'memory\_profiler\_step' it will be effectively lowered to 'memory\_profiler\_step'.
## max\_wkb\_geometry\_elements[β](https://clickhouse.com/docs/operations/settings/settings#max_wkb_geometry_elements "Direct link to max_wkb_geometry_elements")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value1000000 |
Maximum number of points, rings, or polygons allowed in a single WKB geometry element during parsing by `readWKB` and related functions. This protects against excessive memory allocations from malformed WKB data. Set to 0 to use the hard-coded limit (100 million).
## memory\_overcommit\_ratio\_denominator[β](https://clickhouse.com/docs/operations/settings/settings#memory_overcommit_ratio_denominator "Direct link to memory_overcommit_ratio_denominator")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value1073741824 |
It represents the soft memory limit when the hard limit is reached on the global level. This value is used to compute the overcommit ratio for the query. Zero means skip the query. Read more about [memory overcommit](https://clickhouse.com/docs/operations/settings/memory-overcommit).
## memory\_overcommit\_ratio\_denominator\_for\_user[β](https://clickhouse.com/docs/operations/settings/settings#memory_overcommit_ratio_denominator_for_user "Direct link to memory_overcommit_ratio_denominator_for_user")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value1073741824 |
It represents the soft memory limit when the hard limit is reached on the user level. This value is used to compute the overcommit ratio for the query. Zero means skip the query. Read more about [memory overcommit](https://clickhouse.com/docs/operations/settings/memory-overcommit).
## memory\_profiler\_sample\_max\_allocation\_size[β](https://clickhouse.com/docs/operations/settings/settings#memory_profiler_sample_max_allocation_size "Direct link to memory_profiler_sample_max_allocation_size")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Collect random allocations of size less or equal than the specified value with probability equal to `memory_profiler_sample_probability`. 0 means disabled. You may want to set 'max\_untracked\_memory' to 0 to make this threshold work as expected.
## memory\_profiler\_sample\_min\_allocation\_size[β](https://clickhouse.com/docs/operations/settings/settings#memory_profiler_sample_min_allocation_size "Direct link to memory_profiler_sample_min_allocation_size")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Collect random allocations of size greater or equal than the specified value with probability equal to `memory_profiler_sample_probability`. 0 means disabled. You may want to set 'max\_untracked\_memory' to 0 to make this threshold work as expected.
## memory\_profiler\_sample\_probability[β](https://clickhouse.com/docs/operations/settings/settings#memory_profiler_sample_probability "Direct link to memory_profiler_sample_probability")
| Type | Default value |
|---|---|
| TypeFloat | Default value0 |
Collect random allocations and deallocations and write them into system.trace\_log with 'MemorySample' trace\_type. The probability is for every alloc/free regardless of the size of the allocation (can be changed with `memory_profiler_sample_min_allocation_size` and `memory_profiler_sample_max_allocation_size`). Note that sampling happens only when the amount of untracked memory exceeds 'max\_untracked\_memory'. You may want to set 'max\_untracked\_memory' to 0 for extra fine-grained sampling.
## memory\_profiler\_step[β](https://clickhouse.com/docs/operations/settings/settings#memory_profiler_step "Direct link to memory_profiler_step")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value4194304 |
Sets the step of memory profiler. Whenever query memory usage becomes larger than every next step in number of bytes the memory profiler will collect the allocating stacktrace and will write it into [trace\_log](https://clickhouse.com/docs/operations/system-tables/trace_log).
Possible values:
- A positive integer number of bytes.
- 0 for turning off the memory profiler.
## memory\_tracker\_fault\_probability[β](https://clickhouse.com/docs/operations/settings/settings#memory_tracker_fault_probability "Direct link to memory_tracker_fault_probability")
| Type | Default value |
|---|---|
| TypeFloat | Default value0 |
For testing of `exception safety` - throw an exception every time you allocate memory with the specified probability.
## memory\_usage\_overcommit\_max\_wait\_microseconds[β](https://clickhouse.com/docs/operations/settings/settings#memory_usage_overcommit_max_wait_microseconds "Direct link to memory_usage_overcommit_max_wait_microseconds")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value5000000 |
Maximum time thread will wait for memory to be freed in the case of memory overcommit on a user level. If the timeout is reached and memory is not freed, an exception is thrown. Read more about [memory overcommit](https://clickhouse.com/docs/operations/settings/memory-overcommit).
## merge\_table\_max\_tables\_to\_look\_for\_schema\_inference[β](https://clickhouse.com/docs/operations/settings/settings#merge_table_max_tables_to_look_for_schema_inference "Direct link to merge_table_max_tables_to_look_for_schema_inference")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value1000 |
When creating a `Merge` table without an explicit schema or when using the `merge` table function, infer schema as a union of not more than the specified number of matching tables. If there is a larger number of tables, the schema will be inferred from the first specified number of tables.
## merge\_tree\_coarse\_index\_granularity[β](https://clickhouse.com/docs/operations/settings/settings#merge_tree_coarse_index_granularity "Direct link to merge_tree_coarse_index_granularity")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value8 |
When searching for data, ClickHouse checks the data marks in the index file. If ClickHouse finds that required keys are in some range, it divides this range into `merge_tree_coarse_index_granularity` subranges and searches the required keys there recursively.
Possible values:
- Any positive even integer.
## merge\_tree\_compact\_parts\_min\_granules\_to\_multibuffer\_read[β](https://clickhouse.com/docs/operations/settings/settings#merge_tree_compact_parts_min_granules_to_multibuffer_read "Direct link to merge_tree_compact_parts_min_granules_to_multibuffer_read")
ClickHouse Cloud only
| Type | Default value |
|---|---|
| TypeUInt64 | Default value16 |
Only has an effect in ClickHouse Cloud. Number of granules in stripe of compact part of MergeTree tables to use multibuffer reader, which supports parallel reading and prefetch. In case of reading from remote fs using of multibuffer reader increases number of read request.
## merge\_tree\_determine\_task\_size\_by\_prewhere\_columns[β](https://clickhouse.com/docs/operations/settings/settings#merge_tree_determine_task_size_by_prewhere_columns "Direct link to merge_tree_determine_task_size_by_prewhere_columns")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Whether to use only prewhere columns size to determine reading task size.
## merge\_tree\_max\_bytes\_to\_use\_cache[β](https://clickhouse.com/docs/operations/settings/settings#merge_tree_max_bytes_to_use_cache "Direct link to merge_tree_max_bytes_to_use_cache")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value2013265920 |
If ClickHouse should read more than `merge_tree_max_bytes_to_use_cache` bytes in one query, it does not use the cache of uncompressed blocks.
The cache of uncompressed blocks stores data extracted for queries. ClickHouse uses this cache to speed up responses to repeated small queries. This setting protects the cache from trashing by queries that read a large amount of data. The [uncompressed\_cache\_size](https://clickhouse.com/docs/operations/server-configuration-parameters/settings#uncompressed_cache_size) server setting defines the size of the cache of uncompressed blocks.
Possible values:
- Any positive integer.
## merge\_tree\_max\_rows\_to\_use\_cache[β](https://clickhouse.com/docs/operations/settings/settings#merge_tree_max_rows_to_use_cache "Direct link to merge_tree_max_rows_to_use_cache")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value1048576 |
If ClickHouse should read more than `merge_tree_max_rows_to_use_cache` rows in one query, it does not use the cache of uncompressed blocks.
The cache of uncompressed blocks stores data extracted for queries. ClickHouse uses this cache to speed up responses to repeated small queries. This setting protects the cache from trashing by queries that read a large amount of data. The [uncompressed\_cache\_size](https://clickhouse.com/docs/operations/server-configuration-parameters/settings#uncompressed_cache_size) server setting defines the size of the cache of uncompressed blocks.
Possible values:
- Any positive integer.
## merge\_tree\_min\_bytes\_for\_concurrent\_read[β](https://clickhouse.com/docs/operations/settings/settings#merge_tree_min_bytes_for_concurrent_read "Direct link to merge_tree_min_bytes_for_concurrent_read")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value251658240 |
If the number of bytes to read from one file of a [MergeTree](https://clickhouse.com/docs/engines/table-engines/mergetree-family/mergetree)\-engine table exceeds `merge_tree_min_bytes_for_concurrent_read`, then ClickHouse tries to concurrently read from this file in several threads.
Possible value:
- Positive integer.
## merge\_tree\_min\_bytes\_for\_concurrent\_read\_for\_remote\_filesystem[β](https://clickhouse.com/docs/operations/settings/settings#merge_tree_min_bytes_for_concurrent_read_for_remote_filesystem "Direct link to merge_tree_min_bytes_for_concurrent_read_for_remote_filesystem")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
The minimum number of bytes to read from one file before [MergeTree](https://clickhouse.com/docs/engines/table-engines/mergetree-family/mergetree) engine can parallelize reading, when reading from remote filesystem. We do not recommend using this setting.
Possible values:
- Positive integer.
## merge\_tree\_min\_bytes\_for\_seek[β](https://clickhouse.com/docs/operations/settings/settings#merge_tree_min_bytes_for_seek "Direct link to merge_tree_min_bytes_for_seek")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
If the distance between two data blocks to be read in one file is less than `merge_tree_min_bytes_for_seek` bytes, then ClickHouse sequentially reads a range of file that contains both blocks, thus avoiding extra seek.
Possible values:
- Any positive integer.
## merge\_tree\_min\_bytes\_per\_task\_for\_remote\_reading[β](https://clickhouse.com/docs/operations/settings/settings#merge_tree_min_bytes_per_task_for_remote_reading "Direct link to merge_tree_min_bytes_per_task_for_remote_reading")
**Aliases**: `filesystem_prefetch_min_bytes_for_single_read_task`
| Type | Default value |
|---|---|
| TypeUInt64 | Default value2097152 |
Min bytes to read per task.
## merge\_tree\_min\_read\_task\_size[β](https://clickhouse.com/docs/operations/settings/settings#merge_tree_min_read_task_size "Direct link to merge_tree_min_read_task_size")
| Type | Default value |
|---|---|
| TypeNonZeroUInt64 | Default value8 |
Hard lower limit on the task size (even when the number of granules is low and the number of available threads is high we won't allocate smaller tasks
## merge\_tree\_min\_rows\_for\_concurrent\_read[β](https://clickhouse.com/docs/operations/settings/settings#merge_tree_min_rows_for_concurrent_read "Direct link to merge_tree_min_rows_for_concurrent_read")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value163840 |
If the number of rows to be read from a file of a [MergeTree](https://clickhouse.com/docs/engines/table-engines/mergetree-family/mergetree) table exceeds `merge_tree_min_rows_for_concurrent_read` then ClickHouse tries to perform a concurrent reading from this file on several threads.
Possible values:
- Positive integer.
## merge\_tree\_min\_rows\_for\_concurrent\_read\_for\_remote\_filesystem[β](https://clickhouse.com/docs/operations/settings/settings#merge_tree_min_rows_for_concurrent_read_for_remote_filesystem "Direct link to merge_tree_min_rows_for_concurrent_read_for_remote_filesystem")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
The minimum number of lines to read from one file before the [MergeTree](https://clickhouse.com/docs/engines/table-engines/mergetree-family/mergetree) engine can parallelize reading, when reading from remote filesystem. We do not recommend using this setting.
Possible values:
- Positive integer.
## merge\_tree\_min\_rows\_for\_seek[β](https://clickhouse.com/docs/operations/settings/settings#merge_tree_min_rows_for_seek "Direct link to merge_tree_min_rows_for_seek")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
If the distance between two data blocks to be read in one file is less than `merge_tree_min_rows_for_seek` rows, then ClickHouse does not seek through the file but reads the data sequentially.
Possible values:
- Any positive integer.
## merge\_tree\_read\_split\_ranges\_into\_intersecting\_and\_non\_intersecting\_injection\_probability[β](https://clickhouse.com/docs/operations/settings/settings#merge_tree_read_split_ranges_into_intersecting_and_non_intersecting_injection_probability "Direct link to merge_tree_read_split_ranges_into_intersecting_and_non_intersecting_injection_probability")
| Type | Default value |
|---|---|
| TypeFloat | Default value0 |
For testing of `PartsSplitter` - split read ranges into intersecting and non intersecting every time you read from MergeTree with the specified probability.
## merge\_tree\_storage\_snapshot\_sleep\_ms[β](https://clickhouse.com/docs/operations/settings/settings#merge_tree_storage_snapshot_sleep_ms "Direct link to merge_tree_storage_snapshot_sleep_ms")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Inject artificial delay (in milliseconds) when creating a storage snapshot for MergeTree tables. Used for testing and debugging purposes only.
Possible values:
- 0 - No delay (default)
- N - Delay in milliseconds
## merge\_tree\_use\_const\_size\_tasks\_for\_remote\_reading[β](https://clickhouse.com/docs/operations/settings/settings#merge_tree_use_const_size_tasks_for_remote_reading "Direct link to merge_tree_use_const_size_tasks_for_remote_reading")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Whether to use constant size tasks for reading from a remote table.
## merge\_tree\_use\_deserialization\_prefixes\_cache[β](https://clickhouse.com/docs/operations/settings/settings#merge_tree_use_deserialization_prefixes_cache "Direct link to merge_tree_use_deserialization_prefixes_cache")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Enables caching of columns metadata from the file prefixes during reading from remote disks in MergeTree.
## merge\_tree\_use\_prefixes\_deserialization\_thread\_pool[β](https://clickhouse.com/docs/operations/settings/settings#merge_tree_use_prefixes_deserialization_thread_pool "Direct link to merge_tree_use_prefixes_deserialization_thread_pool")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Enables usage of the thread pool for parallel prefixes reading in Wide parts in MergeTree. Size of that thread pool is controlled by server setting `max_prefixes_deserialization_thread_pool_size`.
## merge\_tree\_use\_v1\_object\_and\_dynamic\_serialization[β](https://clickhouse.com/docs/operations/settings/settings#merge_tree_use_v1_object_and_dynamic_serialization "Direct link to merge_tree_use_v1_object_and_dynamic_serialization")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
When enabled, V1 serialization version of JSON and Dynamic types will be used in MergeTree instead of V2. Changing this setting takes affect only after server restart.
## metrics\_perf\_events\_enabled[β](https://clickhouse.com/docs/operations/settings/settings#metrics_perf_events_enabled "Direct link to metrics_perf_events_enabled")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
If enabled, some of the perf events will be measured throughout queries' execution.
## metrics\_perf\_events\_list[β](https://clickhouse.com/docs/operations/settings/settings#metrics_perf_events_list "Direct link to metrics_perf_events_list")
Comma separated list of perf metrics that will be measured throughout queries' execution. Empty means all events. See PerfEventInfo in sources for the available events.
## min\_bytes\_to\_use\_direct\_io[β](https://clickhouse.com/docs/operations/settings/settings#min_bytes_to_use_direct_io "Direct link to min_bytes_to_use_direct_io")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
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[β](https://clickhouse.com/docs/operations/settings/settings#min_bytes_to_use_mmap_io "Direct link to min_bytes_to_use_mmap_io")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
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](https://en.wikipedia.org/wiki/Mmap) 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.
## min\_chunk\_bytes\_for\_parallel\_parsing[β](https://clickhouse.com/docs/operations/settings/settings#min_chunk_bytes_for_parallel_parsing "Direct link to min_chunk_bytes_for_parallel_parsing")
| Type | Default value |
|---|---|
| TypeNonZeroUInt64 | Default value10485760 |
- Type: unsigned int
- Default value: 1 MiB
The minimum chunk size in bytes, which each thread will parse in parallel.
## min\_compress\_block\_size[β](https://clickhouse.com/docs/operations/settings/settings#min_compress_block_size "Direct link to min_compress_block_size")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value65536 |
For [MergeTree](https://clickhouse.com/docs/engines/table-engines/mergetree-family/mergetree) tables. In order to reduce latency when processing queries, a block is compressed when writing the next mark if its size is at least `min_compress_block_size`. By default, 65,536.
The actual size of the block, if the uncompressed data is less than `max_compress_block_size`, is no less than this value and no less than the volume of data for one mark.
Let's look at an example. Assume that `index_granularity` was set to 8192 during table creation.
We are writing a UInt32-type column (4 bytes per value). When writing 8192 rows, the total will be 32 KB of data. Since min\_compress\_block\_size = 65,536, a compressed block will be formed for every two marks.
We are writing a URL column with the String type (average size of 60 bytes per value). When writing 8192 rows, the average will be slightly less than 500 KB of data. Since this is more than 65,536, a compressed block will be formed for each mark. In this case, when reading data from the disk in the range of a single mark, extra data won't be decompressed.
Note
This is an expert-level setting, and you shouldn't change it if you're just getting started with ClickHouse.
## min\_count\_to\_compile\_aggregate\_expression[β](https://clickhouse.com/docs/operations/settings/settings#min_count_to_compile_aggregate_expression "Direct link to min_count_to_compile_aggregate_expression")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value3 |
The minimum number of identical aggregate expressions to start JIT-compilation. Works only if the [compile\_aggregate\_expressions](https://clickhouse.com/docs/operations/settings/settings#compile_aggregate_expressions) setting is enabled.
Possible values:
- Positive integer.
- 0 β Identical aggregate expressions are always JIT-compiled.
## min\_count\_to\_compile\_expression[β](https://clickhouse.com/docs/operations/settings/settings#min_count_to_compile_expression "Direct link to min_count_to_compile_expression")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value3 |
Minimum count of executing same expression before it is get compiled.
## min\_count\_to\_compile\_sort\_description[β](https://clickhouse.com/docs/operations/settings/settings#min_count_to_compile_sort_description "Direct link to min_count_to_compile_sort_description")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value3 |
The number of identical sort descriptions before they are JIT-compiled
## min\_execution\_speed[β](https://clickhouse.com/docs/operations/settings/settings#min_execution_speed "Direct link to min_execution_speed")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Minimal execution speed in rows per second. Checked on every data block when [`timeout_before_checking_execution_speed`](https://clickhouse.com/docs/operations/settings/settings#timeout_before_checking_execution_speed) expires. If the execution speed is lower, an exception is thrown.
## min\_execution\_speed\_bytes[β](https://clickhouse.com/docs/operations/settings/settings#min_execution_speed_bytes "Direct link to min_execution_speed_bytes")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
The minimum number of execution bytes per second. Checked on every data block when [`timeout_before_checking_execution_speed`](https://clickhouse.com/docs/operations/settings/settings#timeout_before_checking_execution_speed) expires. If the execution speed is lower, an exception is thrown.
## min\_external\_table\_block\_size\_bytes[β](https://clickhouse.com/docs/operations/settings/settings#min_external_table_block_size_bytes "Direct link to min_external_table_block_size_bytes")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value268402944 |
Squash blocks passed to the external table to a specified size in bytes, if blocks are not big enough.
## min\_external\_table\_block\_size\_rows[β](https://clickhouse.com/docs/operations/settings/settings#min_external_table_block_size_rows "Direct link to min_external_table_block_size_rows")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value1048449 |
Squash blocks passed to external table to specified size in rows, if blocks are not big enough.
## min\_free\_disk\_bytes\_to\_perform\_insert[β](https://clickhouse.com/docs/operations/settings/settings#min_free_disk_bytes_to_perform_insert "Direct link to min_free_disk_bytes_to_perform_insert")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Minimum free disk space bytes to perform an insert.
## min\_free\_disk\_ratio\_to\_perform\_insert[β](https://clickhouse.com/docs/operations/settings/settings#min_free_disk_ratio_to_perform_insert "Direct link to min_free_disk_ratio_to_perform_insert")
| Type | Default value |
|---|---|
| TypeFloat | Default value0 |
Minimum free disk space ratio to perform an insert.
## min\_free\_disk\_space\_for\_temporary\_data[β](https://clickhouse.com/docs/operations/settings/settings#min_free_disk_space_for_temporary_data "Direct link to min_free_disk_space_for_temporary_data")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
The minimum disk space to keep while writing temporary data used in external sorting and aggregation.
## min\_hit\_rate\_to\_use\_consecutive\_keys\_optimization[β](https://clickhouse.com/docs/operations/settings/settings#min_hit_rate_to_use_consecutive_keys_optimization "Direct link to min_hit_rate_to_use_consecutive_keys_optimization")
| Type | Default value |
|---|---|
| TypeFloat | Default value0\.5 |
Minimal hit rate of a cache which is used for consecutive keys optimization in aggregation to keep it enabled
## min\_insert\_block\_size\_bytes[β](https://clickhouse.com/docs/operations/settings/settings#min_insert_block_size_bytes "Direct link to min_insert_block_size_bytes")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value268402944 |
The minimum size of blocks (in bytes) to form for insertion into a table.
This setting works together with min\_insert\_block\_size\_rows and controls block formation in the same contexts (format parsing and INSERT operations). See min\_insert\_block\_size\_rows for detailed information about when and how these settings are applied.
Possible values:
- Positive integer.
- 0 β setting does not participate in block formation.
## min\_insert\_block\_size\_bytes\_for\_materialized\_views[β](https://clickhouse.com/docs/operations/settings/settings#min_insert_block_size_bytes_for_materialized_views "Direct link to min_insert_block_size_bytes_for_materialized_views")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Sets the minimum number of bytes in the block which can be inserted into a table by an `INSERT` query. Smaller-sized blocks are squashed into bigger ones. This setting is applied only for blocks inserted into [materialized view](https://clickhouse.com/docs/sql-reference/statements/create/view). By adjusting this setting, you control blocks squashing while pushing to materialized view and avoid excessive memory usage.
Possible values:
- Any positive integer.
- 0 β Squashing disabled.
**See also**
- [min\_insert\_block\_size\_bytes](https://clickhouse.com/docs/operations/settings/settings#min_insert_block_size_bytes)
## min\_insert\_block\_size\_rows[β](https://clickhouse.com/docs/operations/settings/settings#min_insert_block_size_rows "Direct link to min_insert_block_size_rows")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value1048449 |
The minimum size of blocks (in rows) to form for insertion into a table.
This setting controls block formation in two contexts:
1. Format parsing: When the server parses row-based input formats (CSV, TSV, JSONEachRow, etc.) from any interface (HTTP, clickhouse-client with inline data, gRPC, PostgreSQL wire protocol), blocks are emitted when:
- Both min\_insert\_block\_size\_rows AND min\_insert\_block\_size\_bytes are reached, OR
- Either max\_insert\_block\_size\_rows OR max\_insert\_block\_size\_bytes is reached
Note: When using clickhouse-client or clickhouse-local to read from a file, the client itself parses the data and this setting applies on the client side.
2. INSERT operations: During INSERT queries and when data flows through materialized views, this setting's behavior depends on `use_strict_insert_block_limits`:
- When enabled: Blocks are emitted when:
- Min thresholds (AND): Both min\_insert\_block\_size\_rows AND min\_insert\_block\_size\_bytes are reached
- Max thresholds (OR): Either max\_insert\_block\_size\_rows OR max\_insert\_block\_size\_bytes is reached
- When disabled (default): Blocks are emitted when min\_insert\_block\_size\_rows OR min\_insert\_block\_size\_bytes is reached. The max\_insert\_block\_size settings are not enforced.
Possible values:
- Positive integer.
- 0 β setting does not participate in block formation.
## min\_insert\_block\_size\_rows\_for\_materialized\_views[β](https://clickhouse.com/docs/operations/settings/settings#min_insert_block_size_rows_for_materialized_views "Direct link to min_insert_block_size_rows_for_materialized_views")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Sets the minimum number of rows in the block which can be inserted into a table by an `INSERT` query. Smaller-sized blocks are squashed into bigger ones. This setting is applied only for blocks inserted into [materialized view](https://clickhouse.com/docs/sql-reference/statements/create/view). By adjusting this setting, you control blocks squashing while pushing to materialized view and avoid excessive memory usage.
Possible values:
- Any positive integer.
- 0 β Squashing disabled.
**See Also**
- [min\_insert\_block\_size\_rows](https://clickhouse.com/docs/operations/settings/settings#min_insert_block_size_rows)
## min\_joined\_block\_size\_bytes[β](https://clickhouse.com/docs/operations/settings/settings#min_joined_block_size_bytes "Direct link to min_joined_block_size_bytes")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value524288 |
Minimum block size in bytes for JOIN input and output blocks (if join algorithm supports it). Small blocks will be squashed. 0 means unlimited.
## min\_joined\_block\_size\_rows[β](https://clickhouse.com/docs/operations/settings/settings#min_joined_block_size_rows "Direct link to min_joined_block_size_rows")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value65409 |
Minimum block size in rows for JOIN input and output blocks (if join algorithm supports it). Small blocks will be squashed. 0 means unlimited.
## min\_os\_cpu\_wait\_time\_ratio\_to\_throw[β](https://clickhouse.com/docs/operations/settings/settings#min_os_cpu_wait_time_ratio_to_throw "Direct link to min_os_cpu_wait_time_ratio_to_throw")
| Type | Default value |
|---|---|
| TypeFloat | Default value0 |
Min ratio between OS CPU wait (OSCPUWaitMicroseconds metric) and busy (OSCPUVirtualTimeMicroseconds metric) times to consider rejecting queries. Linear interpolation between min and max ratio is used to calculate the probability, the probability is 0 at this point.
## min\_outstreams\_per\_resize\_after\_split[β](https://clickhouse.com/docs/operations/settings/settings#min_outstreams_per_resize_after_split "Direct link to min_outstreams_per_resize_after_split")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value24 |
Specifies the minimum number of output streams of a `Resize` or `StrictResize` processor after the split is performed during pipeline generation. If the resulting number of streams is less than this value, the split operation will not occur.
### What is a Resize Node[β](https://clickhouse.com/docs/operations/settings/settings#what-is-a-resize-node "Direct link to What is a Resize Node")
A `Resize` node is a processor in the query pipeline that adjusts the number of data streams flowing through the pipeline. It can either increase or decrease the number of streams to balance the workload across multiple threads or processors. For example, if a query requires more parallelism, the `Resize` node can split a single stream into multiple streams. Conversely, it can merge multiple streams into fewer streams to consolidate data processing.
The `Resize` node ensures that data is evenly distributed across streams, maintaining the structure of the data blocks. This helps optimize resource utilization and improve query performance.
### Why the Resize Node Needs to Be Split[β](https://clickhouse.com/docs/operations/settings/settings#why-the-resize-node-needs-to-be-split "Direct link to Why the Resize Node Needs to Be Split")
During pipeline execution, ExecutingGraph::Node::status\_mutex of the centrally-hubbed `Resize` node is heavily contended especially in high-core-count environments, and this contention leads to:
1. Increased latency for ExecutingGraph::updateNode, directly impacting query performance.
2. Excessive CPU cycles are wasted in spin-lock contention (native\_queued\_spin\_lock\_slowpath), degrading efficiency.
3. Reduced CPU utilization, limiting parallelism and throughput.
### How the Resize Node Gets Split[β](https://clickhouse.com/docs/operations/settings/settings#how-the-resize-node-gets-split "Direct link to How the Resize Node Gets Split")
1. The number of output streams is checked to ensure the split could be performed: the output streams of each split processor meet or exceed the `min_outstreams_per_resize_after_split` threshold.
2. The `Resize` node is divided into smaller `Resize` nodes with equal count of ports, each handling a subset of input and output streams.
3. Each group is processed independently, reducing the lock contention.
### Splitting Resize Node with Arbitrary Inputs/Outputs[β](https://clickhouse.com/docs/operations/settings/settings#splitting-resize-node-with-arbitrary-inputsoutputs "Direct link to Splitting Resize Node with Arbitrary Inputs/Outputs")
In some cases, where the inputs/outputs are indivisible by the number of split `Resize` nodes, some inputs are connected to `NullSource`s and some outputs are connected to `NullSink`s. This allows the split to occur without affecting the overall data flow.
### Purpose of the Setting[β](https://clickhouse.com/docs/operations/settings/settings#purpose-of-the-setting "Direct link to Purpose of the Setting")
The `min_outstreams_per_resize_after_split` setting ensures that the splitting of `Resize` nodes is meaningful and avoids creating too few streams, which could lead to inefficient parallel processing. By enforcing a minimum number of output streams, this setting helps maintain a balance between parallelism and overhead, optimizing query execution in scenarios involving stream splitting and merging.
### Disabling the Setting[β](https://clickhouse.com/docs/operations/settings/settings#disabling-the-setting "Direct link to Disabling the Setting")
To disable the split of `Resize` nodes, set this setting to 0. This will prevent the splitting of `Resize` nodes during pipeline generation, allowing them to retain their original structure without division into smaller nodes.
## min\_table\_rows\_to\_use\_projection\_index[β](https://clickhouse.com/docs/operations/settings/settings#min_table_rows_to_use_projection_index "Direct link to min_table_rows_to_use_projection_index")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value1000000 |
If the estimated number of rows to read from the table is greater than or equal to this threshold, ClickHouse will try to use the projection index during query execution.
## mongodb\_throw\_on\_unsupported\_query[β](https://clickhouse.com/docs/operations/settings/settings#mongodb_throw_on_unsupported_query "Direct link to mongodb_throw_on_unsupported_query")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
If enabled, MongoDB tables will return an error when a MongoDB query cannot be built. Otherwise, ClickHouse reads the full table and processes it locally. This option does not apply when 'allow\_experimental\_analyzer=0'.
## move\_all\_conditions\_to\_prewhere[β](https://clickhouse.com/docs/operations/settings/settings#move_all_conditions_to_prewhere "Direct link to move_all_conditions_to_prewhere")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Move all viable conditions from WHERE to PREWHERE
## move\_primary\_key\_columns\_to\_end\_of\_prewhere[β](https://clickhouse.com/docs/operations/settings/settings#move_primary_key_columns_to_end_of_prewhere "Direct link to move_primary_key_columns_to_end_of_prewhere")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Move PREWHERE conditions containing primary key columns to the end of AND chain. It is likely that these conditions are taken into account during primary key analysis and thus will not contribute a lot to PREWHERE filtering.
## multiple\_joins\_try\_to\_keep\_original\_names[β](https://clickhouse.com/docs/operations/settings/settings#multiple_joins_try_to_keep_original_names "Direct link to multiple_joins_try_to_keep_original_names")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Do not add aliases to top level expression list on multiple joins rewrite
## mutations\_execute\_nondeterministic\_on\_initiator[β](https://clickhouse.com/docs/operations/settings/settings#mutations_execute_nondeterministic_on_initiator "Direct link to mutations_execute_nondeterministic_on_initiator")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
If true constant nondeterministic functions (e.g. function `now()`) are executed on initiator and replaced to literals in `UPDATE` and `DELETE` queries. It helps to keep data in sync on replicas while executing mutations with constant nondeterministic functions. Default value: `false`.
## mutations\_execute\_subqueries\_on\_initiator[β](https://clickhouse.com/docs/operations/settings/settings#mutations_execute_subqueries_on_initiator "Direct link to mutations_execute_subqueries_on_initiator")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
If true scalar subqueries are executed on initiator and replaced to literals in `UPDATE` and `DELETE` queries. Default value: `false`.
## mutations\_max\_literal\_size\_to\_replace[β](https://clickhouse.com/docs/operations/settings/settings#mutations_max_literal_size_to_replace "Direct link to mutations_max_literal_size_to_replace")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value16384 |
The maximum size of serialized literal in bytes to replace in `UPDATE` and `DELETE` queries. Takes effect only if at least one the two settings above is enabled. Default value: 16384 (16 KiB).
## mutations\_sync[β](https://clickhouse.com/docs/operations/settings/settings#mutations_sync "Direct link to mutations_sync")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Allows to execute `ALTER TABLE ... UPDATE|DELETE|MATERIALIZE INDEX|MATERIALIZE PROJECTION|MATERIALIZE COLUMN|MATERIALIZE STATISTICS` queries ([mutations](https://clickhouse.com/docs/sql-reference/statements/alter#mutations)) synchronously.
Possible values:
| Value | Description |
|---|---|
| `0` | Mutations execute asynchronously. |
| `1` | The query waits for all mutations to complete on the current server. |
| `2` | The query waits for all mutations to complete on all replicas (if they exist). |
| `3` | The query waits only for active replicas. Supported only for `SharedMergeTree`. For `ReplicatedMergeTree` it behaves the same as `mutations_sync = 2`. |
## mysql\_datatypes\_support\_level[β](https://clickhouse.com/docs/operations/settings/settings#mysql_datatypes_support_level "Direct link to mysql_datatypes_support_level")
| Type | Default value |
|---|---|
| TypeMySQLDataTypesSupport | Default valuedecimal,datetime64,date2Date32 |
Defines how MySQL types are converted to corresponding ClickHouse types. A comma separated list in any combination of `decimal`, `datetime64`, `date2Date32` or `date2String`. All modern mappings (`decimal`, `datetime64`, `date2Date32`) are enabled by default.
- `decimal`: convert `NUMERIC` and `DECIMAL` types to `Decimal` when precision allows it.
- `datetime64`: convert `DATETIME` and `TIMESTAMP` types to `DateTime64` instead of `DateTime` when precision is not `0`.
- `date2Date32`: convert `DATE` to `Date32` instead of `Date`. Takes precedence over `date2String`.
- `date2String`: convert `DATE` to `String` instead of `Date`. Overridden by `datetime64`.
## mysql\_map\_fixed\_string\_to\_text\_in\_show\_columns[β](https://clickhouse.com/docs/operations/settings/settings#mysql_map_fixed_string_to_text_in_show_columns "Direct link to mysql_map_fixed_string_to_text_in_show_columns")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
When enabled, [FixedString](https://clickhouse.com/docs/sql-reference/data-types/fixedstring) ClickHouse data type will be displayed as `TEXT` in [SHOW COLUMNS](https://clickhouse.com/docs/sql-reference/statements/show#show_columns).
Has an effect only when the connection is made through the MySQL wire protocol.
- 0 - Use `BLOB`.
- 1 - Use `TEXT`.
## mysql\_map\_string\_to\_text\_in\_show\_columns[β](https://clickhouse.com/docs/operations/settings/settings#mysql_map_string_to_text_in_show_columns "Direct link to mysql_map_string_to_text_in_show_columns")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
When enabled, [String](https://clickhouse.com/docs/sql-reference/data-types/string) ClickHouse data type will be displayed as `TEXT` in [SHOW COLUMNS](https://clickhouse.com/docs/sql-reference/statements/show#show_columns).
Has an effect only when the connection is made through the MySQL wire protocol.
- 0 - Use `BLOB`.
- 1 - Use `TEXT`.
## mysql\_max\_rows\_to\_insert[β](https://clickhouse.com/docs/operations/settings/settings#mysql_max_rows_to_insert "Direct link to mysql_max_rows_to_insert")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value65536 |
The maximum number of rows in MySQL batch insertion of the MySQL storage engine
## network\_compression\_method[β](https://clickhouse.com/docs/operations/settings/settings#network_compression_method "Direct link to network_compression_method")
| Type | Default value |
|---|---|
| TypeString | Default valueLZ4 |
The codec for compressing the client/server and server/server communication.
Possible values:
- `NONE` β no compression.
- `LZ4` β use the LZ4 codec.
- `LZ4HC` β use the LZ4HC codec.
- `ZSTD` β use the ZSTD codec.
**See Also**
- [network\_zstd\_compression\_level](https://clickhouse.com/docs/operations/settings/settings#network_zstd_compression_level)
## network\_zstd\_compression\_level[β](https://clickhouse.com/docs/operations/settings/settings#network_zstd_compression_level "Direct link to network_zstd_compression_level")
| Type | Default value |
|---|---|
| TypeInt64 | Default value1 |
Adjusts the level of ZSTD compression. Used only when [network\_compression\_method](https://clickhouse.com/docs/operations/settings/settings#network_compression_method) is set to `ZSTD`.
Possible values:
- Positive integer from 1 to 15.
## normalize\_function\_names[β](https://clickhouse.com/docs/operations/settings/settings#normalize_function_names "Direct link to normalize_function_names")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Normalize function names to their canonical names
## number\_of\_mutations\_to\_delay[β](https://clickhouse.com/docs/operations/settings/settings#number_of_mutations_to_delay "Direct link to number_of_mutations_to_delay")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
If the mutated table contains at least that many unfinished mutations, artificially slow down mutations of table. 0 - disabled
## number\_of\_mutations\_to\_throw[β](https://clickhouse.com/docs/operations/settings/settings#number_of_mutations_to_throw "Direct link to number_of_mutations_to_throw")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
If the mutated table contains at least that many unfinished mutations, throw 'Too many mutations ...' exception. 0 - disabled
## odbc\_bridge\_connection\_pool\_size[β](https://clickhouse.com/docs/operations/settings/settings#odbc_bridge_connection_pool_size "Direct link to odbc_bridge_connection_pool_size")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value16 |
Connection pool size for each connection settings string in ODBC bridge.
## odbc\_bridge\_use\_connection\_pooling[β](https://clickhouse.com/docs/operations/settings/settings#odbc_bridge_use_connection_pooling "Direct link to odbc_bridge_use_connection_pooling")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Use connection pooling in ODBC bridge. If set to false, a new connection is created every time.
## offset[β](https://clickhouse.com/docs/operations/settings/settings#offset "Direct link to offset")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Sets the number of rows to skip before starting to return rows from the query. It adjusts the offset set by the [OFFSET](https://clickhouse.com/docs/sql-reference/statements/select/offset) clause, so that these two values are summarized.
Possible values:
- 0 β No rows are skipped .
- Positive integer.
**Example**
Input table:
```
CREATE TABLE test (i UInt64) ENGINE = MergeTree() ORDER BY i;
INSERT INTO test SELECT number FROM numbers(500);
```
Query:
```
SET limit = 5;
SET offset = 7;
SELECT * FROM test LIMIT 10 OFFSET 100;
```
Result:
```
ββββiββ
β 107 β
β 108 β
β 109 β
βββββββ
```
## opentelemetry\_start\_keeper\_trace\_probability[β](https://clickhouse.com/docs/operations/settings/settings#opentelemetry_start_keeper_trace_probability "Direct link to opentelemetry_start_keeper_trace_probability")
| Type | Default value |
|---|---|
| TypeFloatAuto | Default valueauto |
Probability to start a trace for ZooKeeper request - whether there is a parent trace or not.
Possible values:
- 'auto' - Equals the opentelemetry\_start\_trace\_probability setting
- 0 β Tracing is disabled
- 0 to 1 β Probability (e.g., 1.0 = always enable)
## opentelemetry\_start\_trace\_probability[β](https://clickhouse.com/docs/operations/settings/settings#opentelemetry_start_trace_probability "Direct link to opentelemetry_start_trace_probability")
| Type | Default value |
|---|---|
| TypeFloat | Default value0 |
Sets the probability that the ClickHouse can start a trace for executed queries (if no parent [trace context](https://www.w3.org/TR/trace-context/) is supplied).
Possible values:
- 0 β The trace for all executed queries is disabled (if no parent trace context is supplied).
- Positive floating-point number in the range \[0..1\]. For example, if the setting value is `0,5`, ClickHouse can start a trace on average for half of the queries.
- 1 β The trace for all executed queries is enabled.
## opentelemetry\_trace\_cpu\_scheduling[β](https://clickhouse.com/docs/operations/settings/settings#opentelemetry_trace_cpu_scheduling "Direct link to opentelemetry_trace_cpu_scheduling")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Collect OpenTelemetry spans for workload preemptive CPU scheduling.
## opentelemetry\_trace\_processors[β](https://clickhouse.com/docs/operations/settings/settings#opentelemetry_trace_processors "Direct link to opentelemetry_trace_processors")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Collect OpenTelemetry spans for processors.
## optimize\_aggregation\_in\_order[β](https://clickhouse.com/docs/operations/settings/settings#optimize_aggregation_in_order "Direct link to optimize_aggregation_in_order")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Enables [GROUP BY](https://clickhouse.com/docs/sql-reference/statements/select/group-by) optimization in [SELECT](https://clickhouse.com/docs/sql-reference/statements/select) queries for aggregating data in corresponding order in [MergeTree](https://clickhouse.com/docs/engines/table-engines/mergetree-family/mergetree) tables.
Possible values:
- 0 β `GROUP BY` optimization is disabled.
- 1 β `GROUP BY` optimization is enabled.
**See Also**
- [GROUP BY optimization](https://clickhouse.com/docs/sql-reference/statements/select/group-by#group-by-optimization-depending-on-table-sorting-key)
## optimize\_aggregators\_of\_group\_by\_keys[β](https://clickhouse.com/docs/operations/settings/settings#optimize_aggregators_of_group_by_keys "Direct link to optimize_aggregators_of_group_by_keys")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Eliminates min/max/any/anyLast aggregators of GROUP BY keys in SELECT sectio
## optimize\_and\_compare\_chain[β](https://clickhouse.com/docs/operations/settings/settings#optimize_and_compare_chain "Direct link to optimize_and_compare_chain")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Populate constant comparison in AND chains to enhance filtering ability. Support operators `<`, `<=`, `>`, `>=`, `=` and mix of them. For example, `(a < b) AND (b < c) AND (c < 5)` would be `(a < b) AND (b < c) AND (c < 5) AND (b < 5) AND (a < 5)`.
## optimize\_append\_index[β](https://clickhouse.com/docs/operations/settings/settings#optimize_append_index "Direct link to optimize_append_index")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Use [constraints](https://clickhouse.com/docs/sql-reference/statements/create/table#constraints) in order to append index condition. The default is `false`.
Possible values:
- true, false
## optimize\_arithmetic\_operations\_in\_aggregate\_functions[β](https://clickhouse.com/docs/operations/settings/settings#optimize_arithmetic_operations_in_aggregate_functions "Direct link to optimize_arithmetic_operations_in_aggregate_functions")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Move arithmetic operations out of aggregation functions
## optimize\_const\_name\_size[β](https://clickhouse.com/docs/operations/settings/settings#optimize_const_name_size "Direct link to optimize_const_name_size")
| Type | Default value |
|---|---|
| TypeInt64 | Default value256 |
Replace with scalar and use hash as a name for large constants (size is estimated by the name length).
Possible values:
- positive integer - max length of the name,
- 0 β always,
- negative integer - never.
## optimize\_count\_from\_files[β](https://clickhouse.com/docs/operations/settings/settings#optimize_count_from_files "Direct link to optimize_count_from_files")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Enables or disables the optimization of counting number of rows from files in different input formats. It applies to table functions/engines `file`/`s3`/`url`/`hdfs`/`azureBlobStorage`.
Possible values:
- 0 β Optimization disabled.
- 1 β Optimization enabled.
## optimize\_distinct\_in\_order[β](https://clickhouse.com/docs/operations/settings/settings#optimize_distinct_in_order "Direct link to optimize_distinct_in_order")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Enable DISTINCT optimization if some columns in DISTINCT form a prefix of sorting. For example, prefix of sorting key in merge tree or ORDER BY statement
## optimize\_distributed\_group\_by\_sharding\_key[β](https://clickhouse.com/docs/operations/settings/settings#optimize_distributed_group_by_sharding_key "Direct link to optimize_distributed_group_by_sharding_key")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Optimize `GROUP BY sharding_key` queries, by avoiding costly aggregation on the initiator server (which will reduce memory usage for the query on the initiator server).
The following types of queries are supported (and all combinations of them):
- `SELECT DISTINCT [..., ]sharding_key[, ...] FROM dist`
- `SELECT ... FROM dist GROUP BY sharding_key[, ...]`
- `SELECT ... FROM dist GROUP BY sharding_key[, ...] ORDER BY x`
- `SELECT ... FROM dist GROUP BY sharding_key[, ...] LIMIT 1`
- `SELECT ... FROM dist GROUP BY sharding_key[, ...] LIMIT 1 BY x`
The following types of queries are not supported (support for some of them may be added later):
- `SELECT ... GROUP BY sharding_key[, ...] WITH TOTALS`
- `SELECT ... GROUP BY sharding_key[, ...] WITH ROLLUP`
- `SELECT ... GROUP BY sharding_key[, ...] WITH CUBE`
- `SELECT ... GROUP BY sharding_key[, ...] SETTINGS extremes=1`
Possible values:
- 0 β Disabled.
- 1 β Enabled.
See also:
- [distributed\_group\_by\_no\_merge](https://clickhouse.com/docs/operations/settings/settings#distributed_group_by_no_merge)
- [distributed\_push\_down\_limit](https://clickhouse.com/docs/operations/settings/settings#distributed_push_down_limit)
- [optimize\_skip\_unused\_shards](https://clickhouse.com/docs/operations/settings/settings#optimize_skip_unused_shards)
Note
Right now it requires `optimize_skip_unused_shards` (the reason behind this is that one day it may be enabled by default, and it will work correctly only if data was inserted via Distributed table, i.e. data is distributed according to sharding\_key).
## optimize\_dry\_run\_check\_part[β](https://clickhouse.com/docs/operations/settings/settings#optimize_dry_run_check_part "Direct link to optimize_dry_run_check_part")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
When enabled, `OPTIMIZE ... DRY RUN` validates the resulting merged part using `checkDataPart`. If the check fails, an exception is thrown.
## optimize\_empty\_string\_comparisons[β](https://clickhouse.com/docs/operations/settings/settings#optimize_empty_string_comparisons "Direct link to optimize_empty_string_comparisons")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Convert expressions like col = '' or '' = col into empty(col), and col != '' or '' != col into notEmpty(col), only when col is of String or FixedString type.
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Allow extracting common expressions from disjunctions in WHERE, PREWHERE, ON, HAVING and QUALIFY expressions. A logical expression like `(A AND B) OR (A AND C)` can be rewritten to `A AND (B OR C)`, which might help to utilize:
- indices in simple filtering expressions
- cross to inner join optimizatio
## optimize\_functions\_to\_subcolumns[β](https://clickhouse.com/docs/operations/settings/settings#optimize_functions_to_subcolumns "Direct link to optimize_functions_to_subcolumns")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Enables or disables optimization by transforming some functions to reading subcolumns. This reduces the amount of data to read.
These functions can be transformed:
- [length](https://clickhouse.com/docs/sql-reference/functions/array-functions#length) to read the [size0](https://clickhouse.com/docs/sql-reference/data-types/array#array-size) subcolumn.
- [empty](https://clickhouse.com/docs/sql-reference/functions/array-functions#empty) to read the [size0](https://clickhouse.com/docs/sql-reference/data-types/array#array-size) subcolumn.
- [notEmpty](https://clickhouse.com/docs/sql-reference/functions/array-functions#notEmpty) to read the [size0](https://clickhouse.com/docs/sql-reference/data-types/array#array-size) subcolumn.
- [isNull](https://clickhouse.com/docs/sql-reference/functions/functions-for-nulls#isNull) to read the [null](https://clickhouse.com/docs/sql-reference/data-types/nullable#finding-null) subcolumn.
- [isNotNull](https://clickhouse.com/docs/sql-reference/functions/functions-for-nulls#isNotNull) to read the [null](https://clickhouse.com/docs/sql-reference/data-types/nullable#finding-null) subcolumn.
- [count](https://clickhouse.com/docs/sql-reference/aggregate-functions/reference/count) to read the [null](https://clickhouse.com/docs/sql-reference/data-types/nullable#finding-null) subcolumn.
- [mapKeys](https://clickhouse.com/docs/sql-reference/functions/tuple-map-functions#mapKeys) to read the [keys](https://clickhouse.com/docs/sql-reference/data-types/map#reading-subcolumns-of-map) subcolumn.
- [mapValues](https://clickhouse.com/docs/sql-reference/functions/tuple-map-functions#mapValues) to read the [values](https://clickhouse.com/docs/sql-reference/data-types/map#reading-subcolumns-of-map) subcolumn.
Possible values:
- 0 β Optimization disabled.
- 1 β Optimization enabled.
## optimize\_group\_by\_constant\_keys[β](https://clickhouse.com/docs/operations/settings/settings#optimize_group_by_constant_keys "Direct link to optimize_group_by_constant_keys")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Optimize GROUP BY when all keys in block are constant
## optimize\_group\_by\_function\_keys[β](https://clickhouse.com/docs/operations/settings/settings#optimize_group_by_function_keys "Direct link to optimize_group_by_function_keys")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Eliminates functions of other keys in GROUP BY sectio
## optimize\_if\_chain\_to\_multiif[β](https://clickhouse.com/docs/operations/settings/settings#optimize_if_chain_to_multiif "Direct link to optimize_if_chain_to_multiif")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Replace if(cond1, then1, if(cond2, ...)) chains to multiIf. Currently it's not beneficial for numeric types.
## optimize\_if\_transform\_strings\_to\_enum[β](https://clickhouse.com/docs/operations/settings/settings#optimize_if_transform_strings_to_enum "Direct link to optimize_if_transform_strings_to_enum")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Replaces string-type arguments in If and Transform to enum. Disabled by default cause it could make inconsistent change in distributed query that would lead to its fail.
## optimize\_injective\_functions\_in\_group\_by[β](https://clickhouse.com/docs/operations/settings/settings#optimize_injective_functions_in_group_by "Direct link to optimize_injective_functions_in_group_by")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Replaces injective functions by it's arguments in GROUP BY sectio
## optimize\_injective\_functions\_inside\_uniq[β](https://clickhouse.com/docs/operations/settings/settings#optimize_injective_functions_inside_uniq "Direct link to optimize_injective_functions_inside_uniq")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Delete injective functions of one argument inside uniq\*() functions.
## optimize\_inverse\_dictionary\_lookup[β](https://clickhouse.com/docs/operations/settings/settings#optimize_inverse_dictionary_lookup "Direct link to optimize_inverse_dictionary_lookup")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Avoid repeated inverse dictionary lookup by doing faster lookups into a precomputed set of possible key values.
## optimize\_min\_equality\_disjunction\_chain\_length[β](https://clickhouse.com/docs/operations/settings/settings#optimize_min_equality_disjunction_chain_length "Direct link to optimize_min_equality_disjunction_chain_length")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value3 |
The minimum length of the expression `expr = x1 OR ... expr = xN` for optimizatio
## optimize\_min\_inequality\_conjunction\_chain\_length[β](https://clickhouse.com/docs/operations/settings/settings#optimize_min_inequality_conjunction_chain_length "Direct link to optimize_min_inequality_conjunction_chain_length")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value3 |
The minimum length of the expression `expr <> x1 AND ... expr <> xN` for optimizatio
## optimize\_move\_to\_prewhere[β](https://clickhouse.com/docs/operations/settings/settings#optimize_move_to_prewhere "Direct link to optimize_move_to_prewhere")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Enables or disables automatic [PREWHERE](https://clickhouse.com/docs/sql-reference/statements/select/prewhere) optimization in [SELECT](https://clickhouse.com/docs/sql-reference/statements/select) queries.
Works only for [\*MergeTree](https://clickhouse.com/docs/engines/table-engines/mergetree-family) tables.
Possible values:
- 0 β Automatic `PREWHERE` optimization is disabled.
- 1 β Automatic `PREWHERE` optimization is enabled.
## optimize\_move\_to\_prewhere\_if\_final[β](https://clickhouse.com/docs/operations/settings/settings#optimize_move_to_prewhere_if_final "Direct link to optimize_move_to_prewhere_if_final")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Enables or disables automatic [PREWHERE](https://clickhouse.com/docs/sql-reference/statements/select/prewhere) optimization in [SELECT](https://clickhouse.com/docs/sql-reference/statements/select) queries with [FINAL](https://clickhouse.com/docs/sql-reference/statements/select/from#final-modifier) modifier.
Works only for [\*MergeTree](https://clickhouse.com/docs/engines/table-engines/mergetree-family) tables.
Possible values:
- 0 β Automatic `PREWHERE` optimization in `SELECT` queries with `FINAL` modifier is disabled.
- 1 β Automatic `PREWHERE` optimization in `SELECT` queries with `FINAL` modifier is enabled.
**See Also**
- [optimize\_move\_to\_prewhere](https://clickhouse.com/docs/operations/settings/settings#optimize_move_to_prewhere) setting
## optimize\_multiif\_to\_if[β](https://clickhouse.com/docs/operations/settings/settings#optimize_multiif_to_if "Direct link to optimize_multiif_to_if")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Replace 'multiIf' with only one condition to 'if'.
## optimize\_normalize\_count\_variants[β](https://clickhouse.com/docs/operations/settings/settings#optimize_normalize_count_variants "Direct link to optimize_normalize_count_variants")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Rewrite aggregate functions that semantically equals to count() as count().
## optimize\_on\_insert[β](https://clickhouse.com/docs/operations/settings/settings#optimize_on_insert "Direct link to optimize_on_insert")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Enables or disables data transformation before the insertion, as if merge was done on this block (according to table engine).
Possible values:
- 0 β Disabled.
- 1 β Enabled.
**Example**
The difference between enabled and disabled:
Query:
```
SET optimize_on_insert = 1;
CREATE TABLE test1 (`FirstTable` UInt32) ENGINE = ReplacingMergeTree ORDER BY FirstTable;
INSERT INTO test1 SELECT number % 2 FROM numbers(5);
SELECT * FROM test1;
SET optimize_on_insert = 0;
CREATE TABLE test2 (`SecondTable` UInt32) ENGINE = ReplacingMergeTree ORDER BY SecondTable;
INSERT INTO test2 SELECT number % 2 FROM numbers(5);
SELECT * FROM test2;
```
Result:
```
ββFirstTableββ
β 0 β
β 1 β
ββββββββββββββ
ββSecondTableββ
β 0 β
β 0 β
β 0 β
β 1 β
β 1 β
βββββββββββββββ
```
Note that this setting influences [Materialized view](https://clickhouse.com/docs/sql-reference/statements/create/view#materialized-view) behaviour.
## optimize\_or\_like\_chain[β](https://clickhouse.com/docs/operations/settings/settings#optimize_or_like_chain "Direct link to optimize_or_like_chain")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Optimize multiple OR LIKE into multiMatchAny. This optimization should not be enabled by default, because it defies index analysis in some cases.
## optimize\_qbit\_distance\_function\_reads[β](https://clickhouse.com/docs/operations/settings/settings#optimize_qbit_distance_function_reads "Direct link to optimize_qbit_distance_function_reads")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Replace distance functions on `QBit` data type with equivalent ones that only read the columns necessary for the calculation from the storage.
## optimize\_read\_in\_order[β](https://clickhouse.com/docs/operations/settings/settings#optimize_read_in_order "Direct link to optimize_read_in_order")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Enables [ORDER BY](https://clickhouse.com/docs/sql-reference/statements/select/order-by#optimization-of-data-reading) optimization in [SELECT](https://clickhouse.com/docs/sql-reference/statements/select) queries for reading data from [MergeTree](https://clickhouse.com/docs/engines/table-engines/mergetree-family/mergetree) tables.
Possible values:
- 0 β `ORDER BY` optimization is disabled.
- 1 β `ORDER BY` optimization is enabled.
**See Also**
- [ORDER BY Clause](https://clickhouse.com/docs/sql-reference/statements/select/order-by#optimization-of-data-reading)
## optimize\_redundant\_functions\_in\_order\_by[β](https://clickhouse.com/docs/operations/settings/settings#optimize_redundant_functions_in_order_by "Direct link to optimize_redundant_functions_in_order_by")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Remove functions from ORDER BY if its argument is also in ORDER BY
## optimize\_respect\_aliases[β](https://clickhouse.com/docs/operations/settings/settings#optimize_respect_aliases "Direct link to optimize_respect_aliases")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
If it is set to true, it will respect aliases in WHERE/GROUP BY/ORDER BY, that will help with partition pruning/secondary indexes/optimize\_aggregation\_in\_order/optimize\_read\_in\_order/optimize\_trivial\_count
## optimize\_rewrite\_aggregate\_function\_with\_if[β](https://clickhouse.com/docs/operations/settings/settings#optimize_rewrite_aggregate_function_with_if "Direct link to optimize_rewrite_aggregate_function_with_if")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Rewrite aggregate functions with if expression as argument when logically equivalent. For example, `avg(if(cond, col, null))` can be rewritten to `avgOrNullIf(cond, col)`. It may improve performance.
Note
Supported only with the analyzer (`enable_analyzer = 1`).
## optimize\_rewrite\_array\_exists\_to\_has[β](https://clickhouse.com/docs/operations/settings/settings#optimize_rewrite_array_exists_to_has "Direct link to optimize_rewrite_array_exists_to_has")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Rewrite arrayExists() functions to has() when logically equivalent. For example, arrayExists(x -\> x = 1, arr) can be rewritten to has(arr, 1)
## optimize\_rewrite\_like\_perfect\_affix[β](https://clickhouse.com/docs/operations/settings/settings#optimize_rewrite_like_perfect_affix "Direct link to optimize_rewrite_like_perfect_affix")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Rewrite LIKE expressions with perfect prefix or suffix (e.g. `col LIKE 'ClickHouse%'`) to startsWith or endsWith functions (e.g. `startsWith(col, 'ClickHouse')`).
## optimize\_rewrite\_regexp\_functions[β](https://clickhouse.com/docs/operations/settings/settings#optimize_rewrite_regexp_functions "Direct link to optimize_rewrite_regexp_functions")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Rewrite regular expression related functions into simpler and more efficient forms
## optimize\_rewrite\_sum\_if\_to\_count\_if[β](https://clickhouse.com/docs/operations/settings/settings#optimize_rewrite_sum_if_to_count_if "Direct link to optimize_rewrite_sum_if_to_count_if")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Rewrite sumIf() and sum(if()) function countIf() function when logically equivalent
## optimize\_skip\_merged\_partitions[β](https://clickhouse.com/docs/operations/settings/settings#optimize_skip_merged_partitions "Direct link to optimize_skip_merged_partitions")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Enables or disables optimization for [OPTIMIZE TABLE ... FINAL](https://clickhouse.com/docs/sql-reference/statements/optimize) query if there is only one part with level \> 0 and it doesn't have expired TTL.
- `OPTIMIZE TABLE ... FINAL SETTINGS optimize_skip_merged_partitions=1`
By default, `OPTIMIZE TABLE ... FINAL` query rewrites the one part even if there is only a single part.
Possible values:
- 1 - Enable optimization.
- 0 - Disable optimization.
## optimize\_skip\_unused\_shards[β](https://clickhouse.com/docs/operations/settings/settings#optimize_skip_unused_shards "Direct link to optimize_skip_unused_shards")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Enables or disables skipping of unused shards for [SELECT](https://clickhouse.com/docs/sql-reference/statements/select) queries that have sharding key condition in `WHERE/PREWHERE`, and activates related optimizations for distributed queries (e.g. aggregation by sharding key).
Note
Assumes that the data is distributed by sharding key, otherwise a query yields incorrect result.
Possible values:
- 0 β Disabled.
- 1 β Enabled.
## optimize\_skip\_unused\_shards\_limit[β](https://clickhouse.com/docs/operations/settings/settings#optimize_skip_unused_shards_limit "Direct link to optimize_skip_unused_shards_limit")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value1000 |
Limit for number of sharding key values, turns off `optimize_skip_unused_shards` if the limit is reached.
Too many values may require significant amount for processing, while the benefit is doubtful, since if you have huge number of values in `IN (...)`, then most likely the query will be sent to all shards anyway.
## optimize\_skip\_unused\_shards\_nesting[β](https://clickhouse.com/docs/operations/settings/settings#optimize_skip_unused_shards_nesting "Direct link to optimize_skip_unused_shards_nesting")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Controls [`optimize_skip_unused_shards`](https://clickhouse.com/docs/operations/settings/settings#optimize_skip_unused_shards) (hence still requires [`optimize_skip_unused_shards`](https://clickhouse.com/docs/operations/settings/settings#optimize_skip_unused_shards)) depends on the nesting level of the distributed query (case when you have `Distributed` table that look into another `Distributed` table).
Possible values:
- 0 β Disabled, `optimize_skip_unused_shards` works always.
- 1 β Enables `optimize_skip_unused_shards` only for the first level.
- 2 β Enables `optimize_skip_unused_shards` up to the second level.
## optimize\_skip\_unused\_shards\_rewrite\_in[β](https://clickhouse.com/docs/operations/settings/settings#optimize_skip_unused_shards_rewrite_in "Direct link to optimize_skip_unused_shards_rewrite_in")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Rewrite IN in query for remote shards to exclude values that does not belong to the shard (requires optimize\_skip\_unused\_shards).
Possible values:
- 0 β Disabled.
- 1 β Enabled.
## optimize\_sorting\_by\_input\_stream\_properties[β](https://clickhouse.com/docs/operations/settings/settings#optimize_sorting_by_input_stream_properties "Direct link to optimize_sorting_by_input_stream_properties")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Optimize sorting by sorting properties of input stream
## optimize\_substitute\_columns[β](https://clickhouse.com/docs/operations/settings/settings#optimize_substitute_columns "Direct link to optimize_substitute_columns")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Use [constraints](https://clickhouse.com/docs/sql-reference/statements/create/table#constraints) for column substitution. The default is `false`.
Possible values:
- true, false
## optimize\_syntax\_fuse\_functions[β](https://clickhouse.com/docs/operations/settings/settings#optimize_syntax_fuse_functions "Direct link to optimize_syntax_fuse_functions")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Enables to fuse aggregate functions with identical argument. It rewrites query contains at least two aggregate functions from [sum](https://clickhouse.com/docs/sql-reference/aggregate-functions/reference/sum), [count](https://clickhouse.com/docs/sql-reference/aggregate-functions/reference/count) or [avg](https://clickhouse.com/docs/sql-reference/aggregate-functions/reference/avg) with identical argument to [sumCount](https://clickhouse.com/docs/sql-reference/aggregate-functions/reference/sumcount).
Possible values:
- 0 β Functions with identical argument are not fused.
- 1 β Functions with identical argument are fused.
**Example**
Query:
```
CREATE TABLE fuse_tbl(a Int8, b Int8) Engine = Log;
SET optimize_syntax_fuse_functions = 1;
EXPLAIN SYNTAX run_query_tree_passes = 1 SELECT sum(a), sum(b), count(b), avg(b) from fuse_tbl FORMAT TSV;
```
Result:
```
SELECT
sum(__table1.a) AS `sum(a)`,
tupleElement(sumCount(__table1.b), 1) AS `sum(b)`,
tupleElement(sumCount(__table1.b), 2) AS `count(b)`,
divide(tupleElement(sumCount(__table1.b), 1), toFloat64(tupleElement(sumCount(__table1.b), 2))) AS `avg(b)`
FROM default.fuse_tbl AS __table1
```
## optimize\_throw\_if\_noop[β](https://clickhouse.com/docs/operations/settings/settings#optimize_throw_if_noop "Direct link to optimize_throw_if_noop")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Enables or disables throwing an exception if an [OPTIMIZE](https://clickhouse.com/docs/sql-reference/statements/optimize) query didn't perform a merge.
By default, `OPTIMIZE` returns successfully even if it didn't do anything. This setting lets you differentiate these situations and get the reason in an exception message.
Possible values:
- 1 β Throwing an exception is enabled.
- 0 β Throwing an exception is disabled.
## optimize\_time\_filter\_with\_preimage[β](https://clickhouse.com/docs/operations/settings/settings#optimize_time_filter_with_preimage "Direct link to optimize_time_filter_with_preimage")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Optimize Date and DateTime predicates by converting functions into equivalent comparisons without conversions (e.g. `toYear(col) = 2023 -> col >= '2023-01-01' AND col <= '2023-12-31'`)
## optimize\_trivial\_approximate\_count\_query[β](https://clickhouse.com/docs/operations/settings/settings#optimize_trivial_approximate_count_query "Direct link to optimize_trivial_approximate_count_query")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Use an approximate value for trivial count optimization of storages that support such estimation, for example, EmbeddedRocksDB.
Possible values:
- 0 β Optimization disabled.
- 1 β Optimization enabled.
## optimize\_trivial\_count\_query[β](https://clickhouse.com/docs/operations/settings/settings#optimize_trivial_count_query "Direct link to optimize_trivial_count_query")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Enables or disables the optimization to trivial query `SELECT count() FROM table` using metadata from MergeTree. If you need to use row-level security, disable this setting.
Possible values:
- 0 β Optimization disabled.
- 1 β Optimization enabled.
See also:
- [optimize\_functions\_to\_subcolumns](https://clickhouse.com/docs/operations/settings/settings#optimize_functions_to_subcolumns)
## optimize\_trivial\_insert\_select[β](https://clickhouse.com/docs/operations/settings/settings#optimize_trivial_insert_select "Direct link to optimize_trivial_insert_select")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Optimize trivial 'INSERT INTO table SELECT ... FROM TABLES' query
## optimize\_truncate\_order\_by\_after\_group\_by\_keys[β](https://clickhouse.com/docs/operations/settings/settings#optimize_truncate_order_by_after_group_by_keys "Direct link to optimize_truncate_order_by_after_group_by_keys")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Remove trailing ORDER BY elements once all GROUP BY keys are covered in the ORDER BY prefix.
## optimize\_uniq\_to\_count[β](https://clickhouse.com/docs/operations/settings/settings#optimize_uniq_to_count "Direct link to optimize_uniq_to_count")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Rewrite uniq and its variants(except uniqUpTo) to count if subquery has distinct or group by clause.
## optimize\_use\_implicit\_projections[β](https://clickhouse.com/docs/operations/settings/settings#optimize_use_implicit_projections "Direct link to optimize_use_implicit_projections")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Automatically choose implicit projections to perform SELECT query
## optimize\_use\_projection\_filtering[β](https://clickhouse.com/docs/operations/settings/settings#optimize_use_projection_filtering "Direct link to optimize_use_projection_filtering")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Enables using projections to filter part ranges even when projections are not selected to perform SELECT query.
## optimize\_use\_projections[β](https://clickhouse.com/docs/operations/settings/settings#optimize_use_projections "Direct link to optimize_use_projections")
**Aliases**: `allow_experimental_projection_optimization`
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Enables or disables [projection](https://clickhouse.com/docs/engines/table-engines/mergetree-family/mergetree#projections) optimization when processing `SELECT` queries.
Possible values:
- 0 β Projection optimization disabled.
- 1 β Projection optimization enabled.
## optimize\_using\_constraints[β](https://clickhouse.com/docs/operations/settings/settings#optimize_using_constraints "Direct link to optimize_using_constraints")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Use [constraints](https://clickhouse.com/docs/sql-reference/statements/create/table#constraints) for query optimization. The default is `false`.
Possible values:
- true, false
## os\_threads\_nice\_value\_materialized\_view[β](https://clickhouse.com/docs/operations/settings/settings#os_threads_nice_value_materialized_view "Direct link to os_threads_nice_value_materialized_view")
| Type | Default value |
|---|---|
| TypeInt32 | Default value0 |
Linux nice value for materialized view threads. Lower values mean higher CPU priority.
Requires CAP\_SYS\_NICE capability, otherwise no-op.
Possible values: -20 to 19.
## os\_threads\_nice\_value\_query[β](https://clickhouse.com/docs/operations/settings/settings#os_threads_nice_value_query "Direct link to os_threads_nice_value_query")
**Aliases**: `os_thread_priority`
| Type | Default value |
|---|---|
| TypeInt32 | Default value0 |
Linux nice value for query processing threads. Lower values mean higher CPU priority.
Requires CAP\_SYS\_NICE capability, otherwise no-op.
Possible values: -20 to 19.
## page\_cache\_block\_size[β](https://clickhouse.com/docs/operations/settings/settings#page_cache_block_size "Direct link to page_cache_block_size")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value1048576 |
Size of file chunks to store in the userspace page cache, in bytes. All reads that go through the cache will be rounded up to a multiple of this size.
This setting can be adjusted on a per-query level basis, but cache entries with different block sizes cannot be reused. Changing this setting effectively invalidates existing entries in the cache.
A higher value, like 1 MiB is good for high-throughput queries, and a lower value, like 64 KiB is good for low-latency point queries.
## page\_cache\_inject\_eviction[β](https://clickhouse.com/docs/operations/settings/settings#page_cache_inject_eviction "Direct link to page_cache_inject_eviction")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Userspace page cache will sometimes invalidate some pages at random. Intended for testing.
## page\_cache\_lookahead\_blocks[β](https://clickhouse.com/docs/operations/settings/settings#page_cache_lookahead_blocks "Direct link to page_cache_lookahead_blocks")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value16 |
On userspace page cache miss, read up to this many consecutive blocks at once from the underlying storage, if they're also not in the cache. Each block is page\_cache\_block\_size bytes.
A higher value is good for high-throughput queries, while low-latency point queries will work better without readahead.
## parallel\_distributed\_insert\_select[β](https://clickhouse.com/docs/operations/settings/settings#parallel_distributed_insert_select "Direct link to parallel_distributed_insert_select")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value2 |
Enables parallel distributed `INSERT ... SELECT` query.
If we execute `INSERT INTO distributed_table_a SELECT ... FROM distributed_table_b` queries and both tables use the same cluster, and both tables are either [replicated](https://clickhouse.com/docs/engines/table-engines/mergetree-family/replication) or non-replicated, then this query is processed locally on every shard.
Possible values:
- `0` β Disabled.
- `1` β `SELECT` will be executed on each shard from the underlying table of the distributed engine.
- `2` β `SELECT` and `INSERT` will be executed on each shard from/to the underlying table of the distributed engine.
Setting `enable_parallel_replicas = 1` is needed when using this setting.
## parallel\_hash\_join\_threshold[β](https://clickhouse.com/docs/operations/settings/settings#parallel_hash_join_threshold "Direct link to parallel_hash_join_threshold")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value100000 |
When hash-based join algorithm is applied, this threshold helps to decide between using `hash` and `parallel_hash` (only if estimation of the right table size is available). The former is used when we know that the right table size is below the threshold.
## parallel\_non\_joined\_rows\_processing[β](https://clickhouse.com/docs/operations/settings/settings#parallel_non_joined_rows_processing "Direct link to parallel_non_joined_rows_processing")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Allow multiple threads to process non-joined rows from the right table in parallel during RIGHT and FULL JOINs. This can speed up the non-joined phase when using the `parallel_hash` join algorithm with large tables. When disabled, non-joined rows are processed by a single thread.
## parallel\_replica\_offset[β](https://clickhouse.com/docs/operations/settings/settings#parallel_replica_offset "Direct link to parallel_replica_offset")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
This is internal setting that should not be used directly and represents an implementation detail of the 'parallel replicas' mode. This setting will be automatically set up by the initiator server for distributed queries to the index of the replica participating in query processing among parallel replicas.
## parallel\_replicas\_allow\_in\_with\_subquery[β](https://clickhouse.com/docs/operations/settings/settings#parallel_replicas_allow_in_with_subquery "Direct link to parallel_replicas_allow_in_with_subquery")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
If true, subquery for IN will be executed on every follower replica.
## parallel\_replicas\_allow\_materialized\_views[β](https://clickhouse.com/docs/operations/settings/settings#parallel_replicas_allow_materialized_views "Direct link to parallel_replicas_allow_materialized_views")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Allow usage of materialized views with parallel replicas
## parallel\_replicas\_connect\_timeout\_ms[β](https://clickhouse.com/docs/operations/settings/settings#parallel_replicas_connect_timeout_ms "Direct link to parallel_replicas_connect_timeout_ms")
| Type | Default value |
|---|---|
| TypeMilliseconds | Default value300 |
The timeout in milliseconds for connecting to a remote replica during query execution with parallel replicas. If the timeout is expired, the corresponding replicas is not used for query executio
## parallel\_replicas\_count[β](https://clickhouse.com/docs/operations/settings/settings#parallel_replicas_count "Direct link to parallel_replicas_count")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
This is internal setting that should not be used directly and represents an implementation detail of the 'parallel replicas' mode. This setting will be automatically set up by the initiator server for distributed queries to the number of parallel replicas participating in query processing.
## parallel\_replicas\_custom\_key[β](https://clickhouse.com/docs/operations/settings/settings#parallel_replicas_custom_key "Direct link to parallel_replicas_custom_key")
An arbitrary integer expression that can be used to split work between replicas for a specific table. The value can be any integer expression.
Simple expressions using primary keys are preferred.
If the setting is used on a cluster that consists of a single shard with multiple replicas, those replicas will be converted into virtual shards. Otherwise, it will behave same as for `SAMPLE` key, it will use multiple replicas of each shard.
## parallel\_replicas\_custom\_key\_range\_lower[β](https://clickhouse.com/docs/operations/settings/settings#parallel_replicas_custom_key_range_lower "Direct link to parallel_replicas_custom_key_range_lower")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Allows the filter type `range` to split the work evenly between replicas based on the custom range `[parallel_replicas_custom_key_range_lower, INT_MAX]`.
When used in conjunction with [parallel\_replicas\_custom\_key\_range\_upper](https://clickhouse.com/docs/operations/settings/settings#parallel_replicas_custom_key_range_upper), it lets the filter evenly split the work over replicas for the range `[parallel_replicas_custom_key_range_lower, parallel_replicas_custom_key_range_upper]`.
Note: This setting will not cause any additional data to be filtered during query processing, rather it changes the points at which the range filter breaks up the range `[0, INT_MAX]` for parallel processing.
## parallel\_replicas\_custom\_key\_range\_upper[β](https://clickhouse.com/docs/operations/settings/settings#parallel_replicas_custom_key_range_upper "Direct link to parallel_replicas_custom_key_range_upper")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Allows the filter type `range` to split the work evenly between replicas based on the custom range `[0, parallel_replicas_custom_key_range_upper]`. A value of 0 disables the upper bound, setting it the max value of the custom key expression.
When used in conjunction with [parallel\_replicas\_custom\_key\_range\_lower](https://clickhouse.com/docs/operations/settings/settings#parallel_replicas_custom_key_range_lower), it lets the filter evenly split the work over replicas for the range `[parallel_replicas_custom_key_range_lower, parallel_replicas_custom_key_range_upper]`.
Note: This setting will not cause any additional data to be filtered during query processing, rather it changes the points at which the range filter breaks up the range `[0, INT_MAX]` for parallel processing
## parallel\_replicas\_filter\_pushdown[β](https://clickhouse.com/docs/operations/settings/settings#parallel_replicas_filter_pushdown "Direct link to parallel_replicas_filter_pushdown")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Allow pushing down filters to part of query which parallel replicas choose to execute
## parallel\_replicas\_for\_cluster\_engines[β](https://clickhouse.com/docs/operations/settings/settings#parallel_replicas_for_cluster_engines "Direct link to parallel_replicas_for_cluster_engines")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Replace table function engines with their -Cluster alternatives
## parallel\_replicas\_for\_non\_replicated\_merge\_tree[β](https://clickhouse.com/docs/operations/settings/settings#parallel_replicas_for_non_replicated_merge_tree "Direct link to parallel_replicas_for_non_replicated_merge_tree")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
If true, ClickHouse will use parallel replicas algorithm also for non-replicated MergeTree tables
## parallel\_replicas\_index\_analysis\_only\_on\_coordinator[β](https://clickhouse.com/docs/operations/settings/settings#parallel_replicas_index_analysis_only_on_coordinator "Direct link to parallel_replicas_index_analysis_only_on_coordinator")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Index analysis done only on replica-coordinator and skipped on other replicas. Effective only with enabled parallel\_replicas\_local\_pla
## parallel\_replicas\_insert\_select\_local\_pipeline[β](https://clickhouse.com/docs/operations/settings/settings#parallel_replicas_insert_select_local_pipeline "Direct link to parallel_replicas_insert_select_local_pipeline")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Use local pipeline during distributed INSERT SELECT with parallel replicas
## parallel\_replicas\_local\_plan[β](https://clickhouse.com/docs/operations/settings/settings#parallel_replicas_local_plan "Direct link to parallel_replicas_local_plan")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Build local plan for local replica
## parallel\_replicas\_mark\_segment\_size[β](https://clickhouse.com/docs/operations/settings/settings#parallel_replicas_mark_segment_size "Direct link to parallel_replicas_mark_segment_size")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Parts virtually divided into segments to be distributed between replicas for parallel reading. This setting controls the size of these segments. Not recommended to change until you're absolutely sure in what you're doing. Value should be in range \[128; 16384\]
## parallel\_replicas\_min\_number\_of\_rows\_per\_replica[β](https://clickhouse.com/docs/operations/settings/settings#parallel_replicas_min_number_of_rows_per_replica "Direct link to parallel_replicas_min_number_of_rows_per_replica")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Limit the number of replicas used in a query to (estimated rows to read / min\_number\_of\_rows\_per\_replica). The max is still limited by 'max\_parallel\_replicas'
## parallel\_replicas\_mode[β](https://clickhouse.com/docs/operations/settings/settings#parallel_replicas_mode "Direct link to parallel_replicas_mode")
| Type | Default value |
|---|---|
| TypeParallelReplicasMode | Default valueread\_tasks |
Type of filter to use with custom key for parallel replicas. default - use modulo operation on the custom key, range - use range filter on custom key using all possible values for the value type of custom key.
## parallel\_replicas\_only\_with\_analyzer[β](https://clickhouse.com/docs/operations/settings/settings#parallel_replicas_only_with_analyzer "Direct link to parallel_replicas_only_with_analyzer")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
The analyzer should be enabled to use parallel replicas. With disabled analyzer query execution fallbacks to local execution, even if parallel reading from replicas is enabled. Using parallel replicas without the analyzer enabled is not supported
## parallel\_replicas\_prefer\_local\_join[β](https://clickhouse.com/docs/operations/settings/settings#parallel_replicas_prefer_local_join "Direct link to parallel_replicas_prefer_local_join")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
If true, and JOIN can be executed with parallel replicas algorithm, and all storages of right JOIN part are \*MergeTree, local JOIN will be used instead of GLOBAL JOIN.
## parallel\_replicas\_support\_projection[β](https://clickhouse.com/docs/operations/settings/settings#parallel_replicas_support_projection "Direct link to parallel_replicas_support_projection")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Optimization of projections can be applied in parallel replicas. Effective only with enabled parallel\_replicas\_local\_plan and aggregation\_in\_order is inactive.
## parallel\_view\_processing[β](https://clickhouse.com/docs/operations/settings/settings#parallel_view_processing "Direct link to parallel_view_processing")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Enables pushing to attached views concurrently instead of sequentially.
## parallelize\_output\_from\_storages[β](https://clickhouse.com/docs/operations/settings/settings#parallelize_output_from_storages "Direct link to parallelize_output_from_storages")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Parallelize output for reading step from storage. It allows parallelization of query processing right after reading from storage if possible
## parsedatetime\_e\_requires\_space\_padding[β](https://clickhouse.com/docs/operations/settings/settings#parsedatetime_e_requires_space_padding "Direct link to parsedatetime_e_requires_space_padding")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Formatter '%e' in function 'parseDateTime' expects that single-digit days are space-padded, e.g., ' 2' is accepted but '2' raises an error.
## parsedatetime\_parse\_without\_leading\_zeros[β](https://clickhouse.com/docs/operations/settings/settings#parsedatetime_parse_without_leading_zeros "Direct link to parsedatetime_parse_without_leading_zeros")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Formatters '%c', '%l' and '%k' in function 'parseDateTime' parse months and hours without leading zeros.
## partial\_merge\_join\_left\_table\_buffer\_bytes[β](https://clickhouse.com/docs/operations/settings/settings#partial_merge_join_left_table_buffer_bytes "Direct link to partial_merge_join_left_table_buffer_bytes")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
If not 0 group left table blocks in bigger ones for left-side table in partial merge join. It uses up to 2x of specified memory per joining thread.
## partial\_merge\_join\_rows\_in\_right\_blocks[β](https://clickhouse.com/docs/operations/settings/settings#partial_merge_join_rows_in_right_blocks "Direct link to partial_merge_join_rows_in_right_blocks")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value65536 |
Limits sizes of right-hand join data blocks in partial merge join algorithm for [JOIN](https://clickhouse.com/docs/sql-reference/statements/select/join) queries.
ClickHouse server:
1. Splits right-hand join data into blocks with up to the specified number of rows.
2. Indexes each block with its minimum and maximum values.
3. Unloads prepared blocks to disk if it is possible.
Possible values:
- Any positive integer. Recommended range of values: \[1000, 100000\].
## partial\_result\_on\_first\_cancel[β](https://clickhouse.com/docs/operations/settings/settings#partial_result_on_first_cancel "Direct link to partial_result_on_first_cancel")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Allows query to return a partial result after cancel.
## parts\_to\_delay\_insert[β](https://clickhouse.com/docs/operations/settings/settings#parts_to_delay_insert "Direct link to parts_to_delay_insert")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
If the destination table contains at least that many active parts in a single partition, artificially slow down insert into table.
## parts\_to\_throw\_insert[β](https://clickhouse.com/docs/operations/settings/settings#parts_to_throw_insert "Direct link to parts_to_throw_insert")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
If more than this number active parts in a single partition of the destination table, throw 'Too many parts ...' exception.
## per\_part\_index\_stats[β](https://clickhouse.com/docs/operations/settings/settings#per_part_index_stats "Direct link to per_part_index_stats")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Logs index statistics per part
## poll\_interval[β](https://clickhouse.com/docs/operations/settings/settings#poll_interval "Direct link to poll_interval")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value10 |
Block at the query wait loop on the server for the specified number of seconds.
## polyglot\_dialect[β](https://clickhouse.com/docs/operations/settings/settings#polyglot_dialect "Direct link to polyglot_dialect")
Source SQL dialect for the polyglot transpiler (e.g. 'sqlite', 'mysql', 'postgresql', 'snowflake', 'duckdb').
## postgresql\_connection\_attempt\_timeout[β](https://clickhouse.com/docs/operations/settings/settings#postgresql_connection_attempt_timeout "Direct link to postgresql_connection_attempt_timeout")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value2 |
Connection timeout in seconds of a single attempt to connect PostgreSQL end-point. The value is passed as a `connect_timeout` parameter of the connection URL.
## postgresql\_connection\_pool\_auto\_close\_connection[β](https://clickhouse.com/docs/operations/settings/settings#postgresql_connection_pool_auto_close_connection "Direct link to postgresql_connection_pool_auto_close_connection")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Close connection before returning connection to the pool.
## postgresql\_connection\_pool\_retries[β](https://clickhouse.com/docs/operations/settings/settings#postgresql_connection_pool_retries "Direct link to postgresql_connection_pool_retries")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value2 |
Connection pool push/pop retries number for PostgreSQL table engine and database engine.
## postgresql\_connection\_pool\_size[β](https://clickhouse.com/docs/operations/settings/settings#postgresql_connection_pool_size "Direct link to postgresql_connection_pool_size")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value16 |
Connection pool size for PostgreSQL table engine and database engine.
## postgresql\_connection\_pool\_wait\_timeout[β](https://clickhouse.com/docs/operations/settings/settings#postgresql_connection_pool_wait_timeout "Direct link to postgresql_connection_pool_wait_timeout")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value5000 |
Connection pool push/pop timeout on empty pool for PostgreSQL table engine and database engine. By default it will block on empty pool.
## postgresql\_fault\_injection\_probability[β](https://clickhouse.com/docs/operations/settings/settings#postgresql_fault_injection_probability "Direct link to postgresql_fault_injection_probability")
| Type | Default value |
|---|---|
| TypeFloat | Default value0 |
Approximate probability of failing internal (for replication) PostgreSQL queries. Valid value is in interval \[0.0f, 1.0f\]
## prefer\_column\_name\_to\_alias[β](https://clickhouse.com/docs/operations/settings/settings#prefer_column_name_to_alias "Direct link to prefer_column_name_to_alias")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Enables or disables using the original column names instead of aliases in query expressions and clauses. It especially matters when alias is the same as the column name, see [Expression Aliases](https://clickhouse.com/docs/sql-reference/syntax#notes-on-usage). Enable this setting to make aliases syntax rules in ClickHouse more compatible with most other database engines.
Possible values:
- 0 β The column name is substituted with the alias.
- 1 β The column name is not substituted with the alias.
**Example**
The difference between enabled and disabled:
Query:
```
SET prefer_column_name_to_alias = 0;
SELECT avg(number) AS number, max(number) FROM numbers(10);
```
Result:
```
Received exception from server (version 21.5.1):
Code: 184. DB::Exception: Received from localhost:9000. DB::Exception: Aggregate function avg(number) is found inside another aggregate function in query: While processing avg(number) AS number.
```
Query:
```
SET prefer_column_name_to_alias = 1;
SELECT avg(number) AS number, max(number) FROM numbers(10);
```
Result:
```
ββnumberββ¬βmax(number)ββ
β 4.5 β 9 β
ββββββββββ΄ββββββββββββββ
```
## prefer\_external\_sort\_block\_bytes[β](https://clickhouse.com/docs/operations/settings/settings#prefer_external_sort_block_bytes "Direct link to prefer_external_sort_block_bytes")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value16744704 |
Prefer maximum block bytes for external sort, reduce the memory usage during merging.
## prefer\_global\_in\_and\_join[β](https://clickhouse.com/docs/operations/settings/settings#prefer_global_in_and_join "Direct link to prefer_global_in_and_join")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Enables the replacement of `IN`/`JOIN` operators with `GLOBAL IN`/`GLOBAL JOIN`.
Possible values:
- 0 β Disabled. `IN`/`JOIN` operators are not replaced with `GLOBAL IN`/`GLOBAL JOIN`.
- 1 β Enabled. `IN`/`JOIN` operators are replaced with `GLOBAL IN`/`GLOBAL JOIN`.
**Usage**
Although `SET distributed_product_mode=global` can change the queries behavior for the distributed tables, it's not suitable for local tables or tables from external resources. Here is when the `prefer_global_in_and_join` setting comes into play.
For example, we have query serving nodes that contain local tables, which are not suitable for distribution. We need to scatter their data on the fly during distributed processing with the `GLOBAL` keyword β `GLOBAL IN`/`GLOBAL JOIN`.
Another use case of `prefer_global_in_and_join` is accessing tables created by external engines. This setting helps to reduce the number of calls to external sources while joining such tables: only one call per query.
**See also:**
- [Distributed subqueries](https://clickhouse.com/docs/sql-reference/operators/in#distributed-subqueries) for more information on how to use `GLOBAL IN`/`GLOBAL JOIN`
## prefer\_localhost\_replica[β](https://clickhouse.com/docs/operations/settings/settings#prefer_localhost_replica "Direct link to prefer_localhost_replica")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Enables/disables preferable using the localhost replica when processing distributed queries.
Possible values:
- 1 β ClickHouse always sends a query to the localhost replica if it exists.
- 0 β ClickHouse uses the balancing strategy specified by the [load\_balancing](https://clickhouse.com/docs/operations/settings/settings#load_balancing) setting.
Note
Disable this setting if you use [max\_parallel\_replicas](https://clickhouse.com/docs/operations/settings/settings#max_parallel_replicas) without [parallel\_replicas\_custom\_key](https://clickhouse.com/docs/operations/settings/settings#parallel_replicas_custom_key). If [parallel\_replicas\_custom\_key](https://clickhouse.com/docs/operations/settings/settings#parallel_replicas_custom_key) is set, disable this setting only if it's used on a cluster with multiple shards containing multiple replicas. If it's used on a cluster with a single shard and multiple replicas, disabling this setting will have negative effects.
## prefer\_warmed\_unmerged\_parts\_seconds[β](https://clickhouse.com/docs/operations/settings/settings#prefer_warmed_unmerged_parts_seconds "Direct link to prefer_warmed_unmerged_parts_seconds")
ClickHouse Cloud only
| Type | Default value |
|---|---|
| TypeInt64 | Default value0 |
Only has an effect in ClickHouse Cloud. If a merged part is less than this many seconds old and is not pre-warmed (see [cache\_populated\_by\_fetch](https://clickhouse.com/docs/operations/settings/merge-tree-settings#cache_populated_by_fetch)), but all its source parts are available and pre-warmed, SELECT queries will read from those parts instead. Only for Replicated-/SharedMergeTree. Note that this only checks whether CacheWarmer processed the part; if the part was fetched into cache by something else, it'll still be considered cold until CacheWarmer gets to it; if it was warmed, then evicted from cache, it'll still be considered warm.
## preferred\_block\_size\_bytes[β](https://clickhouse.com/docs/operations/settings/settings#preferred_block_size_bytes "Direct link to preferred_block_size_bytes")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value1000000 |
This setting adjusts the data block size for query processing and represents additional fine-tuning to the more rough 'max\_block\_size' setting. If the columns are large and with 'max\_block\_size' rows the block size is likely to be larger than the specified amount of bytes, its size will be lowered for better CPU cache locality.
## preferred\_max\_column\_in\_block\_size\_bytes[β](https://clickhouse.com/docs/operations/settings/settings#preferred_max_column_in_block_size_bytes "Direct link to preferred_max_column_in_block_size_bytes")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Limit on max column size in block while reading. Helps to decrease cache misses count. Should be close to L2 cache size.
## preferred\_optimize\_projection\_name[β](https://clickhouse.com/docs/operations/settings/settings#preferred_optimize_projection_name "Direct link to preferred_optimize_projection_name")
If it is set to a non-empty string, ClickHouse will try to apply specified projection in query.
Possible values:
- string: name of preferred projectio
## prefetch\_buffer\_size[β](https://clickhouse.com/docs/operations/settings/settings#prefetch_buffer_size "Direct link to prefetch_buffer_size")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value1048576 |
The maximum size of the prefetch buffer to read from the filesystem.
## print\_pretty\_type\_names[β](https://clickhouse.com/docs/operations/settings/settings#print_pretty_type_names "Direct link to print_pretty_type_names")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Allows to print deep-nested type names in a pretty way with indents in `DESCRIBE` query and in `toTypeName()` function.
Example:
```
CREATE TABLE test (a Tuple(b String, c Tuple(d Nullable(UInt64), e Array(UInt32), f Array(Tuple(g String, h Map(String, Array(Tuple(i String, j UInt64))))), k Date), l Nullable(String))) ENGINE=Memory;
DESCRIBE TABLE test FORMAT TSVRaw SETTINGS print_pretty_type_names=1;
```
```
a Tuple(
b String,
c Tuple(
d Nullable(UInt64),
e Array(UInt32),
f Array(Tuple(
g String,
h Map(
String,
Array(Tuple(
i String,
j UInt64
))
)
)),
k Date
),
l Nullable(String)
)
```
## priority[β](https://clickhouse.com/docs/operations/settings/settings#priority "Direct link to priority")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Priority of the query. 1 - the highest, higher value - lower priority; 0 - do not use priorities.
## promql\_database[β](https://clickhouse.com/docs/operations/settings/settings#promql_database "Direct link to promql_database")
Specifies the database name used by the 'promql' dialect. Empty string means the current database.
## promql\_evaluation\_time[β](https://clickhouse.com/docs/operations/settings/settings#promql_evaluation_time "Direct link to promql_evaluation_time")
**Aliases**: `evaluation_time`
| Type | Default value |
|---|---|
| TypeFloatAuto | Default valueauto |
Sets the evaluation time to be used with promql dialect. 'auto' means the current time.
## promql\_table[β](https://clickhouse.com/docs/operations/settings/settings#promql_table "Direct link to promql_table")
Specifies the name of a TimeSeries table used by the 'promql' dialect.
## push\_external\_roles\_in\_interserver\_queries[β](https://clickhouse.com/docs/operations/settings/settings#push_external_roles_in_interserver_queries "Direct link to push_external_roles_in_interserver_queries")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Enable pushing user roles from originator to other nodes while performing a query.
## query\_cache\_compress\_entries[β](https://clickhouse.com/docs/operations/settings/settings#query_cache_compress_entries "Direct link to query_cache_compress_entries")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Compress entries in the [query cache](https://clickhouse.com/docs/operations/query-cache). Lessens the memory consumption of the query cache at the cost of slower inserts into / reads from it.
Possible values:
- 0 - Disabled
- 1 - Enabled
## query\_cache\_max\_entries[β](https://clickhouse.com/docs/operations/settings/settings#query_cache_max_entries "Direct link to query_cache_max_entries")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
The maximum number of query results the current user may store in the [query cache](https://clickhouse.com/docs/operations/query-cache). 0 means unlimited.
Possible values:
- Positive integer \>= 0.
## query\_cache\_max\_size\_in\_bytes[β](https://clickhouse.com/docs/operations/settings/settings#query_cache_max_size_in_bytes "Direct link to query_cache_max_size_in_bytes")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
The maximum amount of memory (in bytes) the current user may allocate in the [query cache](https://clickhouse.com/docs/operations/query-cache). 0 means unlimited.
Possible values:
- Positive integer \>= 0.
## query\_cache\_min\_query\_duration[β](https://clickhouse.com/docs/operations/settings/settings#query_cache_min_query_duration "Direct link to query_cache_min_query_duration")
| Type | Default value |
|---|---|
| TypeMilliseconds | Default value0 |
Minimum duration in milliseconds a query needs to run for its result to be stored in the [query cache](https://clickhouse.com/docs/operations/query-cache).
Possible values:
- Positive integer \>= 0.
## query\_cache\_min\_query\_runs[β](https://clickhouse.com/docs/operations/settings/settings#query_cache_min_query_runs "Direct link to query_cache_min_query_runs")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Minimum number of times a `SELECT` query must run before its result is stored in the [query cache](https://clickhouse.com/docs/operations/query-cache).
Possible values:
- Positive integer \>= 0.
## query\_cache\_nondeterministic\_function\_handling[β](https://clickhouse.com/docs/operations/settings/settings#query_cache_nondeterministic_function_handling "Direct link to query_cache_nondeterministic_function_handling")
| Type | Default value |
|---|---|
| TypeQueryResultCacheNondeterministicFunctionHandling | Default valuethrow |
Controls how the [query cache](https://clickhouse.com/docs/operations/query-cache) handles `SELECT` queries with non-deterministic functions like `rand()` or `now()`.
Possible values:
- `'throw'` - Throw an exception and don't cache the query result.
- `'save'` - Cache the query result.
- `'ignore'` - Don't cache the query result and don't throw an exception.
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
If turned on, the result of `SELECT` queries cached in the [query cache](https://clickhouse.com/docs/operations/query-cache) can be read by other users. It is not recommended to enable this setting due to security reasons.
Possible values:
- 0 - Disabled
- 1 - Enabled
## query\_cache\_squash\_partial\_results[β](https://clickhouse.com/docs/operations/settings/settings#query_cache_squash_partial_results "Direct link to query_cache_squash_partial_results")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Squash partial result blocks to blocks of size [max\_block\_size](https://clickhouse.com/docs/operations/settings/settings#max_block_size). Reduces performance of inserts into the [query cache](https://clickhouse.com/docs/operations/query-cache) but improves the compressability of cache entries (see [query\_cache\_compress-entries](https://clickhouse.com/docs/operations/settings/settings#query_cache_compress_entries)).
Possible values:
- 0 - Disabled
- 1 - Enabled
## query\_cache\_system\_table\_handling[β](https://clickhouse.com/docs/operations/settings/settings#query_cache_system_table_handling "Direct link to query_cache_system_table_handling")
| Type | Default value |
|---|---|
| TypeQueryResultCacheSystemTableHandling | Default valuethrow |
Controls how the [query cache](https://clickhouse.com/docs/operations/query-cache) handles `SELECT` queries against system tables, i.e. tables in databases `system.*` and `information_schema.*`.
Possible values:
- `'throw'` - Throw an exception and don't cache the query result.
- `'save'` - Cache the query result.
- `'ignore'` - Don't cache the query result and don't throw an exception.
## query\_cache\_tag[β](https://clickhouse.com/docs/operations/settings/settings#query_cache_tag "Direct link to query_cache_tag")
A string which acts as a label for [query cache](https://clickhouse.com/docs/operations/query-cache) entries. The same queries with different tags are considered different by the query cache.
Possible values:
- Any string
## query\_cache\_ttl[β](https://clickhouse.com/docs/operations/settings/settings#query_cache_ttl "Direct link to query_cache_ttl")
| Type | Default value |
|---|---|
| TypeSeconds | Default value60 |
After this time in seconds entries in the [query cache](https://clickhouse.com/docs/operations/query-cache) become stale.
Possible values:
- Positive integer \>= 0.
## query\_metric\_log\_interval[β](https://clickhouse.com/docs/operations/settings/settings#query_metric_log_interval "Direct link to query_metric_log_interval")
| Type | Default value |
|---|---|
| TypeInt64 | Default value\-1 |
The interval in milliseconds at which the [query\_metric\_log](https://clickhouse.com/docs/operations/system-tables/query_metric_log) for individual queries is collected.
If set to any negative value, it will take the value `collect_interval_milliseconds` from the [query\_metric\_log setting](https://clickhouse.com/docs/operations/server-configuration-parameters/settings#query_metric_log) or default to 1000 if not present.
To disable the collection of a single query, set `query_metric_log_interval` to 0.
Default value: -1
## query\_plan\_aggregation\_in\_order[β](https://clickhouse.com/docs/operations/settings/settings#query_plan_aggregation_in_order "Direct link to query_plan_aggregation_in_order")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Toggles the aggregation in-order query-plan-level optimization. Only takes effect if setting [`query_plan_enable_optimizations`](https://clickhouse.com/docs/operations/settings/settings#query_plan_enable_optimizations) is 1.
Note
This is an expert-level setting which should only be used for debugging by developers. The setting may change in future in backward-incompatible ways or be removed.
Possible values:
- 0 - Disable
- 1 - Enable
## query\_plan\_convert\_any\_join\_to\_semi\_or\_anti\_join[β](https://clickhouse.com/docs/operations/settings/settings#query_plan_convert_any_join_to_semi_or_anti_join "Direct link to query_plan_convert_any_join_to_semi_or_anti_join")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Allow to convert ANY JOIN to SEMI or ANTI JOIN if filter after JOIN always evaluates to false for not-matched or matched rows
## query\_plan\_convert\_join\_to\_in[β](https://clickhouse.com/docs/operations/settings/settings#query_plan_convert_join_to_in "Direct link to query_plan_convert_join_to_in")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Allow to convert `JOIN` to subquery with `IN` if output columns tied to only left table. May cause wrong results with non-ANY JOINs (e.g. ALL JOINs which is the default).
## query\_plan\_convert\_outer\_join\_to\_inner\_join[β](https://clickhouse.com/docs/operations/settings/settings#query_plan_convert_outer_join_to_inner_join "Direct link to query_plan_convert_outer_join_to_inner_join")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Allow to convert `OUTER JOIN` to `INNER JOIN` if filter after `JOIN` always filters default values
## query\_plan\_direct\_read\_from\_text\_index[β](https://clickhouse.com/docs/operations/settings/settings#query_plan_direct_read_from_text_index "Direct link to query_plan_direct_read_from_text_index")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Allow to perform full text search filtering using only the inverted text index in query plan.
## query\_plan\_display\_internal\_aliases[β](https://clickhouse.com/docs/operations/settings/settings#query_plan_display_internal_aliases "Direct link to query_plan_display_internal_aliases")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Show internal aliases (such as \_\_table1) in EXPLAIN PLAN instead of those specified in the original query.
## query\_plan\_enable\_multithreading\_after\_window\_functions[β](https://clickhouse.com/docs/operations/settings/settings#query_plan_enable_multithreading_after_window_functions "Direct link to query_plan_enable_multithreading_after_window_functions")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Enable multithreading after evaluating window functions to allow parallel stream processing
## query\_plan\_enable\_optimizations[β](https://clickhouse.com/docs/operations/settings/settings#query_plan_enable_optimizations "Direct link to query_plan_enable_optimizations")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Toggles query optimization at the query plan level.
Note
This is an expert-level setting which should only be used for debugging by developers. The setting may change in future in backward-incompatible ways or be removed.
Possible values:
- 0 - Disable all optimizations at the query plan level
- 1 - Enable optimizations at the query plan level (but individual optimizations may still be disabled via their individual settings)
## query\_plan\_execute\_functions\_after\_sorting[β](https://clickhouse.com/docs/operations/settings/settings#query_plan_execute_functions_after_sorting "Direct link to query_plan_execute_functions_after_sorting")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Toggles a query-plan-level optimization which moves expressions after sorting steps. Only takes effect if setting [`query_plan_enable_optimizations`](https://clickhouse.com/docs/operations/settings/settings#query_plan_enable_optimizations) is 1.
Note
This is an expert-level setting which should only be used for debugging by developers. The setting may change in future in backward-incompatible ways or be removed.
Possible values:
- 0 - Disable
- 1 - Enable
## query\_plan\_filter\_push\_down[β](https://clickhouse.com/docs/operations/settings/settings#query_plan_filter_push_down "Direct link to query_plan_filter_push_down")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Toggles a query-plan-level optimization which moves filters down in the execution plan. Only takes effect if setting [query\_plan\_enable\_optimizations](https://clickhouse.com/docs/operations/settings/settings#query_plan_enable_optimizations) is 1.
Note
This is an expert-level setting which should only be used for debugging by developers. The setting may change in future in backward-incompatible ways or be removed.
Possible values:
- 0 - Disable
- 1 - Enable
## query\_plan\_join\_shard\_by\_pk\_ranges[β](https://clickhouse.com/docs/operations/settings/settings#query_plan_join_shard_by_pk_ranges "Direct link to query_plan_join_shard_by_pk_ranges")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Apply sharding for JOIN if join keys contain a prefix of PRIMARY KEY for both tables. Supported for hash, parallel\_hash and full\_sorting\_merge algorithms. Usually does not speed up queries but may lower memory consumption.
## query\_plan\_join\_swap\_table[β](https://clickhouse.com/docs/operations/settings/settings#query_plan_join_swap_table "Direct link to query_plan_join_swap_table")
| Type | Default value |
|---|---|
| TypeBoolAuto | Default valueauto |
Determine which side of the join should be the build table (also called inner, the one inserted into the hash table for a hash join) in the query plan. This setting is supported only for `ALL` join strictness with the `JOIN ON` clause. Possible values are:
- 'auto': Let the planner decide which table to use as the build table.
- 'false': Never swap tables (the right table is the build table).
- 'true': Always swap tables (the left table is the build table).
## query\_plan\_lift\_up\_array\_join[β](https://clickhouse.com/docs/operations/settings/settings#query_plan_lift_up_array_join "Direct link to query_plan_lift_up_array_join")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Toggles a query-plan-level optimization which moves ARRAY JOINs up in the execution plan. Only takes effect if setting [query\_plan\_enable\_optimizations](https://clickhouse.com/docs/operations/settings/settings#query_plan_enable_optimizations) is 1.
Note
This is an expert-level setting which should only be used for debugging by developers. The setting may change in future in backward-incompatible ways or be removed.
Possible values:
- 0 - Disable
- 1 - Enable
## query\_plan\_lift\_up\_union[β](https://clickhouse.com/docs/operations/settings/settings#query_plan_lift_up_union "Direct link to query_plan_lift_up_union")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Toggles a query-plan-level optimization which moves larger subtrees of the query plan into union to enable further optimizations. Only takes effect if setting [`query_plan_enable_optimizations`](https://clickhouse.com/docs/operations/settings/settings#query_plan_enable_optimizations) is 1.
Note
This is an expert-level setting which should only be used for debugging by developers. The setting may change in future in backward-incompatible ways or be removed.
Possible values:
- 0 - Disable
- 1 - Enable
## query\_plan\_max\_limit\_for\_lazy\_materialization[β](https://clickhouse.com/docs/operations/settings/settings#query_plan_max_limit_for_lazy_materialization "Direct link to query_plan_max_limit_for_lazy_materialization")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value10000 |
Control maximum limit value that allows to use query plan for lazy materialization optimization. If zero, there is no limit.
## query\_plan\_max\_limit\_for\_top\_k\_optimization[β](https://clickhouse.com/docs/operations/settings/settings#query_plan_max_limit_for_top_k_optimization "Direct link to query_plan_max_limit_for_top_k_optimization")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value1000 |
Control maximum limit value that allows to evaluate query plan for TopK optimization by using minmax skip index and dynamic threshold filtering. If zero, there is no limit.
## query\_plan\_max\_optimizations\_to\_apply[β](https://clickhouse.com/docs/operations/settings/settings#query_plan_max_optimizations_to_apply "Direct link to query_plan_max_optimizations_to_apply")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value10000 |
Limits the total number of optimizations applied to query plan, see setting [query\_plan\_enable\_optimizations](https://clickhouse.com/docs/operations/settings/settings#query_plan_enable_optimizations). Useful to avoid long optimization times for complex queries. In the EXPLAIN PLAN query, stop applying optimizations after this limit is reached and return the plan as is. For regular query execution if the actual number of optimizations exceeds this setting, an exception is thrown.
Note
This is an expert-level setting which should only be used for debugging by developers. The setting may change in future in backward-incompatible ways or be removed.
## query\_plan\_max\_step\_description\_length[β](https://clickhouse.com/docs/operations/settings/settings#query_plan_max_step_description_length "Direct link to query_plan_max_step_description_length")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value500 |
Maximum length of step description in EXPLAIN PLAN.
## query\_plan\_merge\_expressions[β](https://clickhouse.com/docs/operations/settings/settings#query_plan_merge_expressions "Direct link to query_plan_merge_expressions")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Toggles a query-plan-level optimization which merges consecutive filters. Only takes effect if setting [query\_plan\_enable\_optimizations](https://clickhouse.com/docs/operations/settings/settings#query_plan_enable_optimizations) is 1.
Note
This is an expert-level setting which should only be used for debugging by developers. The setting may change in future in backward-incompatible ways or be removed.
Possible values:
- 0 - Disable
- 1 - Enable
## query\_plan\_merge\_filter\_into\_join\_condition[β](https://clickhouse.com/docs/operations/settings/settings#query_plan_merge_filter_into_join_condition "Direct link to query_plan_merge_filter_into_join_condition")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Allow to merge filter into `JOIN` condition and convert `CROSS JOIN` to `INNER`.
## query\_plan\_merge\_filters[β](https://clickhouse.com/docs/operations/settings/settings#query_plan_merge_filters "Direct link to query_plan_merge_filters")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Allow to merge filters in the query plan.
## query\_plan\_optimize\_join\_order\_algorithm[β](https://clickhouse.com/docs/operations/settings/settings#query_plan_optimize_join_order_algorithm "Direct link to query_plan_optimize_join_order_algorithm")
| Type | Default value |
|---|---|
| TypeJoinOrderAlgorithm | Default valuegreedy |
Specifies which JOIN order algorithms to attempt during query plan optimization. The following algorithms are available:
- 'greedy' - basic greedy algorithm - works fast but might not produce the best join order
- 'dpsize' - implements DPsize algorithm currently only for Inner joins - considers all possible join orders and finds the most optimal one but might be slow for queries with many tables and join predicates. Multiple algorithms can be specified, e.g. 'dpsize,greedy'.
## query\_plan\_optimize\_join\_order\_limit[β](https://clickhouse.com/docs/operations/settings/settings#query_plan_optimize_join_order_limit "Direct link to query_plan_optimize_join_order_limit")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value10 |
Optimize the order of joins within the same subquery. Currently only supported for very limited cases. Value is the maximum number of tables to optimize.
## query\_plan\_optimize\_join\_order\_randomize[β](https://clickhouse.com/docs/operations/settings/settings#query_plan_optimize_join_order_randomize "Direct link to query_plan_optimize_join_order_randomize")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
When non-zero, the join order optimizer uses randomly generated cardinalities and NDVs instead of real statistics. When set to 1, a random seed is generated, when set to a value \> 1, that value is used as the seed directly. This is intended for testing to find errors caused by different join orderings.
## query\_plan\_optimize\_lazy\_materialization[β](https://clickhouse.com/docs/operations/settings/settings#query_plan_optimize_lazy_materialization "Direct link to query_plan_optimize_lazy_materialization")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Use query plan for lazy materialization optimization.
## query\_plan\_optimize\_prewhere[β](https://clickhouse.com/docs/operations/settings/settings#query_plan_optimize_prewhere "Direct link to query_plan_optimize_prewhere")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Allow to push down filter to PREWHERE expression for supported storages
## query\_plan\_push\_down\_limit[β](https://clickhouse.com/docs/operations/settings/settings#query_plan_push_down_limit "Direct link to query_plan_push_down_limit")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Toggles a query-plan-level optimization which moves LIMITs down in the execution plan. Only takes effect if setting [query\_plan\_enable\_optimizations](https://clickhouse.com/docs/operations/settings/settings#query_plan_enable_optimizations) is 1.
Note
This is an expert-level setting which should only be used for debugging by developers. The setting may change in future in backward-incompatible ways or be removed.
Possible values:
- 0 - Disable
- 1 - Enable
## query\_plan\_read\_in\_order[β](https://clickhouse.com/docs/operations/settings/settings#query_plan_read_in_order "Direct link to query_plan_read_in_order")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Toggles the read in-order optimization query-plan-level optimization. Only takes effect if setting [`query_plan_enable_optimizations`](https://clickhouse.com/docs/operations/settings/settings#query_plan_enable_optimizations) is 1.
Note
This is an expert-level setting which should only be used for debugging by developers. The setting may change in future in backward-incompatible ways or be removed.
Possible values:
- 0 - Disable
- 1 - Enable
## query\_plan\_read\_in\_order\_through\_join[β](https://clickhouse.com/docs/operations/settings/settings#query_plan_read_in_order_through_join "Direct link to query_plan_read_in_order_through_join")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Keep reading in order from the left table in JOIN operations, which can be utilized by subsequent steps.
## query\_plan\_remove\_redundant\_distinct[β](https://clickhouse.com/docs/operations/settings/settings#query_plan_remove_redundant_distinct "Direct link to query_plan_remove_redundant_distinct")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Toggles a query-plan-level optimization which removes redundant DISTINCT steps. Only takes effect if setting [`query_plan_enable_optimizations`](https://clickhouse.com/docs/operations/settings/settings#query_plan_enable_optimizations) is 1.
Note
This is an expert-level setting which should only be used for debugging by developers. The setting may change in future in backward-incompatible ways or be removed.
Possible values:
- 0 - Disable
- 1 - Enable
## query\_plan\_remove\_redundant\_sorting[β](https://clickhouse.com/docs/operations/settings/settings#query_plan_remove_redundant_sorting "Direct link to query_plan_remove_redundant_sorting")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Toggles a query-plan-level optimization which removes redundant sorting steps, e.g. in subqueries. Only takes effect if setting [`query_plan_enable_optimizations`](https://clickhouse.com/docs/operations/settings/settings#query_plan_enable_optimizations) is 1.
Note
This is an expert-level setting which should only be used for debugging by developers. The setting may change in future in backward-incompatible ways or be removed.
Possible values:
- 0 - Disable
- 1 - Enable
## query\_plan\_remove\_unused\_columns[β](https://clickhouse.com/docs/operations/settings/settings#query_plan_remove_unused_columns "Direct link to query_plan_remove_unused_columns")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Toggles a query-plan-level optimization which tries to remove unused columns (both input and output columns) from query plan steps. Only takes effect if setting [query\_plan\_enable\_optimizations](https://clickhouse.com/docs/operations/settings/settings#query_plan_enable_optimizations) is 1.
Note
This is an expert-level setting which should only be used for debugging by developers. The setting may change in future in backward-incompatible ways or be removed.
Possible values:
- 0 - Disable
- 1 - Enable
## query\_plan\_reuse\_storage\_ordering\_for\_window\_functions[β](https://clickhouse.com/docs/operations/settings/settings#query_plan_reuse_storage_ordering_for_window_functions "Direct link to query_plan_reuse_storage_ordering_for_window_functions")
**Aliases**: `optimize_read_in_window_order`
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Toggles a query-plan-level optimization which uses storage sorting when sorting for window functions. Only takes effect if setting [`query_plan_enable_optimizations`](https://clickhouse.com/docs/operations/settings/settings#query_plan_enable_optimizations) is 1.
Note
This is an expert-level setting which should only be used for debugging by developers. The setting may change in future in backward-incompatible ways or be removed.
Possible values:
- 0 - Disable
- 1 - Enable
## query\_plan\_split\_filter[β](https://clickhouse.com/docs/operations/settings/settings#query_plan_split_filter "Direct link to query_plan_split_filter")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Note
This is an expert-level setting which should only be used for debugging by developers. The setting may change in future in backward-incompatible ways or be removed.
Toggles a query-plan-level optimization which splits filters into expressions. Only takes effect if setting [query\_plan\_enable\_optimizations](https://clickhouse.com/docs/operations/settings/settings#query_plan_enable_optimizations) is 1.
Possible values:
- 0 - Disable
- 1 - Enable
## query\_plan\_text\_index\_add\_hint[β](https://clickhouse.com/docs/operations/settings/settings#query_plan_text_index_add_hint "Direct link to query_plan_text_index_add_hint")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Allow to add hint (additional predicate) for filtering built from the inverted text index in query plan.
## query\_plan\_try\_use\_vector\_search[β](https://clickhouse.com/docs/operations/settings/settings#query_plan_try_use_vector_search "Direct link to query_plan_try_use_vector_search")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Toggles a query-plan-level optimization which tries to use the vector similarity index. Only takes effect if setting [`query_plan_enable_optimizations`](https://clickhouse.com/docs/operations/settings/settings#query_plan_enable_optimizations) is 1.
Note
This is an expert-level setting which should only be used for debugging by developers. The setting may change in future in backward-incompatible ways or be removed.
Possible values:
- 0 - Disable
- 1 - Enable
## query\_plan\_use\_new\_logical\_join\_step[β](https://clickhouse.com/docs/operations/settings/settings#query_plan_use_new_logical_join_step "Direct link to query_plan_use_new_logical_join_step")
**Aliases**: `query_plan_use_logical_join_step`
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Use logical join step in query plan. Note: setting `query_plan_use_new_logical_join_step` is deprecated, use `query_plan_use_logical_join_step` instead.
## query\_profiler\_cpu\_time\_period\_ns[β](https://clickhouse.com/docs/operations/settings/settings#query_profiler_cpu_time_period_ns "Direct link to query_profiler_cpu_time_period_ns")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value1000000000 |
Sets the period for a CPU clock timer of the [query profiler](https://clickhouse.com/docs/operations/optimizing-performance/sampling-query-profiler). This timer counts only CPU time.
Possible values:
- A positive integer number of nanoseconds.
Recommended values:
- 10000000 (100 times a second) nanoseconds and more for single queries.
- 1000000000 (once a second) for cluster-wide profiling.
- 0 for turning off the timer.
See also:
- System table [trace\_log](https://clickhouse.com/docs/operations/system-tables/trace_log)
## query\_profiler\_real\_time\_period\_ns[β](https://clickhouse.com/docs/operations/settings/settings#query_profiler_real_time_period_ns "Direct link to query_profiler_real_time_period_ns")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value1000000000 |
Sets the period for a real clock timer of the [query profiler](https://clickhouse.com/docs/operations/optimizing-performance/sampling-query-profiler). Real clock timer counts wall-clock time.
Possible values:
- Positive integer number, in nanoseconds.
Recommended values:
- 10000000 (100 times a second) nanoseconds and less for single queries.
- 1000000000 (once a second) for cluster-wide profiling.
- 0 for turning off the timer.
See also:
- System table [trace\_log](https://clickhouse.com/docs/operations/system-tables/trace_log)
Cloud default value: `3000000000`.
## queue\_max\_wait\_ms[β](https://clickhouse.com/docs/operations/settings/settings#queue_max_wait_ms "Direct link to queue_max_wait_ms")
| Type | Default value |
|---|---|
| TypeMilliseconds | Default value0 |
The wait time in the request queue, if the number of concurrent requests exceeds the maximum.
## rabbitmq\_max\_wait\_ms[β](https://clickhouse.com/docs/operations/settings/settings#rabbitmq_max_wait_ms "Direct link to rabbitmq_max_wait_ms")
| Type | Default value |
|---|---|
| TypeMilliseconds | Default value5000 |
The wait time for reading from RabbitMQ before retry.
## read\_backoff\_max\_throughput[β](https://clickhouse.com/docs/operations/settings/settings#read_backoff_max_throughput "Direct link to read_backoff_max_throughput")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value1048576 |
Settings to reduce the number of threads in case of slow reads. Count events when the read bandwidth is less than that many bytes per second.
## read\_backoff\_min\_concurrency[β](https://clickhouse.com/docs/operations/settings/settings#read_backoff_min_concurrency "Direct link to read_backoff_min_concurrency")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value1 |
Settings to try keeping the minimal number of threads in case of slow reads.
## read\_backoff\_min\_events[β](https://clickhouse.com/docs/operations/settings/settings#read_backoff_min_events "Direct link to read_backoff_min_events")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value2 |
Settings to reduce the number of threads in case of slow reads. The number of events after which the number of threads will be reduced.
## read\_backoff\_min\_interval\_between\_events\_ms[β](https://clickhouse.com/docs/operations/settings/settings#read_backoff_min_interval_between_events_ms "Direct link to read_backoff_min_interval_between_events_ms")
| Type | Default value |
|---|---|
| TypeMilliseconds | Default value1000 |
Settings to reduce the number of threads in case of slow reads. Do not pay attention to the event, if the previous one has passed less than a certain amount of time.
## read\_backoff\_min\_latency\_ms[β](https://clickhouse.com/docs/operations/settings/settings#read_backoff_min_latency_ms "Direct link to read_backoff_min_latency_ms")
| Type | Default value |
|---|---|
| TypeMilliseconds | Default value1000 |
Setting to reduce the number of threads in case of slow reads. Pay attention only to reads that took at least that much time.
## read\_from\_distributed\_cache\_if\_exists\_otherwise\_bypass\_cache[β](https://clickhouse.com/docs/operations/settings/settings#read_from_distributed_cache_if_exists_otherwise_bypass_cache "Direct link to read_from_distributed_cache_if_exists_otherwise_bypass_cache")
ClickHouse Cloud only
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Only has an effect in ClickHouse Cloud. Same as read\_from\_filesystem\_cache\_if\_exists\_otherwise\_bypass\_cache, but for distributed cache.
## read\_from\_filesystem\_cache\_if\_exists\_otherwise\_bypass\_cache[β](https://clickhouse.com/docs/operations/settings/settings#read_from_filesystem_cache_if_exists_otherwise_bypass_cache "Direct link to read_from_filesystem_cache_if_exists_otherwise_bypass_cache")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Allow to use the filesystem cache in passive mode - benefit from the existing cache entries, but don't put more entries into the cache. If you set this setting for heavy ad-hoc queries and leave it disabled for short real-time queries, this will allows to avoid cache threshing by too heavy queries and to improve the overall system efficiency.
## read\_from\_page\_cache\_if\_exists\_otherwise\_bypass\_cache[β](https://clickhouse.com/docs/operations/settings/settings#read_from_page_cache_if_exists_otherwise_bypass_cache "Direct link to read_from_page_cache_if_exists_otherwise_bypass_cache")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Use userspace page cache in passive mode, similar to read\_from\_filesystem\_cache\_if\_exists\_otherwise\_bypass\_cache.
## read\_in\_order\_two\_level\_merge\_threshold[β](https://clickhouse.com/docs/operations/settings/settings#read_in_order_two_level_merge_threshold "Direct link to read_in_order_two_level_merge_threshold")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value100 |
Minimal number of parts to read to run preliminary merge step during multithread reading in order of primary key.
## read\_in\_order\_use\_buffering[β](https://clickhouse.com/docs/operations/settings/settings#read_in_order_use_buffering "Direct link to read_in_order_use_buffering")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Use buffering before merging while reading in order of primary key. It increases the parallelism of query executio
## read\_in\_order\_use\_virtual\_row[β](https://clickhouse.com/docs/operations/settings/settings#read_in_order_use_virtual_row "Direct link to read_in_order_use_virtual_row")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Use virtual row while reading in order of primary key or its monotonic function fashion. It is useful when searching over multiple parts as only relevant ones are touched.
## read\_overflow\_mode[β](https://clickhouse.com/docs/operations/settings/settings#read_overflow_mode "Direct link to read_overflow_mode")
| Type | Default value |
|---|---|
| TypeOverflowMode | Default valuethrow |
What to do when the limit is exceeded.
## read\_overflow\_mode\_leaf[β](https://clickhouse.com/docs/operations/settings/settings#read_overflow_mode_leaf "Direct link to read_overflow_mode_leaf")
| Type | Default value |
|---|---|
| TypeOverflowMode | Default valuethrow |
Sets what happens when the volume of data read exceeds one of the leaf limits.
Possible options:
- `throw`: throw an exception (default).
- `break`: stop executing the query and return the partial result.
## read\_priority[β](https://clickhouse.com/docs/operations/settings/settings#read_priority "Direct link to read_priority")
| Type | Default value |
|---|---|
| TypeInt64 | Default value0 |
Priority to read data from local filesystem or remote filesystem. Only supported for 'pread\_threadpool' method for local filesystem and for `threadpool` method for remote filesystem.
## read\_through\_distributed\_cache[β](https://clickhouse.com/docs/operations/settings/settings#read_through_distributed_cache "Direct link to read_through_distributed_cache")
ClickHouse Cloud only
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Only has an effect in ClickHouse Cloud. Allow reading from distributed cache
## readonly[β](https://clickhouse.com/docs/operations/settings/settings#readonly "Direct link to readonly")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
0 - no read-only restrictions. 1 - only read requests, as well as changing explicitly allowed settings. 2 - only read requests, as well as changing settings, except for the 'readonly' setting.
## receive\_data\_timeout\_ms[β](https://clickhouse.com/docs/operations/settings/settings#receive_data_timeout_ms "Direct link to receive_data_timeout_ms")
| Type | Default value |
|---|---|
| TypeMilliseconds | Default value2000 |
Connection timeout for receiving first packet of data or packet with positive progress from replica
## receive\_timeout[β](https://clickhouse.com/docs/operations/settings/settings#receive_timeout "Direct link to receive_timeout")
| Type | Default value |
|---|---|
| TypeSeconds | Default value300 |
Timeout for receiving data from the network, in seconds. If no bytes were received in this interval, the exception is thrown. If you set this setting on the client, the 'send\_timeout' for the socket will also be set on the corresponding connection end on the server.
## regexp\_dict\_allow\_hyperscan[β](https://clickhouse.com/docs/operations/settings/settings#regexp_dict_allow_hyperscan "Direct link to regexp_dict_allow_hyperscan")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Allow regexp\_tree dictionary using Hyperscan library.
## regexp\_dict\_flag\_case\_insensitive[β](https://clickhouse.com/docs/operations/settings/settings#regexp_dict_flag_case_insensitive "Direct link to regexp_dict_flag_case_insensitive")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Use case-insensitive matching for a regexp\_tree dictionary. Can be overridden in individual expressions with (?i) and (?-i).
## regexp\_dict\_flag\_dotall[β](https://clickhouse.com/docs/operations/settings/settings#regexp_dict_flag_dotall "Direct link to regexp_dict_flag_dotall")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Allow '.' to match newline characters for a regexp\_tree dictionary.
## regexp\_max\_matches\_per\_row[β](https://clickhouse.com/docs/operations/settings/settings#regexp_max_matches_per_row "Direct link to regexp_max_matches_per_row")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value1000 |
Sets the maximum number of matches for a single regular expression per row. Use it to protect against memory overload when using greedy regular expression in the [extractAllGroupsHorizontal](https://clickhouse.com/docs/sql-reference/functions/string-search-functions#extractAllGroupsHorizontal) function.
Possible values:
- Positive integer.
## reject\_expensive\_hyperscan\_regexps[β](https://clickhouse.com/docs/operations/settings/settings#reject_expensive_hyperscan_regexps "Direct link to reject_expensive_hyperscan_regexps")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Reject patterns which will likely be expensive to evaluate with hyperscan (due to NFA state explosion)
## remerge\_sort\_lowered\_memory\_bytes\_ratio[β](https://clickhouse.com/docs/operations/settings/settings#remerge_sort_lowered_memory_bytes_ratio "Direct link to remerge_sort_lowered_memory_bytes_ratio")
| Type | Default value |
|---|---|
| TypeFloat | Default value2 |
If memory usage after remerge does not reduced by this ratio, remerge will be disabled.
## remote\_filesystem\_read\_method[β](https://clickhouse.com/docs/operations/settings/settings#remote_filesystem_read_method "Direct link to remote_filesystem_read_method")
| Type | Default value |
|---|---|
| TypeString | Default valuethreadpool |
Method of reading data from remote filesystem, one of: read, threadpool.
## remote\_filesystem\_read\_prefetch[β](https://clickhouse.com/docs/operations/settings/settings#remote_filesystem_read_prefetch "Direct link to remote_filesystem_read_prefetch")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Should use prefetching when reading data from remote filesystem.
## remote\_fs\_read\_backoff\_max\_tries[β](https://clickhouse.com/docs/operations/settings/settings#remote_fs_read_backoff_max_tries "Direct link to remote_fs_read_backoff_max_tries")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value5 |
Max attempts to read with backoff
## remote\_fs\_read\_max\_backoff\_ms[β](https://clickhouse.com/docs/operations/settings/settings#remote_fs_read_max_backoff_ms "Direct link to remote_fs_read_max_backoff_ms")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value10000 |
Max wait time when trying to read data for remote disk
## remote\_read\_min\_bytes\_for\_seek[β](https://clickhouse.com/docs/operations/settings/settings#remote_read_min_bytes_for_seek "Direct link to remote_read_min_bytes_for_seek")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value4194304 |
Min bytes required for remote read (url, s3) to do seek, instead of read with ignore.
## rename\_files\_after\_processing[β](https://clickhouse.com/docs/operations/settings/settings#rename_files_after_processing "Direct link to rename_files_after_processing")
- **Type:** String
- **Default value:** Empty string
This setting allows to specify renaming pattern for files processed by `file` table function. When option is set, all files read by `file` table function will be renamed according to specified pattern with placeholders, only if files processing was successful.
### Placeholders[β](https://clickhouse.com/docs/operations/settings/settings#placeholders "Direct link to Placeholders")
- `%a` β Full original filename (e.g., "sample.csv").
- `%f` β Original filename without extension (e.g., "sample").
- `%e` β Original file extension with dot (e.g., ".csv").
- `%t` β Timestamp (in microseconds).
- `%%` β Percentage sign ("%").
### Example[β](https://clickhouse.com/docs/operations/settings/settings#example "Direct link to Example")
- Option: `--rename_files_after_processing="processed_%f_%t%e"`
- Query: `SELECT * FROM file('sample.csv')`
If reading `sample.csv` is successful, file will be renamed to `processed_sample_1683473210851438.csv`
## replace\_running\_query[β](https://clickhouse.com/docs/operations/settings/settings#replace_running_query "Direct link to replace_running_query")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
When using the HTTP interface, the 'query\_id' parameter can be passed. This is any string that serves as the query identifier. If a query from the same user with the same 'query\_id' already exists at this time, the behaviour depends on the 'replace\_running\_query' parameter.
`0` (default) β Throw an exception (do not allow the query to run if a query with the same 'query\_id' is already running).
`1` β Cancel the old query and start running the new one.
Set this parameter to 1 for implementing suggestions for segmentation conditions. After entering the next character, if the old query hasn't finished yet, it should be cancelled.
## replace\_running\_query\_max\_wait\_ms[β](https://clickhouse.com/docs/operations/settings/settings#replace_running_query_max_wait_ms "Direct link to replace_running_query_max_wait_ms")
| Type | Default value |
|---|---|
| TypeMilliseconds | Default value5000 |
The wait time for running the query with the same `query_id` to finish, when the [replace\_running\_query](https://clickhouse.com/docs/operations/settings/settings#replace_running_query) setting is active.
Possible values:
- Positive integer.
- 0 β Throwing an exception that does not allow to run a new query if the server already executes a query with the same `query_id`.
## replication\_wait\_for\_inactive\_replica\_timeout[β](https://clickhouse.com/docs/operations/settings/settings#replication_wait_for_inactive_replica_timeout "Direct link to replication_wait_for_inactive_replica_timeout")
| Type | Default value |
|---|---|
| TypeInt64 | Default value120 |
Specifies how long (in seconds) to wait for inactive replicas to execute [`ALTER`](https://clickhouse.com/docs/sql-reference/statements/alter), [`OPTIMIZE`](https://clickhouse.com/docs/sql-reference/statements/optimize) or [`TRUNCATE`](https://clickhouse.com/docs/sql-reference/statements/truncate) queries.
Possible values:
- `0` β Do not wait.
- Negative integer β Wait for unlimited time.
- Positive integer β The number of seconds to wait.
## restore\_replace\_external\_dictionary\_source\_to\_null[β](https://clickhouse.com/docs/operations/settings/settings#restore_replace_external_dictionary_source_to_null "Direct link to restore_replace_external_dictionary_source_to_null")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Replace external dictionary sources to Null on restore. Useful for testing purposes
## restore\_replace\_external\_engines\_to\_null[β](https://clickhouse.com/docs/operations/settings/settings#restore_replace_external_engines_to_null "Direct link to restore_replace_external_engines_to_null")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
For testing purposes. Replaces all external engines to Null to not initiate external connections.
## restore\_replace\_external\_table\_functions\_to\_null[β](https://clickhouse.com/docs/operations/settings/settings#restore_replace_external_table_functions_to_null "Direct link to restore_replace_external_table_functions_to_null")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
For testing purposes. Replaces all external table functions to Null to not initiate external connections.
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Replace table engine from Replicated*MergeTree -\> Shared*MergeTree during RESTORE.
Cloud default value: `1`.
## result\_overflow\_mode[β](https://clickhouse.com/docs/operations/settings/settings#result_overflow_mode "Direct link to result_overflow_mode")
| Type | Default value |
|---|---|
| TypeOverflowMode | Default valuethrow |
Cloud default value: `throw`
Sets what to do if the volume of the result exceeds one of the limits.
Possible values:
- `throw`: throw an exception (default).
- `break`: stop executing the query and return the partial result, as if the source data ran out.
Using 'break' is similar to using LIMIT. `Break` interrupts execution only at the block level. This means that amount of returned rows is greater than [`max_result_rows`](https://clickhouse.com/docs/operations/settings/settings#max_result_rows), multiple of [`max_block_size`](https://clickhouse.com/docs/operations/settings/settings#max_block_size) and depends on [`max_threads`](https://clickhouse.com/docs/operations/settings/settings#max_threads).
**Example**
```
SET max_threads = 3, max_block_size = 3333;
SET max_result_rows = 3334, result_overflow_mode = 'break';
SELECT *
FROM numbers_mt(100000)
FORMAT Null;
```
```
6666 rows in set. ...
```
## rewrite\_count\_distinct\_if\_with\_count\_distinct\_implementation[β](https://clickhouse.com/docs/operations/settings/settings#rewrite_count_distinct_if_with_count_distinct_implementation "Direct link to rewrite_count_distinct_if_with_count_distinct_implementation")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Allows you to rewrite `countDistcintIf` with [count\_distinct\_implementation](https://clickhouse.com/docs/operations/settings/settings#count_distinct_implementation) setting.
Possible values:
- true β Allow.
- false β Disallow.
## rewrite\_in\_to\_join[β](https://clickhouse.com/docs/operations/settings/settings#rewrite_in_to_join "Direct link to rewrite_in_to_join")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Rewrite expressions like 'x IN subquery' to JOIN. This might be useful for optimizing the whole query with join reordering.
## rows\_before\_aggregation[β](https://clickhouse.com/docs/operations/settings/settings#rows_before_aggregation "Direct link to rows_before_aggregation")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
When enabled, ClickHouse will provide exact value for rows\_before\_aggregation statistic, represents the number of rows read before aggregatio
## s3\_allow\_multipart\_copy[β](https://clickhouse.com/docs/operations/settings/settings#s3_allow_multipart_copy "Direct link to s3_allow_multipart_copy")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Allow multipart copy in S3.
## s3\_allow\_parallel\_part\_upload[β](https://clickhouse.com/docs/operations/settings/settings#s3_allow_parallel_part_upload "Direct link to s3_allow_parallel_part_upload")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Use multiple threads for s3 multipart upload. It may lead to slightly higher memory usage
## s3\_check\_objects\_after\_upload[β](https://clickhouse.com/docs/operations/settings/settings#s3_check_objects_after_upload "Direct link to s3_check_objects_after_upload")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Check each uploaded object to s3 with head request to be sure that upload was successful
## s3\_connect\_timeout\_ms[β](https://clickhouse.com/docs/operations/settings/settings#s3_connect_timeout_ms "Direct link to s3_connect_timeout_ms")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value1000 |
Connection timeout for host from s3 disks.
## s3\_create\_new\_file\_on\_insert[β](https://clickhouse.com/docs/operations/settings/settings#s3_create_new_file_on_insert "Direct link to s3_create_new_file_on_insert")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Enables or disables creating a new file on each insert in s3 engine tables. If enabled, on each insert a new S3 object will be created with the key, similar to this pattern:
initial: `data.Parquet.gz` -\> `data.1.Parquet.gz` -\> `data.2.Parquet.gz`, etc.
Possible values:
- 0 β `INSERT` query creates a new file or fail if file exists and s3\_truncate\_on\_insert is not set.
- 1 β `INSERT` query creates a new file on each insert using suffix (from the second one) if s3\_truncate\_on\_insert is not set.
See more details [here](https://clickhouse.com/docs/integrations/s3#inserting-data).
## s3\_disable\_checksum[β](https://clickhouse.com/docs/operations/settings/settings#s3_disable_checksum "Direct link to s3_disable_checksum")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Do not calculate a checksum when sending a file to S3. This speeds up writes by avoiding excessive processing passes on a file. It is mostly safe as the data of MergeTree tables is checksummed by ClickHouse anyway, and when S3 is accessed with HTTPS, the TLS layer already provides integrity while transferring through the network. While additional checksums on S3 give defense in depth.
## s3\_ignore\_file\_doesnt\_exist[β](https://clickhouse.com/docs/operations/settings/settings#s3_ignore_file_doesnt_exist "Direct link to s3_ignore_file_doesnt_exist")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Ignore absence of file if it does not exist when reading certain keys.
Possible values:
- 1 β `SELECT` returns empty result.
- 0 β `SELECT` throws an exception.
## s3\_list\_object\_keys\_size[β](https://clickhouse.com/docs/operations/settings/settings#s3_list_object_keys_size "Direct link to s3_list_object_keys_size")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value1000 |
Maximum number of files that could be returned in batch by ListObject request
## s3\_max\_connections[β](https://clickhouse.com/docs/operations/settings/settings#s3_max_connections "Direct link to s3_max_connections")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value1024 |
The maximum number of connections per server.
## s3\_max\_get\_burst[β](https://clickhouse.com/docs/operations/settings/settings#s3_max_get_burst "Direct link to s3_max_get_burst")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Max number of requests that can be issued simultaneously before hitting request per second limit. By default (0) equals to `s3_max_get_rps`
## s3\_max\_get\_rps[β](https://clickhouse.com/docs/operations/settings/settings#s3_max_get_rps "Direct link to s3_max_get_rps")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Limit on S3 GET request per second rate before throttling. Zero means unlimited.
## s3\_max\_inflight\_parts\_for\_one\_file[β](https://clickhouse.com/docs/operations/settings/settings#s3_max_inflight_parts_for_one_file "Direct link to s3_max_inflight_parts_for_one_file")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value20 |
The maximum number of a concurrent loaded parts in multipart upload request. 0 means unlimited.
## s3\_max\_part\_number[β](https://clickhouse.com/docs/operations/settings/settings#s3_max_part_number "Direct link to s3_max_part_number")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value10000 |
Maximum part number number for s3 upload part.
## s3\_max\_put\_burst[β](https://clickhouse.com/docs/operations/settings/settings#s3_max_put_burst "Direct link to s3_max_put_burst")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Max number of requests that can be issued simultaneously before hitting request per second limit. By default (0) equals to `s3_max_put_rps`
## s3\_max\_put\_rps[β](https://clickhouse.com/docs/operations/settings/settings#s3_max_put_rps "Direct link to s3_max_put_rps")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Limit on S3 PUT request per second rate before throttling. Zero means unlimited.
## s3\_max\_single\_operation\_copy\_size[β](https://clickhouse.com/docs/operations/settings/settings#s3_max_single_operation_copy_size "Direct link to s3_max_single_operation_copy_size")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value33554432 |
Maximum size for single-operation copy in s3. This setting is used only if s3\_allow\_multipart\_copy is true.
## s3\_max\_single\_part\_upload\_size[β](https://clickhouse.com/docs/operations/settings/settings#s3_max_single_part_upload_size "Direct link to s3_max_single_part_upload_size")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value33554432 |
The maximum size of object to upload using singlepart upload to S3.
## s3\_max\_single\_read\_retries[β](https://clickhouse.com/docs/operations/settings/settings#s3_max_single_read_retries "Direct link to s3_max_single_read_retries")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value4 |
The maximum number of retries during single S3 read.
## s3\_max\_unexpected\_write\_error\_retries[β](https://clickhouse.com/docs/operations/settings/settings#s3_max_unexpected_write_error_retries "Direct link to s3_max_unexpected_write_error_retries")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value4 |
The maximum number of retries in case of unexpected errors during S3 write.
## s3\_max\_upload\_part\_size[β](https://clickhouse.com/docs/operations/settings/settings#s3_max_upload_part_size "Direct link to s3_max_upload_part_size")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value5368709120 |
The maximum size of part to upload during multipart upload to S3.
## s3\_min\_upload\_part\_size[β](https://clickhouse.com/docs/operations/settings/settings#s3_min_upload_part_size "Direct link to s3_min_upload_part_size")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value16777216 |
The minimum size of part to upload during multipart upload to S3.
## s3\_path\_filter\_limit[β](https://clickhouse.com/docs/operations/settings/settings#s3_path_filter_limit "Direct link to s3_path_filter_limit")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value1000 |
Maximum number of `_path` values that can be extracted from query filters to use for file iteration instead of glob listing. 0 means disabled.
## s3\_request\_timeout\_ms[β](https://clickhouse.com/docs/operations/settings/settings#s3_request_timeout_ms "Direct link to s3_request_timeout_ms")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value30000 |
Idleness timeout for sending and receiving data to/from S3. Fail if a single TCP read or write call blocks for this long.
## s3\_skip\_empty\_files[β](https://clickhouse.com/docs/operations/settings/settings#s3_skip_empty_files "Direct link to s3_skip_empty_files")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Enables or disables skipping empty files in [S3](https://clickhouse.com/docs/engines/table-engines/integrations/s3) engine tables.
Possible values:
- 0 β `SELECT` throws an exception if empty file is not compatible with requested format.
- 1 β `SELECT` returns empty result for empty file.
## s3\_slow\_all\_threads\_after\_network\_error[β](https://clickhouse.com/docs/operations/settings/settings#s3_slow_all_threads_after_network_error "Direct link to s3_slow_all_threads_after_network_error")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
When set to `true`, all threads executing S3 requests to the same backup endpoint are slowed down after any single s3 request encounters a retryable network error, such as socket timeout. When set to `false`, each thread handles S3 request backoff independently of the others.
## s3\_strict\_upload\_part\_size[β](https://clickhouse.com/docs/operations/settings/settings#s3_strict_upload_part_size "Direct link to s3_strict_upload_part_size")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
The exact size of part to upload during multipart upload to S3 (some implementations does not supports variable size parts).
## s3\_throw\_on\_zero\_files\_match[β](https://clickhouse.com/docs/operations/settings/settings#s3_throw_on_zero_files_match "Direct link to s3_throw_on_zero_files_match")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Throw an error, when ListObjects request cannot match any files
## s3\_truncate\_on\_insert[β](https://clickhouse.com/docs/operations/settings/settings#s3_truncate_on_insert "Direct link to s3_truncate_on_insert")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Enables or disables truncate before inserts in s3 engine tables. If disabled, an exception will be thrown on insert attempts if an S3 object already exists.
Possible values:
- 0 β `INSERT` query creates a new file or fail if file exists and s3\_create\_new\_file\_on\_insert is not set.
- 1 β `INSERT` query replaces existing content of the file with the new data.
See more details [here](https://clickhouse.com/docs/integrations/s3#inserting-data).
## s3\_upload\_part\_size\_multiply\_factor[β](https://clickhouse.com/docs/operations/settings/settings#s3_upload_part_size_multiply_factor "Direct link to s3_upload_part_size_multiply_factor")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value2 |
Multiply s3\_min\_upload\_part\_size by this factor each time s3\_multiply\_parts\_count\_threshold parts were uploaded from a single write to S3.
## s3\_upload\_part\_size\_multiply\_parts\_count\_threshold[β](https://clickhouse.com/docs/operations/settings/settings#s3_upload_part_size_multiply_parts_count_threshold "Direct link to s3_upload_part_size_multiply_parts_count_threshold")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value500 |
Each time this number of parts was uploaded to S3, s3\_min\_upload\_part\_size is multiplied by s3\_upload\_part\_size\_multiply\_factor.
## s3\_use\_adaptive\_timeouts[β](https://clickhouse.com/docs/operations/settings/settings#s3_use_adaptive_timeouts "Direct link to s3_use_adaptive_timeouts")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
When set to `true` than for all s3 requests first two attempts are made with low send and receive timeouts. When set to `false` than all attempts are made with identical timeouts.
## s3\_validate\_request\_settings[β](https://clickhouse.com/docs/operations/settings/settings#s3_validate_request_settings "Direct link to s3_validate_request_settings")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Enables s3 request settings validation. Possible values:
- 1 β validate settings.
- 0 β do not validate settings.
## s3queue\_default\_zookeeper\_path[β](https://clickhouse.com/docs/operations/settings/settings#s3queue_default_zookeeper_path "Direct link to s3queue_default_zookeeper_path")
| Type | Default value |
|---|---|
| TypeString | Default value/clickhouse/s3queue/ |
Default zookeeper path prefix for S3Queue engine
## s3queue\_enable\_logging\_to\_s3queue\_log[β](https://clickhouse.com/docs/operations/settings/settings#s3queue_enable_logging_to_s3queue_log "Direct link to s3queue_enable_logging_to_s3queue_log")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Enable writing to system.s3queue\_log. The value can be overwritten per table with table settings
## s3queue\_keeper\_fault\_injection\_probability[β](https://clickhouse.com/docs/operations/settings/settings#s3queue_keeper_fault_injection_probability "Direct link to s3queue_keeper_fault_injection_probability")
| Type | Default value |
|---|---|
| TypeFloat | Default value0 |
Keeper fault injection probability for S3Queue.
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Migrate old metadata structure of S3Queue table to a new one
## schema\_inference\_cache\_require\_modification\_time\_for\_url[β](https://clickhouse.com/docs/operations/settings/settings#schema_inference_cache_require_modification_time_for_url "Direct link to schema_inference_cache_require_modification_time_for_url")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Use schema from cache for URL with last modification time validation (for URLs with Last-Modified header)
## schema\_inference\_use\_cache\_for\_azure[β](https://clickhouse.com/docs/operations/settings/settings#schema_inference_use_cache_for_azure "Direct link to schema_inference_use_cache_for_azure")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Use cache in schema inference while using azure table functio
## schema\_inference\_use\_cache\_for\_file[β](https://clickhouse.com/docs/operations/settings/settings#schema_inference_use_cache_for_file "Direct link to schema_inference_use_cache_for_file")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Use cache in schema inference while using file table functio
## schema\_inference\_use\_cache\_for\_hdfs[β](https://clickhouse.com/docs/operations/settings/settings#schema_inference_use_cache_for_hdfs "Direct link to schema_inference_use_cache_for_hdfs")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Use cache in schema inference while using hdfs table functio
## schema\_inference\_use\_cache\_for\_s3[β](https://clickhouse.com/docs/operations/settings/settings#schema_inference_use_cache_for_s3 "Direct link to schema_inference_use_cache_for_s3")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Use cache in schema inference while using s3 table functio
## schema\_inference\_use\_cache\_for\_url[β](https://clickhouse.com/docs/operations/settings/settings#schema_inference_use_cache_for_url "Direct link to schema_inference_use_cache_for_url")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Use cache in schema inference while using url table functio
## secondary\_indices\_enable\_bulk\_filtering[β](https://clickhouse.com/docs/operations/settings/settings#secondary_indices_enable_bulk_filtering "Direct link to secondary_indices_enable_bulk_filtering")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Enable the bulk filtering algorithm for indices. It is expected to be always better, but we have this setting for compatibility and control.
## select\_sequential\_consistency[β](https://clickhouse.com/docs/operations/settings/settings#select_sequential_consistency "Direct link to select_sequential_consistency")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Note
This setting differ in behavior between SharedMergeTree and ReplicatedMergeTree, see [SharedMergeTree consistency](https://clickhouse.com/docs/cloud/reference/shared-merge-tree#consistency) for more information about the behavior of `select_sequential_consistency` in SharedMergeTree.
Enables or disables sequential consistency for `SELECT` queries. Requires `insert_quorum_parallel` to be disabled (enabled by default).
Possible values:
- 0 β Disabled.
- 1 β Enabled.
Usage
When sequential consistency is enabled, ClickHouse allows the client to execute the `SELECT` query only for those replicas that contain data from all previous `INSERT` queries executed with `insert_quorum`. If the client refers to a partial replica, ClickHouse will generate an exception. The SELECT query will not include data that has not yet been written to the quorum of replicas.
When `insert_quorum_parallel` is enabled (the default), then `select_sequential_consistency` does not work. This is because parallel `INSERT` queries can be written to different sets of quorum replicas so there is no guarantee a single replica will have received all writes.
See also:
- [insert\_quorum](https://clickhouse.com/docs/operations/settings/settings#insert_quorum)
- [insert\_quorum\_timeout](https://clickhouse.com/docs/operations/settings/settings#insert_quorum_timeout)
- [insert\_quorum\_parallel](https://clickhouse.com/docs/operations/settings/settings#insert_quorum_parallel)
## send\_logs\_level[β](https://clickhouse.com/docs/operations/settings/settings#send_logs_level "Direct link to send_logs_level")
| Type | Default value |
|---|---|
| TypeLogsLevel | Default valuefatal |
Send server text logs with specified minimum level to client. Valid values: 'trace', 'debug', 'information', 'warning', 'error', 'fatal', 'none'
## send\_logs\_source\_regexp[β](https://clickhouse.com/docs/operations/settings/settings#send_logs_source_regexp "Direct link to send_logs_source_regexp")
Send server text logs with specified regexp to match log source name. Empty means all sources.
## send\_profile\_events[β](https://clickhouse.com/docs/operations/settings/settings#send_profile_events "Direct link to send_profile_events")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Enables or disables sending of [ProfileEvents](https://clickhouse.com/docs/native-protocol/server#profile-events) packets to the client.
This can be disabled to reduce network traffic for clients that do not require profile events.
Possible values:
- 0 β Disabled.
- 1 β Enabled.
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Enables or disables `X-ClickHouse-Progress` HTTP response headers in `clickhouse-server` responses.
For more information, read the [HTTP interface description](https://clickhouse.com/docs/interfaces/http).
Possible values:
- 0 β Disabled.
- 1 β Enabled.
## send\_timeout[β](https://clickhouse.com/docs/operations/settings/settings#send_timeout "Direct link to send_timeout")
| Type | Default value |
|---|---|
| TypeSeconds | Default value300 |
Timeout for sending data to the network, in seconds. If a client needs to send some data but is not able to send any bytes in this interval, the exception is thrown. If you set this setting on the client, the 'receive\_timeout' for the socket will also be set on the corresponding connection end on the server.
## serialize\_query\_plan[β](https://clickhouse.com/docs/operations/settings/settings#serialize_query_plan "Direct link to serialize_query_plan")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Serialize query plan for distributed processing
## serialize\_string\_in\_memory\_with\_zero\_byte[β](https://clickhouse.com/docs/operations/settings/settings#serialize_string_in_memory_with_zero_byte "Direct link to serialize_string_in_memory_with_zero_byte")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Serialize String values during aggregation with zero byte at the end. Enable to keep compatibility when querying cluster of incompatible versions.
## session\_timezone[β](https://clickhouse.com/docs/operations/settings/settings#session_timezone "Direct link to session_timezone")
Sets the implicit time zone of the current session or query. The implicit time zone is the time zone applied to values of type DateTime/DateTime64 which have no explicitly specified time zone. The setting takes precedence over the globally configured (server-level) implicit time zone. A value of '' (empty string) means that the implicit time zone of the current session or query is equal to the [server time zone](https://clickhouse.com/docs/operations/server-configuration-parameters/settings#timezone).
You can use functions `timeZone()` and `serverTimeZone()` to get the session time zone and server time zone.
Possible values:
- Any time zone name from `system.time_zones`, e.g. `Europe/Berlin`, `UTC` or `Zulu`
Examples:
```
SELECT timeZone(), serverTimeZone() FORMAT CSV
"Europe/Berlin","Europe/Berlin"
```
```
SELECT timeZone(), serverTimeZone() SETTINGS session_timezone = 'Asia/Novosibirsk' FORMAT CSV
"Asia/Novosibirsk","Europe/Berlin"
```
Assign session time zone 'America/Denver' to the inner DateTime without explicitly specified time zone:
```
SELECT toDateTime64(toDateTime64('1999-12-12 23:23:23.123', 3), 3, 'Europe/Zurich') SETTINGS session_timezone = 'America/Denver' FORMAT TSV
1999-12-13 07:23:23.123
```
Note
Not all functions that parse DateTime/DateTime64 respect `session_timezone`. This can lead to subtle errors. See the following example and explanation.
```
CREATE TABLE test_tz (`d` DateTime('UTC')) ENGINE = Memory AS SELECT toDateTime('2000-01-01 00:00:00', 'UTC');
SELECT *, timeZone() FROM test_tz WHERE d = toDateTime('2000-01-01 00:00:00') SETTINGS session_timezone = 'Asia/Novosibirsk'
0 rows in set.
SELECT *, timeZone() FROM test_tz WHERE d = '2000-01-01 00:00:00' SETTINGS session_timezone = 'Asia/Novosibirsk'
ββββββββββββββββββββdββ¬βtimeZone()ββββββββ
β 2000-01-01 00:00:00 β Asia/Novosibirsk β
βββββββββββββββββββββββ΄βββββββββββββββββββ
```
This happens due to different parsing pipelines:
- `toDateTime()` without explicitly given time zone used in the first `SELECT` query honors setting `session_timezone` and the global time zone.
- In the second query, a DateTime is parsed from a String, and inherits the type and time zone of the existing column`d`. Thus, setting `session_timezone` and the global time zone are not honored.
**See also**
- [timezone](https://clickhouse.com/docs/operations/server-configuration-parameters/settings#timezone)
## set\_overflow\_mode[β](https://clickhouse.com/docs/operations/settings/settings#set_overflow_mode "Direct link to set_overflow_mode")
| Type | Default value |
|---|---|
| TypeOverflowMode | Default valuethrow |
Sets what happens when the amount of data exceeds one of the limits.
Possible values:
- `throw`: throw an exception (default).
- `break`: stop executing the query and return the partial result, as if the source data ran out.
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Automatically synchronize set of data parts after MOVE\|REPLACE\|ATTACH partition operations in SMT tables. Cloud only
## short\_circuit\_function\_evaluation[β](https://clickhouse.com/docs/operations/settings/settings#short_circuit_function_evaluation "Direct link to short_circuit_function_evaluation")
| Type | Default value |
|---|---|
| TypeShortCircuitFunctionEvaluation | Default valueenable |
Allows calculating the [if](https://clickhouse.com/docs/sql-reference/functions/conditional-functions#if), [multiIf](https://clickhouse.com/docs/sql-reference/functions/conditional-functions#multiIf), [and](https://clickhouse.com/docs/sql-reference/functions/logical-functions#and), and [or](https://clickhouse.com/docs/sql-reference/functions/logical-functions#or) functions according to a [short scheme](https://en.wikipedia.org/wiki/Short-circuit_evaluation). This helps optimize the execution of complex expressions in these functions and prevent possible exceptions (such as division by zero when it is not expected).
Possible values:
- `enable` β Enables short-circuit function evaluation for functions that are suitable for it (can throw an exception or computationally heavy).
- `force_enable` β Enables short-circuit function evaluation for all functions.
- `disable` β Disables short-circuit function evaluation.
## short\_circuit\_function\_evaluation\_for\_nulls[β](https://clickhouse.com/docs/operations/settings/settings#short_circuit_function_evaluation_for_nulls "Direct link to short_circuit_function_evaluation_for_nulls")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Optimizes evaluation of functions that return NULL when any argument is NULL. When the percentage of NULL values in the function's arguments exceeds the short\_circuit\_function\_evaluation\_for\_nulls\_threshold, the system skips evaluating the function row-by-row. Instead, it immediately returns NULL for all rows, avoiding unnecessary computation.
## short\_circuit\_function\_evaluation\_for\_nulls\_threshold[β](https://clickhouse.com/docs/operations/settings/settings#short_circuit_function_evaluation_for_nulls_threshold "Direct link to short_circuit_function_evaluation_for_nulls_threshold")
| Type | Default value |
|---|---|
| TypeDouble | Default value1 |
Ratio threshold of NULL values to execute functions with Nullable arguments only on rows with non-NULL values in all arguments. Applies when setting short\_circuit\_function\_evaluation\_for\_nulls is enabled. When the ratio of rows containing NULL values to the total number of rows exceeds this threshold, these rows containing NULL values will not be evaluated.
## show\_data\_lake\_catalogs\_in\_system\_tables[β](https://clickhouse.com/docs/operations/settings/settings#show_data_lake_catalogs_in_system_tables "Direct link to show_data_lake_catalogs_in_system_tables")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Enables showing data lake catalogs in system tables.
## show\_processlist\_include\_internal[β](https://clickhouse.com/docs/operations/settings/settings#show_processlist_include_internal "Direct link to show_processlist_include_internal")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Show internal auxiliary processes in the `SHOW PROCESSLIST` query output.
Internal processes include dictionary reloads, refreshable materialized view reloads, auxiliary `SELECT`s executed in `SHOW ...` queries, auxiliary `CREATE DATABASE ...` queries executed internally to accommodate broken tables and more.
## show\_table\_uuid\_in\_table\_create\_query\_if\_not\_nil[β](https://clickhouse.com/docs/operations/settings/settings#show_table_uuid_in_table_create_query_if_not_nil "Direct link to show_table_uuid_in_table_create_query_if_not_nil")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Sets the `SHOW TABLE` query display.
Possible values:
- 0 β The query will be displayed without table UUID.
- 1 β The query will be displayed with table UUID.
## single\_join\_prefer\_left\_table[β](https://clickhouse.com/docs/operations/settings/settings#single_join_prefer_left_table "Direct link to single_join_prefer_left_table")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
For single JOIN in case of identifier ambiguity prefer left table
## skip\_redundant\_aliases\_in\_udf[β](https://clickhouse.com/docs/operations/settings/settings#skip_redundant_aliases_in_udf "Direct link to skip_redundant_aliases_in_udf")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Redundant aliases are not used (substituted) in user-defined functions in order to simplify it's usage.
Possible values:
- 1 β The aliases are skipped (substituted) in UDFs.
- 0 β The aliases are not skipped (substituted) in UDFs.
**Example**
The difference between enabled and disabled:
Query:
```
SET skip_redundant_aliases_in_udf = 0;
CREATE FUNCTION IF NOT EXISTS test_03274 AS ( x ) -> ((x + 1 as y, y + 2));
EXPLAIN SYNTAX SELECT test_03274(4 + 2);
```
Result:
```
SELECT ((4 + 2) + 1 AS y, y + 2)
```
Query:
```
SET skip_redundant_aliases_in_udf = 1;
CREATE FUNCTION IF NOT EXISTS test_03274 AS ( x ) -> ((x + 1 as y, y + 2));
EXPLAIN SYNTAX SELECT test_03274(4 + 2);
```
Result:
```
SELECT ((4 + 2) + 1, ((4 + 2) + 1) + 2)
```
## skip\_unavailable\_shards[β](https://clickhouse.com/docs/operations/settings/settings#skip_unavailable_shards "Direct link to skip_unavailable_shards")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Enables or disables silently skipping of unavailable shards.
Shard is considered unavailable if all its replicas are unavailable. A replica is unavailable in the following cases:
- ClickHouse can't connect to replica for any reason.
When connecting to a replica, ClickHouse performs several attempts. If all these attempts fail, the replica is considered unavailable.
- Replica can't be resolved through DNS.
If replica's hostname can't be resolved through DNS, it can indicate the following situations:
- Replica's host has no DNS record. It can occur in systems with dynamic DNS, for example, [Kubernetes](https://kubernetes.io/), where nodes can be unresolvable during downtime, and this is not an error.
- Configuration error. ClickHouse configuration file contains a wrong hostname.
Possible values:
- 1 β skipping enabled.
If a shard is unavailable, ClickHouse returns a result based on partial data and does not report node availability issues.
- 0 β skipping disabled.
If a shard is unavailable, ClickHouse throws an exception.
## sleep\_after\_receiving\_query\_ms[β](https://clickhouse.com/docs/operations/settings/settings#sleep_after_receiving_query_ms "Direct link to sleep_after_receiving_query_ms")
| Type | Default value |
|---|---|
| TypeMilliseconds | Default value0 |
Time to sleep after receiving query in TCPHandler
## sleep\_in\_send\_data\_ms[β](https://clickhouse.com/docs/operations/settings/settings#sleep_in_send_data_ms "Direct link to sleep_in_send_data_ms")
| Type | Default value |
|---|---|
| TypeMilliseconds | Default value0 |
Time to sleep in sending data in TCPHandler
## sleep\_in\_send\_tables\_status\_ms[β](https://clickhouse.com/docs/operations/settings/settings#sleep_in_send_tables_status_ms "Direct link to sleep_in_send_tables_status_ms")
| Type | Default value |
|---|---|
| TypeMilliseconds | Default value0 |
Time to sleep in sending tables status response in TCPHandler
## sort\_overflow\_mode[β](https://clickhouse.com/docs/operations/settings/settings#sort_overflow_mode "Direct link to sort_overflow_mode")
| Type | Default value |
|---|---|
| TypeOverflowMode | Default valuethrow |
Sets what happens if the number of rows received before sorting exceeds one of the limits.
Possible values:
- `throw`: throw an exception.
- `break`: stop executing the query and return the partial result.
## split\_intersecting\_parts\_ranges\_into\_layers\_final[β](https://clickhouse.com/docs/operations/settings/settings#split_intersecting_parts_ranges_into_layers_final "Direct link to split_intersecting_parts_ranges_into_layers_final")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Split intersecting parts ranges into layers during FINAL optimizatio
## split\_parts\_ranges\_into\_intersecting\_and\_non\_intersecting\_final[β](https://clickhouse.com/docs/operations/settings/settings#split_parts_ranges_into_intersecting_and_non_intersecting_final "Direct link to split_parts_ranges_into_intersecting_and_non_intersecting_final")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Split parts ranges into intersecting and non intersecting during FINAL optimizatio
## splitby\_max\_substrings\_includes\_remaining\_string[β](https://clickhouse.com/docs/operations/settings/settings#splitby_max_substrings_includes_remaining_string "Direct link to splitby_max_substrings_includes_remaining_string")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Controls whether function [splitBy\*()](https://clickhouse.com/docs/sql-reference/functions/splitting-merging-functions) with argument `max_substrings` \> 0 will include the remaining string in the last element of the result array.
Possible values:
- `0` - The remaining string will not be included in the last element of the result array.
- `1` - The remaining string will be included in the last element of the result array. This is the behavior of Spark's [`split()`](https://spark.apache.org/docs/3.1.2/api/python/reference/api/pyspark.sql.functions.split.html) function and Python's ['string.split()'](https://docs.python.org/3/library/stdtypes.html#str.split) method.
## stop\_refreshable\_materialized\_views\_on\_startup[β](https://clickhouse.com/docs/operations/settings/settings#stop_refreshable_materialized_views_on_startup "Direct link to stop_refreshable_materialized_views_on_startup")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
On server startup, prevent scheduling of refreshable materialized views, as if with SYSTEM STOP VIEWS. You can manually start them with `SYSTEM START VIEWS` or `SYSTEM START VIEW <name>` afterwards. Also applies to newly created views. Has no effect on non-refreshable materialized views.
## storage\_file\_read\_method[β](https://clickhouse.com/docs/operations/settings/settings#storage_file_read_method "Direct link to storage_file_read_method")
| Type | Default value |
|---|---|
| TypeLocalFSReadMethod | Default valuepread |
Method of reading data from storage file, one of: `read`, `pread`, `mmap`. The mmap method does not apply to clickhouse-server (it's intended for clickhouse-local).
## storage\_system\_stack\_trace\_pipe\_read\_timeout\_ms[β](https://clickhouse.com/docs/operations/settings/settings#storage_system_stack_trace_pipe_read_timeout_ms "Direct link to storage_system_stack_trace_pipe_read_timeout_ms")
| Type | Default value |
|---|---|
| TypeMilliseconds | Default value100 |
Maximum time to read from a pipe for receiving information from the threads when querying the `system.stack_trace` table. This setting is used for testing purposes and not meant to be changed by users.
## stream\_flush\_interval\_ms[β](https://clickhouse.com/docs/operations/settings/settings#stream_flush_interval_ms "Direct link to stream_flush_interval_ms")
| Type | Default value |
|---|---|
| TypeMilliseconds | Default value7500 |
Works for tables with streaming in the case of a timeout, or when a thread generates [max\_insert\_block\_size](https://clickhouse.com/docs/operations/settings/settings#max_insert_block_size) rows.
The default value is 7500.
The smaller the value, the more often data is flushed into the table. Setting the value too low leads to poor performance.
## stream\_like\_engine\_allow\_direct\_select[β](https://clickhouse.com/docs/operations/settings/settings#stream_like_engine_allow_direct_select "Direct link to stream_like_engine_allow_direct_select")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Allow direct SELECT query for Kafka, RabbitMQ, FileLog, Redis Streams, S3Queue, AzureQueue and NATS engines. In case there are attached materialized views, SELECT query is not allowed even if this setting is enabled. If there are no attached materialized views, enabling this setting allows to read data. Be aware that usually the read data is removed from the queue. In order to avoid removing read data the related engine settings should be configured properly.
## stream\_like\_engine\_insert\_queue[β](https://clickhouse.com/docs/operations/settings/settings#stream_like_engine_insert_queue "Direct link to stream_like_engine_insert_queue")
When stream-like engine reads from multiple queues, the user will need to select one queue to insert into when writing. Used by Redis Streams and NATS.
## stream\_poll\_timeout\_ms[β](https://clickhouse.com/docs/operations/settings/settings#stream_poll_timeout_ms "Direct link to stream_poll_timeout_ms")
| Type | Default value |
|---|---|
| TypeMilliseconds | Default value500 |
Timeout for polling data from/to streaming storages.
## system\_events\_show\_zero\_values[β](https://clickhouse.com/docs/operations/settings/settings#system_events_show_zero_values "Direct link to system_events_show_zero_values")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Allows to select zero-valued events from [`system.events`](https://clickhouse.com/docs/operations/system-tables/events).
Some monitoring systems require passing all the metrics values to them for each checkpoint, even if the metric value is zero.
Possible values:
- 0 β Disabled.
- 1 β Enabled.
**Examples**
Query
```
SELECT * FROM system.events WHERE event='QueryMemoryLimitExceeded';
```
Result
```
Ok.
```
Query
```
SET system_events_show_zero_values = 1;
SELECT * FROM system.events WHERE event='QueryMemoryLimitExceeded';
```
Result
```
ββeventβββββββββββββββββββββ¬βvalueββ¬βdescriptionββββββββββββββββββββββββββββββββββββββββββββ
β QueryMemoryLimitExceeded β 0 β Number of times when memory limit exceeded for query. β
ββββββββββββββββββββββββββββ΄ββββββββ΄ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
```
## table\_engine\_read\_through\_distributed\_cache[β](https://clickhouse.com/docs/operations/settings/settings#table_engine_read_through_distributed_cache "Direct link to table_engine_read_through_distributed_cache")
ClickHouse Cloud only
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Only has an effect in ClickHouse Cloud. Allow reading from distributed cache via table engines / table functions (s3, azure, etc)
## table\_function\_remote\_max\_addresses[β](https://clickhouse.com/docs/operations/settings/settings#table_function_remote_max_addresses "Direct link to table_function_remote_max_addresses")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value1000 |
Sets the maximum number of addresses generated from patterns for the [remote](https://clickhouse.com/docs/sql-reference/table-functions/remote) function.
Possible values:
- Positive integer.
## tcp\_keep\_alive\_timeout[β](https://clickhouse.com/docs/operations/settings/settings#tcp_keep_alive_timeout "Direct link to tcp_keep_alive_timeout")
| Type | Default value |
|---|---|
| TypeSeconds | Default value290 |
The time in seconds the connection needs to remain idle before TCP starts sending keepalive probes
## temporary\_data\_in\_cache\_reserve\_space\_wait\_lock\_timeout\_milliseconds[β](https://clickhouse.com/docs/operations/settings/settings#temporary_data_in_cache_reserve_space_wait_lock_timeout_milliseconds "Direct link to temporary_data_in_cache_reserve_space_wait_lock_timeout_milliseconds")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value600000 |
Wait time to lock cache for space reservation for temporary data in filesystem cache
## temporary\_files\_buffer\_size[β](https://clickhouse.com/docs/operations/settings/settings#temporary_files_buffer_size "Direct link to temporary_files_buffer_size")
| Type | Default value |
|---|---|
| TypeNonZeroUInt64 | Default value1048576 |
Size of the buffer for temporary files writers. Larger buffer size means less system calls, but more memory consumption.
## temporary\_files\_codec[β](https://clickhouse.com/docs/operations/settings/settings#temporary_files_codec "Direct link to temporary_files_codec")
| Type | Default value |
|---|---|
| TypeString | Default valueLZ4 |
Sets compression codec for temporary files used in sorting and joining operations on disk.
Possible values:
- LZ4 β [LZ4](https://en.wikipedia.org/wiki/LZ4_\(compression_algorithm\)) compression is applied.
- NONE β No compression is applied.
## text\_index\_hint\_max\_selectivity[β](https://clickhouse.com/docs/operations/settings/settings#text_index_hint_max_selectivity "Direct link to text_index_hint_max_selectivity")
| Type | Default value |
|---|---|
| TypeFloat | Default value0\.2 |
Maximal selectivity of the filter to use the hint built from the inverted text index.
## text\_index\_like\_max\_postings\_to\_read[β](https://clickhouse.com/docs/operations/settings/settings#text_index_like_max_postings_to_read "Direct link to text_index_like_max_postings_to_read")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value50 |
Maximum number of large postings to read when text index LIKE evaluation by the dictionary scan is enabled.
Requires `use_text_index_like_evaluation_by_dictionary_scan` to be enabled.
## text\_index\_like\_min\_pattern\_length[β](https://clickhouse.com/docs/operations/settings/settings#text_index_like_min_pattern_length "Direct link to text_index_like_min_pattern_length")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value4 |
Minimum length of the alphanumeric needle in a LIKE/ILIKE pattern required to use the text index LIKE evaluation by the dictionary scan. Patterns shorter than this threshold match too many dictionary tokens and are skipped to avoid expensive scans.
Requires `use_text_index_like_evaluation_by_dictionary_scan` to be enabled.
## throw\_if\_no\_data\_to\_insert[β](https://clickhouse.com/docs/operations/settings/settings#throw_if_no_data_to_insert "Direct link to throw_if_no_data_to_insert")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Allows or forbids empty INSERTs, enabled by default (throws an error on an empty insert). Only applies to INSERTs using [`clickhouse-client`](https://clickhouse.com/docs/interfaces/cli) or using the [gRPC interface](https://clickhouse.com/docs/interfaces/grpc).
## throw\_on\_error\_from\_cache\_on\_write\_operations[β](https://clickhouse.com/docs/operations/settings/settings#throw_on_error_from_cache_on_write_operations "Direct link to throw_on_error_from_cache_on_write_operations")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Ignore error from cache when caching on write operations (INSERT, merges)
## throw\_on\_max\_partitions\_per\_insert\_block[β](https://clickhouse.com/docs/operations/settings/settings#throw_on_max_partitions_per_insert_block "Direct link to throw_on_max_partitions_per_insert_block")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Allows you to control the behaviour when `max_partitions_per_insert_block` is reached.
Possible values:
- `true` - When an insert block reaches `max_partitions_per_insert_block`, an exception is raised.
- `false` - Logs a warning when `max_partitions_per_insert_block` is reached.
## throw\_on\_unsupported\_query\_inside\_transaction[β](https://clickhouse.com/docs/operations/settings/settings#throw_on_unsupported_query_inside_transaction "Direct link to throw_on_unsupported_query_inside_transaction")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Throw exception if unsupported query is used inside transactio
## timeout\_before\_checking\_execution\_speed[β](https://clickhouse.com/docs/operations/settings/settings#timeout_before_checking_execution_speed "Direct link to timeout_before_checking_execution_speed")
| Type | Default value |
|---|---|
| TypeSeconds | Default value10 |
Checks that execution speed is not too slow (no less than `min_execution_speed`), after the specified time in seconds has expired.
## timeout\_overflow\_mode[β](https://clickhouse.com/docs/operations/settings/settings#timeout_overflow_mode "Direct link to timeout_overflow_mode")
| Type | Default value |
|---|---|
| TypeOverflowMode | Default valuethrow |
Sets what to do if the query is run longer than the `max_execution_time` or the estimated running time is longer than `max_estimated_execution_time`.
Possible values:
- `throw`: throw an exception (default).
- `break`: stop executing the query and return the partial result, as if the source data ran out.
## timeout\_overflow\_mode\_leaf[β](https://clickhouse.com/docs/operations/settings/settings#timeout_overflow_mode_leaf "Direct link to timeout_overflow_mode_leaf")
| Type | Default value |
|---|---|
| TypeOverflowMode | Default valuethrow |
Sets what happens when the query in leaf node run longer than `max_execution_time_leaf`.
Possible values:
- `throw`: throw an exception (default).
- `break`: stop executing the query and return the partial result, as if the source data ran out.
## totals\_auto\_threshold[β](https://clickhouse.com/docs/operations/settings/settings#totals_auto_threshold "Direct link to totals_auto_threshold")
| Type | Default value |
|---|---|
| TypeFloat | Default value0\.5 |
The threshold for `totals_mode = 'auto'`. See the section "WITH TOTALS modifier".
## totals\_mode[β](https://clickhouse.com/docs/operations/settings/settings#totals_mode "Direct link to totals_mode")
| Type | Default value |
|---|---|
| TypeTotalsMode | Default valueafter\_having\_exclusive |
How to calculate TOTALS when HAVING is present, as well as when max\_rows\_to\_group\_by and group\_by\_overflow\_mode = 'any' are present. See the section "WITH TOTALS modifier".
## trace\_profile\_events[β](https://clickhouse.com/docs/operations/settings/settings#trace_profile_events "Direct link to trace_profile_events")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Enables or disables collecting stacktraces on each update of profile events along with the name of profile event and the value of increment and sending them into [trace\_log](https://clickhouse.com/docs/operations/system-tables/trace_log).
Possible values:
- 1 β Tracing of profile events enabled.
- 0 β Tracing of profile events disabled.
## trace\_profile\_events\_list[β](https://clickhouse.com/docs/operations/settings/settings#trace_profile_events_list "Direct link to trace_profile_events_list")
When the setting `trace_profile_events` is enabled, limit the traced events to the specified list of comma-separated names. If the `trace_profile_events_list` is an empty string (by default), trace all profile events.
Example value: 'DiskS3ReadMicroseconds,DiskS3ReadRequestsCount,SelectQueryTimeMicroseconds,ReadBufferFromS3Bytes'
Using this setting allows more precise collection of data for a large number of queries, because otherwise the vast amount of events can overflow the internal system log queue and some portion of them will be dropped.
## transfer\_overflow\_mode[β](https://clickhouse.com/docs/operations/settings/settings#transfer_overflow_mode "Direct link to transfer_overflow_mode")
| Type | Default value |
|---|---|
| TypeOverflowMode | Default valuethrow |
Sets what happens when the amount of data exceeds one of the limits.
Possible values:
- `throw`: throw an exception (default).
- `break`: stop executing the query and return the partial result, as if the source data ran out.
## transform\_null\_in[β](https://clickhouse.com/docs/operations/settings/settings#transform_null_in "Direct link to transform_null_in")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Enables equality of [NULL](https://clickhouse.com/docs/sql-reference/syntax#null) values for [IN](https://clickhouse.com/docs/sql-reference/operators/in) operator.
By default, `NULL` values can't be compared because `NULL` means undefined value. Thus, comparison `expr = NULL` must always return `false`. With this setting `NULL = NULL` returns `true` for `IN` operator.
Possible values:
- 0 β Comparison of `NULL` values in `IN` operator returns `false`.
- 1 β Comparison of `NULL` values in `IN` operator returns `true`.
**Example**
Consider the `null_in` table:
```
βββidxββ¬βββββiββ
β 1 β 1 β
β 2 β NULL β
β 3 β 3 β
ββββββββ΄ββββββββ
```
Query:
```
SELECT idx, i FROM null_in WHERE i IN (1, NULL) SETTINGS transform_null_in = 0;
```
Result:
```
βββidxββ¬ββββiββ
β 1 β 1 β
ββββββββ΄βββββββ
```
Query:
```
SELECT idx, i FROM null_in WHERE i IN (1, NULL) SETTINGS transform_null_in = 1;
```
Result:
```
βββidxββ¬βββββiββ
β 1 β 1 β
β 2 β NULL β
ββββββββ΄ββββββββ
```
**See Also**
- [NULL Processing in IN Operators](https://clickhouse.com/docs/sql-reference/operators/in#null-processing)
## traverse\_shadow\_remote\_data\_paths[β](https://clickhouse.com/docs/operations/settings/settings#traverse_shadow_remote_data_paths "Direct link to traverse_shadow_remote_data_paths")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Traverse frozen data (shadow directory) in addition to actual table data when query system.remote\_data\_paths
## union\_default\_mode[β](https://clickhouse.com/docs/operations/settings/settings#union_default_mode "Direct link to union_default_mode")
Sets a mode for combining `SELECT` query results. The setting is only used when shared with [UNION](https://clickhouse.com/docs/sql-reference/statements/select/union) without explicitly specifying the `UNION ALL` or `UNION DISTINCT`.
Possible values:
- `'DISTINCT'` β ClickHouse outputs rows as a result of combining queries removing duplicate rows.
- `'ALL'` β ClickHouse outputs all rows as a result of combining queries including duplicate rows.
- `''` β ClickHouse generates an exception when used with `UNION`.
See examples in [UNION](https://clickhouse.com/docs/sql-reference/statements/select/union).
## unknown\_packet\_in\_send\_data[β](https://clickhouse.com/docs/operations/settings/settings#unknown_packet_in_send_data "Direct link to unknown_packet_in_send_data")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Send unknown packet instead of data Nth data packet
## update\_parallel\_mode[β](https://clickhouse.com/docs/operations/settings/settings#update_parallel_mode "Direct link to update_parallel_mode")
| Type | Default value |
|---|---|
| TypeUpdateParallelMode | Default valueauto |
Determines the behavior of concurrent update queries.
Possible values:
- `sync` - run sequentially all `UPDATE` queries.
- `auto` - run sequentially only `UPDATE` queries with dependencies between columns updated in one query and columns used in expressions of another query.
- `async` - do not synchronize update queries.
## update\_sequential\_consistency[β](https://clickhouse.com/docs/operations/settings/settings#update_sequential_consistency "Direct link to update_sequential_consistency")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
If true set of parts is updated to the latest version before execution of update.
## use\_async\_executor\_for\_materialized\_views[β](https://clickhouse.com/docs/operations/settings/settings#use_async_executor_for_materialized_views "Direct link to use_async_executor_for_materialized_views")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Use async and potentially multithreaded execution of materialized view query, can speedup views processing during INSERT, but also consume more memory.
## use\_cache\_for\_count\_from\_files[β](https://clickhouse.com/docs/operations/settings/settings#use_cache_for_count_from_files "Direct link to use_cache_for_count_from_files")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Enables caching of rows number during count from files in table functions `file`/`s3`/`url`/`hdfs`/`azureBlobStorage`.
Enabled by default.
## use\_client\_time\_zone[β](https://clickhouse.com/docs/operations/settings/settings#use_client_time_zone "Direct link to use_client_time_zone")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Use client timezone for interpreting DateTime string values, instead of adopting server timezone.
## use\_compact\_format\_in\_distributed\_parts\_names[β](https://clickhouse.com/docs/operations/settings/settings#use_compact_format_in_distributed_parts_names "Direct link to use_compact_format_in_distributed_parts_names")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Uses compact format for storing blocks for background (`distributed_foreground_insert`) INSERT into tables with `Distributed` engine.
Possible values:
- 0 β Uses `user[:password]@host:port#default_database` directory format.
- 1 β Uses `[shard{shard_index}[_replica{replica_index}]]` directory format.
Note
- with `use_compact_format_in_distributed_parts_names=0` changes from cluster definition will not be applied for background INSERT.
- with `use_compact_format_in_distributed_parts_names=1` changing the order of the nodes in the cluster definition, will change the `shard_index`/`replica_index` so be aware.
## use\_concurrency\_control[β](https://clickhouse.com/docs/operations/settings/settings#use_concurrency_control "Direct link to use_concurrency_control")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Respect the server's concurrency control (see the `concurrent_threads_soft_limit_num` and `concurrent_threads_soft_limit_ratio_to_cores` global server settings). If disabled, it allows using a larger number of threads even if the server is overloaded (not recommended for normal usage, and needed mostly for tests).
Cloud default value: `0`.
## use\_hash\_table\_stats\_for\_join\_reordering[β](https://clickhouse.com/docs/operations/settings/settings#use_hash_table_stats_for_join_reordering "Direct link to use_hash_table_stats_for_join_reordering")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Enable using collected hash table statistics for cardinality estimation during join reordering
## use\_hedged\_requests[β](https://clickhouse.com/docs/operations/settings/settings#use_hedged_requests "Direct link to use_hedged_requests")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Enables hedged requests logic for remote queries. It allows to establish many connections with different replicas for query. New connection is enabled in case existent connection(s) with replica(s) were not established within `hedged_connection_timeout` or no data was received within `receive_data_timeout`. Query uses the first connection which send non empty progress packet (or data packet, if `allow_changing_replica_until_first_data_packet`); other connections are cancelled. Queries with `max_parallel_replicas > 1` are supported.
Enabled by default.
Cloud default value: `0`.
## use\_hive\_partitioning[β](https://clickhouse.com/docs/operations/settings/settings#use_hive_partitioning "Direct link to use_hive_partitioning")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
When enabled, ClickHouse will detect Hive-style partitioning in path (`/name=value/`) in file-like table engines [File](https://clickhouse.com/docs/sql-reference/table-functions/file#hive-style-partitioning)/[S3](https://clickhouse.com/docs/sql-reference/table-functions/s3#hive-style-partitioning)/[URL](https://clickhouse.com/docs/sql-reference/table-functions/url#hive-style-partitioning)/[HDFS](https://clickhouse.com/docs/sql-reference/table-functions/hdfs#hive-style-partitioning)/[AzureBlobStorage](https://clickhouse.com/docs/sql-reference/table-functions/azureBlobStorage#hive-style-partitioning) and will allow to use partition columns as virtual columns in the query. These virtual columns will have the same names as in the partitioned path, but starting with `_`.
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
If turned on, iceberg table function and iceberg storage may utilize the iceberg metadata files cache.
Possible values:
- 0 - Disabled
- 1 - Enabled
## use\_iceberg\_partition\_pruning[β](https://clickhouse.com/docs/operations/settings/settings#use_iceberg_partition_pruning "Direct link to use_iceberg_partition_pruning")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Use Iceberg partition pruning for Iceberg tables
## use\_index\_for\_in\_with\_subqueries[β](https://clickhouse.com/docs/operations/settings/settings#use_index_for_in_with_subqueries "Direct link to use_index_for_in_with_subqueries")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Try using an index if there is a subquery or a table expression on the right side of the IN operator.
## use\_index\_for\_in\_with\_subqueries\_max\_values[β](https://clickhouse.com/docs/operations/settings/settings#use_index_for_in_with_subqueries_max_values "Direct link to use_index_for_in_with_subqueries_max_values")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
The maximum size of the set in the right-hand side of the IN operator to use table index for filtering. It allows to avoid performance degradation and higher memory usage due to the preparation of additional data structures for large queries. Zero means no limit.
## use\_join\_disjunctions\_push\_down[β](https://clickhouse.com/docs/operations/settings/settings#use_join_disjunctions_push_down "Direct link to use_join_disjunctions_push_down")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Enable pushing OR-connected parts of JOIN conditions down to the corresponding input sides ("partial pushdown"). This allows storage engines to filter earlier, which can reduce data read. The optimization is semantics-preserving and is applied only when each top-level OR branch contributes at least one deterministic predicate for the target side.
## use\_legacy\_to\_time[β](https://clickhouse.com/docs/operations/settings/settings#use_legacy_to_time "Direct link to use_legacy_to_time")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
When enabled, allows to use legacy toTime function, which converts a date with time to a certain fixed date, while preserving the time. Otherwise, uses a new toTime function, that converts different type of data into the Time type. The old legacy function is also unconditionally accessible as toTimeWithFixedDate.
## use\_page\_cache\_for\_disks\_without\_file\_cache[β](https://clickhouse.com/docs/operations/settings/settings#use_page_cache_for_disks_without_file_cache "Direct link to use_page_cache_for_disks_without_file_cache")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Use userspace page cache for remote disks that don't have filesystem cache enabled.
## use\_page\_cache\_for\_local\_disks[β](https://clickhouse.com/docs/operations/settings/settings#use_page_cache_for_local_disks "Direct link to use_page_cache_for_local_disks")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Use userspace page cache when reading from local disks. Used for testing, unlikely to improve performance in practice. Requires local\_filesystem\_read\_method = 'pread' or 'read'. Doesn't disable the OS page cache; min\_bytes\_to\_use\_direct\_io can be used for that. Only affects regular tables, not file() table function or File() table engine.
## use\_page\_cache\_for\_object\_storage[β](https://clickhouse.com/docs/operations/settings/settings#use_page_cache_for_object_storage "Direct link to use_page_cache_for_object_storage")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Use userspace page cache when reading from object storage table functions (s3, azure, hdfs) and table engines (S3, Azure, HDFS).
## use\_page\_cache\_with\_distributed\_cache[β](https://clickhouse.com/docs/operations/settings/settings#use_page_cache_with_distributed_cache "Direct link to use_page_cache_with_distributed_cache")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Use userspace page cache when distributed cache is used.
## use\_paimon\_partition\_pruning[β](https://clickhouse.com/docs/operations/settings/settings#use_paimon_partition_pruning "Direct link to use_paimon_partition_pruning")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Use Paimon partition pruning for Paimon table functions
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
If turned on, parquet format may utilize the parquet metadata cache.
Possible values:
- 0 - Disabled
- 1 - Enabled
## use\_partition\_pruning[β](https://clickhouse.com/docs/operations/settings/settings#use_partition_pruning "Direct link to use_partition_pruning")
**Aliases**: `use_partition_key`
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Use partition key to prune partitions during query execution for MergeTree tables.
Possible values:
- 0 β Disabled.
- 1 β Enabled.
## use\_primary\_key[β](https://clickhouse.com/docs/operations/settings/settings#use_primary_key "Direct link to use_primary_key")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Use the primary key to prune granules during query execution for MergeTree tables.
Possible values:
- 0 β Disabled.
- 1 β Enabled.
## use\_query\_cache[β](https://clickhouse.com/docs/operations/settings/settings#use_query_cache "Direct link to use_query_cache")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
If turned on, `SELECT` queries may utilize the [query cache](https://clickhouse.com/docs/operations/query-cache). Parameters [enable\_reads\_from\_query\_cache](https://clickhouse.com/docs/operations/settings/settings#enable_reads_from_query_cache) and [enable\_writes\_to\_query\_cache](https://clickhouse.com/docs/operations/settings/settings#enable_writes_to_query_cache) control in more detail how the cache is used.
Possible values:
- 0 - Disabled
- 1 - Enabled
## use\_query\_condition\_cache[β](https://clickhouse.com/docs/operations/settings/settings#use_query_condition_cache "Direct link to use_query_condition_cache")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Enable the [query condition cache](https://clickhouse.com/docs/operations/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\_roaring\_bitmap\_iceberg\_positional\_deletes[β](https://clickhouse.com/docs/operations/settings/settings#use_roaring_bitmap_iceberg_positional_deletes "Direct link to use_roaring_bitmap_iceberg_positional_deletes")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Use roaring bitmap for iceberg positional deletes.
## use\_skip\_indexes[β](https://clickhouse.com/docs/operations/settings/settings#use_skip_indexes "Direct link to use_skip_indexes")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Use data skipping indexes during query execution.
Possible values:
- 0 β Disabled.
- 1 β Enabled.
## use\_skip\_indexes\_for\_disjunctions[β](https://clickhouse.com/docs/operations/settings/settings#use_skip_indexes_for_disjunctions "Direct link to use_skip_indexes_for_disjunctions")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Evaluate WHERE filters with mixed AND and OR conditions using skip indexes. Example: WHERE A = 5 AND (B = 5 OR C = 5). If disabled, skip indexes are still used to evaluate WHERE conditions but they must only contain AND-ed clauses.
Possible values:
- 0 β Disabled.
- 1 β Enabled.
## use\_skip\_indexes\_for\_top\_k[β](https://clickhouse.com/docs/operations/settings/settings#use_skip_indexes_for_top_k "Direct link to use_skip_indexes_for_top_k")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Enable using data skipping indexes for TopK filtering.
When enabled, if a minmax skip index exists on the column in `ORDER BY <column> LIMIT n` query, optimizer will attempt to use the minmax index to skip granules that are not relevant for the final result . This can reduce query latency.
Possible values:
- 0 β Disabled.
- 1 β Enabled.
## use\_skip\_indexes\_if\_final[β](https://clickhouse.com/docs/operations/settings/settings#use_skip_indexes_if_final "Direct link to use_skip_indexes_if_final")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Controls whether skipping indexes are used when executing a query with the FINAL modifier.
Skip indexes may exclude rows (granules) containing the latest data, which could lead to incorrect results from a query with the FINAL modifier. When this setting is enabled, skipping indexes are applied even with the FINAL modifier, potentially improving performance but with the risk of missing recent updates. This setting should be enabled in sync with the setting use\_skip\_indexes\_if\_final\_exact\_mode (default is enabled).
Possible values:
- 0 β Disabled.
- 1 β Enabled.
## use\_skip\_indexes\_if\_final\_exact\_mode[β](https://clickhouse.com/docs/operations/settings/settings#use_skip_indexes_if_final_exact_mode "Direct link to use_skip_indexes_if_final_exact_mode")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Controls whether granules returned by a skipping index are expanded in newer parts to return correct results when executing a query with the FINAL modifier.
Using skip indexes may exclude rows (granules) containing the latest data which could lead to incorrect results. This setting can ensure that correct results are returned by scanning newer parts that have overlap with the ranges returned by the skip index. This setting should be disabled only if approximate results based on looking up the skip index are okay for an application.
Possible values:
- 0 β Disabled.
- 1 β Enabled.
## use\_skip\_indexes\_on\_data\_read[β](https://clickhouse.com/docs/operations/settings/settings#use_skip_indexes_on_data_read "Direct link to use_skip_indexes_on_data_read")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Enable using data skipping indexes during data reading.
When enabled, skip indexes are evaluated dynamically at the time each data granule is being read, rather than being analyzed in advance before query execution begins. This can reduce query startup latency.
Possible values:
- 0 β Disabled.
- 1 β Enabled.
## use\_statistics[β](https://clickhouse.com/docs/operations/settings/settings#use_statistics "Direct link to use_statistics")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
/// preferred over 'allow\_statistics\_optimize' because of consistency with 'use\_primary\_key' and 'use\_skip\_indexes' Allows using statistics to optimize queries
## use\_statistics\_cache[β](https://clickhouse.com/docs/operations/settings/settings#use_statistics_cache "Direct link to use_statistics_cache")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Use statistics cache in a query to avoid the overhead of loading statistics of every parts
## use\_statistics\_for\_part\_pruning[β](https://clickhouse.com/docs/operations/settings/settings#use_statistics_for_part_pruning "Direct link to use_statistics_for_part_pruning")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Use statistics to filter out parts during query execution.
When enabled, pruning in SELECT queries will use column statistics (e.g. MinMax statistics) to eliminate parts that cannot contain matching data before reading any data.
Possible values:
- 0 β Disabled.
- 1 β Enabled.
## use\_strict\_insert\_block\_limits[β](https://clickhouse.com/docs/operations/settings/settings#use_strict_insert_block_limits "Direct link to use_strict_insert_block_limits")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
When enabled, strictly enforces both minimum and maximum insert block size limits.
A block is emitted when:
- Min thresholds (AND): Both min\_insert\_block\_size\_rows AND min\_insert\_block\_size\_bytes are reached.
- Max thresholds (OR): Either max\_insert\_block\_size\_rows OR max\_insert\_block\_size\_bytes is reached.
When disabled, a block is emitted when:
- Min thresholds (OR): min\_insert\_block\_size\_rows OR min\_insert\_block\_size\_bytes is reached.
**Note**: If max settings are smaller than min settings, the max limits take precedence and blocks will be emitted before min thresholds are reached.
**Note**: This setting is automatically disabled for async inserts, because async inserts attach per-entry deduplication tokens that are incompatible with block splitting that is needed for enforcement of strict limits.
Disabled by default.
## use\_structure\_from\_insertion\_table\_in\_table\_functions[β](https://clickhouse.com/docs/operations/settings/settings#use_structure_from_insertion_table_in_table_functions "Direct link to use_structure_from_insertion_table_in_table_functions")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value2 |
Use structure from insertion table instead of schema inference from data. Possible values: 0 - disabled, 1 - enabled, 2 - auto
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Whether to use a cache of deserialized text index header. Using the text index header cache can significantly reduce latency and increase throughput when working with a large number of text index queries.
## use\_text\_index\_like\_evaluation\_by\_dictionary\_scan[β](https://clickhouse.com/docs/operations/settings/settings#use_text_index_like_evaluation_by_dictionary_scan "Direct link to use_text_index_like_evaluation_by_dictionary_scan")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Enable evaluation of LIKE/ILIKE queries by scanning the inverted text index dictionary.
## use\_text\_index\_postings\_cache[β](https://clickhouse.com/docs/operations/settings/settings#use_text_index_postings_cache "Direct link to use_text_index_postings_cache")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Whether to use a cache of deserialized text index posting lists. Using the text index postings cache can significantly reduce latency and increase throughput when working with a large number of text index queries.
## use\_text\_index\_tokens\_cache[β](https://clickhouse.com/docs/operations/settings/settings#use_text_index_tokens_cache "Direct link to use_text_index_tokens_cache")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Whether to use a cache of deserialized text index token infos. Using the text index tokens cache can significantly reduce latency and increase throughput when working with a large number of text index queries.
## use\_top\_k\_dynamic\_filtering[β](https://clickhouse.com/docs/operations/settings/settings#use_top_k_dynamic_filtering "Direct link to use_top_k_dynamic_filtering")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Enable dynamic filtering optimization when executing a `ORDER BY <column> LIMIT n` query.
When enabled, the query executor will try to skip granules and rows that will not be part of the final `top N` rows in the resultset. This optimization is dynamic in nature and latency improvements depends on data distribution and presence of other predicates in the query.
Possible values:
- 0 β Disabled.
- 1 β Enabled.
## use\_uncompressed\_cache[β](https://clickhouse.com/docs/operations/settings/settings#use_uncompressed_cache "Direct link to use_uncompressed_cache")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Whether to use a cache of uncompressed blocks. Accepts 0 or 1. By default, 0 (disabled). Using the uncompressed cache (only for tables in the MergeTree family) can significantly reduce latency and increase throughput when working with a large number of short queries. Enable this setting for users who send frequent short requests. Also pay attention to the [uncompressed\_cache\_size](https://clickhouse.com/docs/operations/server-configuration-parameters/settings#uncompressed_cache_size) configuration parameter (only set in the config file) β the size of uncompressed cache blocks. By default, it is 8 GiB. The uncompressed cache is filled in as needed and the least-used data is automatically deleted.
For queries that read at least a somewhat large volume of data (one million rows or more), the uncompressed cache is disabled automatically to save space for truly small queries. This means that you can keep the 'use\_uncompressed\_cache' setting always set to 1.
## use\_variant\_as\_common\_type[β](https://clickhouse.com/docs/operations/settings/settings#use_variant_as_common_type "Direct link to use_variant_as_common_type")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Allows to use `Variant` type as a result type for [if](https://clickhouse.com/docs/sql-reference/functions/conditional-functions#if)/[multiIf](https://clickhouse.com/docs/sql-reference/functions/conditional-functions#multiIf)/[array](https://clickhouse.com/docs/sql-reference/functions/array-functions)/[map](https://clickhouse.com/docs/sql-reference/functions/tuple-map-functions) functions when there is no common type for argument types.
Example:
```
SET use_variant_as_common_type = 1;
SELECT toTypeName(if(number % 2, number, range(number))) as variant_type FROM numbers(1);
SELECT if(number % 2, number, range(number)) as variant FROM numbers(5);
```
```
ββvariant_typeββββββββββββββββββββ
β Variant(Array(UInt64), UInt64) β
ββββββββββββββββββββββββββββββββββ
ββvariantββββ
β [] β
β 1 β
β [0,1] β
β 3 β
β [0,1,2,3] β
βββββββββββββ
```
```
SET use_variant_as_common_type = 1;
SELECT toTypeName(multiIf((number % 4) = 0, 42, (number % 4) = 1, [1, 2, 3], (number % 4) = 2, 'Hello, World!', NULL)) AS variant_type FROM numbers(1);
SELECT multiIf((number % 4) = 0, 42, (number % 4) = 1, [1, 2, 3], (number % 4) = 2, 'Hello, World!', NULL) AS variant FROM numbers(4);
```
```
βvariant_typeββββββββββββββββββββββββββ
β Variant(Array(UInt8), String, UInt8) β
ββββββββββββββββββββββββββββββββββββββββ
ββvariantββββββββ
β 42 β
β [1,2,3] β
β Hello, World! β
β α΄Ία΅α΄Έα΄Έ β
βββββββββββββββββ
```
```
SET use_variant_as_common_type = 1;
SELECT toTypeName(array(range(number), number, 'str_' || toString(number))) as array_of_variants_type from numbers(1);
SELECT array(range(number), number, 'str_' || toString(number)) as array_of_variants FROM numbers(3);
```
```
ββarray_of_variants_typeβββββββββββββββββββββββββ
β Array(Variant(Array(UInt64), String, UInt64)) β
βββββββββββββββββββββββββββββββββββββββββββββββββ
ββarray_of_variantsββ
β [[],0,'str_0'] β
β [[0],1,'str_1'] β
β [[0,1],2,'str_2'] β
βββββββββββββββββββββ
```
```
SET use_variant_as_common_type = 1;
SELECT toTypeName(map('a', range(number), 'b', number, 'c', 'str_' || toString(number))) as map_of_variants_type from numbers(1);
SELECT map('a', range(number), 'b', number, 'c', 'str_' || toString(number)) as map_of_variants FROM numbers(3);
```
```
ββmap_of_variants_typeβββββββββββββββββββββββββββββββββ
β Map(String, Variant(Array(UInt64), String, UInt64)) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββ
ββmap_of_variantsββββββββββββββββ
β {'a':[],'b':0,'c':'str_0'} β
β {'a':[0],'b':1,'c':'str_1'} β
β {'a':[0,1],'b':2,'c':'str_2'} β
βββββββββββββββββββββββββββββββββ
```
## use\_variant\_default\_implementation\_for\_comparisons[β](https://clickhouse.com/docs/operations/settings/settings#use_variant_default_implementation_for_comparisons "Direct link to use_variant_default_implementation_for_comparisons")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Enables or disables default implementation for Variant type in comparison functions.
## use\_with\_fill\_by\_sorting\_prefix[β](https://clickhouse.com/docs/operations/settings/settings#use_with_fill_by_sorting_prefix "Direct link to use_with_fill_by_sorting_prefix")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Columns preceding WITH FILL columns in ORDER BY clause form sorting prefix. Rows with different values in sorting prefix are filled independently
## validate\_enum\_literals\_in\_operators[β](https://clickhouse.com/docs/operations/settings/settings#validate_enum_literals_in_operators "Direct link to validate_enum_literals_in_operators")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
If enabled, validate enum literals in operators like `IN`, `NOT IN`, `==`, `!=` against the enum type and throw an exception if the literal is not a valid enum value.
## validate\_mutation\_query[β](https://clickhouse.com/docs/operations/settings/settings#validate_mutation_query "Direct link to validate_mutation_query")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Validate mutation queries before accepting them. Mutations are executed in the background, and running an invalid query will cause mutations to get stuck, requiring manual intervention.
Only change this setting if you encounter a backward-incompatible bug.
## validate\_polygons[β](https://clickhouse.com/docs/operations/settings/settings#validate_polygons "Direct link to validate_polygons")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
Enables or disables throwing an exception in the [pointInPolygon](https://clickhouse.com/docs/sql-reference/functions/geo/coordinates#pointinpolygon) function, if the polygon is self-intersecting or self-tangent.
Possible values:
- 0 β Throwing an exception is disabled. `pointInPolygon` accepts invalid polygons and returns possibly incorrect results for them.
- 1 β Throwing an exception is enabled.
## vector\_search\_filter\_strategy[β](https://clickhouse.com/docs/operations/settings/settings#vector_search_filter_strategy "Direct link to vector_search_filter_strategy")
| Type | Default value |
|---|---|
| TypeVectorSearchFilterStrategy | Default valueauto |
If a vector search query has a WHERE clause, this setting determines if it is evaluated first (pre-filtering) OR if the vector similarity index is checked first (post-filtering). Possible values:
- 'auto' - Postfiltering (the exact semantics may change in future).
- 'postfilter' - Use vector similarity index to identify the nearest neighbours, then apply other filters
- 'prefilter' - Evaluate other filters first, then perform brute-force search to identify neighbours.
## vector\_search\_index\_fetch\_multiplier[β](https://clickhouse.com/docs/operations/settings/settings#vector_search_index_fetch_multiplier "Direct link to vector_search_index_fetch_multiplier")
**Aliases**: `vector_search_postfilter_multiplier`
| Type | Default value |
|---|---|
| TypeFloat | Default value1 |
Multiply the number of fetched nearest neighbors from the vector similarity index by this number. Only applied for post-filtering with other predicates or if setting 'vector\_search\_with\_rescoring = 1'.
## vector\_search\_with\_rescoring[β](https://clickhouse.com/docs/operations/settings/settings#vector_search_with_rescoring "Direct link to vector_search_with_rescoring")
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
If ClickHouse performs rescoring for queries that use the vector similarity index. Without rescoring, the vector similarity index returns the rows containing the best matches directly. With rescoring, the rows are extrapolated to granule level and all rows in the granule are checked again. In most situations, rescoring helps only marginally with accuracy but it deteriorates performance of vector search queries significantly. Note: A query run without rescoring and with parallel replicas enabled may fall back to rescoring.
## wait\_changes\_become\_visible\_after\_commit\_mode[β](https://clickhouse.com/docs/operations/settings/settings#wait_changes_become_visible_after_commit_mode "Direct link to wait_changes_become_visible_after_commit_mode")
| Type | Default value |
|---|---|
| TypeTransactionsWaitCSNMode | Default valuewait\_unknown |
Wait for committed changes to become actually visible in the latest snapshot
## wait\_for\_async\_insert[β](https://clickhouse.com/docs/operations/settings/settings#wait_for_async_insert "Direct link to wait_for_async_insert")
| Type | Default value |
|---|---|
| TypeBool | Default value1 |
If true wait for processing of asynchronous insertio
## wait\_for\_async\_insert\_timeout[β](https://clickhouse.com/docs/operations/settings/settings#wait_for_async_insert_timeout "Direct link to wait_for_async_insert_timeout")
| Type | Default value |
|---|---|
| TypeSeconds | Default value120 |
Timeout for waiting for processing asynchronous insertio
## wait\_for\_window\_view\_fire\_signal\_timeout[β](https://clickhouse.com/docs/operations/settings/settings#wait_for_window_view_fire_signal_timeout "Direct link to wait_for_window_view_fire_signal_timeout")
| Type | Default value |
|---|---|
| TypeSeconds | Default value10 |
Timeout for waiting for window view fire signal in event time processing
## webassembly\_udf\_max\_fuel[β](https://clickhouse.com/docs/operations/settings/settings#webassembly_udf_max_fuel "Direct link to webassembly_udf_max_fuel")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value100000 |
Fuel limit per WebAssembly UDF instance execution. Each WebAssembly instruction consumes some amount of fuel. Set to 0 for no limit.
## webassembly\_udf\_max\_input\_block\_size[β](https://clickhouse.com/docs/operations/settings/settings#webassembly_udf_max_input_block_size "Direct link to webassembly_udf_max_input_block_size")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Maximum number of rows passed to a WebAssembly UDF in a single block. Set to 0 to process all rows at once.
## webassembly\_udf\_max\_instances[β](https://clickhouse.com/docs/operations/settings/settings#webassembly_udf_max_instances "Direct link to webassembly_udf_max_instances")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value32 |
Maximum number of WebAssembly UDF instances that can run in parallel per function.
## webassembly\_udf\_max\_memory[β](https://clickhouse.com/docs/operations/settings/settings#webassembly_udf_max_memory "Direct link to webassembly_udf_max_memory")
| Type | Default value |
|---|---|
| TypeUInt64 | Default value134217728 |
Memory limit in bytes per WebAssembly UDF instance.
## window\_view\_clean\_interval[β](https://clickhouse.com/docs/operations/settings/settings#window_view_clean_interval "Direct link to window_view_clean_interval")
| Type | Default value |
|---|---|
| TypeSeconds | Default value60 |
The clean interval of window view in seconds to free outdated data.
## window\_view\_heartbeat\_interval[β](https://clickhouse.com/docs/operations/settings/settings#window_view_heartbeat_interval "Direct link to window_view_heartbeat_interval")
| Type | Default value |
|---|---|
| TypeSeconds | Default value15 |
The heartbeat interval in seconds to indicate watch query is alive.
## workload[β](https://clickhouse.com/docs/operations/settings/settings#workload "Direct link to workload")
| Type | Default value |
|---|---|
| TypeString | Default valuedefault |
Name of workload to be used to access resources
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Write full paths (including s3://) into iceberg metadata files.
## write\_through\_distributed\_cache[β](https://clickhouse.com/docs/operations/settings/settings#write_through_distributed_cache "Direct link to write_through_distributed_cache")
ClickHouse Cloud only
| Type | Default value |
|---|---|
| TypeBool | Default value0 |
Only has an effect in ClickHouse Cloud. Allow writing to distributed cache (writing to s3 will also be done by distributed cache)
## write\_through\_distributed\_cache\_buffer\_size[β](https://clickhouse.com/docs/operations/settings/settings#write_through_distributed_cache_buffer_size "Direct link to write_through_distributed_cache_buffer_size")
ClickHouse Cloud only
| Type | Default value |
|---|---|
| TypeUInt64 | Default value0 |
Only has an effect in ClickHouse Cloud. Set buffer size for write-through distributed cache. If 0, will use buffer size which would have been used if there was not distributed cache.
## zstd\_window\_log\_max[β](https://clickhouse.com/docs/operations/settings/settings#zstd_window_log_max "Direct link to zstd_window_log_max")
| Type | Default value |
|---|---|
| TypeInt64 | Default value0 |
Allows you to select the max window log of ZSTD (it will not be used for MergeTree family) |
| Shard | 89 (laksa) |
| Root Hash | 12633450985039531489 |
| Unparsed URL | com,clickhouse!/docs/operations/settings/settings s443 |