DevTools Logo

SQL Performance Analyzer

SQL Performance Analyzer

Find performance anti-patterns in a SQL query and get ranked fixes

SQL query

Examples

A full-scan LIKE

Input
SELECT * FROM users WHERE name LIKE '%ada%'
Output
Score reduced — SELECT * (medium) and leading-wildcard LIKE (high) flagged.

A leading wildcard defeats indexes and forces a full table scan; SELECT * fetches unneeded columns too.

A Cartesian product

Input
SELECT * FROM users, orders
Output
Critical — comma join / cross join without a join condition.

A comma join with no ON/WHERE pairs every row with every row. Use an explicit JOIN … ON.

About this tool

Most slow queries suffer from a small number of recurring mistakes, and you do not need a live database to spot them. This analyzer inspects SQL for the patterns that reliably hurt performance: SELECT *, leading-wildcard LIKE that defeats indexes, missing WHERE clauses, comma-style cross joins, NOT IN with its NULL pitfalls, functions applied to columns, ORDER BY without LIMIT, and UNION where UNION ALL would do.

Each finding is ranked by severity with a concrete suggestion, and the query gets an overall 0–100 performance score. The analysis is heuristic and schema-agnostic — it points at likely problems fast, but real tuning still depends on indexes, row counts, and the actual execution plan.

How to use this tool

  1. Paste the query

    Enter the SQL statement you want to review.

  2. Read the score

    The 0–100 score and grade summarize how many anti-patterns are present.

  3. Work the findings

    Apply the high-severity suggestions first for the biggest performance gain.

  4. Verify with a plan

    Confirm each change with EXPLAIN and real data volumes.

Common mistakes

Mistake:Using leading-wildcard LIKE.

Fix:LIKE '%term' cannot use a normal index. Use full-text search or a prefix-anchored pattern.

Mistake:SELECT * for convenience.

Fix:List only needed columns to cut I/O and keep the query stable when the schema changes.

Frequently asked questions

Does this replace EXPLAIN?

No. It is a schema-agnostic heuristic that flags common anti-patterns quickly. Confirm every change with EXPLAIN and your real data volume.

Why was my query scored poorly?

Each penalty comes from a specific finding (e.g. SELECT *, a leading-wildcard LIKE, or a missing WHERE). Read the findings list to see exactly what lowered the score.

Is my query uploaded?

No. Analysis happens locally in your browser.

References & standards