ColumnarDB
Analytical Query Engine in C++17
A from-scratch columnar database with SIMD-accelerated vectorized execution
github.com/sidx007/ColumnarDB
Analytical Query Engine in C++17
A from-scratch columnar database with SIMD-accelerated vectorized execution
github.com/sidx007/ColumnarDB
ColumnarDB is a complete analytical query engine built from scratch in C++17. It covers every layer โ from a hand-written SQL parser down to custom memory allocators โ with a focus on squeezing performance out of modern hardware.
Recursive-descent parser โ AST โ cost-based query planner with selectivity estimation, index selection, and join reordering.
Volcano-model iterator with 1024-row batches. Operators: SeqScan (AVX2), IndexScan (B+ Tree), Filter, Aggregate, HashJoin.
RowGroups of 64K rows. Columns stored with Dictionary/RLE compression and 1-bit-per-row Null Bitmaps.
MVCC with Snapshot Isolation. Epoch-based GC. B+ Tree with hand-over-hand locking for concurrent reads.
Scan Throughput โ 10M rows
Allocator โ 100k cycles
| Size | Slab | malloc | Speedup |
|---|---|---|---|
| 32 B | 5.97 ms | 9.94 ms | 1.7ร |
| 512 B | 10.35 ms | 30.57 ms | 3.0ร |
Query Latency โ 100k rows
| Query | Latency |
|---|---|
| Full Scan | 25.78 ms |
| COUNT Aggregate | 8.85 ms |
| GROUP BY SUM | 20.27 ms |
ColumnarDB exposes a SQL interface that covers CREATE, INSERT, SELECT with WHERE filters, GROUP BY aggregations, and JOINs โ all executed through the vectorized pipeline.