Processed online by Toolvito
SQL Index Advisor
Paste the queries your application runs and, if you can, your CREATE TABLE and CREATE INDEX statements. Get the indexes that would help them, with the reason for each.
How the suggestions are made
- Each query is parsed with sqlglot in your SQL dialect. Nothing is run and nothing connects to your database.
- For each table, the columns compared with = (or IN, or IS NULL) and the join columns come first, then one column compared with <, >, BETWEEN or LIKE 'abc%'; without a range, the ORDER BY or GROUP BY columns.
- When one suggestion is the start of another, only the longer one is kept: it serves both.
- With your CREATE INDEX statements and keys, a suggestion that an index you have already starts with is shown as covered.
Warnings
- A function on a column (LOWER(email) = …) or LIKE '%abc' cannot use a plain index on that column.
- OR between conditions on different columns may stop one index from serving both sides.
- SELECT * and UPDATE or DELETE without WHERE are pointed out.
- Measure before and after with EXPLAIN: an index speeds up reads but slows down writes and takes space.