Hacker News new | ask | show | jobs
by ronfriedhaber 16 days ago
One can argue each view of a database is merely a derivate of the WAL, and therefore every view is an index. The major benefit of columnar databases is the data stored being continuous in memory. Avoid all serialize/deserialize and control flow logic. Most core index data structures in relational DBs do not support this kind of tight vector view, Arrow[1]is a format that does.

Theoretically one can have a custom index extension which stores the data in a column-oriented manner, yet then one has major duplication, which is a problem for petabyte-scale databases, and is an even bigger problem in the Cloud.

KDB+ is the best implementation of a columnar DB in my opinion. Simple C, and one can understand how the data is stored down to the DRAM cells. Durability is just MMAP, which is fine as OLAP DBMSs tend not to be ACID.

In my personal opinion one shall learn from the best. The best in the world in massively parallel vectorized computation are the people at OpenAI and Anthropic, and the people who built PyTorch. Much of their work can be applied to analytical DBMSs.

(Draft, of course the topic is much more nuanced)

[1] https://arrow.apache.org/

1 comments

Or, every index is a view.
Yes, this is the cleaner interpretation. More specifically, every index is a materialized view that is always updated atomically with the table itself.
> that is always updated atomically with the table itself.

Is "atomically" necessarily true? I am pretty sure many relational DBMS implement index rehydration as an async process.

I'm not sure, I have never seen that except when explicitly taking the index offline. To my mind it doesn't make sense for (active) indexes to be out of sync with the table they're referencing, but I can't vouch for the sanity of 100% of database implementations out there. Maybe read "should be" instead of "is".