Query Optimizer
9 checks for the patterns that make a query scan more than it needs to, each with the reason it costs something.
Your query
What it found
5 findings, 2 costly
SELECT * reads every column
CostlyColumnar stores like Snowflake, BigQuery, Redshift and Athena bill by bytes scanned, and reading a column you discard costs exactly as much as reading one you use. On a wide table this is usually the single largest avoidable cost in a query.
Do this instead: Name the columns you actually need. If you are exploring, add a LIMIT so the scan stays small.A function wraps the column being filtered
CostlyOnce a column is inside a function the engine can no longer match it against an index or prune partitions by it, so a filter that looks narrow reads everything. This is the usual reason a date filter still scans the whole table.
Do this instead: Rewrite the predicate so the bare column is on one side — compare against a computed range instead of transforming the column.LIKE pattern starts with a wildcard
Worth fixingA pattern beginning with % cannot use an index or a column's min/max statistics, so the engine has to read and test every row.
Do this instead: Anchor the pattern if you can (LIKE 'abc%'). For genuine substring search, a full-text or search index is the right tool.Tables joined with a comma
Worth fixingComma joins produce a cross product unless every pair is constrained in the WHERE clause. One forgotten predicate multiplies the row count instead of raising an error.
Do this instead: Use explicit JOIN ... ON. The join condition then sits next to the join it belongs to, and a missing one is visible.ORDER BY without a LIMIT
Worth fixingSorting is one of the few operations that cannot stream — the engine materialises and orders the entire result before returning the first row. Without a LIMIT you pay that for rows you may never read.
Do this instead: Add a LIMIT if you only need the top rows. If the ordering is for a downstream consumer, consider sorting there instead.
These are patterns in the text, not a cost estimate. Without your table sizes, partitions and indexes — none of which leave your machine — nothing here can tell you which of two queries is faster. Check the plan in your engine for that.
How to Use Query Optimizer
How to identify and eliminate expensive SQL query patterns that cause full table scans.
Paste Your Query
Paste any SELECT or analytical SQL query that is running slowly or needs performance review.
Choose Target Database
Select your database engine so the optimizer evaluates engine-specific indexing and partition pruning rules.
Inspect Anti-Pattern Warnings
Review actionable warnings explaining why specific clauses scan more data than necessary and how to fix them.
Frequently Asked Questions
Common questions about privacy, supported dialects, and how Query Optimizer works under the hood.
What anti-patterns does SQLParity check for?
It checks for 9 common performance anti-patterns: functions on filtered columns (which break index sargability), SELECT * on wide analytical tables, leading-wildcard LIKE queries (%pattern), NOT IN subqueries containing nulls, missing WHERE clauses, and unpartitioned scans.
What does "functions on filtered columns break index pruning" mean?
Writing WHERE DATE(created_at) = "2026-01-01" forces the database engine to evaluate the DATE() function on every row instead of performing an index range seek. Rewriting it as WHERE created_at >= "2026-01-01" AND created_at < "2026-01-02" allows instant index pruning.
Does SQLParity need access to my database credentials or EXPLAIN plan?
No. It performs static SQL AST analysis directly in your browser. You never need to supply database passwords, connection strings, or internal table access.
Why avoid NOT IN with subqueries?
If the subquery returns even a single NULL value, standard SQL specifies that NOT IN evaluates to UNKNOWN/false for every row, often leading to unexpected zero results or costly table scans. Using NOT EXISTS is safer and faster.