Tagged articles
2 articles
Page 1 of 1
ITPUB
ITPUB
Feb 21, 2023 · Databases

How MySQL Implements File Sorting: Internals, Modes, and Optimizations

This article explains MySQL's file‑sort mechanism in depth, covering the sort buffer, handling of long sort keys, three sort modes, priority‑queue and read‑rnd‑buffer optimizations, internal vs. external sorting, descending sort implementation, and how to inspect details with optimizer trace.

Optimizer_traceexternal sortingfilesort
0 likes · 32 min read
How MySQL Implements File Sorting: Internals, Modes, and Optimizations
Full-Stack Internet Architecture
Full-Stack Internet Architecture
Aug 5, 2021 · Databases

Understanding and Optimizing ORDER BY in MySQL

This article explains the internal execution process of MySQL's ORDER BY, compares full‑field and rowid sorting, shows how indexes, sort_buffer size and max_length_for_sort_data affect performance, and provides practical optimization techniques such as composite and covering indexes.

Order ByRowidcovering index
0 likes · 13 min read
Understanding and Optimizing ORDER BY in MySQL