SQL Query Explainer

SQL Tools

Break a query into clauses with a plain-English explanation of each.

Runs entirely in your browser โ€” nothing is uploaded

Features

  • Splits the statement into SELECT, FROM, JOIN, WHERE, GROUP BY and friends.
  • Explains each clause in plain English.
  • Lists the tables, columns and joins involved.
  • Warns about SELECT *, missing WHERE on UPDATE/DELETE and cartesian joins.

How to use the SQL Query Explainer

  1. 1Paste the query you want to understand.
  2. 2Read the clause-by-clause walkthrough.
  3. 3Check the warnings before you run it in production.

Frequently asked questions

Is this the same as EXPLAIN in my database?

No. Database EXPLAIN shows the execution plan using live statistics. This is a static, readable explanation of what the SQL says.

Is this the same as EXPLAIN in a database?

No, and the distinction matters. A database EXPLAIN shows the execution plan the optimiser actually chose, using real statistics about your tables. This reads the text of the query and explains what each clause does. It helps you understand an unfamiliar query; it will not tell you why one is slow.

How do I work out why a query is slow?

Run EXPLAIN, or EXPLAIN ANALYZE, against your own database, because only it knows the table sizes, indexes and statistics involved. Look for sequential scans on large tables and for row estimates that are far from the actual counts. This tool is for understanding what a query means, which is a different question.

Can it explain any dialect?

It handles standard SQL and the common constructs of the major dialects. Vendor-specific extensions, stored-procedure syntax and unusual functions may be described only in general terms. The clause structure that carries most of a query's meaning is largely the same everywhere.