Yandex Cloud
Search
Contact UsTry it for free
  • Customer Stories
  • Documentation
  • Blog
  • All Services
  • System Status
    • Featured
    • Infrastructure & Network
    • Data Platform
    • Containers
    • Developer tools
    • Serverless
    • Security
    • Monitoring & Resources
    • AI for business
    • Business tools
  • All Solutions
    • By industry
    • By use case
    • Economics and Pricing
    • Security
    • Technical Support
    • Start testing with double trial credits
    • Cloud credits to scale your IT product
    • Gateway to Russia
    • Cloud for Startups
    • Center for Technologies and Society
    • Yandex Cloud Partner program
    • Price calculator
    • Pricing plans
  • Customer Stories
  • Documentation
  • Blog
© 2025 Direct Cursus Technology L.L.C.
Yandex Managed Service for ClickHouse®
  • Getting started
    • Resource relationships
    • Host classes
    • Networking in Managed Service for ClickHouse®
    • Quotas and limits
    • Storage
    • Backups
    • Replication
    • Dictionaries
    • Sharding
    • Service users
    • Maintenance
    • Supported clients
    • Memory management
    • ClickHouse® versioning policy
    • ClickHouse® settings
  • Access management
  • Pricing policy
  • Terraform reference
  • Yandex Monitoring metrics
  • Audit Trails events
  • Public materials
  • Release notes

In this article:

  • Server-level settings
  • Query-level settings
  • DBMS settings
  • Custom settings
  • Quota settings
  1. Concepts
  2. ClickHouse® settings

ClickHouse® settings

Written by
Yandex Cloud
Updated at December 10, 2025
  • Server-level settings
  • Query-level settings
    • DBMS settings
    • Custom settings
  • Quota 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_uri in the gRPC API and Terraform.
    • geobaseUri in the REST API.
  • Allow DDL in the management console is the same as:
    • allow_ddl in the CLI, gRPC API, and SQL.
    • allowDdl in the REST API.

