Same Job, Two Engines: InnoDB and Iceberg Internals

The first version of my stock analysis repo ran analytics on an OLTP engine and my second version runs the same thing on an OLAP stack. I chose the OLAP stack because of a single optimization, but had to understand everything about the lakehouse to take advantage of it.

OLTP

InnoDB’s Three Guarantees

Rows store all columns together Fetching one bar for one symbol touches a single spot on disk, which is exactly what ingest wants. An indicator that needs two columns still fetches every column through the buffer pool.

Indexes speed up reads and slow writes Every index is its own B-tree and every write must update all B-trees in the table. B-trees are extremely quick to read. The goal of any index is to speed up reads at the cost of slower writes. Great for selective reads, awful for write heavy ingestion work. Which was my reasoning why my Raw* tables only have a primary key, and why there’s heavy indexing and partitioning on the tables that receive the Raw*’s work.