v.18.14Improvement
Significant Memory Optimization for ORDER BY and LIMIT Queries
Significantly reduced memory consumption for queries withORDER BYandLIMIT. See themax_bytes_before_remerge_sortsetting. #3205
Why it matters
This feature addresses the high memory usage problem when executing queries that combineORDER BY and LIMIT. By optimizing the sorting process, it helps users run such queries more efficiently, reducing resource consumption and improving overall performance.How to use it
Users can enable or configure this optimization by setting themax_bytes_before_remerge_sort parameter in their query settings or user configurations. Adjusting this value controls when the remerge sort optimization is applied to limit memory usage during sorting.