Server-level settingsServer-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 console

    Access 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 is false. When set to true, you need the GRANT 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 is false. When set to true, you need the GRANT 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 console CLI API

    Sets whether to log information about asynchronous inserts. Such logs will be saved to the system.asynchronous_insert_log table.

    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 console CLI API

    Size of the system.asynchronous_insert_log table, 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 console CLI API

    Time interval, in milliseconds, between adding a record to the system.asynchronous_insert_log table and deleting the record. This value must be a multiple of 1,000.

    The default value is 2592000000 (30 days). If 0, the records will be stored indefinitely.

  • Asynchronous metric log enabled Management console CLI API

    Sets whether to log historical metric values from the system.asynchronous_metrics table to the system.asynchronous_metric_log table.

    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 console CLI API

    Size of the system.asynchronous_metric_log table, 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 console CLI API

    Time interval, in milliseconds, between adding a record to the system.asynchronous_metric_log table and deleting the record. This value must be a multiple of 1,000.

    The default value is 2592000000 (30 days). If 0, the records will be stored indefinitely.

  • Background buffer flush schedule pool size Management console

    Number of threads for background data flushing in Buffer tables.

    The minimum value is 1 and the default is 16. Changing this setting will restart ClickHouse® servers on the cluster hosts.

    For more information, see this ClickHouse® guide.

  • Background common pool size Management console API

    Number of threads for common background operations, such as file system clean up, in MergeTree tables.

    The minimum value is 1 and the default is 8. Changing this setting will restart ClickHouse® servers on the cluster hosts.

    For more information, see this ClickHouse® guide.

  • Background distributed schedule pool size Management console

    Number of threads for background operations in Distributed tables.

    The minimum value is 1 and the default is 16. Changing this setting will restart ClickHouse® servers on the cluster hosts.

    For more information, see this ClickHouse® guide.

  • Background fetches pool size Management console API

    Number 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 is 16; 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 console CLI API

    Number 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 console

    Number of threads for background message translation operations. This setting gets a new value when restarting the ClickHouse® server.

    The minimum value is 1 and the default is 16. Changing this setting will restart ClickHouse® servers on the cluster hosts.

    For more information, see this ClickHouse® guide.

  • Background move pool size Management console

    Number of threads for background moves of data parts in MergeTree tables.

    The minimum value is 1 and the default is 8. Changing this setting will restart ClickHouse® servers on the cluster hosts.

    For more information, see this ClickHouse® guide.

  • Background pool size Management console API Terraform

    Number of threads for background merges and mutations in MergeTree tables.

    The minimum value is 1 and the default is 16. Changing this setting will restart ClickHouse® servers on the cluster hosts.

    For more information, see this ClickHouse® guide.

  • Background schedule pool size Management console API Terraform

    Number 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 1 and the default is 128. Changing this setting will restart ClickHouse® servers on the cluster hosts.

  • Compression Management console API Terraform

    Data 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 is 1, the maximum value is 12, and the default value is 9.
    • 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.

  • Default database Management console API

    Default 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 console CLI Terraform API SQL

    With 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 console CLI API

    Enables/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 console CLI API Terraform

    Address of the archive containing the custom geobase in Object Storage.

    Changing this setting will restart ClickHouse® servers on the cluster hosts.

  • Graphite rollup Management console API Terraform

    GraphiteMergeTree 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 GraphiteMergeTree tables, specify column names for each one of such tables:

    • Path column name: Column with the metric name (Graphite sensor). The default value is Path.
    • 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 console CLI API Terraform

    JDBC 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 console CLI Terraform

    Global 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 librdkafka library 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-256 and SCRAM-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 console CLI API Terraform

    Time 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 console CLI API Terraform

    Event logging level. At each next level, the log will contain complete information from the previous one:

    1. ERROR: Information about cluster errors.
    2. WARNING: Information about events that may result in cluster errors.
    3. INFORMATION: Confirmations and information about events that do not result in cluster errors.
    4. DEBUG: System information for debugging.
    5. TRACE: All available information on the cluster operation.

    For more information about logging levels, see this ClickHouse® guide.

  • Mark cache size Management console CLI API Terraform

    Approximate 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 console CLI API Terraform

    Maximum number of concurrent queries.

    The minimum value is 10 and the default is 500. Changing this setting will restart ClickHouse® servers on the cluster hosts.

  • Max connections Management console CLI API Terraform

    Maximum number of inbound client connections. This setting does not account for connections established to run distributed subqueries.

    The minimum value is 10 and the default is 4096. Changing this setting will restart ClickHouse® servers on the cluster hosts.

  • Max partition size to drop Management console CLI API Terraform

    Maximum MergeTree table partition size, in bytes, at which you can delete the table using a DROP TABLE query. 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 to 0, you can delete tables of any size.

  • Max table size to drop Management console CLI API Terraform

    Maximum size, in bytes, of a MergeTree table you can delete using a DROP TABLE query. 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 to 0, you can delete tables of any size.

  • Merge tree Management console CLI API Terraform

    MergeTree 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 console CLI: 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 console CLI: 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 console CLI: Enables applying modified TTL rules for tables or rows only when the query explicitly specifies MATERIALIZE 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.

    • 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 0 and the default is 1073741824 (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 ReplicatedMergeTree queue.

      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 Wide format. 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 Compact format.

      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 Wide format. 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 Compact format.

      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 the Too 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 console CLI Terraform

    Sets whether to log metric values from the system.metrics and system.events tables to the system.metric_log table.

    The default value is true. Changing this setting will restart ClickHouse® servers on the cluster hosts.

  • Metric log retention size Management console CLI Terraform

    Size of the system.metric_log table, in bytes, exceeding which will trigger deletion of old records from that table.

    The default value is 536870912 (0.5 GB). When set to 0, old records will not be deleted irrespective of the table size.

  • Metric log retention time Management console CLI Terraform

    Time interval, in milliseconds, between adding a record to the system.metric_log table and deleting the record. This value must be a multiple of 1,000.

    The default value is 2592000000 (30 days). If 0, the records will be stored indefinitely.

  • Opentelemetry span log enabled Management console

    Sets whether to log trace and metric values from a distributed application. Such logs will be saved to the system.opentelemetry_span_log table.

    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 console CLI API

    Size of the system.opentelemetry_span_log table, 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 console CLI API

    Time interval, in milliseconds, between adding a record to the system.opentelemetry_span_log table and deleting the record. This value must be a multiple of 1,000.

    The default value is 2592000000 (30 days). If 0, the records will be stored indefinitely.

  • Part log retention size Management console CLI Terraform

    Size of the system.part_log table, in bytes, exceeding which will trigger deletion of old records from that table.

    The default value is 536870912 (0.5 GB). When set to 0, old records will not be deleted irrespective of the table size.

  • Part log retention time Management console CLI Terraform

    Time interval, in milliseconds, between adding a record to the system.part_log table and deleting the record. This value must be a multiple of 1,000.

    The default value is 2592000000 (30 days). If 0, the records will be stored indefinitely.

  • Processors profile log enabled Management console CLI

    Sets whether to log information about processor-level profiling. Such logs will be saved to the system.processors_profile_log table.

    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.

  • Processors profile log retention size Management console CLI

    Maximum size of the system.processors_profile_log table, 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 console CLI

    Time interval, in milliseconds, between adding a record to the system.processors_profile_log table and deleting the record. This value must be a multiple of 1,000.

    The default value is 2592000000 (30 days). If 0, the records will be stored indefinitely.

  • Query cache Management console CLI Terraform API

    Query cache settings. The cache allows you to run SELECT queries 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 SELECT query results that can be cached. The default value is 1024.
    • Max entry size in bytes: Maximum number of bytes to allocate in the cache for each SELECT query result. The default value is 1048576 (1 MB).
    • Max entry size in rows: Maximum number of rows to allocate in the cache for each SELECT query result. The default value is 30000000.
    • Max size in bytes: Maximum cache size, in bytes. If set to 0, the query cache will be disabled. The default value is 1073741824 (1 GB).

    You can learn more about these settings in this ClickHouse® guide.

  • Query log retention size Management console CLI Terraform

    Size of the system.query_log table, in bytes, exceeding which will trigger deletion of old records from that table.

    The default value is 1073741824 (1 GB). When set to 0, old records will not be deleted irrespective of the table size.

  • Query log retention time Management console CLI Terraform

    Time interval, in milliseconds, between adding a record to the system.query_log table and deleting the record. This value must be a multiple of 1,000.

    The default value is 2592000000 (30 days). If 0, the records will be stored indefinitely.

  • Query masking rules Management console CLI Terraform API

    Query 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 console CLI Terraform API

    Activates the system.query_thread_log table 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 console CLI Terraform

    Size of the system.query_thread_log table, in bytes, exceeding which will trigger deletion of old records from that table.

    The default value is 536870912 (0.5 GB). When set to 0, old records will not be deleted irrespective of the table size.

  • Query thread log retention time Management console CLI Terraform

    Time interval, in milliseconds, between adding a record to the system.query_thread_log table and deleting the record. This value must be a multiple of 1,000.

    The default value is 2592000000 (30 days). If 0, the records will be stored indefinitely.

  • Query views log enabled Management console CLI API

    Sets whether to log information about dependent views executed when running queries. Such logs will be saved to the system.query_views_log table.

    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 console CLI API

    Size of the system.query_views_log table, 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 console CLI API

    Time interval, in milliseconds, between adding a record to the system.query_views_log table and deleting the record. This value must be a multiple of 1,000.

    The default value is 2592000000 (30 days). If 0, the records will be stored indefinitely.

  • Rabbitmq Management console CLI API Terraform

    Global 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 console CLI API

    Sets whether to log information about successful and failed login/logout events. Such logs will be saved to the system.session_log table.

    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 console CLI API

    Size of the system.session_log table, 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 console CLI API

    Time interval, in milliseconds, between adding a record to the system.session_log table and deleting the record. This value must be a multiple of 1,000.

    The default value is 2592000000 (30 days). If 0, the records will be stored indefinitely.

  • Text log enabled Management console CLI Terraform

    Sets whether to write system logs. Such logs will be saved to the system.text_log table.

    The default value is false. Changing this setting will restart ClickHouse® servers on the cluster hosts.

  • Text log level Management console CLI Terraform

    Event 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 console CLI Terraform

    Size of the system.text_log table, in bytes, exceeding which will trigger deletion of old records from that table.

    The default value is 536870912 (0.5 GB). When set to 0, old records will not be deleted irrespective of the table size.

  • Text log retention time Management console CLI Terraform

    Time interval, in milliseconds, between adding a record to the system.text_log table and deleting the record. This value must be a multiple of 1,000.

    The default value is 2592000000 (30 days). If 0, the records will be stored indefinitely.

  • Timezone Management console CLI API Terraform

    Server 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 console API

    RAM, in bytes, for a stack trace at each memory allocation step. Data is stored in the system.trace_log table. The query_id value 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 console

    Percentage probability of logging information about accidental memory allocation and release. Such log records are stored in the system.trace_log table. The trace_type parameter takes the value of the MemorySample parameter. 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 console CLI Terraform

    Sets whether to log stack traces collected by the query profiler. Stack traces are saved to the system.trace_log table.

    The default value is true. Changing this setting will restart ClickHouse® servers on the cluster hosts.

  • Trace log retention size Management console CLI Terraform

    Size of the system.trace_log table, in bytes, exceeding which will trigger deletion of old records from that table.

    The default value is 536870912 (0.5 GB). When set to 0, old records will not be deleted irrespective of the table size.

  • Trace log retention time Management console CLI Terraform

    Time interval, in milliseconds, between adding a record to the system.trace_log table and deleting the record. This value must be a multiple of 1,000.

    The default value is 2592000000 (30 days). If 0, the records will be stored indefinitely.

  • Uncompressed cache size Management console CLI API Terraform

    Cache 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 console CLI API

    Sets whether to log ZooKeeper server request and response parameters. Such logs will be saved to the system.zookeeper_log table.

    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 console CLI API

    Size of the system.zookeeper_log table, 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 console CLI API

    Time interval, in milliseconds, between adding a record to the system.zookeeper_log table and deleting the record. This value must be a multiple of 1,000.

    The default value is 2592000000 (30 days). If 0, the records will be stored indefinitely.

Query-level settingsQuery-level settings

DBMS settingsDBMS 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 console CLI API SQL

    Adds a CORS header to HTTP responses.

    By default, no CORS header is included in HTTP responses.

  • Allow DDL All interfaces

    Sets 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 console API SQL

    Enables 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 console API SQL

    Allows using the LowCardinality data type with fixed-size data types of up to 8 bytes.

    The possible values are:

    • 0: Restricted use of LowCardinality.
    • 1: Unrestricted use of LowCardinality.

    The default value is 0.

    For more information, see this ClickHouse® guide.

  • Any join distinct right table keys Management console SQL

    Enables the deprecated behavior of the ClickHouse® server for ANY INNER|LEFT JOIN.

    By default, the deprecated JOIN behavior is disabled.

    For more information, see this ClickHouse® guide.

  • Async insert Management console API SQL

    Enables/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 console API SQL

    Maximum data insert timeout, in milliseconds, after the first INSERT query.

    The default value is 200. If 0, there is no timeout.

    For more information, see this ClickHouse® guide.

  • Async insert max data size Management console API SQL

    Maximum size of raw data, in bytes, collected per query before inserting it.

    The default value is 1000000. If 0, asynchronous inserts are disabled.

    For more information, see this ClickHouse® guide.

  • Async insert stale timeout Management console API SQL

    Maximum data insert timeout, in milliseconds, after the last INSERT query. For non-zero values, Async insert busy timeout will increase with each INSERT query until the Async insert max data size value is exceeded.

    The default value is 0. If 0, there is no timeout.

    For more information, see this ClickHouse® guide.

  • Async insert threads Management console API SQL

    Maximum number of threads for data background processing and inserts.

    The default value is 16. If 0, asynchronous inserts are disabled.

    For more information, see this ClickHouse® guide.

  • Async insert use adaptive busy timeout Management console CLI SQL

    Sets 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 console API SQL

    If 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 console CLI API SQL

    Sets 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 console CLI API SQL

    Connection timeout, in milliseconds.

    The minimum value is 1, the default value is 10000 (ten seconds).

  • Connect timeout with failover Management console API SQL

    Remote server connection timeout, in milliseconds, for the Distributed table 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 console CLI API

    Sets which uniq* function runs COUNT(DISTINCT …):

    • uniq
    • uniqCombined
    • uniqCombined64
    • uniqHLL12
    • uniqExact

    By default, the uniqExact function is used.

    For more information, see this ClickHouse® guide.

  • Data type default nullable Management console CLI SQL

    Sets whether to use the Nullable data type by default in column definition without explicit NULL or NOT NULL modifiers.

    This setting is disabled by default.

    For more information, see this ClickHouse® guide.

  • Date time input format Management console SQL

    Sets 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 basic parser is used.

    For more information, see this ClickHouse® guide.

  • Date time output format Management console SQL

    Sets 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 console SQL

    Enables 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 console CLI API SQL

    Sets the ClickHouse® behavior if the amount of data when running a SELECT DISTINCT query 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 console CLI API SQL

    Sets 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 interfaces

    Sets 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 console CLI API SQL

    Changes 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 regular IN/JOIN.
    • global: Replaces the IN/JOIN query with the GLOBAL IN/GLOBAL JOIN one.
    • 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 console CLI SQL

    Sets whether to process table sections independently for SELECT queries with the FINAL operator.

    This setting is disabled by default.

    For more information, see this ClickHouse® guide.

  • Empty result for aggregation by empty set Management console CLI API SQL

    Sets 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 NULL values for aggregation functions, in accordance with the SQL standard.
    • Enabled: ClickHouse® returns an empty result.
  • Enable HTTP compression Management console CLI API SQL

    Sets 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-Encoding request header:

    • gzip
    • br
    • deflate

    By default, data compression in HTTP responses is disabled.

    For more information, see this ClickHouse® guide.

  • Enable reads from query cache Management console CLI SQL

    Sets whether to extract the results of SELECT queries 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 console CLI SQL

    Sets whether to save the results of SELECT queries 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 console CLI API SQL

    Forces 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 SELECT queries from distributed tables pointing to replicated tables.

    By default, query forcing is enabled.

    For more information, see this ClickHouse® guide.

    See also Max replica delay for distributed queries.

  • Flatten nested Management console API SQL

    Sets 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 console CLI API SQL

    Blocks 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 console CLI API SQL

    Blocks 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 console CLI SQL

    URL of the Confluent schema registry for AvroConfluent format.

    For more information, see this ClickHouse® guide.

  • Format regexp Management console SQL

    Sets 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 \n or \r\n line 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 console SQL

    Sets the escaping rule for the regular expression specified in the Format regexp setting:

    • CSV
    • Escaped
    • JSON
    • Quoted
    • Raw
    • XML

    The default value is Raw, i.e., no escaping is used.

  • Format regexp skip unmatched Management console SQL

    Outputs 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 console CLI API SQL

    Sets 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: Run GROUP BY in 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 console CLI API SQL

    Sets 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 is 100000.

  • Group by two level threshold bytes Management console CLI API SQL

    Sets 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 is 50000000.

  • Hedged connection timeout ms Management console CLI Terraform API SQL

    Timeout, 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 console CLI API SQL

    Sets the HTTP connection timeout, in milliseconds.

    The minimum value is 1. The default value is 1000 (one second).

  • HTTP headers progress interval Management console CLI API SQL

    Sets the minimum interval, in milliseconds, between progress notifications with the X-ClickHouse-Progress HTTP header.

    The minimum value is 1 and the default is 100.

  • HTTP max field name size Management console CLI SQL

    Maximum 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 console CLI SQL

    Maximum field value length in an HTTP header.

    The default value is 131072.

    For more information, see this ClickHouse® guide.

  • HTTP receive timeout Management console CLI API SQL

    Sets the timeout for receiving data over HTTP, in milliseconds.

    The minimum value is 1; the default value is 1800000 (30 minutes).

  • HTTP send timeout Management console CLI API SQL

    Sets the timeout for sending data over HTTP, in milliseconds.

    The minimum value is 1; the default value is 1800000 (30 minutes).

  • Idle connection timeout Management console CLI Terraform API SQL

    Timeout 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 console CLI SQL

    Sets 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 console CLI API SQL

    Sets 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 console

    Sets 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 console SQL

    Sets whether to write default values in NULL cells if the column data type does not allow storing the NULL value.

    This setting is enabled by default, i.e., NULL cells get default values.

    For more information, see this ClickHouse® guide.

  • Input format parallel parsing Management console

    Sets 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 console CLI API SQL

    Enables 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 the now() 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 console SQL

    Sets 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 console CLI API

    The 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 is 20.

    For more information, see this ClickHouse® guide.

  • Insert null as default Management console API SQL

    Enables inserting default values instead of NULL into columns that do not allow storing NULL values.

    The possible values are:

    • 0: Inserting NULL into a column that does not allow NULL will throw an exception.
    • 1: Insert the default column value instead of NULL.

    The default value is 1.

    For more information, see this ClickHouse® guide.

  • Insert quorum Management console CLI API SQL

    Manages 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 quorum replicas 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 previous INSERT queries.

    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 console SQL

    If this setting is enabled, you can run multiple concurrent INSERT queries with quorum writes. If disabled, a single INSERT query with a quorum write will be made to the same table.

    This setting is enabled by default.

  • Insert quorum timeout Management console CLI API SQL

    Sets the quorum write timeout, in milliseconds. If the timeout ends without a write, ClickHouse® will abort the INSERT query and return an error.

    The minimum value is 1000 (one second). The default value is 60000 (one minute).

  • Join algorithm Management console SQL

    Sets the JOIN algorithm:

    • 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.
      • LEFT and INNER JOIN clauses are running.
    • 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_merge algorithm. It is used whenever possible; otherwise, the hash algorithm 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 interfaces

    Sets the action ClickHouse® will perform if any of the following JOIN limits is reached:

    • max_bytes_in_join
    • max_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 console CLI SQL

    Controls the behavior of JOIN clauses. If the setting is enabled, empty cells resulting from a join will get NULL values. 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 console CLI SQL

    Requires aliases for subqueries when running the JOIN clause.

    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 MyQuery
    

    This setting is enabled by default.

  • Load balancing Management console CLI Terraform API SQL

    Sets 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 named example-05-05-5 and two replicas, example-05-05-7 and example-05-06-7. The example-05-05-7 replica 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 random value.

    • hostname_levenshtein_distance: To select a replica, the same principle applies as for nearest_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 to in_order. However, it has the advantage over the in_order algorithm: 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 console

    Sets how to read data from the local file system.

    The possible values are:

    • nmap
    • pread
    • pread_threadpool
    • read

    The default value is pread.

  • Log processors profiles Management console CLI SQL

    Sets whether to log information about processor-level profiling. Such logs will be saved to the system.processors_profile_log table.

    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 CLI SQL

    Sets whether to write only randomly selected queries with a specified probability to the system.query_log, system.query_thread_log, and system.query_views_log tables. 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 to 0, no queries will be written to the system tables. If set to 1 (by default), all queries will be written to the system tables.

    For more information, see this ClickHouse® guide.

  • Log query threads Management console CLI Terraform API SQL

    Enables 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 console CLI SQL

    Sets whether to log information about dependent views in queries. Such logs will be saved to the system.query_views_log table.

    This setting is enabled by default.

    For more information, see this ClickHouse® guide.

  • Low cardinality allow in native format Management console CLI API SQL

    Sets 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 SELECT queries, convert LowCardinality columns to regular ones.
      • For INSERT queries, convert regular columns to LowCardinality.

    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 console CLI API SQL

    Maximum 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 a SELECT ... 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 console CLI API SQL

    Maximum 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 console CLI API SQL

    Data 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 1 and the default is 65536.

  • Max bytes before external group by Management console CLI API SQL

    Data accumulated during the GROUP BY aggregation 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 BY is disabled in external memory). The default value is 0.

    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 console CLI API SQL

    This setting is similar to the previous one, except that it is used for the sorting operation (ORDER BY).

  • Max bytes in distinct Management console CLI API SQL

    Maximum 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 interfaces

    Maximum 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 interfaces

    Maximum amount of uncompressed data, in bytes, occupied by a set created from a subquery in the IN section.

    The minimum and default value is 0, i.e., there is no limit.

  • Max bytes to read Management console CLI API SQL

    Maximum 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 console CLI API SQL

    Maximum 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 console CLI API SQL

    Maximum 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 console CLI API SQL

    Maximum 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 console API SQL

    Maximum number of concurrently processed user queries to a MergeTree table.

    The minimum value is 0, i.e., there is no limit. The default value is 450.

    For more information, see this ClickHouse® guide.

  • Max execution time Management console CLI API SQL

    Maximum 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 is 600000.

  • Max expanded ast elements Management console CLI API SQL

    Maximum 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 console

    Maximum number of parallel threads for a SELECT query with the FINAL modifier.

    The default value is equal to Max threads.

    For more information, see this ClickHouse® guide.

  • Max HTTP get redirects Management console API SQL

    Sets 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 console CLI API SQL

    Sets 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 console CLI Terraform API SQL

    Maximum number of threads for the INSERT SELECT query.

    If the value is greater than 1, the threads will run in parallel. The default value is 0.

    You can run INSERT SELECT queries in parallel only if using the Max threads setting to enable running SELECT queries 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 console CLI API SQL

    Maximum 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 BY or 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 console CLI API SQL

    Maximum 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 console CLI API SQL

    Maximum 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 console CLI API SQL

    Maximum 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 console CLI API

    Maximum 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 is 1000.

    For more information, see this ClickHouse® guide.

  • Max partitions per insert block Management console SQL

    Limits 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 is 100.

    For more information, see this ClickHouse® guide.

  • Max query size Management console CLI API SQL

    Limits 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 1 and the default is 262144.

  • Max read buffer size Management console

    Maximum 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 console CLI API SQL

    Maximum 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 is 300000 (five minutes).

    See also Fallback to stale replicas for distributed queries.

  • Max result bytes Management console CLI API SQL

    Maximum 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 console CLI API SQL

    Maximum 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 console CLI API SQL

    Limits 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 interfaces

    Maximum number of rows in a hash table used when joining tables. It applies to SELECT… JOIN operations and the Join table 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 interfaces

    Maximum number of rows for a set created from a subquery in the IN section.

    The minimum and default value is 0, i.e., there is no limit.

  • Max rows to group by Management console CLI API SQL

    Limits 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 console CLI API SQL

    Maximum 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 console CLI API SQL

    Maximum 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 console CLI API SQL

    Maximum 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 console CLI API SQL

    Maximum 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 console CLI API

    Maximum 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 console CLI API

    Maximum 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 console CLI API SQL

    Maximum 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 console CLI API SQL

    Maximum 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 console CLI API

    Memory 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 is 1.

    For more information, see this ClickHouse® guide.

  • Memory overcommit ratio denominator for user Management console CLI API

    Memory 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 is 1.

    For more information, see this ClickHouse® guide.

  • Memory profiler sample probability Management console API SQL

    The system will log information about specific memory allocation and deallocation to the system.trace_log file of the MemorySample tracing type with the specified probability. The logging probability does not depend on the size of the allocated/deallocated memory.

    You can specify values between 0 and 1. The default value is 0.

  • Memory profiler step Management console API SQL

    Memory 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). If 0, the memory profiler is disabled.

  • Memory usage overcommit max wait microseconds Management console CLI API

    Timeout, 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 console CLI API SQL

    Maximum 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 console CLI API SQL

    Maximum 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 console CLI API SQL

    If 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 1 and the default is 24x10x1024x1024.

  • Merge tree min rows for concurrent read Management console CLI API SQL

    If 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 1 and the default is 20x8192.

  • Min bytes to use direct io Management console CLI API SQL

    Amount 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 CLI API SQL

    This 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 0 and the default is 3.

  • Min count to compile expression Management console CLI API SQL

    Sets 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 0 and the default is 3.

  • Min execution speed All interfaces

    Minimum 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 interfaces

    Minimum 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 console CLI API SQL

    Minimum 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 is 268435456 (256 MB).

  • Min insert block size rows Management console CLI API SQL

    Minimum 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 is 1048576.

  • Output format json quote denormals Management console CLI API SQL

    Sets 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 console CLI API SQL

    Sets the format of numbers in the JSON output. If this setting is enabled, 64-bit integers (UInt64 and Int64) 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 console CLI Terraform API SQL

    Enables sending distributed queries to the localhost replica.

    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 console CLI API SQL

    Sets 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 console CLI SQL

    Maximum 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 console CLI SQL

    Maximum 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 console CLI SQL

    Minimum SELECT query 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 console CLI SQL

    Minimum number of completed SELECT queries 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 console CLI SQL

    Sets how the query cache will process SELECT queries with non-determined functions, such as rand() or now().

    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 console CLI SQL

    Sets whether other users can read the results of the SELECT queries 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 console CLI SQL

    String 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 console CLI SQL

    Time, 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 console CLI SQL

    Mode used to track resources utilized when quotas are enabled:

    • default: Keys are not used.
    • keyed: quota_key is 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 console CLI API SQL

    Sets 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 console CLI API SQL

    Permissions 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 console CLI API SQL

    Timeout for receiving data, in milliseconds.

    The default value is 300000 (five minutes).

  • Remote filesystem read method Management console CLI API

    Sets how to read data from a remote file system.

    The possible values are:

    • read
    • threadpool

    The default value is threadpool.

  • Replication alter partitions sync Management console CLI API SQL

    Sets the wait mode for asynchronous actions on replicas for ALTER ... ATTACH DETACH DROP queries:

    • 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 console CLI API SQL

    Sets 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 console CLI API SQL

    Sets whether to enable sequential consistency for SELECT queries.

    By default, sequential consistency is disabled.

    For more information, see this ClickHouse® guide.

  • Send progress in HTTP headers Management console CLI API SQL

    Enables sending notifications regarding query execution status using X-ClickHouse-Progress headers.

    By default, notifications are disabled.

  • Send timeout Management console CLI API SQL

    Timeout for sending data, in milliseconds.

    The default value is 300000 (five minutes).

  • Set overflow mode All interfaces

    Sets 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 console CLI API SQL

    Enables 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 console CLI API SQL

    Sets 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 console API SQL

    Timeout, 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 console CLI API SQL

    Sets 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 console CLI API SQL

    Sets 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 console CLI SQL

    If this setting is enabled, NULL = NULL returns true in the IN operator.

    This setting is disabled by default.

    For more information, see this ClickHouse® guide.

  • Use hedged requests Management console CLI Terraform API SQL

    Enables 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 console CLI SQL

    Sets whether SELECT queries 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 console CLI API SQL

    Sets 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 console API SQL

    Enables waiting for asynchronous insert processing.

    The possible values are:

    • 0: The server returns OK even if a data insert is not completed yet.
    • 1: The server returns OK only after data is inserted.

    The default value is 1.

    For more information, see this ClickHouse® guide.

  • Wait for async insert timeout Management console API SQL

    Timeout for asynchronous insert processing, in seconds.

    The default value is 120. If 0, there is no timeout.

    For more information, see this ClickHouse® guide.

Custom settingsCustom settings

You can override custom settings as variables in the settings profile, session, or query. Working with settings profiles is available if the user management via SQL is enabled for the cluster.

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 settingsQuota 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 interfaces

    Limits the total number of failed queries.

    The minimum value is 0, i.e., there is no limit.

  • Execution time All interfaces

    Limits the total query execution time in milliseconds.

    The minimum value is 0, i.e., there is no limit.

  • Interval duration All interfaces

    Quota interval, in milliseconds. This value must be a multiple of 1,000.

    The minimum value is 1000 (one second).

  • Queries All interfaces

    Limits the total number of queries.

    The minimum value is 0, i.e., there is no limit.

  • Read rows All interfaces

    Limits 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 interfaces

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

Was the article helpful?

Previous
ClickHouse® versioning policy
Next
Access management
© 2025 Direct Cursus Technology L.L.C.