Toolvito

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.

Choose what to do

Task
Suggest indexes by rules

Your SQL is sent to the Toolvito server to be parsed; it is never run. The AI suggestions come from a language model that runs on the server itself. Nothing is sent to another company. Download the result within one hour after the job finishes. Choose Delete files now to request earlier removal. The hourly cleanup normally removes files within one to two hours after completion.

How the suggestions are made

  1. Each query is parsed with sqlglot in your SQL dialect. Nothing is run and nothing connects to your database.
  2. 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.
  3. When one suggestion is the start of another, only the longer one is kept: it serves both.
  4. 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.

Related tools