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 after OPTIMIZE ... FINAL query from old parts without TTL infos or with outdated TTL infos, e.g. after ALTER ... MODIFY TTL query. Added queries SYSTEM STOP/START TTL MERGES to disallow/allow assign merges with TTL and filter expired values in all merges. #6274 (Anton Popov)
Values and rows with expired TTL are now removed after executing OPTIMIZE ... FINAL on old data parts that lack TTL information or have outdated TTL information, such as after modifying TTL with an ALTER ... MODIFY TTL query. Additionally, new system queries to control TTL merges have been introduced.

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

Run OPTIMIZE 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.