Execution Plan Analysis — Read What the Engine Actually Chose
Optimize what the engine does, not what the SQL looks like: cost concentration, estimate-vs-actual gaps, and plan warnings — with forensic evidence rules.
View Resource →Coding Workflows
"Optimize this query" gets generic indexing advice. Pick a goal, a database platform, and an evidence mode — and get an optimization contract: execution-plan thinking, per-platform guidance, justified index recommendations with their write tax, and a forensic mode where generic advice is forbidden and missing evidence becomes a command to gather it. Runs entirely in your browser.
Which query, slow in what way? E.g. "Find why the order-search query behind GET /orders takes four seconds."
Forensic is the flagship: every conclusion cites evidence, and generic advice is forbidden.
Paste it and the prompt carries it verbatim — the detector also flags SELECT * and non-sargable patterns.
If you have it, the analysis grounds in it. If not, the prompt demands the capture command instead of inventing one.
How slow, since when, for which inputs — measured, not felt.
Optimize what the engine does, not what the SQL looks like: cost concentration, estimate-vs-actual gaps, and plan warnings — with forensic evidence rules.
View Resource →Map every predicate, join, and sort to the index that serves it — or doesn't. Composite order rules, covering decisions, and the write tax nobody mentions.
View Resource →EXPLAIN shows type=ALL on a 1.2M-row table: full scan on every search. MySQL optimization with InnoDB clustering realities, version-aware optimizer limits, and covering reads.
View Resource →An 11-minute report that reads two years of orders to return 24 rows: the rows-read to rows-returned ratio is the target — filters pushed down, pre-aggregation costed honestly.
View Resource →A five-table join that got slow as data grew: establish cardinality first, check each join strategy against the data shape, and hunt the fan-out doing wasted work.
View Resource →A real plan with the story inside: estimate says 42 rows, actual is 51,840. PostgreSQL analysis grounded in the plan — stale statistics, bloat, planner costs, and the index arsenal.
View Resource →Queries that were instant at launch and crawl a year later: scale-aware investigation of work that grows faster than the data, before it owns the server.
View Resource →"Optimize this query" gets generic indexing advice. The optimization contract demands evidence: real bottlenecks, justified indexes with their write tax, and no invented plans.
View Resource →At 240M rows and growing: keyset pagination over OFFSET, partition pruning, and the PostgreSQL specifics — analysis aimed at the scale the table will reach, not the scale it passed.
View Resource →Fast for most customers, 30x slower for the largest two — the parameter sniffing signature. SQL Server tuning with actual plans, clustering-key economics, and CONVERT_IMPLICIT hunting.
View Resource →State the optimization objective, pick the goal — Query Speed, Join Optimization, Index Strategy, Large Dataset Scaling, Reporting Query Optimization, or Execution Plan Analysis — and choose the database platform and evidence mode. Each goal is a different optimization philosophy with its own priorities and analysis areas; each platform adds real engine-specific guidance — actual-plan tooling, optimizer quirks, clustered-index realities — not just a label. Then provide what evidence you have: the query (the detector flags SELECT * and non-sargable patterns), the execution plan, tables with row counts, existing indexes, and measured symptoms. What you can't provide changes the contract: no plan means the prompt demands the exact capture command instead of inventing one; no index list means no index may be assumed. Click Generate SQL Optimization Prompt for the full contract — bottleneck analysis, impact-ordered opportunities, justified index recommendations with their write tax, tradeoffs, and an assumptions ledger. Forensic mode adds the rule that defines the tool: generic advice is forbidden. Nothing leaves your browser.
No — it builds the contract. The output is a prompt that instructs an AI how to analyze and optimize your SQL: which philosophy to apply, what platform realities to respect, what evidence to demand, and how to justify every recommendation. The flagship is the evidence discipline — no invented execution plans, no assumed indexes, no assumed row counts, and in Forensic mode, no generic advice at all.
Because it gets generic database advice: "add an index on the WHERE columns, avoid SELECT *" — recommendations that read the same for every query ever written. Real optimization is evidence work: which operator concentrates the cost, what the estimate-vs-actual gap says about statistics, whether the join order matches the cardinalities, what each candidate index taxes on writes. The contract demands exactly that, and forbids the rest.
Same reasoning as frameworks in the Test Case Prompt Generator: the optimization question is identical — only the engine realities differ. SQL Server brings parameter sniffing and clustering-key economics; PostgreSQL brings EXPLAIN (ANALYZE, BUFFERS), bloat, and planner cost settings; MySQL brings InnoDB realities and version-specific optimizer limits. Each platform mode injects that real guidance into the same contract — and the platform-specific search intents live as resources.
Depends on what you know. If you don't yet know where the time goes — could be code, could be network, could be the database — start with the Debugging Prompt Generator's performance investigation: it finds the bottleneck. Once the suspect is a specific query, this tool takes over: query-level analysis is its entire job. In this category's verbs: Debugging investigates, SQL Optimization optimizes.
The contract refuses to fake one. Its non-goals open with "do not invent execution plans" — so instead, the prompt demands the exact capture command for your platform (EXPLAIN (ANALYZE, BUFFERS) on PostgreSQL, the Actual Execution Plan plus SET STATISTICS IO, TIME ON on SQL Server) and marks every plan-dependent conclusion as pending that evidence. In Forensic mode, gathering the missing evidence becomes the first recommendation itself.
Review's SQL language mode judges code that happens to contain SQL — injection risks, readability, obvious anti-patterns — from a reviewer's perspective. This tool owns performance: execution plans, cardinality, join strategy, index economics. The category rule is strict: everything SQL-performance belongs here, which is why the review tool deliberately has no database-review resources.
Only with a pedigree. The contract's index rules: every recommendation must name the exact predicates, joins, or sorts it serves — no index without a clause; composite column order must be justified; covering decisions come with their storage and write cost; and every index states its write tax — which inserts and updates it slows. It also checks existing indexes first: extending a near-miss index beats creating an overlapping new one.