Row vs Columnar Storage: How Table Layout Shapes Query Speed
Databases must decide how to physically arrange table data on disk, either keeping each record's fields together or grouping each field's values across records. Row storage keeps a full record contiguous, which suits applications that repeatedly fetch or change individual records by key. Columnar storage keeps each column contiguous, letting analytical queries read only the few fields they need and compress data efficiently. The article illustrates this with a fifty-column, hundred-million-row example where columnar layout could cut data scanned from about twenty gigabytes to a few hundred megabytes. The trade-off is that columnar stores handle single-row writes poorly, so neither layout is universally better and the right choice depends on the query's access pattern.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in