SQL Index Advisor
Paste a SQL SELECT query and your table's columns to get suggested indexes based on WHERE, JOIN, and ORDER BY clauses, with the CREATE INDEX statements ready to copy.
🔒 This tool runs entirely in your browser. Your files are never uploaded to a server.
Suggested indexes
How SQL Index Advisor works
- Paste a SELECT query — a sample orders/customers join is pre-filled and analysed immediately.
- The parser identifies every table (and its alias) named after FROM and JOIN, then scans the WHERE clause, each JOIN's ON condition, and the ORDER BY list for column references.
- For each table, it groups the columns actually used against it into one composite index suggestion, ordered join/equality columns first and sort columns last.
- Copy the generated
CREATE INDEXstatement straight into a migration or your database console.
This mirrors the manual process of reading a query and asking "which columns does the database need to look up quickly to answer this?" — the same first question behind reading an EXPLAIN plan, just automated from the query text itself.
FAQ
Why does the suggested index list join columns before WHERE columns?
In a composite (multi-column) index, column order determines which queries can use it efficiently. Putting the most selective equality/join columns first lets the database narrow to a small set of rows immediately, with any ORDER BY columns placed last so the same index can also satisfy the sort without a separate step.
Does this actually check my database, or just the query text?
Just the query text — it never connects to a database. It parses the SQL you paste (FROM/JOIN targets, WHERE conditions, JOIN ON conditions, ORDER BY columns) with pattern matching, the same columns a human reviewing an EXPLAIN plan would look for first.
Will creating every suggested index always speed things up?
Not necessarily — indexes speed up reads but slow down writes and use disk space, so they're a genuine trade-off, not a free win. Treat these as a starting point for a slow query, not a rule to blindly apply to every table.
How we compare
| Feature | Online Tool Store | Doing it manually | A generic online tool |
|---|---|---|---|
| No file upload — runs in your browser | ✓ | N/A | ✗ |
| No sign-up required | ✓ | ✓ | ✗ |
| Free, no watermark | ✓ | ✓ | ✗ |
A full query-plan analyzer needs a live connection to your database and permission to run EXPLAIN. This tool works from the query text alone — paste it and get a starting-point index suggestion in your browser, without granting any tool access to your data.