Query Analyze
Query Analyze is a static SQL rewrite advisor that runs entirely in your browser. Paste a SQL query and click "Query Analyze" to get rewrite suggestions and query-shape warnings. No database connection is needed and the query is never executed.
How it works
- SQL text is normalized so comments and literals do not create obvious false positives.
- A set of client-side checks looks for common rewrite opportunities and correctness risks.
- Findings are labeled by severity and confidence so you can decide what deserves validation.
Severity and confidence
Each finding has a severity and confidence level:
- HIGH confidence — safe to act on in most cases.
- MED confidence — usually correct but verify against your specific query.
- LOW confidence — heuristic suggestion; treat as a starting point, not a verdict.
Finding categories
The public docs intentionally do not list every internal check or detection pattern. The advisor broadly covers:
- predicates that can hide useful indexes
- NULL-sensitive anti-join patterns
- pagination and ordering mistakes
- joins that imply accidental row multiplication
- existence checks that count more than necessary
- timestamp boundary patterns
- broad scans caused by wildcard or negative predicates
- repeated subqueries and readability issues
- cases where a rewrite should be validated with EXPLAIN before applying
Design principles
- Rewrite-first — the advisor focuses on SQL shape before suggesting schema changes.
- Hedged wording — messages say "often", "may", "typically". No absolute claims about planner behavior.
- Validate with EXPLAIN — static analysis is a starting point, not a substitute for measuring the original and rewritten query.