v.23.1Improvement
Remove Redundant Sorting in Subqueries
Remove redundant sorting, for example, sorting related ORDER BY clauses in subqueries. Implemented on top of query plan. It does similar optimization asoptimize_duplicate_order_by_and_distinctregardingORDER BYclauses, but more generic, since it's applied to any redundant sorting steps (not only caused by ORDER BY clause) and applied to subqueries of any depth. Related to #42648. #43905 (Igor Nikonov).
Why it matters
This feature eliminates unnecessary sorting steps that can occur in subqueries or other parts of a query plan. By removing redundant sorting, it improves query performance and reduces resource consumption. It generalizes the optimization performed byoptimize_duplicate_order_by_and_distinct and applies it to sorting redundancies at any depth in subqueries.