SQL Query Analyzer
Find expensive SQL patterns, missing filters and index opportunities.
SQL query
Static analysis only — the query is never executed and never leaves your browser.
Analysis
Tables: orders, customers, order_items
- warningSELECT * returns every column
Wildcard projections read and transfer columns the application may never use, and they break silently when the table changes.
→ List only the columns you need: SELECT id, name, created_at …
- warningLeading-wildcard LIKE
A pattern that starts with % cannot use a B-tree index, so it forces a full scan.
→ Anchor the pattern (LIKE 'abc%'), or use a full-text / trigram index.
- warningFunction applied to a filtered column
Wrapping a column in a function makes the predicate non-sargable, so the index on that column is ignored.
→ Rewrite the predicate (e.g. col >= '2026-01-01' AND col < '2026-02-01') or add a functional/expression index.
- infoORDER BY without LIMIT
Sorting the full result set costs memory and may spill to disk.
→ Add LIMIT/OFFSET, or sort in the application when the set is small.
- warningLarge OFFSET pagination
OFFSET N still reads and discards N rows on every page.
→ Use keyset pagination: WHERE id > :last_id ORDER BY id LIMIT :n.
Suggested indexes
CREATE INDEX idx_o_status ON o (status);
CREATE INDEX idx_c_id ON c (id);
CREATE INDEX idx_o_customer_id ON o (customer_id);
CREATE INDEX idx_i_order_id ON i (order_id);
CREATE INDEX idx_o_id ON o (id);Hints are derived from WHERE, ON and ORDER BY columns — verify against your real cardinality and existing indexes.
About the SQL Query Analyzer
Paste a SQL statement to get a static review: SELECT *, missing WHERE clauses, UPDATE/DELETE without filters, leading-wildcard LIKE, non-sargable functions on filtered columns, NOT IN subqueries, implicit cross joins, joins without ON, deep OFFSET pagination, UNION versus UNION ALL and more — plus a cost estimate and ready-to-run CREATE INDEX suggestions.
Examples
Wildcard select
SELECT * FROM ordersOutput
Warning: SELECT * and no WHERE clauseKeyboard shortcuts
- Copy the main outputCtrl / ⌘ + Shift + C
- Download the resultCtrl / ⌘ + S
- Share this toolCtrl / ⌘ + Shift + S
- Reset the inputsAlt + R
- Open the tool search paletteCtrl / ⌘ + K
Related tools
SQL Formatter
Dev Utilities
Format and indent SQL queries for readability.
SQL Playground & Query Runner
Dev Utilities
Write schema and seed SQL, then run queries against an in-memory database.
SQLite Database Viewer & Query Runner
Dev Utilities
Open a .sqlite/.db file in your browser and run SQL against it.
.editorconfig Generator
Dev Utilities
Create an .editorconfig file with per-language overrides.
.htaccess Redirect Generator
Dev Utilities
Generate Apache .htaccess redirect and rewrite rules.
Android APK Analyzer & Explorer
Dev Utilities
Open an APK, decode its manifest and browse or download every file inside.
Frequently asked questions
Read more
- Debugging slow SQL queries: an index primer
Reading EXPLAIN output, understanding why an index gets ignored, and the indexing patterns that fix most slow queries.
- A SQL playground that runs in your tab: CSV import, schema explorer and exportable results
Practise SQL, prototype a query or analyse a CSV without installing a database. How SQLite-in-WebAssembly makes a private, zero-setup playground possible.
Comments
No login needed. Comments appear after a quick review.
Loading comments…
Version 1.0.0 · Updated 2026-08-17 · Runs entirely in your browser