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

max_insert_block_size

Aliases: max_insert_block_size_rows The maximum size of blocks (in a count of rows) to form for insertion into a table. This setting controls block formation in two contexts:
  1. Format parsing: When the server parses row-based input formats (CSV, TSV, JSONEachRow, etc.) from any interface (HTTP, clickhouse-client with inline data, gRPC, PostgreSQL wire protocol), blocks are emitted when:
    • Both min_insert_block_size_rows AND min_insert_block_size_bytes are reached, OR
    • Either max_insert_block_size_rows OR max_insert_block_size_bytes is reached
    Note: When using clickhouse-client or clickhouse-local to read from a file, the client itself parses the data and this setting applies on the client side.
  2. INSERT operations: During INSERT queries and when data flows through materialized views, this setting’s behavior depends on use_strict_insert_block_limits:
    • When enabled: Blocks are emitted when:
      • Min thresholds (AND): Both min_insert_block_size_rows AND min_insert_block_size_bytes are reached
      • Max thresholds (OR): Either max_insert_block_size_rows OR max_insert_block_size_bytes is reached
    • When disabled: Blocks are emitted when min_insert_block_size_rows OR min_insert_block_size_bytes is reached. The max_insert_block_size settings are not enforced.
Possible values:
  • Positive integer.

max_insert_block_size_bytes

The maximum size of blocks (in bytes) to form for insertion into a table. This setting works together with max_insert_block_size_rows and controls block formation in the same context. See max_insert_block_size_rows for detailed information about when and how these settings are applied. Possible values:
  • Positive integer.
  • 0 — setting does not participate in block formation.

max_insert_delayed_streams_for_parallel_write

The maximum number of streams (columns) to delay final part flush. Default - auto (100 in case of underlying storage supports parallel write, for example S3 and disabled otherwise) Cloud default value: 50.

max_insert_threads

The maximum number of threads to execute the INSERT SELECT query. Possible values:
  • 0 (or 1) — INSERT SELECT no parallel execution.
  • Positive integer. Bigger than 1.
Cloud default value:
  • 1 for nodes with 8 GiB memory
  • 2 for nodes with 16 GiB memory
  • 4 for larger nodes
Parallel INSERT SELECT has effect only if the SELECT part is executed in parallel, see max_threads setting. Higher values will lead to higher memory usage.

max_insert_threads_min_free_memory_per_thread

Same as max_threads_min_free_memory_per_thread, but applied to max_insert_threads instead of max_threads. The default is higher because insert pipelines typically hold larger per-thread buffers (merge tree parts, compression blocks) than read pipelines. If the amount of free memory is less than max_insert_threads multiplied by this value, max_insert_threads is reduced to fit, down to a minimum of 1. Set to 0 to disable this limit.
Last modified on July 23, 2026