Tagged articles
3 articles
Page 1 of 1
Tencent Cloud Developer
Tencent Cloud Developer
May 5, 2019 · Databases

Handling ORDER BY When Index Order Differs and Using Descending Indexes in MySQL

MySQL can avoid a filesort for ORDER BY clauses that match an index’s direction by scanning the index forward or backward, and MySQL 8.0’s descending indexes let mixed‑direction sorts be satisfied similarly; for older versions you can emulate this by retrieving rows in index order and reversing groups in the application.

Descending IndexOrder Bydatabase
0 likes · 9 min read
Handling ORDER BY When Index Order Differs and Using Descending Indexes in MySQL