v.25.9Performance Improvement
Added JOIN order optimization
Added JOIN order optimization that can automatically reorder JOINs for better performance (controlled byquery_plan_optimize_join_order_limitsetting). Note that the join order optimization currently has limited statistics support and primarily relies on row count estimates from storage engines - more sophisticated statistics collection and cardinality estimation will be added in future releases. If you encounter issues with JOIN queries after upgrading, you can temporarily disable the new implementation by settingSET query_plan_use_new_logical_join_step = 0and report the issue for investigation. Note about resolution of identifiers from USING clause: Changed resolving of the coalesced column fromOUTER JOIN ... USINGclause to be more consistent: previously, when selecting both the USING column and qualified columns (a, t1.a, t2.a) in a OUTER JOIN, the USING column would incorrectly be resolved tot1.a, showing 0/NULL for rows from the right table with no left match. Now identifiers from USING clause are always resolved to the coalesced column, while qualified identifiers resolve to the non-coalesced columns, regardless of which other identifiers are present in the query. For example: ```sql SELECT a, t1.a, t2.a FROM (SELECT 1 as a WHERE 0) t1 FULL JOIN (SELECT 2 as a) t2 USING (a) -- Before: a=0, t1.a=0, t2.a=2 (incorrect - 'a' resolved to t1.a) -- After: a=2, t1.a=0, t2.a=2 (correct - 'a' is coalesced). #80848 (Vladimir Cherkasov).