v.24.7Improvement
Optimize Trivial Insert Select Setting Disabled by Default
The settingoptimize_trivial_insert_selectis disabled by default. In most cases, it should be beneficial. Nevertheless, if you are seeing slower INSERT SELECT or increased memory usage, you can enable it back orSET compatibility = '24.6'. #58970 (Alexey Milovidov).
Why it matters
This feature aims to optimize trivialINSERT SELECT queries for better performance and resource efficiency. By default, it is disabled to avoid cases where enabling it might lead to slower inserts or higher memory consumption, giving users control to enable it when beneficial.How to use it
Users can enable this optimization by settingoptimize_trivial_insert_select = 1 in the configuration or during a session. Alternatively, they can run SET compatibility = '24.6' to turn on the optimization along with other version 24.6 compatible behaviors.