Skip to content
ClickHouse Docs
ClickHouse DocsClickHouse Docs

max_partitions_* session settings

These settings are available in system.settings and are autogenerated from source.

max_partitions_per_insert_block

Type
UInt64
Default
100
Version history
VersionDefault valueComment
19.5100Add a limit for the number of partitions in one block

Limits the maximum number of partitions in a single inserted block and an exception is thrown if the block contains too many partitions.

  • Positive integer.
  • 0 — Unlimited number of partitions.

Details

When inserting data, ClickHouse calculates the number of partitions in the inserted block. If the number of partitions is more than max_partitions_per_insert_block, ClickHouse either logs a warning or throws an exception based on throw_on_max_partitions_per_insert_block. Exceptions have the following text:

“Too many partitions for a single INSERT block (partitions_count partitions, limit is “ + toString(max_partitions) + “). The limit is controlled by the ‘max_partitions_per_insert_block’ setting. A large number of partitions is a common misconception. It will lead to severe negative performance impact, including slow server startup, slow INSERT queries and slow SELECT queries. Recommended total number of partitions for a table is under 1000..10000. Please note, that partitioning is not intended to speed up SELECT queries (ORDER BY key is sufficient to make range queries fast). Partitions are intended for data manipulation (DROP PARTITION, etc).”

max_partitions_to_read

Type
Int64
Default
-1

Limits the maximum number of partitions that can be accessed in a single query.

The setting value specified when the table is created can be overridden via query-level setting.

Possible values:

  • Positive integer
  • -1 - unlimited (default)
Navigation