Database SQL Queries Inspector
Analyze SQL queries for performance, complexity, and optimization suggestions.
Come utilizzare SQL Query Analyzer
Attach your SQL Query
Attach one or more SQL queries to the editor, or click "Load Example" for a demonstrative query with known issues.
Analyze Query
Click "Analyze Query" to run automated checks on performance and accuracy.
Read the findings
Review grouped findings by severity (errors, warnings, optimizations, information) with detail and suggestions for each.
Check optimized query
If available, go to the "Optimized Query" tab to see rewrite suggestions.
Suggerimenti
- Analyze queries before running them in production, especially UPDATE and DELETE.
- Use always EXPLAIN ANALYZE on your database to check the actual execution plan, in addition to the tool's suggestions.
- Prefer explicit joins (INNER JOIN, LEFT JOIN) over comma-separated syntax in the FROM clause to avoid accidental Cartesian products.
Domande frequenti
What kind of issues does the analyzer detect?
Detects 10 problem categories: SELECT without UPDATE/DELETE, JOIN without ON, Cartesian product, subquery in WHERE, N+1 pattern, LIKE with initial wildcard, functions on indexed columns, LIMIT absent and missing index hints.
How is complexity score calculated?
It's a weighted sum of SQL clause occurrences (SELECT, JOIN, WHERE, GROUP BY, UNION, etc.), each with varying weights, up to a maximum of 100 points. The higher the score, the more complex the query is structurally.
What does "UPDATE without WHERE clause" error marked as critical?
Indicate that the UPDATE query would modify all table rows because it lacks a WHERE clause to limit affected rows - this is usually an error to correct before execution.
Does the tool support multiple SQL dialects such as PostgreSQL and MySQL?
Controls are based on standard SQL patterns applicable to most dialects. Some suggestions, such as functional index GIN trigrams, are specific to PostgreSQL and explicitly indicated in the suggestion text.
Are my queries sent to a server for analysis?
No, analysis is entirely client-side via pattern matching and regular expressions in the browser: no queries are sent.