AdhocDB is an analytical SQL engine built from scratch. No config. No cluster. No external dependencies. Just point it at your data and go.
Data stored column-by-column for maximum analytical query performance. Scans only the columns you need.
Custom recursive-descent SQL parser. No ANTLR, no Calcite, no generated code. Every token parsed with intent.
SELECT, WHERE, GROUP BY, HAVING, ORDER BY, LIMIT, OFFSET, DISTINCT, subqueries, and aggregate functions.
Built-in HTTP server with a beautiful query editor. Schema explorer, syntax highlighting, autocomplete. Zero setup.
Full REPL with tab completion, SQL syntax highlighting, and formatted table output. Powered by JLine.
Understand exactly what the engine does. Step-by-step execution plans for every query.
Uses the latest Java features: sealed interfaces, records, pattern matching. Runs on any JVM.
One fat JAR. No Docker. No cluster. No config files. Download, run, query.
Validated against the industry-standard ClickBench analytical benchmark. Real queries, real data.
Clone and build with Gradle. Java 25 required.
git clone https://github.com/PakhomovAlexander/adhoc-db-live
cd adhoc-db-live
./gradlew jar
Point it at any TSV file. It loads and indexes automatically.
java -jar build/libs/adhoc-db-live.jar data.tsv
Write SQL. Get answers. It's that simple.
SELECT COUNT(*), AVG(duration)
FROM events
WHERE status = 'error'
GROUP BY region;
Character-by-character tokenization. Handles SQL keywords, identifiers, strings, numbers, and operators with zero dependencies.
Produces a clean AST using Java sealed interfaces and records. Pattern matching for exhaustive type handling.
Row filtering, group-by partitioning, and aggregate computation operate directly on column arrays for cache-friendly access.
Each column stored as a typed Java array. Only touched columns are read during query execution. Minimal memory overhead.
| Query | Description | Time | Relative |
|---|---|---|---|
| Q1 | COUNT(*) | 2ms | |
| Q6 | GROUP BY with COUNT + ORDER BY | 38ms | |
| Q12 | WHERE + GROUP BY + HAVING + ORDER BY | 125ms | |
| Q23 | Multi-column GROUP BY + complex WHERE | 210ms | |
| Q35 | Full analytical: nested aggregates + LIKE | 340ms |
Open source. Free forever. Built by a developer, for developers.