SQL Slow Query Analyzer
Paste your query. Get an instant diagnosis across 100 rules — full table scans, missing indexes, function abuse, bad joins, and more. No sign-up.
Supports PostgreSQL, MySQL, Oracle, SQL Server. Separate multiple queries with ;
What this tool checks
100 rules across 11 categories. Each finding includes what's wrong, why it's slow, and the exact fix.
SELECT Clause
10 rulesSELECT *, DISTINCT, missing LIMIT, large IN lists
WHERE Clause
15 rulesFull scans, NULL traps, OR conditions, implicit casts
Functions in WHERE
14 rulesLOWER(), DATE(), EXTRACT(), CAST() killing indexes
JOINs
8 rulesCartesian products, missing ON, function in JOIN condition
Subqueries
7 rulesCorrelated subqueries, NOT IN NULL trap, ORDER BY inside subquery
ORDER BY / GROUP BY
8 rulesORDER BY RANDOM(), OFFSET pagination, HAVING vs WHERE
DML Safety
6 rulesUPDATE/DELETE without WHERE, INSERT without column list
Data Patterns
8 rulesILIKE, JSONB unindexed, CSV in columns, FLOAT for money
CTEs & Advanced
5 rulesRecursive CTE without limit, many CTEs, window functions
Performance Patterns
12 rulesMultiple aggregations, correlated updates, implicit type casts
Code Quality
7 rulesLong queries, no aliases, duplicate conditions, missing schema
More being added
OngoingRules are updated as new patterns are identified
Frequently Asked Questions
How do I find slow SQL queries?
Enable your database's slow query log (PostgreSQL: log_min_duration_statement, MySQL: slow_query_log), then paste the offending query into this analyzer. It checks for full table scans, missing indexes, function abuse in WHERE clauses, and dangerous JOIN patterns across 100 rules.
What causes a full table scan in SQL?
A full table scan happens when the database reads every row instead of using an index. Common causes: no index on the filtered column, a function wrapping the column in the WHERE clause (e.g. WHERE LOWER(email) = ?), implicit type casting, or a LIKE pattern starting with a wildcard (%value).
How do I fix a slow SQL query without changing the schema?
First add covering indexes on columns used in WHERE, JOIN ON, and ORDER BY clauses. Then rewrite correlated subqueries as JOINs, replace SELECT * with specific columns, and move any functions off the filtered column so the index can be used. These changes require no schema migration.