Choosing the Best Composite Index for A = ?, B IN (...), ORDER BY C
The article explains why placing column C immediately after the equality column A in a composite index (A, C, B) avoids filesort and keeps performance stable regardless of how many values appear in the B IN list, outperforming other index orders such as (A, B, C).
