Row Store vs. Columnar Store

6 days ago

Row Store vs. Columnar Store

Same rows, same schema. Only the byte order on disk changes, and that one choice decides what the database is good at.

  • A row store keeps each row contiguous. Perfect when you want everything about one record, like give me this whole order. Wasteful when you want three columns across a million rows, because the disk still steps over every other column to get there.

  • A columnar store keeps each column contiguous instead. An average over one column touches that column and skips the rest of the table. Values in a column also share a type and repeat often, so they compress far better than a mixed row does [1].

Row store keeps each row contiguous; a columnar store keeps each column contiguous.
Row store keeps each row contiguous; a columnar store keeps each column contiguous.

That second shape is what analytics looks like, meaning wide scans over many rows, but only a few narrow columns. It is why OLAP engines are columnar and OLTP engines are not.

I ran into the gap directly. In my South Korea World Cup Analytics Warehouse, migrating the dbt star schema from local DuckDB to AWS Athena over partitioned S3 Parquet cut bytes scanned 331x. Parquet is columnar [3], so Athena reads only the columns a query names. Same 234K+ events, same queries, different layout on disk.

The Postgres schema I built during my internship was different: the app reads and writes one SKU record at a time, so a row store is what it wants.


References

[1] D. J. Abadi, S. R. Madden, and N. Hachem, “Column-stores vs. row-stores: How different are they really?” in Proc. ACM SIGMOD Int. Conf. Management of Data, Vancouver, BC, Canada, 2008, pp. 967-980.

[2] M. Stonebraker, D. J. Abadi, A. Batkin, X. Chen, M. Cherniack, M. Ferreira, E. Lau, A. Lin, S. Madden, E. O’Neil, P. O’Neil, A. Rasin, N. Tran, and S. Zdonik, “C-Store: A column-oriented DBMS,” in Proc. 31st Int. Conf. Very Large Data Bases (VLDB), Trondheim, Norway, 2005, pp. 553-564.

[3] S. Melnik, A. Gubarev, J. J. Long, G. Romer, S. Shivakumar, M. Tolton, and T. Vassilakis, “Dremel: Interactive analysis of web-scale datasets,” Proc. VLDB Endowment, vol. 3, no. 1-2, pp. 330-339, 2010.

[4] Apache Software Foundation, “File format,” Apache Parquet Documentation. [Online]. Available: https://parquet.apache.org/docs/file-format/. [Accessed: Jul. 25, 2026].

[5] Amazon Web Services, “Columnar storage,” Amazon Redshift Database Developer Guide. [Online]. Available: https://docs.aws.amazon.com/redshift/latest/dg/c_columnar_storage_disk_mem_mgmnt.html. [Accessed: Jul. 25, 2026].

[6] Amazon Web Services, “Amazon RDS vs. Amazon Redshift,” AWS Cloud Comparisons. [Online]. Available: https://aws.amazon.com/compare/rds-and-redshift/. [Accessed: Jul 8. 7, 2026].

[7] Amazon Web Services, “What is database storage?” AWS Cloud Computing Concepts Hub. [Online]. Available: https://aws.amazon.com/what-is/database-storage/. [Accessed: Jul. 7, 2026].