v.20.5Improvement

Introduce min_insert_block_size settings for Materialized Views

Introduce min_insert_block_size_rows_for_materialized_views, min_insert_block_size_bytes_for_materialized_views settings. This settings are similar to min_insert_block_size_rows and min_insert_block_size_bytes, but applied only for blocks inserted into MATERIALIZED VIEW. It helps to control blocks squashing while pushing to MVs and avoid excessive memory usage. #10858 (Azat Khuzhin).
ClickHouse introduces the min_insert_block_size_rows_for_materialized_views and min_insert_block_size_bytes_for_materialized_views settings to control block sizes specifically for inserts into MATERIALIZED VIEW tables.

Why it matters

These settings address the need to manage block squashing and memory usage when inserting data into materialized views. By customizing minimum insert block sizes for materialized views separately from regular tables, users can optimize performance and resource consumption during data ingestion.

How to use it

To use these features, set the new settings min_insert_block_size_rows_for_materialized_views and/or min_insert_block_size_bytes_for_materialized_views in the server configuration or session settings. For example:

SET min_insert_block_size_rows_for_materialized_views = 10000;
SET min_insert_block_size_bytes_for_materialized_views = 1000000;


These settings will then apply to controlling block sizes when inserting data into MATERIALIZED VIEW tables.