Index Column Order Advisor
Reads your WHERE and ORDER BY clauses and puts the index columns in the order that works.
Loading the tool…
How to use this tool
- Paste your queries, one per line. A bare WHERE clause works just as well as a whole statement.
- Select Suggest the indexes.
- Read the reason column, not just the suggestion — it names the columns that were left out and says why.
- Look for the redundant rows at the bottom: those indexes are already served by a longer one and should not both be created.
- Confirm anything you plan to create against a real EXPLAIN, since this page cannot see your data.
What index column order advisor does
A composite index on (a, b) and one on (b, a) are different indexes with different uses, and the wrong one of the pair is close to useless. The rule that decides it is not complicated but it is easy to get backwards: columns compared with equals or IN go first, then at most one column compared with a range, then the columns you sort by. Once the scan opens on a range, everything after it in the index is no longer in a useful order, which is why a second range column earns nothing and why a sort column placed before a range column costs you the sort you were trying to avoid.
Paste one query, or just one WHERE clause, per line. Each gets back the column order it wants and the reason for that order, including which columns were left out and why. At the end the tool checks the suggestions against each other and flags any index that is a leading prefix of a longer one — those are already served by the longer index and creating both wastes write throughput and disk for no read benefit. It reads text and does not connect to anything, so it knows nothing about your cardinality; treat the output as the starting shortlist, not the last word.