What it is
plan is a single-node transactional database kernel prototype built around TPC-H, with a compute engine and a storage engine. It isn’t a product — it’s a testbed for how a kernel should be written.
| Language | Go |
| License | Apache-2.0 |
| Stars / Forks | 8 / 4 |
| Open issues | 20 |
| Last push | 2026-10-22 |
| Repository | daviszhen/plan |
Snapshot at build time, not live.
Architecture
Both diagrams come from the repo’s book/ directory (Apache-2.0):
Modules
| Directory | Responsibility |
|---|---|
parser | SQL parsing, binding, expressions |
compute | vectorized execution, operators, chunks |
storage | storage engine (pages, indexes, transactions) |
storage2 | next-generation storage engine (in progress) |
chunk | columnar memory layout |
common / util | types, errors, utilities |
cmd/plandb | interactive psql server |
cmd/tester | non-interactive TPC-H runner |
Capabilities
create schema/create tablecopyfrom parquet and CSVinsert ... values- all 22 TPC-H queries (via
tester)
TPC-H 1g results
22/22 marked right; compared with DuckDB and MatrixOne (ignoring precision and headers):
| Result | Count |
|---|---|
| identical to DuckDB | 16 |
| differs from DuckDB (address/comment columns etc.) | 6 |
| identical to MatrixOne | 20 |
| known difference (q13: left join to inner join) | 1 |
The full table is in the repo README.
Documentation
- 快速实现数据库内核: binding, CTE preprocessing, table-definition parsing, query planning (filter pushdown, join ordering, column pruning, reference counting, output expressions), vector/chunk execution;
STORAGE2_DEVELOPMENT_PLAN*: phased plans for the second storage engine;storage-test-plan.md/storage2-tdd-plan.md: testing and TDD plans.
All in the repository.
Quick start
make plandb
./plandb
psql -h 127.0.0.1
make tester
./tester tpch1gddl --ddl "create table ..."
Known limits
- Prototype; not production-ready;
- 20 open issues;
storage2is still evolving and its interfaces may change;- Covers the SQL subset TPC-H needs, not a full SQL engine.
Relation to this site
The database series here is about reading other kernels (optimizers, gporca, Lucene); this project is about building one. They inform each other.
Implementation series
The repo’s build notes distilled into posts: Building a database kernel.

