Hacker News new | ask | show | jobs
by natebrennand 4454 days ago
There are some interesting implications on databases in terms of column-stores vs row-stores due to CPU caching. Besides the I/O improvements, column-stores benefit greatly from better CPU usage because the data is iterated over by type (column by column), so the same operators stay in the cache. This allows data to be pipelined in to the CPU and processed very quickly relative to traditional row-stores. It can even be efficient to operate on compressed data [1] if the relevant decoding data can be kept in the cache.

In case you missed it, there was a relevant article last week about how B-Trees benefit by reducing the number of cache requests.

[1]. http://db.lcs.mit.edu/projects/cstore/abadisigmod06.pdf

[2]. http://www.me.net.nz/blog/btrees-are-the-new-black/

1 comments

Yes, array-of-structs -> struct-of-arrays is a well known manual optimization pattern. Compilers sadly don't do it, except to cheat on SPECint.