v.19.14Improvement
Now Values and Rows with Expired TTL Will Be Removed After OPTIMIZE ..
Now values and rows with expired TTL will be removed afterOPTIMIZE ... FINALquery from old parts without TTL infos or with outdated TTL infos, e.g. afterALTER ... MODIFY TTLquery. Added queriesSYSTEM STOP/START TTL MERGESto disallow/allow assign merges with TTL and filter expired values in all merges. #6274 (Anton Popov)
Why it matters
This feature ensures that expired data managed by TTL settings is properly cleaned up even in old parts that do not have current TTL metadata, improving data consistency and storage efficiency. The added system queries provide DBAs control over TTL-related merges, allowing them to pause or resume automatic TTL-based data expiration during merges as needed.How to use it
RunOPTIMIZE table_name FINAL to remove expired rows from old parts affected by TTL modifications. Use the system commands SYSTEM STOP TTL MERGES to stop TTL merges and filtering of expired values, and SYSTEM START TTL MERGES to resume them.