Preparing the page
Public context is loading before any interactive tool code.
Preparing the page
Public context is loading before any interactive tool code.
Tokenize a single SELECT locally, separate its retrieval, source, filter, group, order, row-bound, parameter and locking stages, and see what still requires a real database plan.
Your checked result will appear here.
The token strip becomes retrieval, source, filter, group, order, row-bound, parameter and locking lanes. Structural flags stay separate from the unavailable database plan.

The tool does not guess a missing schema or silently rewrite a query. Unsupported statement shapes stop with a visible error.
Line and block comments are removed; strings, quoted identifiers, placeholders, parentheses and common operators remain distinct tokens.
WITH, compound queries, write verbs, multiple statements, nested comments and dollar-quoted strings are rejected in this version.
Clause keywords inside a function or subexpression do not split the outer statement because parenthesis depth remains visible.
Counts and clause excerpts come from tokens; flags identify review questions without predicting a scan, index, cost or runtime.
The tested fixture contains three output expressions, one source, two filter predicates, one sort, a row limit and two placeholders. Its ordering step triggers one plan-review flag.
SELECT id, status, total_cents FROM orders WHERE status = $1 AND total_cents >= $2 ORDER BY created_at DESC LIMIT 50;
# SELECT clause explanation
## Retrieval · 3 expressions
id, status, total_cents
## Source · 1 branch
orders
## Filtering · 2 predicates
status = $1 AND total_cents >= $2
## Ordering
created_at DESC
## Row bound
LIMIT 50
## Parameters · 2Observed: 5 stages · 3 expressions · 1 source · 2 predicates · 2 parameters · 1 flag
DELETE FROM orders WHERE id = $1;The first token is not SELECT, so no explanation is generated inside this read-only boundary.
A structural pattern can deserve attention without being wrong. Data distribution, indexes, statistics, engine version and workload decide the real plan.
An unqualified * asks for every visible column; compare that shape with the consumer's actual needs.
A source query without LIMIT or FETCH declares no result ceiling, even if the current table happens to be small.
Multiple or comma-separated sources require a deliberate join and cardinality review.
DISTINCT, grouping and ordering can use different strategies; inspect the target engine's plan rather than assuming one.
EXPLAIN belongs to the database because the planner needs the actual schema, indexes, statistics, configuration and permissions.
PostgreSQL, MySQL and SQLite expose different plan formats and levels of detail.
Plain EXPLAIN commonly shows estimates; ANALYZE-style variants can execute the statement and therefore require safer data and privileges.
Look for scans, joins, sorts, temporary structures and row-estimate gaps in the context of the real workload.
A syntactic rewrite is not an optimization until the target plan and representative execution evidence improve.
The output describes statement structure only. It does not prove correctness, authorization, result shape, index use or speed.