Skip to content
ClickHouse Docs
ClickHouse DocsClickHouse Docs

min_insert_* session settings

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

min_insert_block_size_bytes

Type
UInt64
Default
268402944

The minimum size of blocks (in bytes) to form for insertion into a table.

This setting works together with min_insert_block_size_rows and controls block formation in the same contexts (format parsing and INSERT operations). See min_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.

min_insert_block_size_bytes_for_materialized_views

Type
UInt64
Default
0

Sets the minimum number of bytes in the block which can be inserted into a table by an INSERT query. Smaller-sized blocks are squashed into bigger ones. This setting is applied only for blocks inserted into materialized view. By adjusting this setting, you control blocks squashing while pushing to materialized view and avoid excessive memory usage.

Possible values:

  • Any positive integer.
  • 0 — Squashing disabled.

See also

min_insert_block_size_rows

Type
UInt64
Default
1048449

The minimum size of blocks (in 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 (default): 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.
  • 0 — setting does not participate in block formation.

min_insert_block_size_rows_for_materialized_views

Type
UInt64
Default
0

Sets the minimum number of rows in the block which can be inserted into a table by an INSERT query. Smaller-sized blocks are squashed into bigger ones. This setting is applied only for blocks inserted into materialized view. By adjusting this setting, you control blocks squashing while pushing to materialized view and avoid excessive memory usage.

Possible values:

  • Any positive integer.
  • 0 — Squashing disabled.

See Also

Navigation