Optimize SQL with reasoning.
Paste a single statement, choose your engine, and get a dialect-aware rewrite with the reasoning — not just a result.
- PostgreSQL
- 12–18
- MySQL
- 5.7–9.0
- Oracle
- 11g–23ai
- SQL Server
- 2016–2025
Every engine above is covered on the free tier.
How it works
Step 1
Paste your statement
Paste one SQL statement and pick the engine and version it runs on. Nothing else is required.
Step 2
Get a dialect-aware rewrite
The rewrite follows your engine's syntax, version limits and known anti-patterns, not a generic template.
Step 3
Review every change
Each change arrives with its reason and risk level, plus index and statistics advice where it applies.
Frequently asked questions
What SQL optimization with this tool covers, and what it deliberately leaves to you.
What does a SQL optimizer do?
A SQL optimizer rewrites a query so the database can run it with less work. SQL Optimizer reads one statement, applies the syntax and version limits of the engine you choose, and returns a rewrite with a reason and a risk level attached to every change, plus index and statistics advice where it applies.
What does SQL optimization change, and what does it not?
It makes one statement cheaper for the engine that runs it: fewer rows scanned, a better join order, a projection that stops pulling columns nobody reads. It changes the statement and nothing else — your schema, indexes and data are left alone, and advice about them is reported separately so you can judge it against your own tables. Anything that could alter the result set is flagged rather than applied, and your SQL is not stored, logged or used for training.
How do I optimize a slow SQL query?
Measure before rewriting: read the plan with actual row counts, check whether the index on the filtered column can be used at all, cut the rows and columns the statement asks for, and only then change the SQL. Elapsed time alone does not say which step is the problem — stale statistics or a function wrapped around the filtered column are the usual causes.
Which numbers in an execution plan actually matter?
Four, in this order: estimated versus actual rows, scan versus seek, the join method and how many times it looped, and where the sort happens. When the two row counts differ by orders of magnitude, the plan was built on wrong statistics and the rest of it cannot be trusted. Total cost is not one of the four — it is an arbitrary unit comparable only inside the same plan.
Which databases are supported?
SQL optimization is supported for PostgreSQL 12 through 18, MySQL 5.7 through 9.0, Oracle 11g through 23ai, and SQL Server 2016 through 2025. The rewrite follows the rules of the selected engine, so pagination, quoting, null handling and string concatenation are emitted in that dialect rather than as a generic template.
Is SQL optimization the same as adding indexes?
No, and the two are separate levers. Index and statistics advice answers whether the database can find rows quickly; a rewrite answers whether the statement asks for the right work at all. SQL Optimizer reports both, but it never invents an index that the rewrite depends on without saying so.
Can a rewrite that is correct in one database break another?
Yes, and the failure is quiet. An empty string is NULL on Oracle but not on PostgreSQL; || concatenates in PostgreSQL and Oracle but is logical OR in MySQL's default mode; unquoted identifiers fold to lower case in PostgreSQL and upper case in Oracle. A rewrite is only correct for the engine and version it was written for, which is why pagination, quoting and null handling are emitted in the dialect you selected.
Does SQL Optimizer store or train on my SQL?
No. The statement is read to produce the rewrite and is never written to disk, never logged, and never used for model training. Schema and execution-plan fields are optional, and session recording is masked across the entire workbench.
How is this different from reading an EXPLAIN plan?
An execution plan tells you what the database did with the statement you gave it; SQL optimization changes the statement itself. The two are complementary: paste the plan into the optional context field and the advice accounts for it, but the rewrite is produced from the SQL.
Can I try SQL optimization before paying?
Yes. One optimization per day is free without an account, for all four SQL dialects (PostgreSQL, MySQL, Oracle, SQL Server), and the output safety checks are included. Paid plans raise the monthly limit to 1,000 (Pro) or 3,000 (Max) optimizations; there is no per-seat pricing.
Is it safe to run the optimized SQL in production?
Treat every rewrite as a suggestion to review, not a result to deploy. Changes that could alter the result set are flagged instead of applied silently, and statements that were not present in the input are called out before you run anything. Check the stated assumptions against your own schema first.