[HN Gopher] Optimize the Data Layout
___________________________________________________________________
Optimize the Data Layout
Author : napsterbr
Score : 26 points
Date : 2024-10-11 12:54 UTC (4 days ago)
(HTM) web link (cedardb.com)
(TXT) w3m dump (cedardb.com)
| jakozaur wrote:
| A similar explanation could be applied to columnar vs row
| databases.
| durner wrote:
| The idea of comparing column and row storage actually inspired
| this whole post.
| tomnipotent wrote:
| Your read performance test is biased towards a struct of
| arrays, array of structs should outperform when needing
| random non-contigious look-ups. In the context of fixed-page
| databases, this is an important distinction since row-based
| and hybrid storage (PAX) will need to read fewer pages than a
| pure columnar store.
| bunderbunder wrote:
| They're broadly the same thing as AoS vs SoA. Just relax the
| "array" bit to allow other kinds of core data structures such
| as B-trees.
| o11c wrote:
| Where this gets interesting is when you have patterns of sparse
| data. Often a mix is best - AoS fails badly for partially-sparse
| rows, and SoA requires duplicating the key, but SoAoS only has to
| duplicate the key per struct, and SoAoSoA only has to duplicate
| it once per sequence of adjacent structs.
___________________________________________________________________
(page generated 2024-10-15 23:01 UTC)