What you need to know
A compound index is not interchangeable across every field order. A query can often use a leftmost prefix, so the first fields determine which filters and sorts the index supports.
How to apply it
Inspect common queries, place fields used for equality conditions before range or sort fields when appropriate, then confirm behavior with explain output and realistic data.
Common mistake to avoid
Do not create indexes from a guess. Each index consumes storage and adds work to inserts and updates.
