v.19.3Improvements

Slightly Better Message with Reason for OPTIMIZE Query with Optimize_throw_if_noop Setting Enabled

Slightly better message with reason for OPTIMIZE query with optimize_throw_if_noop setting enabled. #4294 (alexey-milovidov)
Improved error messaging for the OPTIMIZE query when the optimize_throw_if_noop setting is enabled.

Why it matters

This feature enhances the feedback provided to users running OPTIMIZE queries by including a detailed reason why the operation did not perform any changes (no-op). It helps users understand why OPTIMIZE did not affect the data, improving troubleshooting and operational clarity.

How to use it

Enable the optimize_throw_if_noop setting before running an OPTIMIZE query. When no optimization can be performed, the query will throw an error message with a detailed reason instead of silently doing nothing.