v.20.1Improvement

Implement ORDER BY Optimization for Merge, Buffer, and Materialized View Storages

Implement ORDER BY optimization for Merge, Buffer and Materilized View storages with underlying MergeTree tables. #8130 (Anton Popov)
Implemented ORDER BY optimization for Merge, Buffer, and Materialized View storages that use underlying MergeTree tables.

Why it matters

This feature improves query performance by optimizing how data is ordered and merged in storages that rely on MergeTree underlying tables. It reduces overhead and enhances efficiency when reading from Merge, Buffer, and Materialized View storages by better leveraging the ORDER BY clause.

How to use it

Users benefit from this optimization automatically when using Merge, Buffer, or Materialized View tables built on MergeTree engines. No explicit action is required other than using these storages with ORDER BY clauses defined in the underlying tables.