Skip to content

sql.liter8.sh

Read the plan, not the query.

A real relational engine in your browser — parser, cost-based planner, statistics, volcano executor, MVCC. Write a query, see the rows it returned and the pages it cost. Free, local-first, no account required.

Every model writes SQL, all day, and writes it badly in a specific and predictable way: correct on a hundred rows, catastrophic on ten million. Grading here is not did you get the right rows. It is did you get the right rows without a four-million-row sequential scan.

Seven tracks

What is actually running

A relational engine in plain TypeScript: a lexer and recursive-descent parser, heap tables in real 8KB pages, B-tree indexes with a genuine node fanout, per-column statistics with an equi-depth histogram, a cost-based planner modelled on PostgreSQL, a volcano executor that counts every row and page it touches, and an MVCC transaction manager with deadlock detection. No server runs any of it. It runs in this tab.

The cost constants are a model, not a prediction. Rows, pages and loops are real counts the executor took; nothing here is printed in milliseconds, because that would imply it forecasts your production database.