SQLite Query Explainer: The tool that teaches SQL by reading queries
Simon Willison has released a web tool that runs your SQL queries on a SQLite database in the browser and explains, line by line, what the engine is doing under the hood. It takes the output of EXPLAIN QUERY PLAN and the low-level bytecode from EXPLAIN, and annotates it with plain English descriptions.
Why it matters. Understanding what the query planner does is the difference between a query that responds in 50 milliseconds and one that scans the entire table. Until now you had two options: learn to read EXPLAIN output by eye (hard, few actually do it), or paste your query into an LLM chat every time (works, but doesn’t build lasting understanding). This tool sits in the middle: it shows you the actual plan with annotations, so you learn by seeing, not by asking.
He built it with Claude Fable, the same tool he recently used to rewrite sqlite-utils, after reading a post by Julia Evans saying she wanted to learn how to read SQLite query plans.
A declared limitation: Willison himself writes that he doesn’t know enough about SQLite query plans to verify the results. The explanations should be taken as learning aids, not definitive truth.
If you want to try it, the tool is public and requires no installation: open the page, write a query, read the annotations.
In detail
SQLite, like any database, has a query planner: when you give it a query, it decides how to execute it. It can use an index, do a full table scan, join tables in a certain order. The same query written two different ways can run in milliseconds or minutes, depending on the planner’s choices.
The EXPLAIN QUERY PLAN command lets you see these choices. The output is compact: a few lines that say, for example, SEARCH TABLE orders USING INDEX idx_customer or SCAN TABLE orders. The difference between SEARCH and SCAN is huge: the first uses an index and touches few rows, the second reads the entire table.
There’s also a deeper level, EXPLAIN, which shows the bytecode that SQLite’s virtual machine actually executes: a sequence of instructions like OpenRead, Column, Next, Close. It’s SQLite assembly, and reading it requires familiarity with the database’s internal architecture.
Willison’s tool takes both outputs and annotates them. For each line of EXPLAIN QUERY PLAN it adds a sentence explaining what it means. For each bytecode instruction it says what it does and why it’s there. The result is a readable explanation of something that normally only an expert DBA would know how to interpret.
Technically, the tool runs entirely in the browser. SQLite is compiled to WebAssembly and Python runs via Pyodide, also in WebAssembly. No server, no API key, no data leaving your computer.
The construction pattern is as interesting as the result. Willison used Claude Fable to have the tool written after reading Julia Evans’s post. It’s the same approach as the recent sqlite-utils 4.0: a clear idea, an agent that builds it, human review at the end. The fact that Willison admits he can’t verify the explanations is significant: the tool is useful for exploring, but it’s not an oracle.
This connects to a theme running through the discussion of AI empowering people. The tool doesn’t replace your understanding of SQL: it accelerates it. Instead of reading abstract documentation about what Next does in SQLite’s bytecode, you see the instruction applied to your query, with a contextualized explanation. You learn from the real case, not from theory.
The limitation, honestly declared, is that the annotations could contain errors. If you’re optimizing a query in production, this tool is a starting point for understanding what’s happening, not the definitive answer. For that you still need someone who can read an execution plan by hand and can confirm or dispute what the tool says.