v.21.4Improvements

Do not create empty parts on INSERT with optimize_on_insert enabled

Do not create empty parts on INSERT when optimize_on_insert setting enabled. Fixes #20304. #20387 (Kruglov Pavel).
Prevent creation of empty parts during INSERT operations when the optimize_on_insert setting is enabled.

Why it matters

To avoid generating unnecessary empty data parts on INSERT with optimize_on_insert enabled, improving storage efficiency and performance by eliminating redundant data parts.

How to use it

Enable the feature by setting optimize_on_insert = 1 in your session or server settings. This ensures that empty parts are not created during insert operations.