ClickHouse® settings
For Managed Service for ClickHouse® clusters, you can configure ClickHouse® settings.
- Server-level settings: Configured at the shard or cluster level. In a custom ClickHouse® installation, you can change these settings only via configuration files, while in Managed Service for ClickHouse® clusters, only via Yandex Cloud interfaces.
- Query-level settings: Configured at the user, session, or query level.
- Quota settings: Configured at the user level.
Note
ClickHouse® supports more settings than Yandex Cloud interfaces. You can use SQL queries to modify ClickHouse® settings, e.g., configure ClickHouse® settings at the query level or change the settings for MergeTree tables.
The label next to the setting name helps determine which interface is used to set the value of this setting: the management console, CLI, API, SQL, or Terraform. The All interfaces label means that all of the above interfaces are supported.
Depending on the interface you select, the same setting will be represented differently, e.g.:
- Geobase uri in the management console is the same as:
geobase_uriin the gRPC API and Terraform.geobaseUriin the REST API.
- Allow DDL in the management console is the same as:
allow_ddlin the CLI, gRPC API, and SQL.allowDdlin the REST API.
Server-level settings
Note
To reset to default values using Terraform, specify these values explicitly for the settings in the manifest. Deleting settings from the manifest will not reset them to their defaults.
The following settings are available:
-
Access control improvements
Management consoleAccess control system settings:
-
Select from information schema requires grant: Sets whether the
SELECT * FROM information_schema.<table>query requires any permissions and whether any user can run the query. The default value isfalse. When set totrue, you need theGRANT SELECT ON information_schema.<table>permission to run the query, same as for ordinary tables. -
Select from system db requires grant: Sets whether the
SELECT * FROM system.<table>query requires any permissions and whether any user can run the query. The default value isfalse. When set totrue, you need theGRANT SELECT ON system.<table>permission to run the query, same as for ordinary tables.
For more information, see this ClickHouse® guide
. -
-
Asynchronous insert log enabled
Management consoleCLIAPISets whether to log information about asynchronous inserts. Such logs will be saved to the
system.asynchronous_insert_logtable.The default value is
false. Changing this setting will restart ClickHouse® servers on the cluster hosts.For more information, see this ClickHouse® guide
. -
Asynchronous insert log retention size
Management consoleCLIAPISize of the
system.asynchronous_insert_logtable, in bytes, exceeding which will trigger deletion of old records from that table.The default value is
0, i.e., old records will not be deleted irrespective of the table size. -
Asynchronous insert log retention time
Management consoleCLIAPITime interval, in milliseconds, between adding a record to the
system.asynchronous_insert_logtable and deleting the record. This value must be a multiple of 1,000.The default value is
2592000000(30 days). If0, the records will be stored indefinitely. -
Asynchronous metric log enabled
Management consoleCLIAPISets whether to log historical metric values from the
system.asynchronous_metricstable to thesystem.asynchronous_metric_logtable.The default value is
false. Changing this setting will restart ClickHouse® servers on the cluster hosts.For more information, see this ClickHouse® guide
. -
Asynchronous metric log retention size
Management consoleCLIAPISize of the
system.asynchronous_metric_logtable, in bytes, exceeding which will trigger deletion of old records from that table.The default value is
0, i.e., old records will not be deleted irrespective of the table size. -
Asynchronous metric log retention time
Management consoleCLIAPITime interval, in milliseconds, between adding a record to the
system.asynchronous_metric_logtable and deleting the record. This value must be a multiple of 1,000.The default value is
2592000000(30 days). If0, the records will be stored indefinitely. -
Background buffer flush schedule pool size
Management consoleNumber of threads for background data flushing in Buffer
tables.The minimum value is
1and the default is16. Changing this setting will restart ClickHouse® servers on the cluster hosts.For more information, see this ClickHouse® guide
. -
Background common pool size
Management consoleAPINumber of threads for common background operations, such as file system clean up, in MergeTree
tables.The minimum value is
1and the default is8. Changing this setting will restart ClickHouse® servers on the cluster hosts.For more information, see this ClickHouse® guide
. -
Background distributed schedule pool size
Management consoleNumber of threads for background operations in Distributed
tables.The minimum value is
1and the default is16. Changing this setting will restart ClickHouse® servers on the cluster hosts.For more information, see this ClickHouse® guide
. -
Background fetches pool size
Management consoleAPINumber of threads for background data copying from a replica in ReplicatedMergeTree
tables.The minimum value is
1; for ClickHouse® 24.12 or lower, the default value is16; for 25.1 or higher,32. Changing this setting will restart ClickHouse® servers on the cluster hosts.For more information, see this ClickHouse® guide
. -
Background merges mutations concurrency ratio
Management consoleCLIAPINumber of background merges and mutations that each thread can run concurrently.
The default value is
2. Changing this setting will restart ClickHouse® servers on the cluster hosts.For more information, see this ClickHouse® guide
. -
Background message broker schedule pool size
Management consoleNumber of threads for background message translation operations. This setting gets a new value when restarting the ClickHouse® server.
The minimum value is
1and the default is16. Changing this setting will restart ClickHouse® servers on the cluster hosts.For more information, see this ClickHouse® guide
. -
Background move pool size
Management consoleNumber of threads for background moves of data parts in MergeTree
tables.The minimum value is
1and the default is8. Changing this setting will restart ClickHouse® servers on the cluster hosts.For more information, see this ClickHouse® guide
. -
Background pool size
Management consoleAPITerraformNumber of threads for background merges and mutations
in MergeTree tables.The minimum value is
1and the default is16. Changing this setting will restart ClickHouse® servers on the cluster hosts.For more information, see this ClickHouse® guide
. -
Background schedule pool size
Management consoleAPITerraformNumber of threads for background jobs. It is used for replicated tables, streams in Apache Kafka®, and updating IP addresses of records in the internal DNS cache.
The minimum value is
1and the default is128. Changing this setting will restart ClickHouse® servers on the cluster hosts. -
Compression
Management consoleAPITerraformData compression rules for MergeTree
tables. For each rule, you need to specify the following:- Level: Compression level. It is only available for the zstd
compression method. The minimum value is1, the maximum value is12, and the default value is9. - Method: Compression method. You can use either LZ4
or zstd . - Min part size: Minimum size of a data part
, in bytes. - Min part size ratio: Ratio between the smallest table part size and full table size. ClickHouse® will only apply the rule to the tables where this ratio does not exceed Min part size ratio.
You can add multiple compression rules. ClickHouse® will check the Min part size and Min part size ratio conditions and apply the rules to those tables that meet both of them. If multiple rules may apply to the same table, ClickHouse® applies the first one. If none of the rules apply, ClickHouse® will use the LZ4
compression method.Changing this setting will restart ClickHouse® servers on the cluster hosts.
For more information, see this ClickHouse® guide
. - Level: Compression level. It is only available for the zstd
-
Default database
Management consoleAPIDefault database. To learn how to get a list of cluster databases, see Managing databases.
Changing this setting will restart ClickHouse® servers on the cluster hosts.
-
Dictionaries lazy load
Management consoleCLITerraformAPISQLWith this setting enabled, each dictionary is loaded when you first use it. If the loading fails, the function that uses the dictionary will return an exception.
If the setting is disabled, the dictionaries are loaded when the server starts. The server waits for all the dictionaries to load before it starts processing connections.
By default, the setting is disabled for ClickHouse® 24.12 or lower and enabled for 25.1 or higher.
For more information, see this ClickHouse® guide
. -
Geobase enabled
Management consoleCLIAPIEnables/disables the built-in geobase dictionary.
The default value is
false. Changing this setting will restart ClickHouse® servers on the cluster hosts. -
Geobase uri
Management consoleCLIAPITerraformAddress of the archive containing the custom geobase in Object Storage.
Changing this setting will restart ClickHouse® servers on the cluster hosts.
-
Graphite rollup
Management consoleAPITerraformGraphiteMergeTree
engine configurations for Graphite data thinning and aggregation (rollup):- Name: Configuration name.
- Patterns: Thinning rules. A rule applies if the metric name matches the Regexp parameter value and the age of data matches the Retention parameter group value.
- Function: Aggregation function name.
- Regexp: Regular expression the metric name must match.
- Retention: Retention parameters. The function applies to the data with the age interval of [Age, Age + Precision]. You can set multiple groups of such parameters.
- Age: Minimum data age, in seconds.
- Precision: Accuracy of determining the age of the data, in seconds. The value must be a multiple of
86400(number of seconds in 24 hours).
You can set up multiple configurations and use them for different tables. Changing this setting will restart ClickHouse® servers on the cluster hosts.
To create
GraphiteMergeTreetables, specify column names for each one of such tables:- Path column name: Column with the metric name (
Graphitesensor). The default value isPath. - Time column name: Column with the time of measuring the metric. The default value is
Time. - Value column name: Column with the metric value. The default value is
Value. - Version column name: Column with the metric version. The default value is
Timestamp.
To learn more about Graphite support, see this ClickHouse® guide
. -
Jdbc bridge
Management consoleCLIAPITerraformJDBC bridge for queries against external databases. Specify the host and, optionally, port for accessing the data source.
Changing these settings will restart ClickHouse® servers on the cluster hosts.
For more information, see this ClickHouse® guide
. -
Kafka
Management consoleCLITerraformGlobal authentication settings for integration with Apache Kafka®
:-
Auto offset reset: Initial position from which a consumer starts reading messages. Starting from there, as the consumer reads incoming messages, it commits offsets for new ones. By default, no value is set (equivalent to
latest). For more information, see this Confluent guide . -
Debug: Context for debugging purposes. By default, the value is not set. You can only specify one value for this setting. For the list of possible values, see the
librdkafkalibrary page on GitHub . -
Enable ssl certificate verification: Sets whether to verify SSL certificates. The default value is
false. -
Max poll interval ms: Maximum interval, in milliseconds, between polls to get messages for high-level consumers. If exceeded, the user is removed from the group and a rebalance starts. No value is set by default (equivalent to
300000, 5 minutes). -
Sasl mechanism: SASL authentication:
GSSAPI(default): Authentication using Kerberos .PLAIN: Authentication using an unencrypted username-password pair .SCRAM-SHA-256andSCRAM-SHA-512: Authentication using the SCRAM family mechanisms .
By default, no value is set (equivalent to
GSSAPI). -
Sasl password: Apache Kafka® account password.
-
Sasl username: Apache Kafka® account name.
-
Security protocol: Security protocol used for authentication:
PLAINTEXT: Authentication credentials are sent as plain text.SSL: Authentication credentials are sent SSL encrypted.SASL_PLAINTEXT: Authentication credentials are sent as plain text using SASL.SASL_SSL: Authentication credentials are sent SSL encrypted using SASL.
By default, no value is set (equivalent to
PLAINTEXT). -
Session timeout ms: Timeout, in milliseconds, for a periodic signal from a user to maintain a client group session. If exceeded, the broker removes the user from the group and runs a rebalance. For ClickHouse® 25.1 or lower, the default value is
45000(45 s); for 25.2 or higher,30000(30 s).
Changing these settings will restart ClickHouse® servers on the cluster hosts.
Tip
If you want to specify authentication settings at the topic level, specify them when creating the Kafka table
or reuse them with named collections . -
-
Keep alive timeout
Management consoleCLIAPITerraformTime period, in seconds, from the moment ClickHouse® receives the last query until the connection is terminated. If a new query comes during this time interval, the connection is not terminated.
The default value is
3. Changing this setting will restart ClickHouse® servers on the cluster hosts. -
Log level
Management consoleCLIAPITerraformEvent logging level. At each next level, the log will contain complete information from the previous one:
ERROR: Information about cluster errors.WARNING: Information about events that may result in cluster errors.INFORMATION: Confirmations and information about events that do not result in cluster errors.DEBUG: System information for debugging.TRACE: All available information on the cluster operation.
For more information about logging levels, see this ClickHouse® guide
. -
Mark cache size
Management consoleCLIAPITerraformApproximate size, in bytes, of the mark cache used by MergeTree
table engines. The cache is shared by a cluster host. Memory is allocated as needed.The selected setting value is not a strict limit. ClickHouse® can make this cache a little smaller or larger.
The default value is
5368709120. Changing this setting will restart ClickHouse® servers on the cluster hosts. -
Max concurrent queries
Management consoleCLIAPITerraformMaximum number of concurrent queries.
The minimum value is
10and the default is500. Changing this setting will restart ClickHouse® servers on the cluster hosts. -
Max connections
Management consoleCLIAPITerraformMaximum number of inbound client connections. This setting does not account for connections established to run distributed subqueries.
The minimum value is
10and the default is4096. Changing this setting will restart ClickHouse® servers on the cluster hosts. -
Max partition size to drop
Management consoleCLIAPITerraformMaximum MergeTree
table partition size, in bytes, at which you can delete the table using aDROP TABLEquery. You can use this setting to avoid accidental deletion of tables with real data, as these tables tend to be larger than test ones.The default value is
53687091200(50 GB). When set to0, you can delete tables of any size. -
Max table size to drop
Management consoleCLIAPITerraformMaximum size, in bytes, of a MergeTree
table you can delete using aDROP TABLEquery. You can use this setting to avoid accidental deletion of tables with real data, as these tables tend to be larger than test ones.The default value is
53687091200(50 GB). When set to0, you can delete tables of any size. -
Merge tree
Management consoleCLIAPITerraformMergeTree engine configuration:
-
Allow remote fs zero copy replication: Sets whether to allow remote zero copy replication for S3 and HDFS disks.
The default value is
true. Changing this setting will restart ClickHouse® servers on the cluster hosts.For more information, see this ClickHouse® guide
. -
Check sample column is correct: When creating a table, checks that column data type is correct for sampling or sampling expressions.
By default, the check is enabled. You can disable it if you already have tables with incorrect sampling expressions. This will eliminate false negatives and exceptions when starting the server.
For more information, see this ClickHouse® guide
. -
Cleanup delay period: Time interval, in seconds, between running distributed DDL queries
to clean up outdated data.The default value is
30. Changing this setting will restart ClickHouse® servers on the cluster hosts.For more information, see this ClickHouse® guide
. -
Deduplicate merge projection mode
Management consoleCLI: Sets the background merge behavior in tables with projections:ignore: Ignore the parameter. Use this value only to ensure compatibility.throw: Generate an exception to prevent the projection parts from getting desynchronized.drop: Delete the affected part of the projection table.rebuild: Rebuild the affected part of the projection table.
By default, no value is set (equivalent to
throw). Changing this setting will restart ClickHouse® servers on the cluster hosts.For more information, see this ClickHouse® guide
. -
Inactive parts to delay insert: Number of inactive table data parts, exceeding which will trigger ClickHouse® to throttle the speed of table data inserts.
This setting is disabled by default (
0). Changing this setting will restart ClickHouse® servers on the cluster hosts.For more information, see this ClickHouse® guide
. -
Inactive parts to throw insert: Number of inactive table data parts, exceeding which will trigger ClickHouse® to throw the
Too many inactive parts ...exception.This setting is disabled by default (
0). Changing this setting will restart ClickHouse® servers on the cluster hosts.For more information, see this ClickHouse® guide
. -
Lightweight mutation projection mode
Management consoleCLI: Sets the simplified deletion behavior in tables with projections:throw: Generate an exception to prevent the projection parts from getting desynchronized.drop: Delete the affected part of the projection table.rebuild: Rebuild the affected part of the projection table.
By default, no value is set (equivalent to
throw). Changing this setting will restart ClickHouse® servers on the cluster hosts.For more information, see this ClickHouse® guide
. -
Materialize ttl recalculate only
Management consoleCLI: Enables applying modified TTL rules for tables or rows only when the query explicitly specifiesMATERIALIZE TTL.The default value is:
- For ClickHouse® versions 25.2 or higher:
true. Recalculates only the TTL info, which simplifies TTL materialization. - For ClickHouse® versions 25.1 or lower:
false. Complete TTL materialization is performed.
Changing this setting will restart ClickHouse® servers on the cluster hosts.
For more information, see this ClickHouse® guide
. - For ClickHouse® versions 25.2 or higher:
-
Max avg part size for too many parts: Maximum average size of active data parts in a table, in bytes, that triggers the Parts to delay insert and Parts to throw insert checks. If exceeded, data inserts into the table will neither slow down nor get rejected.
The minimum value is
0and the default is1073741824(1 GB). Changing this setting will restart ClickHouse® servers on the cluster hosts. -
Max bytes to merge at max space in pool: Maximum total size of data parts, in bytes, to merge when the background pool has available resources.
The default value is
161061273600(150 GB). Changing this setting will restart ClickHouse® servers on the cluster hosts.For more information, see this ClickHouse® guide
. -
Max bytes to merge at min space in pool: Maximum total size of data parts to merge when the background pool has minimum available resources.
The default value is
1048576(1 MB). Changing this setting will restart ClickHouse® servers on the cluster hosts.For more information, see this ClickHouse® guide
. -
Max cleanup delay period: Maximum period, in seconds, to clean up outdated data, such as query logs, data block and data part hashes.
Specify a value not smaller than that of Cleanup delay period.
The default value is
300. -
Max merge selecting sleep ms: Maximum timeout, in milliseconds, before trying to select parts to merge.
Specify a value not smaller than that of Merge selecting sleep ms.
The default value is
60000(one minute). If you specify a smaller value, selecting tasks will frequently run in the background task pool, which will result in a large amount of requests to ZooKeeper in large-scale clusters. -
Max number of merges with ttl in pool: Maximum number of TTL-based merges in the background pool.
The default value is
2. Changing this setting will restart ClickHouse® servers on the cluster hosts. -
Max parts in total: Number of active data parts in all table partitions, exceeding which will trigger ClickHouse® to throw the
Too many parts ...exception.For ClickHouse® 25.1 or lower, the default value is
100000; for 25.2 or higher,20000. Changing this setting will restart ClickHouse® servers on the cluster hosts.For more information, see this ClickHouse® guide
. -
Max replicated merges in queue: Maximum number of concurrent merge jobs in a
ReplicatedMergeTreequeue.The default value is
16. Changing this setting will restart ClickHouse® servers on the cluster hosts. -
Merge max block size: Number of rows in the blocks forming the data parts for merging.
The database reads rows from these data parts, then merges those rows and writes them to a new data part. The rows being read are stored in RAM, so this setting affects its size required to merge rows. The smaller the value, the less RAM is available, which slows down row merging.
The default value is
8192.For more information, see this ClickHouse® guide
. -
Merge selecting sleep ms: Timeout, in milliseconds, before trying to select data parts to merge after no parts were selected.
The default value is
5000(five seconds). Changing this setting will restart ClickHouse® servers on the cluster hosts.For more information, see this ClickHouse® guide
. -
Merge with recompression TTL timeout: Minimum timeout, in seconds, before merges with recompression of data with expired TTL.
The default value is
14400(four hours). Changing this setting will restart ClickHouse® servers on the cluster hosts.For more information, see this ClickHouse® guide
. -
Merge with TTL timeout: Minimum timeout, in seconds, before merges to delete data with expired TTL.
The default value is
14400(four hours). Changing this setting will restart ClickHouse® servers on the cluster hosts.For more information, see this ClickHouse® guide
. -
Min age to force merge on partition only: Sets whether to only merge partitions
based on the Min age to force merge seconds setting value.Forcing merges on partitions only is disabled by default. Changing this setting will restart ClickHouse® servers on the cluster hosts.
For more information, see this ClickHouse® guide
. -
Min age to force merge seconds: Minimum time, in seconds, before a data part is merged.
The default value is
0(merging is disabled). Changing this setting will restart ClickHouse® servers on the cluster hosts.For more information, see this ClickHouse® guide
. -
Min bytes for wide part: Minimum number of bytes a data part must have to be stored in
Wideformat. You can set it together with Min rows for wide part.If a data part has fewer bytes than the set value, it will be stored in
Compactformat.Changing this setting will restart ClickHouse® servers on the cluster hosts.
For more information, see this ClickHouse® guide
. -
Min rows for wide part: Minimum number of rows a data part must have to be stored in
Wideformat. You can set it together with Min bytes for wide part.If the number of rows in a data part is fewer than the set value, it will be stored in
Compactformat.Changing this setting will restart ClickHouse® servers on the cluster hosts.
For more information, see this ClickHouse® guide
. -
Number of free entries in pool to execute mutation: Threshold for free entries in the pool. If the number of entries in the pool falls below this value, ClickHouse® stops running mutations
. Thus, you can have free threads for merges and avoid theToo many parts ...exception.The default value is
20. Changing this setting will restart ClickHouse® servers on the cluster hosts.For more information, see this ClickHouse® guide
. -
Number of free entries in pool to lower max size of merge: Threshold for free entries in the pool. If the number of entries in the pool falls below this value, ClickHouse® reduces the maximum size of a data part to merge. This helps handle small merges faster.
The default value is
8. Changing this setting will restart ClickHouse® servers on the cluster hosts. -
Parts to delay insert: Number of active table data parts, exceeding which will trigger ClickHouse® to throttle the speed of table data inserts. An active data part is a new data part you get from a merge.
For ClickHouse® 24.12 or lower, the default value is
150; for 25.1 or higher,1000. Changing this setting will restart ClickHouse® servers on the cluster hosts.For more information, see this ClickHouse® guide
. -
Parts to throw insert: Threshold for active table data parts, exceeding which will trigger ClickHouse® to throw the
Too many parts ...exception.For ClickHouse® 24.12 or lower, the default value is
300; for 25.1 or higher,3000. Changing this setting will restart ClickHouse® servers on the cluster hosts.For more information, see this ClickHouse® guide
. -
Replicated deduplication window: Number of blocks for recent hash inserts that ZooKeeper will store. Deduplication only works for the most recently inserted data. Old blocks will be deleted.
The default value is
100. Changing this setting will restart ClickHouse® servers on the cluster hosts.For more information, see this ClickHouse® guide
. -
Replicated deduplication window seconds: Time interval during which ZooKeeper stores blocks of recent hash inserts. Deduplication only works for the most recently inserted data. Old blocks will be deleted.
The default value is
604800. Changing this setting will restart ClickHouse® servers on the cluster hosts.For more information, see this ClickHouse® guide
. -
TTL only drop parts: Sets data drop mode based on TTL:
true: Drop complete data parts.false: Drop data row by row with additional data merges. This mode uses much more resources than dropping complete data parts.
The default value is
false. Changing this setting will restart ClickHouse® servers on the cluster hosts.For more information, see this ClickHouse® guide
.
-
-
Metric log enabled
Management consoleCLITerraformSets whether to log metric values from the
system.metricsandsystem.eventstables to thesystem.metric_logtable.The default value is
true. Changing this setting will restart ClickHouse® servers on the cluster hosts. -
Metric log retention size
Management consoleCLITerraformSize of the
system.metric_logtable, in bytes, exceeding which will trigger deletion of old records from that table.The default value is
536870912(0.5 GB). When set to0, old records will not be deleted irrespective of the table size. -
Metric log retention time
Management consoleCLITerraformTime interval, in milliseconds, between adding a record to the
system.metric_logtable and deleting the record. This value must be a multiple of 1,000.The default value is
2592000000(30 days). If0, the records will be stored indefinitely. -
Opentelemetry span log enabled
Management consoleSets whether to log trace and metric values from a distributed application. Such logs will be saved to the
system.opentelemetry_span_logtable.The default value is
false. Changing this setting will restart ClickHouse® servers on the cluster hosts.For more information, see this ClickHouse® guide
. -
Opentelemetry span log retention size
Management consoleCLIAPISize of the
system.opentelemetry_span_logtable, in bytes, exceeding which will trigger deletion of old records from that table.The default value is
0, i.e., old records will not be deleted irrespective of the table size. -
Opentelemetry span log retention time
Management consoleCLIAPITime interval, in milliseconds, between adding a record to the
system.opentelemetry_span_logtable and deleting the record. This value must be a multiple of 1,000.The default value is
2592000000(30 days). If0, the records will be stored indefinitely. -
Part log retention size
Management consoleCLITerraformSize of the
system.part_logtable, in bytes, exceeding which will trigger deletion of old records from that table.The default value is
536870912(0.5 GB). When set to0, old records will not be deleted irrespective of the table size. -
Part log retention time
Management consoleCLITerraformTime interval, in milliseconds, between adding a record to the
system.part_logtable and deleting the record. This value must be a multiple of 1,000.The default value is
2592000000(30 days). If0, the records will be stored indefinitely. -
Processors profile log enabled
Management consoleCLISets whether to log information about processor-level profiling. Such logs will be saved to the
system.processors_profile_logtable.The default value is:
- For ClickHouse® versions 25.2 or higher:
true. - For ClickHouse® versions 25.1 or lower:
false.
Changing this setting will restart ClickHouse® servers on the cluster hosts.
- For ClickHouse® versions 25.2 or higher:
-
Processors profile log retention size
Management consoleCLIMaximum size of the
system.processors_profile_logtable, in bytes, exceeding which will trigger automatic deletion of old records from that table.The default value is
0, i.e., old records will not be deleted irrespective of the table size. -
Processors profile log retention time
Management consoleCLITime interval, in milliseconds, between adding a record to the
system.processors_profile_logtable and deleting the record. This value must be a multiple of 1,000.The default value is
2592000000(30 days). If0, the records will be stored indefinitely. -
Query cache
Management consoleCLITerraformAPIQuery cache
settings. The cache allows you to runSELECTqueries only once and use the saved results in subsequent operations. This reduces latency and cluster resource consumption when processing queries.The available query cache settings include:
- Max entries: Maximum number of
SELECTquery results that can be cached. The default value is1024. - Max entry size in bytes: Maximum number of bytes to allocate in the cache for each
SELECTquery result. The default value is1048576(1 MB). - Max entry size in rows: Maximum number of rows to allocate in the cache for each
SELECTquery result. The default value is30000000. - Max size in bytes: Maximum cache size, in bytes. If set to
0, the query cache will be disabled. The default value is1073741824(1 GB).
You can learn more about these settings in this ClickHouse® guide
. - Max entries: Maximum number of
-
Query log retention size
Management consoleCLITerraformSize of the
system.query_logtable, in bytes, exceeding which will trigger deletion of old records from that table.The default value is
1073741824(1 GB). When set to0, old records will not be deleted irrespective of the table size. -
Query log retention time
Management consoleCLITerraformTime interval, in milliseconds, between adding a record to the
system.query_logtable and deleting the record. This value must be a multiple of 1,000.The default value is
2592000000(30 days). If0, the records will be stored indefinitely. -
Query masking rules
Management consoleCLITerraformAPIQuery masking
settings. Use these to apply regular expressions to queries and messages stored in logs. This makes data logging secure, as regular expressions help prevent leakage of sensitive data, such as names, emails, or bank card details.The available settings for the query masking rules include:
- Name: Rule name. This is an optional setting.
- Regexp: RE2 regular expression.
- Replace: Expression to replace the sensitive data. Six asterisks are used by default.
-
Query thread log enabled
Management consoleCLITerraformAPIActivates the
system.query_thread_logtable to log query threads in it. The logging also requires enabling the Log query threads setting.The default value is
true. Changing this setting will restart ClickHouse® servers on the cluster hosts.For more information, see this ClickHouse® guide
. -
Query thread log retention size
Management consoleCLITerraformSize of the
system.query_thread_logtable, in bytes, exceeding which will trigger deletion of old records from that table.The default value is
536870912(0.5 GB). When set to0, old records will not be deleted irrespective of the table size. -
Query thread log retention time
Management consoleCLITerraformTime interval, in milliseconds, between adding a record to the
system.query_thread_logtable and deleting the record. This value must be a multiple of 1,000.The default value is
2592000000(30 days). If0, the records will be stored indefinitely. -
Query views log enabled
Management consoleCLIAPISets whether to log information about dependent views executed when running queries. Such logs will be saved to the
system.query_views_logtable.The default value is
false. Changing this setting will restart ClickHouse® servers on the cluster hosts.For more information, see this ClickHouse® guide
. -
Query views log retention size
Management consoleCLIAPISize of the
system.query_views_logtable, in bytes, exceeding which will trigger deletion of old records from that table.The default value is
0, i.e., old records will not be deleted irrespective of the table size. -
Query views log retention time
Management consoleCLIAPITime interval, in milliseconds, between adding a record to the
system.query_views_logtable and deleting the record. This value must be a multiple of 1,000.The default value is
2592000000(30 days). If0, the records will be stored indefinitely. -
Rabbitmq
Management consoleCLIAPITerraformGlobal authentication settings for integration with RabbitMQ
:- Password: RabbitMQ account password.
- Username: RabbitMQ account name.
- Vhost: RabbitMQ virtual host address.
Changing these settings will restart ClickHouse® servers on the cluster hosts.
-
Session log enabled
Management consoleCLIAPISets whether to log information about successful and failed login/logout events. Such logs will be saved to the
system.session_logtable.The default value is
false. Changing this setting will restart ClickHouse® servers on the cluster hosts.For more information, see this ClickHouse® guide
. -
Session log retention size
Management consoleCLIAPISize of the
system.session_logtable, in bytes, exceeding which will trigger deletion of old records from that table.The default value is
0, i.e., old records will not be deleted irrespective of the table size. -
Session log retention time
Management consoleCLIAPITime interval, in milliseconds, between adding a record to the
system.session_logtable and deleting the record. This value must be a multiple of 1,000.The default value is
2592000000(30 days). If0, the records will be stored indefinitely. -
Text log enabled
Management consoleCLITerraformSets whether to write system logs. Such logs will be saved to the
system.text_logtable.The default value is
false. Changing this setting will restart ClickHouse® servers on the cluster hosts. -
Text log level
Management consoleCLITerraformEvent logging level in the system.text_log
table. At each next level, the log will contain complete information from the previous one:ERROR: Information about DBMS errors.WARNING: Information about events that may result in DBMS errors.INFORMATION: Confirmations and information about events that do not result in DBMS errors.DEBUG: System information for debugging.TRACE: All available information on the DBMS operation.
The default value is
TRACE. Changing this setting will restart ClickHouse® servers on the cluster hosts. -
Text log retention size
Management consoleCLITerraformSize of the
system.text_logtable, in bytes, exceeding which will trigger deletion of old records from that table.The default value is
536870912(0.5 GB). When set to0, old records will not be deleted irrespective of the table size. -
Text log retention time
Management consoleCLITerraformTime interval, in milliseconds, between adding a record to the
system.text_logtable and deleting the record. This value must be a multiple of 1,000.The default value is
2592000000(30 days). If0, the records will be stored indefinitely. -
Timezone
Management consoleCLIAPITerraformServer time zone. It is specified by the IANA identifier as the UTC time zone or geographical location, e.g., Africa/Abidjan.
Changing this setting will restart ClickHouse® servers on the cluster hosts.
For more information, see this ClickHouse® guide
. -
Total memory profiler step
Management consoleAPIRAM, in bytes, for a stack trace at each memory allocation step. Data is stored in the
system.trace_logtable. Thequery_idvalue is an empty string.The default value is
4194304(4 MB). Changing this setting will restart ClickHouse® servers on the cluster hosts.For more information, see this ClickHouse® guide
. -
Total memory tracker sample probability
Management consolePercentage probability of logging information about accidental memory allocation and release. Such log records are stored in the
system.trace_logtable. Thetrace_typeparameter takes the value of theMemorySampleparameter. The probability is valid for each memory allocation or release event, regardless of the allocation size. Information is only selected when the amount of untracked memory exceeds the Total memory profiler step setting value.By default, accidental memory allocations and releases are not logged (
0). Changing this setting will restart ClickHouse® servers on the cluster hosts.For more information, see this ClickHouse® guide
. -
Trace log enabled
Management consoleCLITerraformSets whether to log stack traces collected by the query profiler. Stack traces are saved to the
system.trace_logtable.The default value is
true. Changing this setting will restart ClickHouse® servers on the cluster hosts. -
Trace log retention size
Management consoleCLITerraformSize of the
system.trace_logtable, in bytes, exceeding which will trigger deletion of old records from that table.The default value is
536870912(0.5 GB). When set to0, old records will not be deleted irrespective of the table size. -
Trace log retention time
Management consoleCLITerraformTime interval, in milliseconds, between adding a record to the
system.trace_logtable and deleting the record. This value must be a multiple of 1,000.The default value is
2592000000(30 days). If0, the records will be stored indefinitely. -
Uncompressed cache size
Management consoleCLIAPITerraformCache size, in bytes, for uncompressed data used by the MergeTree
table engines.The default value is
8589934592(8 GB). Changing this setting will restart ClickHouse® servers on the cluster hosts. -
Zookeeper log enabled
Management consoleCLIAPISets whether to log ZooKeeper server request and response parameters. Such logs will be saved to the
system.zookeeper_logtable.The default value is
false. Changing this setting will restart ClickHouse® servers on the cluster hosts.For more information, see this ClickHouse® guide
. -
Zookeeper log retention size
Management consoleCLIAPISize of the
system.zookeeper_logtable, in bytes, exceeding which will trigger deletion of old records from that table.The default value is
0, i.e., old records will not be deleted irrespective of the table size. -
Zookeeper log retention time
Management consoleCLIAPITime interval, in milliseconds, between adding a record to the
system.zookeeper_logtable and deleting the record. This value must be a multiple of 1,000.The default value is
2592000000(30 days). If0, the records will be stored indefinitely.
Query-level settings
DBMS settings
These settings apply at the individual user level.
Note
To reset to default values using Terraform, specify these values explicitly for the settings in the manifest. Deleting settings from the manifest will not reset them to their defaults.
The following settings are available:
-
Add HTTP CORS header
Management consoleCLIAPISQLAdds a CORS header to HTTP responses.
By default, no CORS header is included in HTTP responses.
-
Allow DDL
All interfacesSets whether to run DDL queries (
CREATE,ALTER,RENAME, and others).By default, DDL queries are allowed.
For more information, see this ClickHouse® guide
.See also the Readonly setting.
-
Allow introspection functions
Management consoleAPISQLEnables introspection functions
for query profiling.The possible values are:
0: Introspection functions are disabled.1: Introspection functions are enabled.
The default value is
0.For more information, see this ClickHouse® guide
. -
Allow suspicious low cardinality types
Management consoleAPISQLAllows using the LowCardinality
data type with fixed-size data types of up to 8 bytes.The possible values are:
0: Restricted use ofLowCardinality.1: Unrestricted use ofLowCardinality.
The default value is
0.For more information, see this ClickHouse® guide
. -
Any join distinct right table keys
Management consoleSQLEnables the deprecated behavior of the ClickHouse® server for
ANY INNER|LEFT JOIN.By default, the deprecated
JOINbehavior is disabled.For more information, see this ClickHouse® guide
. -
Async insert
Management consoleAPISQLEnables/disables asynchronous inserts. It only works for inserts over HTTP, without deduplication.
If this setting is enabled, data is inserted into a table in batches. This allows making small and frequent inserts in ClickHouse® (up to 15,000 queries per second) without using intermediate tables.
The possible values are:
0: Inserts are synchronous, one query after another.1: Multiple asynchronous inserts are enabled.
The default value is
0.For more information, see this ClickHouse® guide
. -
Async insert busy timeout
Management consoleAPISQLMaximum data insert timeout, in milliseconds, after the first
INSERTquery.The default value is
200. If0, there is no timeout.For more information, see this ClickHouse® guide
. -
Async insert max data size
Management consoleAPISQLMaximum size of raw data, in bytes, collected per query before inserting it.
The default value is
1000000. If0, asynchronous inserts are disabled.For more information, see this ClickHouse® guide
. -
Async insert stale timeout
Management consoleAPISQLMaximum data insert timeout, in milliseconds, after the last
INSERTquery. For non-zero values, Async insert busy timeout will increase with eachINSERTquery until the Async insert max data size value is exceeded.The default value is
0. If0, there is no timeout.For more information, see this ClickHouse® guide
. -
Async insert threads
Management consoleAPISQLMaximum number of threads for data background processing and inserts.
The default value is
16. If0, asynchronous inserts are disabled.For more information, see this ClickHouse® guide
. -
Async insert use adaptive busy timeout
Management consoleCLISQLSets whether to use an adaptive asynchronous insert, where ClickHouse® limits the number of inserts depending on the server load.
This setting is enabled by default.
For more information, see this ClickHouse® guide
. -
Cancel HTTP readonly queries on client close
Management consoleAPISQLIf enabled, the service cancels HTTP readonly queries, e.g., SELECT, when the client aborts a connection before receiving a response.
This setting is disabled by default.
For more information, see this ClickHouse® guide
. -
Compile expressions
Management consoleCLIAPISQLSets whether to compile expressions when running queries. With compilation enabled, queries that use identical expressions may run faster by using compiled expressions.
Use this setting in combination with Min count to compile expression.
Expression compilation is disabled by default.
-
Connect timeout
Management consoleCLIAPISQLConnection timeout, in milliseconds.
The minimum value is
1, the default value is10000(ten seconds). -
Connect timeout with failover
Management consoleAPISQLRemote server connection timeout, in milliseconds, for the
Distributedtable engine if a cluster uses sharding and replication.If unable to connect to the server, the system will retry connecting to its replicas.
The default value is
50.For more information, see this ClickHouse® guide
. -
Count distinct implementation
Management consoleCLIAPISets which
uniq*function runsCOUNT(DISTINCT …):By default, the
uniqExactfunction is used.For more information, see this ClickHouse® guide
. -
Data type default nullable
Management consoleCLISQLSets whether to use the
Nullabledata type by default in column definition without explicitNULLorNOT NULLmodifiers.This setting is disabled by default.
For more information, see this ClickHouse® guide
. -
Date time input format
Management consoleSQLSets which parser to use for a text representation of date and time when processing the input format:
best_effort: Extended parser.basic: Basic parser.
By default, the
basicparser is used.For more information, see this ClickHouse® guide
. -
Date time output format
Management consoleSQLSets the output format for a text representation of date and time:
simple: Simple format.iso: ISO format.unix_timestamp: Unix format.
The default format is
simple.For more information, see this ClickHouse® guide
. -
Deduplicate blocks in dependent materialized views
Management consoleSQLEnables checks for deduplication in materialized views that get data from replicated tables.
By default, the check is disabled (
0).For more information, see this ClickHouse® guide
. -
Distinct overflow mode
Management consoleCLIAPISQLSets the ClickHouse® behavior if the amount of data when running a
SELECT DISTINCTquery exceeds the limits :throw: Abort the query and return an error.break: Return a partial output.
By default, no value is set (equivalent to
throw). -
Distributed aggregation memory efficient
Management consoleCLIAPISQLSets whether to enable memory saving mode for distributed aggregation.
For distributed query processing, remote servers perform external aggregation. Enable this setting to reduce the RAM consumption on the server initiating the query.
By default, memory saving mode is disabled.
For more information, see this ClickHouse® guide
. -
Distributed ddl task timeout
All interfacesSets the timeout for responses to DDL queries from all cluster hosts. If a DDL query is not run on all hosts, the response will contain the timeout error and the query will be run in asynchronous mode. The possible values are:
- Positive integer: Timeout is equal to this integer, in seconds.
0: Asynchronous mode.- Negative number: Infinite timeout.
The default value is
180. -
Distributed product mode
Management consoleCLIAPISQLChanges the behavior of distributed subqueries when a query contains the product of distributed tables:
deny: Blocks the use of such subqueries.local: Replaces the database and table in a subquery with the destination server (shard) local database and table leaving the regularIN/JOIN.global: Replaces theIN/JOINquery with theGLOBAL IN/GLOBAL JOINone.allow: Allows the use of such subqueries.
By default, no value is set (equivalent to
deny).For more information, see this ClickHouse® guide
. -
Do not merge across partitions select final {#setting-do-not-merge-across-partitions-select-final}
Management consoleCLISQLSets whether to process table sections independently for
SELECTqueries with theFINALoperator.This setting is disabled by default.
For more information, see this ClickHouse® guide
. -
Empty result for aggregation by empty set
Management consoleCLIAPISQLSets the result format when aggregating data without keys (without
GROUP BY) for an empty set (e.g.,SELECT count(*) FROM table WHERE 0):- Disabled (default): ClickHouse® returns a single-line result with
NULLvalues for aggregation functions, in accordance with the SQL standard. - Enabled: ClickHouse® returns an empty result.
- Disabled (default): ClickHouse® returns a single-line result with
-
Enable HTTP compression
Management consoleCLIAPISQLSets whether to compress data in an HTTP response.
By default, ClickHouse® stores data in a compressed format. The request output is not compressed. For ClickHouse® to compress a request output when sending it over HTTP, enable this setting and provide your compression method in the
Accept-Encodingrequest header:gzipbrdeflate
By default, data compression in HTTP responses is disabled.
For more information, see this ClickHouse® guide
. -
Enable reads from query cache
Management consoleCLISQLSets whether to extract the results of
SELECTqueries from the query cache.This setting is enabled by default.
For more information, see this ClickHouse® guide
.See also Use query cache.
-
Enable writes to query cache
Management consoleCLISQLSets whether to save the results of
SELECTqueries to the query cache.This setting is enabled by default.
For more information, see this ClickHouse® guide
.See also Use query cache.
-
Fallback to stale replicas for distributed queries
Management consoleCLIAPISQLForces a query to a stale replica if up-to-date data is unavailable.
ClickHouse® will select the most up-to-date stale replica in the table. Use this setting when running
SELECTqueries from distributed tables pointing to replicated tables.By default, query forcing is enabled.
For more information, see this ClickHouse® guide
. -
Flatten nested
Management consoleAPISQLSets the data format for nested columns
.The possible values are:
0: Nested column is converted into an array of tuples.1: Nested column is converted into individual arrays.
The default value is
1.For more information, see this ClickHouse® guide
. -
Force index by date
Management consoleCLIAPISQLBlocks queries if you cannot use an index by date. This setting applies to tables of the MergeTree
family.By default, it is disabled, i.e., you can run queries.
For more information, see this ClickHouse® guide
. -
Force primary key
Management consoleCLIAPISQLBlocks queries if you cannot use an index by primary key. This setting applies to tables of the MergeTree
family.By default, it is disabled, i.e., you can run queries.
For more information, see this ClickHouse® guide
. -
Format avro schema registry url
Management consoleCLISQLURL of the Confluent schema registry for AvroConfluent format.
For more information, see this ClickHouse® guide
. -
Format regexp
Management consoleSQLSets a regular expression in re2 format
to apply to each row of imported data. The number of subtemplates (parenthetical groups) in the expression must be equal to the number of columns in the table the data is imported to. Use the\nor\r\nline break characters as delimiters; line breaks cannot be escaped. If a row does not match the regular expression, it is skipped.No value is set by default.
-
Format regexp escaping rule
Management consoleSQLSets the escaping rule for the regular expression specified in the Format regexp setting:
CSVEscapedJSONQuotedRawXML
The default value is
Raw, i.e., no escaping is used. -
Format regexp skip unmatched
Management consoleSQLOutputs an error message if a row in imported data cannot be split by the template specified in the Format regexp setting.
By default, no message is output (
0). -
Group by overflow mode
Management consoleCLIAPISQLSets the ClickHouse® behavior if, during aggregation, the number of unique keys exceeds the limit
:throw: Abort the query and return an error.break: Return a partial output.any: RunGROUP BYin fuzzy mode. The quality of this computation depends on the statistical properties of the data.
By default, no value is set (equivalent to
throw). -
Group by two level threshold
Management consoleCLIAPISQLSets the number of keys, reaching which triggers two-level aggregation.
The minimum value is
0, i.e., the number is not set. The default value is100000. -
Group by two level threshold bytes
Management consoleCLIAPISQLSets the number of bytes in the aggregated output, reaching which triggers two-level aggregation.
The minimum value is
0, i.e., the number is not set. The default value is50000000. -
Hedged connection timeout ms
Management consoleCLITerraformAPISQLTimeout, in milliseconds, for connecting to the replica to work with hedged requests. Use this setting in combination with Use hedged requests.
The default value is
50.For more information, see this ClickHouse® guide
. -
HTTP connection timeout
Management consoleCLIAPISQLSets the HTTP connection timeout, in milliseconds.
The minimum value is
1. The default value is1000(one second). -
HTTP headers progress interval
Management consoleCLIAPISQLSets the minimum interval, in milliseconds, between progress notifications with the
X-ClickHouse-ProgressHTTP header.The minimum value is
1and the default is100. -
HTTP max field name size
Management consoleCLISQLMaximum field name length in an HTTP header.
The default value is
131072.For more information, see this ClickHouse® guide
. -
HTTP max field value size
Management consoleCLISQLMaximum field value length in an HTTP header.
The default value is
131072.For more information, see this ClickHouse® guide
. -
HTTP receive timeout
Management consoleCLIAPISQLSets the timeout for receiving data over HTTP, in milliseconds.
The minimum value is
1; the default value is1800000(30 minutes). -
HTTP send timeout
Management consoleCLIAPISQLSets the timeout for sending data over HTTP, in milliseconds.
The minimum value is
1; the default value is1800000(30 minutes). -
Idle connection timeout
Management consoleCLITerraformAPISQLTimeout for closing idle TCP connections, in milliseconds.
If set to
0, all connections are closed immediately.The default value is
360000(six minutes).For more information, see this ClickHouse® guide
. -
Ignore materialized views with dropped target table
Management consoleCLISQLSets whether to ignore materialized views with a deleted target table when switching to views.
This setting is disabled by default.
For more information, see this ClickHouse® guide
. -
Input format defaults for omitted fields
Management consoleCLIAPISQLSets whether to write default values into omitted fields based on a column data type when inserting data with
INSERT.This setting is enabled by default.
For more information, see this ClickHouse® guide
. -
Input format import nested json
Management consoleSets whether to insert JSON data with nested objects.
Such data inserts are disabled by default.
For more information, see this ClickHouse® guide
. -
Input format null as default
Management consoleSQLSets whether to write default values in
NULLcells if the column data type does not allow storing theNULLvalue.This setting is enabled by default, i.e.,
NULLcells get default values.For more information, see this ClickHouse® guide
. -
Input format parallel parsing
Management consoleSets whether to split incoming data into parts and parse each of them concurrently while preserving the original sequence. This setting is only supported for TSV
, TKSV , CSV , and JSONEachRow formats.By default, such splitting of incoming data is enabled.
For more information, see this ClickHouse® guide
. -
Input format values interpret expressions
Management consoleCLIAPISQLEnables the SQL parser if the stream parser is unable to parse the data. Use this setting when inserting values containing SQL expressions into the table.
For instance, the stream parser cannot parse a value containing
now()while the SQL parser, if enabled, will do it correctly and insert the output of thenow()SQL function, i.e., current date and time.This setting is only used for Values
format when inserting data.By default, the SQL parser is enabled.
For more information, see this ClickHouse® guide
. -
Input format with names use header
Management consoleSQLSets whether to check the order of columns when inserting data.
By default, the check is enabled.
For more information, see this ClickHouse® guide
. -
Insert keeper max retries
Management consoleCLIAPIThe maximum number of retries for ClickHouse® Keeper (or ZooKeeper) requests during inserts to replicated MergeTree
tables.The minimum value is
0, i.e., retries are disabled, and the default is20.For more information, see this ClickHouse® guide
. -
Insert null as default
Management consoleAPISQLEnables inserting default values
instead of NULL into columns that do not allow storingNULLvalues.The possible values are:
0: InsertingNULLinto a column that does not allowNULLwill throw an exception.1: Insert the default column value instead ofNULL.
The default value is
1.For more information, see this ClickHouse® guide
. -
Insert quorum
Management consoleCLIAPISQLManages a quorum write in a ClickHouse® cluster:
- If the value is less than 2, quorum writes are disabled.
- If the value is greater than or equal to 2, quorum writes are enabled.
Quorum writes ensure that ClickHouse® writes data error-free to the
Insert quorumreplicas during within a time period not exceeding Insert quorum timeout and that data is not lost if one or multiple replicas fail. All replicas in the quorum are consistent, i.e., they contain data from all the previousINSERTqueries.You can use the Select sequential consistency setting to read data written with
Insert quorum.By default, quorum writes are disabled (
0).For more information, see this ClickHouse® guide
. -
Insert quorum parallel
Management consoleSQLIf this setting is enabled, you can run multiple concurrent
INSERTqueries with quorum writes. If disabled, a singleINSERTquery with a quorum write will be made to the same table.This setting is enabled by default.
-
Insert quorum timeout
Management consoleCLIAPISQLSets the quorum write timeout, in milliseconds. If the timeout ends without a write, ClickHouse® will abort the
INSERTquery and return an error.The minimum value is
1000(one second). The default value is60000(one minute). -
Join algorithm
Management consoleSQLSets the
JOINalgorithm:auto: Hash join. However, if the server is running out of memory, ClickHouse® will attempt a merge join.direct: Join by searching the right-hand table rows, which serve as keys in the left-hand table. Joins are only possible if these two conditions are met:- Storage in the right-hand table supports key-value queries, e.g., Dictionary
or EmbeddedRocksDB . LEFTandINNER JOINclauses are running.
- Storage in the right-hand table supports key-value queries, e.g., Dictionary
hash: Hash join.parallel_hash: Type of hash join where data is split into segments and multiple hash tables are created at the same time instead of a single one.partial_merge: Type of sort-merge join where only the right-hand side of the table is completely sorted.prefer_partial_merge:partial_mergealgorithm. It is used whenever possible; otherwise, thehashalgorithm is used.sorting_merge: Sort-merge join.
For ClickHouse® 24.11 or lower, the default value is
direct,auto; for 24.12 or higher,direct,parallel_hash,hash. An available algorithm will be selected for a specific query depending on the table type and engine.For more information, see this ClickHouse® guide
. -
Join overflow mode
All interfacesSets the action ClickHouse® will perform if any of the following
JOINlimits is reached:max_bytes_in_joinmax_rows_in_join
The possible values are:
throw: ClickHouse® throws an exception and terminates the operation.break: ClickHouse® terminates the operation without throwing an exception.
The default action is
throw. -
Join use nulls
Management consoleCLISQLControls the behavior of
JOINclauses. If the setting is enabled, empty cells resulting from a join will getNULLvalues. Otherwise, the cells will get the default values based on the specific field type.This setting is disabled by default.
For more information, see this ClickHouse® guide
. -
Joined subquery requires alias
Management consoleCLISQLRequires aliases for subqueries when running the
JOINclause.If the setting is enabled, such a query will not be run:
SELECT col1, col2 FROM table1 JOIN (SELECT col3 FROM table2)The query with the specified alias will be successfully run:
SELECT col1, col2 FROM table1 JOIN (SELECT col3 FROM table2) AS MyQueryThis setting is enabled by default.
-
Load balancing
Management consoleCLITerraformAPISQLSets the replica selection algorithm used to send and process distributed queries. ClickHouse® counts the number of errors per replica and selects the one with the lowest value. If multiple replicas have the same number of errors, the Load balancing setting determines the order to sort the replicas in and which replica to select.
The possible values are:
-
random: Sends the query to a random replica. This is a default value.Its disadvantage is that host proximity is ignored.
-
nearest_hostname: Sends the query to the replica whose host name is the closest possible match to the server host name in the ClickHouse® configuration file. Let's assume you have a server namedexample-05-05-5and two replicas,example-05-05-7andexample-05-06-7. Theexample-05-05-7replica will be selected, as its name is only one character different from the server name.With this approach, distributed queries will be more likely sent to the same replicas located in proximity to each other. It eliminates the disadvantage of the
randomvalue. -
hostname_levenshtein_distance: To select a replica, the same principle applies as fornearest_hostname. However, the appropriate replica host name is determined by the Levenshtein distance . -
in_order: Sends the query to the replica in the order set in the ClickHouse® configuration file. In a Managed Service for ClickHouse® cluster, the replica located in the same availability zone as the host initiating distributed subqueries is the first one in the order.Its disadvantage is that if the first replica fails, its workload will be placed on the next replica, which will double that replica’s workload.
-
first_or_random: Sends the query to the first replica similarly toin_order. However, it has the advantage over thein_orderalgorithm: if the first replica in the list fails, a random replica is selected. -
round_robin: Applies the Round-Robin policy to select a replica. It is only used with queries supporting this policy.
For more information, see this ClickHouse® guide
. -
-
Local filesystem read method
Management consoleSets how to read data from the local file system.
The possible values are:
nmappreadpread_threadpoolread
The default value is
pread. -
Log processors profiles
Management consoleCLISQLSets whether to log information about processor-level profiling. Such logs will be saved to the
system.processors_profile_logtable.This setting is disabled by default. Changing this setting will restart ClickHouse® servers on the cluster hosts.
For more information, see this ClickHouse® guide
. -
Log queries probability
CLISQLSets whether to write only randomly selected queries with a specified probability to the
system.query_log,system.query_thread_log, andsystem.query_views_logtables. Random selection reduces the load in case of large number of queries per second.This setting is a positive floating-point number within the [0..1] range. For example, if set to
0,5, approximately half of the queries will be written to the system tables. If set to0, no queries will be written to the system tables. If set to1(by default), all queries will be written to the system tables.For more information, see this ClickHouse® guide
. -
Log query threads
Management consoleCLITerraformAPISQLEnables logging of threads which run queries. Such logs will be saved to the system.query_thread_log
table.This setting only applies when the Query thread log enabled setting is enabled. This setting is disabled by default.
It only applies for some users or queries.
For more information, see this ClickHouse® guide
. -
Log query views
Management consoleCLISQLSets whether to log information about dependent views in queries. Such logs will be saved to the
system.query_views_logtable.This setting is enabled by default.
For more information, see this ClickHouse® guide
. -
Low cardinality allow in native format
Management consoleCLIAPISQLSets whether to use LowCardinality type
in native format:- If this setting is enabled (by default), use native format.
- If the setting is disabled, do not use native format:
- For
SELECTqueries, convert LowCardinality columns to regular ones. - For
INSERTqueries, convert regular columns to LowCardinality.
- For
Columns of this type enable you to store data more efficiently as hash tables. Wherever possible, ClickHouse® uses LowCardinality columns.
Some third-party clients for ClickHouse® do not support LowCardinality columns and cannot correctly interpret the output of a query that contains columns of this type. Disabling this setting enables such clients to process query outputs correctly.
The official ClickHouse® client supports LowCardinality columns.
This setting is enabled by default.
-
Max ast depth
Management consoleCLIAPISQLMaximum nesting depth of a syntax tree.
For complex queries, the syntax tree may be too deep. This setting enables you to block unnecessarily complex or unoptimized queries for large tables.
For example, a
SELECT *query will mostly result in a deeper and more complex syntax tree than aSELECT ... WHERE ...query with constraints and conditions.The default value is
1000. If you set the value too small, ClickHouse® may not be able to run most queries. -
Max ast elements
Management consoleCLIAPISQLMaximum size of the query syntax tree, i.e., the number of tree nodes.
For complex queries, the syntax tree may contain too many elements. This setting enables you to block unnecessarily complex or unoptimized queries for large tables.
The default value is
50000. If you set the value too small, ClickHouse® may not be able to run most queries. -
Max block size
Management consoleCLIAPISQLData in ClickHouse® is processed by blocks, i.e., sets of column parts. This setting specifies the recommended block size (number of rows) that will be loaded when processing tables. You are charged for processing each block, so setting a small value can slow down processing.
The minimum value is
1and the default is65536. -
Max bytes before external group by
Management consoleCLIAPISQLData accumulated during the
GROUP BYaggregation is stored in RAM for a certain period of time. This parameter sets a threshold, in bytes, exceeding which will trigger data flush to disk to save RAM.Use this setting if your queries terminate with an error because there is not enough RAM to aggregate a large amount of data. If this is the case, set this parameter to a non-zero value to get ClickHouse® to flush data to disk and perform successful aggregation.
The minimum value is
0(GROUP BYis disabled in external memory). The default value is0.When using aggregation in the external memory, we recommend setting the value twice as low as Max memory usage. By default, the maximum memory usage is limited to 10 GB.
For more information, see this ClickHouse® guide
.See also Distributed aggregation memory efficient.
-
Max bytes before external sort
Management consoleCLIAPISQLThis setting is similar to the previous one, except that it is used for the sorting operation (
ORDER BY). -
Max bytes in distinct
Management consoleCLIAPISQLMaximum amount of uncompressed data, in bytes, occupied by a hash table when using
DISTINCT.The minimum and default value is
0, i.e., there is no limit. -
Max bytes in join
All interfacesMaximum amount of uncompressed data, in bytes, occupied by a hash table when using
JOIN.The minimum and default value is
0, i.e., there is no limit. -
Max bytes in set
All interfacesMaximum amount of uncompressed data, in bytes, occupied by a set created from a subquery in the
INsection.The minimum and default value is
0, i.e., there is no limit. -
Max bytes to read
Management consoleCLIAPISQLMaximum amount of uncompressed data, in bytes, that can be read from a table when running a query.
The minimum and default value is
0, i.e., there is no limit. -
Max bytes to sort
Management consoleCLIAPISQLMaximum amount of uncompressed data, in bytes, that can be read from a table before sorting. This setting helps limit RAM usage for sorting.
The minimum and default value is
0, i.e., there is no limit. -
Max bytes to transfer
Management consoleCLIAPISQLMaximum amount of uncompressed data, in bytes, that can be sent to a remote server or saved to a temporary table when using
GLOBAL IN.The minimum and default value is
0, i.e., there is no limit. -
Max columns to read
Management consoleCLIAPISQLMaximum number of columns that can be read from a table in a single query. Queries that require reading more columns will terminate with an error.
The minimum and default value is
0, i.e., there is no limit. -
Max concurrent queries for user
Management consoleAPISQLMaximum number of concurrently processed user queries to a MergeTree
table.The minimum value is
0, i.e., there is no limit. The default value is450.For more information, see this ClickHouse® guide
. -
Max execution time
Management consoleCLIAPISQLMaximum query run time, in milliseconds.
During sorting or merging and finalizing aggregations, the limit on the maximum query run time will not be checked and may be exceeded.
The minimum value is
0, i.e., there is no limit. The default value is600000. -
Max expanded ast elements
Management consoleCLIAPISQLMaximum query syntax tree size (number of tree nodes) after expansion of aliases and the asterisk.
For complex queries, the syntax tree may contain too many elements. This setting enables you to block unnecessarily complex or unoptimized queries for large tables.
The default value is
500000. If you set the value too small, ClickHouse® may not be able to run most queries. -
Max final threads
Management consoleMaximum number of parallel threads for a
SELECTquery with the FINAL modifier.The default value is equal to Max threads.
For more information, see this ClickHouse® guide
. -
Max HTTP get redirects
Management consoleAPISQLSets the maximum number of redirect hops in URL engine
tables for HTTP GET requests.If
0, redirect hops are not allowed.The default value is
0.For more information, see this ClickHouse® guide
. -
Max insert block size
Management consoleCLIAPISQLSets the size, in bytes, for blocks when inserting data into a table. This setting will only apply if a server creates such blocks.
The default value is
1048576.For more information, see this ClickHouse® guide
. -
Max insert threads
Management consoleCLITerraformAPISQLMaximum number of threads for the
INSERT SELECTquery.If the value is greater than
1, the threads will run in parallel. The default value is0.You can run
INSERT SELECTqueries in parallel only if using the Max threads setting to enable runningSELECTqueries in parallel.The greater the Max insert threads value is, the more cluster RAM is used.
For more information, see this ClickHouse® guide
. -
Max memory usage
Management consoleCLIAPISQLMaximum amount of RAM, in bytes, to run a query on a single server. This setting does not account for the amount of free memory or the total amount of a machine's memory. It applies to a single query on a single server.
The minimum and default value is
0, i.e., there is no limit. The maximum value is limited by Max server memory usage, which you cannot change directly. For more information, see Memory management in Managed Service for ClickHouse®. If the set value is greater than Max server memory usage, the latter is used.If you are using Max bytes before external
GROUP BYor Max bytes before external sort, we recommend setting their values to half of Max memory usage.For more information, see this ClickHouse® guide
. -
Max memory usage for user
Management consoleCLIAPISQLMaximum amount of RAM, in bytes, to run user queries on a single server. This setting does not account for the amount of free memory or the total amount of a machine's memory.
It applies to all user queries that run concurrently on the same server, as opposed to Max memory usage.
The minimum and default value is
0, i.e., there is no limit. -
Max network bandwidth
Management consoleCLIAPISQLMaximum network data transmission rate for a single query, in bytes per second.
The minimum and default value is
0, i.e., there is no limit. -
Max network bandwidth for user
Management consoleCLIAPISQLMaximum network data transmission rate, in bytes per second. This setting applies to all concurrent user queries, as opposed to Max network bandwidth.
The minimum and default value is
0, i.e., there is no limit. -
Max parser depth
Management consoleCLIAPIMaximum recursion depth in the recursive descent parser. It allows you to control the stack size.
The minimum value is
0, i.e., the recursion depth is not limited. The default value is1000.For more information, see this ClickHouse® guide
. -
Max partitions per insert block
Management consoleSQLLimits the maximum number of partitions per insert block.
The minimum value is
0, i.e., the number of partitions is not limited. The default value is100.For more information, see this ClickHouse® guide
. -
Max query size
Management consoleCLIAPISQLLimits the size of the largest part of a query, in bytes, that can be transferred to RAM for parsing using the SQL parser.
The minimum value is
1and the default is262144. -
Max read buffer size
Management consoleMaximum buffer size, in bytes, to read data from the file system.
The default value is
1048576(1 MB). -
Max replica delay for distributed queries
Management consoleCLIAPISQLMaximum replica delay, in milliseconds. If a replica delay is greater than this value, the replica is no longer used.
The minimum value is
1000(one second). The default value is300000(five minutes).See also Fallback to stale replicas for distributed queries.
-
Max result bytes
Management consoleCLIAPISQLMaximum size of an uncompressed data query output, in bytes. It also applies to subqueries and to parts of distributed queries that run on remote servers.
The minimum and default value is
0, i.e., there is no limit. -
Max result rows
Management consoleCLIAPISQLMaximum number of output rows. It also applies to subqueries and to parts of distributed queries that run on remote servers.
The minimum and default value is
0, i.e., there is no limit. -
Max rows in distinct
Management consoleCLIAPISQLLimits the maximum number of distinct rows when using
DISTINCT.The minimum and default value is
0, i.e., there is no limit. -
Max rows in join
All interfacesMaximum number of rows in a hash table used when joining tables. It applies to
SELECT… JOINoperations and theJointable engine.The minimum and default value is
0, i.e., there is no limit.For more information, see this ClickHouse® guide
. -
Max rows in set
All interfacesMaximum number of rows for a set created from a subquery in the
INsection.The minimum and default value is
0, i.e., there is no limit. -
Max rows to group by
Management consoleCLIAPISQLLimits the maximum number of unique keys received from the aggregation function. Use this setting to limit RAM usage during aggregation.
The minimum and default value is
0, i.e., there is no limit. -
Max rows to read
Management consoleCLIAPISQLMaximum number of rows that can be read from a table when running a query.
The minimum and default value is
0, i.e., there is no limit. -
Max rows to sort
Management consoleCLIAPISQLMaximum number of rows to sort. Use this setting to limit RAM usage during sorting.
The minimum and default value is
0, i.e., there is no limit. -
Max rows to transfer
Management consoleCLIAPISQLMaximum number of rows that can be sent to a remote server or saved in a temporary table when using
GLOBAL IN.The minimum and default value is
0, i.e., there is no limit. -
Max temporary columns
Management consoleCLIAPISQLMaximum number of temporary columns concurrently kept in RAM when running a query, including constant columns.
The minimum and default value is
0, i.e., there is no limit. -
Max temporary data on disk size for query
Management consoleCLIAPIMaximum amount of data, in bytes, consumed by temporary files on the disk for all concurrently running queries.
The minimum value is
0, i.e., there is no limit.For more information, see this ClickHouse® guide
. -
Max temporary data on disk size for user
Management consoleCLIAPIMaximum amount of data, in bytes, consumed by temporary files on the disk for all concurrently running user queries.
The minimum value is
0, i.e., there is no limit.For more information, see this ClickHouse® guide
. -
Max temporary non const columns
Management consoleCLIAPISQLMaximum number of temporary columns concurrently kept in RAM when running a query, excluding constant columns.
The minimum and default value is
0, i.e., there is no limit. -
Max threads
Management consoleCLIAPISQLMaximum number of query processing threads, excluding threads for reading data from remote servers. This setting applies to threads that perform the same stages of the query processing pipeline in parallel.
The minimum and default value is
0, i.e., the value is calculated automatically as the number of physical CPU cores excluding hyper-threading cores.For more information, see this ClickHouse® guide
. -
Memory overcommit ratio denominator
Management consoleCLIAPIMemory overcommit
limit, in GB, when the strict memory usage limit is reached at the user level.The minimum value is
0, i.e., there is no limit. The default value is1.For more information, see this ClickHouse® guide
. -
Memory overcommit ratio denominator for user
Management consoleCLIAPIMemory overcommit
limit, in GB, when the strict memory usage limit is reached globally.The minimum value is
0, i.e., there is no limit. The default value is1.For more information, see this ClickHouse® guide
. -
Memory profiler sample probability
Management consoleAPISQLThe system will log information about specific memory allocation and deallocation to the
system.trace_logfile of theMemorySampletracing type with the specified probability. The logging probability does not depend on the size of the allocated/deallocated memory.You can specify values between
0and1. The default value is0. -
Memory profiler step
Management consoleAPISQLMemory profiler step, in bytes. Whenever query memory usage increases every next step greater than the number of bytes specified in this setting, the memory profiler will save the allocated stack trace. A value less than several MB slows down query processing.
The default value is
4194304(4 MB). If0, the memory profiler is disabled. -
Memory usage overcommit max wait microseconds
Management consoleCLIAPITimeout, in microseconds, for releasing memory in the event of user-level memory overcommit
.The default value is
5000000(five seconds).For more information, see this ClickHouse® guide
. -
Merge tree max bytes to use cache
Management consoleCLIAPISQLMaximum size of a query, in bytes, that uses the uncompressed data cache. Queries larger than the specified value do not use cache.
Use this setting in combination with the Use uncompressed cache setting.
The default value is
192x10x1024x1024. -
Merge tree max rows to use cache
Management consoleCLIAPISQLMaximum size of a query, in rows, that uses the uncompressed data cache. Queries larger than the specified value do not use cache.
Use this setting in combination with the Use uncompressed cache setting.
The default value is
128x8192. -
Merge tree min bytes for concurrent read
Management consoleCLIAPISQLIf the number of bytes read from a file exceeds this value, ClickHouse® will try to use multiple threads for concurrent data reads from this file.
The minimum value is
1and the default is24x10x1024x1024. -
Merge tree min rows for concurrent read
Management consoleCLIAPISQLIf the number of rows read from a file exceeds this value, ClickHouse® will try to use multiple threads for concurrent data reads from this file.
The minimum value is
1and the default is20x8192. -
Min bytes to use direct io
Management consoleCLIAPISQLAmount of data, in bytes, required for direct reading (direct I/O) from disk.
By default, ClickHouse® does not read data directly from a disk, relying on the file system and its cache instead. This reading strategy is effective for small amounts of data. If you need to read large amounts of data, it is more efficient to do it directly from the disk bypassing the file system cache.
If the total amount of data stored for reading is greater than the value of this setting, ClickHouse® will read the data directly from the disk.
The minimum and default value is
0, i.e., direct reads are disabled. -
Min count to compile
CLIAPISQLThis setting is deprecated.
It sets the minimum number of structurally identical queries that triggers compilation.
For a value of
0, compilation is performed in synchronous mode: a query waits for the compilation to finish and then resumes. We recommended setting this value only for testing purposes.For all other values, compilation is performed asynchronously in a separate thread: queries, currently running ones as well, will use the result as soon as it is available.
The minimum value is
0and the default is3. -
Min count to compile expression
Management consoleCLIAPISQLSets the minimum number of identical expressions that triggers expression compilation.
For a value of
0, compilation is performed in synchronous mode: an expression waits for the compilation to finish, then the query resumes. We recommended setting this value only for testing purposes.For all other values, compilation is performed asynchronously in a separate thread: queries, currently running ones as well, will use the result as soon as it is available.
The minimum value is
0and the default is3. -
Min execution speed
All interfacesMinimum query execution speed, in rows per second.
When running queries, ClickHouse® processes data in batches. If a batch is processed longer than the time set in timeout_before_checking_execution_speed
, the query execution speed is checked. If the speed is lower than the setting value, ClickHouse® throws an exception.The minimum and default value is
0, i.e., there is no limit.For more information, see this ClickHouse® guide
. -
Min execution speed bytes
All interfacesMinimum query execution speed, bytes per second.
When running queries, ClickHouse® processes data in batches. If a batch is processed longer than the time set in timeout_before_checking_execution_speed
, the query execution speed is checked. If the speed is lower than the setting value, ClickHouse® throws an exception.The minimum and default value is
0, i.e., there is no limit.For more information, see this ClickHouse® guide
. -
Min insert block size bytes
Management consoleCLIAPISQLMinimum block size, in bytes, that can be inserted into a table using
INSERT. Smaller blocks are squashed into bigger ones .The minimum value is
0, i.e., block squashing is disabled. The default value is268435456(256 MB). -
Min insert block size rows
Management consoleCLIAPISQLMinimum block size, in rows, that can be inserted into a table using
INSERT. Smaller blocks are squashed into bigger ones .The minimum value is
0, i.e., block squashing is disabled. The default value is1048576. -
Output format json quote denormals
Management consoleCLIAPISQLSets whether to output special values for floating-point numbers (
+nan,-nan,+inf, and-inf) when using JSON format.The default value is
false, i.e., special values are not output. -
Output format json quote_64bit integers
Management consoleCLIAPISQLSets the format of numbers in the JSON output. If this setting is enabled, 64-bit integers (
UInt64andInt64) are enclosed in quotes in a JSON output to maintain compatibility with most JavaScript engines; otherwise, no quotes are used.By default, enclosing 64-bit integers in quotes is disabled.
-
Prefer localhost replica
Management consoleCLITerraformAPISQLEnables sending distributed queries to the
localhostreplica.If the setting is enabled, Managed Service for ClickHouse® distributes queries based on the Load balancing value.
This setting is enabled by default.
Warning
If a cluster has a single shard and multiple replicas, disabling this setting may impair the health of the cluster.
For more information, see this ClickHouse® guide
. -
Priority
Management consoleCLIAPISQLSets the query priority:
0: No priority.1: The highest priority.- Other: The higher the number, the lower the query priority.
The value is set for each query individually.
If ClickHouse® receives a query with a higher priority, lower-priority queries are suspended until this query is completed.
The minimum and default value is
0. -
Query cache max entries
Management consoleCLISQLMaximum number of query results the current user can save in the query cache.
The minimum and default value is
0, i.e., there is no limit.For more information, see this ClickHouse® guide
.See also Use query cache.
-
Query cache max size in bytes
Management consoleCLISQLMaximum cache size, in bytes, for the user.
The minimum and default value is
0, i.e., there is no limit.For more information, see this ClickHouse® guide
.See also Use query cache.
-
Query cache min query duration
Management consoleCLISQLMinimum
SELECTquery duration, in milliseconds, for saving the results to the query cache.The minimum and default value is
0, i.e., there is no limit.For more information, see this ClickHouse® guide
.See also Use query cache.
-
Query cache min query runs
Management consoleCLISQLMinimum number of completed
SELECTqueries required for saving the results to the query cache.The minimum and default value is
0, i.e., there is no limit.For more information, see this ClickHouse® guide
.See also Use query cache.
-
Query cache nondeterministic function handling
Management consoleCLISQLSets how the query cache will process
SELECTqueries with non-determined functions, such asrand()ornow().The possible values are:
throw: To throw an exception without caching the query result.save: To cache the query result.ignore: Not to throw an exception and not to cache the query result.
By default, no value is set (equivalent to
throw).For more information, see this ClickHouse® guide
.See also Use query cache.
-
Query cache share between users
Management consoleCLISQLSets whether other users can read the results of the
SELECTqueries saved in the query cache. We do not recommend enabling this parameter for security reasons.This setting is disabled by default.
For more information, see this ClickHouse® guide
.See also Use query cache.
-
Query cache tag
Management consoleCLISQLString that serves as a tag for query cache entries. This setting allows you to cache multiple results of the same query. Queries with different tags are considered different.
For more information, see this ClickHouse® guide
.See also Use query cache.
-
Query cache ttl
Management consoleCLISQLTime, in seconds, after which entries in the query cache become stale.
The default value is
60.For more information, see this ClickHouse® guide
.See also Use query cache.
-
Quota mode
Management consoleCLISQLMode used to track resources utilized when quotas
are enabled:default: Keys are not used.keyed:quota_keyis provided in a user query parameter, and quotas are calculated individually for each key value.keyed_by_ip: Similar to the previous one, but a user IP address acts as the key. We recommend using this mode only if a user cannot change their IP address quickly, e.g., to bypass the quota restrictions. This applies to both IPv4 and IPv6 addresses.
By default, no value is set (equivalent to
default).For more information, see this ClickHouse® guide
. -
Read overflow mode
Management consoleCLIAPISQLSets the ClickHouse® behavior if the amount of read data exceeds one of the limits
:throw: Abort the query and return an error.break: Return a partial output.
By default, no value is set (equivalent to
throw). -
Readonly
Management consoleCLIAPISQLPermissions for configuration, read, and write queries:
0(default): Allows queries of all types.1: Only data read queries are allowed.2: Data read and configuration queries are allowed.
This setting does not apply to DDL queries. To enable or disable DDL queries, use the Allow DDL setting.
See also the example of creating a user with read-only access permissions.
-
Receive timeout
Management consoleCLIAPISQLTimeout for receiving data, in milliseconds.
The default value is
300000(five minutes). -
Remote filesystem read method
Management consoleCLIAPISets how to read data from a remote file system.
The possible values are:
readthreadpool
The default value is
threadpool. -
Replication alter partitions sync
Management consoleCLIAPISQLSets the wait mode for asynchronous actions on replicas for
ALTER ... ATTACH DETACH DROPqueries:0: Do not wait.1: Only wait for own execution. This is a default value.2: Wait for everyone.
For more information, see this ClickHouse® guide
. -
Result overflow mode
Management consoleCLIAPISQLSets the ClickHouse® behavior if the size of the result exceeds one of the limits
:throw: Abort the query and return an error.break: Return a partial output.
By default, no value is set (equivalent to
throw). -
Select sequential consistency
Management consoleCLIAPISQLSets whether to enable sequential consistency for
SELECTqueries.By default, sequential consistency is disabled.
For more information, see this ClickHouse® guide
. -
Send progress in HTTP headers
Management consoleCLIAPISQLEnables sending notifications regarding query execution status using
X-ClickHouse-Progressheaders.By default, notifications are disabled.
-
Send timeout
Management consoleCLIAPISQLTimeout for sending data, in milliseconds.
The default value is
300000(five minutes). -
Set overflow mode
All interfacesSets the ClickHouse® behavior if the amount of data exceeds one of the query complexity limits
:throw: Abort the query and return an error.break: Return a partial output.
By default, no value is set (equivalent to
throw). -
Skip unavailable shards
Management consoleCLIAPISQLEnables silent skipping of unavailable shards. A shard is considered unavailable if none of its replicas are available.
By default, silent skipping is disabled.
-
Sort overflow mode
Management consoleCLIAPISQLSets the ClickHouse® behavior if the number of rows received before sorting exceeds one of the limits
:throw: Abort the query and return an error.break: Return a partial output.
By default, no value is set (equivalent to
throw). -
Timeout before checking execution speed
Management consoleAPISQLTimeout, in milliseconds, for a query execution speed check. ClickHouse® checks that the execution speed is not lower than Min execution speed.
The default value is
60000(one minute).For more information, see this ClickHouse® guide
. -
Timeout overflow mode
Management consoleCLIAPISQLSets the ClickHouse® behavior if a query takes longer than max_execution_time:
throw: Abort the query and return an error.break: Return a partial output.
By default, no value is set (equivalent to
throw). -
Transfer overflow mode
Management consoleCLIAPISQLSets the ClickHouse® behavior if the amount of data to transfer to another server exceeds one of the limits
:throw: Abort the query and return an error.break: Return a partial output.
By default, no value is set (equivalent to
throw). -
Transform null in
Management consoleCLISQLIf this setting is enabled,
NULL = NULLreturnstruein theINoperator.This setting is disabled by default.
For more information, see this ClickHouse® guide
. -
Use hedged requests
Management consoleCLITerraformAPISQLEnables hedged requests.
This setting allows you to establish multiple connections to various replicas for queries. A new connection is established if the current connections to replicas were not successful within the Hedged connection timeout ms period.
The first connection that sent a non-empty query progress packet is used for this query. The other connections are canceled.
This setting is enabled by default.
For more information, see this ClickHouse® guide
. -
Use query cache
Management consoleCLISQLSets whether
SELECTqueries can use the query cache.This setting is disabled by default.
For more information, see this ClickHouse® guide
.See also Enable reads from query cache and Enable writes to query cache.
-
Use uncompressed cache
Management consoleCLIAPISQLSets whether to use a cache of uncompressed blocks. Using this type of cache can help significantly reduce latency and improve throughput for a large number of short queries (only for the MergeTree
family of tables). Enable this setting for users who frequently initiate small queries.By default, the cache is disabled.
For more information, see this ClickHouse® guide
.See also Merge tree max bytes to use cache and Merge tree max rows to use cache.
-
Wait for async insert
Management consoleAPISQLEnables waiting for asynchronous insert processing.
The possible values are:
0: The server returnsOKeven if a data insert is not completed yet.1: The server returnsOKonly after data is inserted.
The default value is
1.For more information, see this ClickHouse® guide
. -
Wait for async insert timeout
Management consoleAPISQLTimeout for asynchronous insert processing, in seconds.
The default value is
120. If0, there is no timeout.For more information, see this ClickHouse® guide
.
Custom settings
You can override custom settings
In Managed Service for ClickHouse®, the name of the custom setting must start with the custom_ predefined prefix. This prefix is non-editable, which means the users cannot change it.
Quota settings
Quotas allow you to limit the consumption of ClickHouse® resources for a specified time interval. Quota settings are set for an individual user.
If one of the quota limits is exceeded, the user will not be able to run new queries until the interval ends.
ClickHouse® will display a message about the quota being exceeded and give start time of the next interval, when the query ban will be lifted and the limit counters will be reset.
ClickHouse® also uses quotas to account for resource consumption.
For each user, there is a default quota that considers the consumption of all resources per hour but does not impose any restrictions.
The resource consumption level information is written to the ClickHouse® server log.
For more information, see the ClickHouse® documentation
You can use the following quota settings:
-
Errors
All interfacesLimits the total number of failed queries.
The minimum value is
0, i.e., there is no limit. -
Execution time
All interfacesLimits the total query execution time in milliseconds.
The minimum value is
0, i.e., there is no limit. -
Interval duration
All interfacesQuota interval, in milliseconds. This value must be a multiple of 1,000.
The minimum value is
1000(one second). -
Queries
All interfacesLimits the total number of queries.
The minimum value is
0, i.e., there is no limit. -
Read rows
All interfacesLimits the total number of source rows read from tables for running queries, including rows read from remote servers.
The minimum value is
0, i.e., there is no limit. -
Result rows
All interfacesLimits the total number of rows in query results.
The minimum value is
0, i.e., there is no limit.
ClickHouse® is a registered trademark of ClickHouse, Inc