Skip to main content
These settings are available in system.settings and are autogenerated from source.

max_analyze_depth

Maximum number of analyses performed by interpreter.

max_autoincrement_series

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

The maximum read speed in bytes per second for particular backup on server. Zero means unlimited.

max_block_size

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_columns_to_read

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.
This setting is useful for preventing overly complex queries.
0 value means unlimited.

max_compress_block_size

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.
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_consume_snapshots

Maximum number of Paimon snapshots to consume per incremental read. 0 means no limit.

max_estimated_execution_time

Maximum query estimate execution time in seconds. Checked on every data block when timeout_before_checking_execution_speed expires.

max_expanded_ast_elements

Maximum size of query syntax tree in number of nodes after expansion of aliases and the asterisk.

max_fetch_partition_retries_count

Amount of retries while fetching partition from another host.

max_final_threads

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

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_limit_for_vector_search_queries

SELECT queries with LIMIT bigger than this setting cannot use vector similarity indices. Helps to prevent memory overflows in vector similarity indices.

max_number_of_partitions_for_independent_aggregation

Maximal number of partitions in table to apply optimizatio

max_os_cpu_wait_time_ratio_to_throw

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

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_parsing_threads

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

Restriction on dropping partitions in query time. The value 0 means that you can drop partitions without any restrictions. Cloud default value: 1 TB.
This query setting overwrites its server setting equivalent, see max_partition_size_to_drop

max_parts_to_move

Limit the number of parts that can be moved in one query. Zero means unlimited.

max_projection_rows_to_use_projection_index

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

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.
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_recursive_cte_evaluation_depth

Maximum limit on recursive CTE evaluation depth

max_replica_delay_for_distributed_queries

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_reverse_dictionary_lookup_cache_size_bytes

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_sessions_for_user

Maximum number of simultaneous sessions per authenticated user to the ClickHouse server. Example:
Possible values:
  • Positive integer
  • 0 - infinite count of simultaneous sessions (default)

max_subquery_depth

If a query has more than the specified number of nested subqueries, throws an exception.
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

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.
This query setting overwrites its server setting equivalent, see max_table_size_to_drop

max_untracked_memory

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

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).
Last modified on July 24, 2026