Module 1 · Storage

Episode 6 Row vs. Column vs. PAX

7 min · SQL · Postgres

Title card of Episode 6: Row vs. Column vs. PAX

▶ This video is coming to YouTube soon.

The same table stored three ways: whole rows (NSM, like Postgres), one file per column (DSM), and PAX's columns-inside-pages. Watch which pages an OLTP lookup and an OLAP average touch, then measure it on a 300,000-row Postgres table with EXPLAIN BUFFERS.

Chapters

  1. 0:00Intro
  2. 0:14One column, every page
  3. 0:32Rows together: NSM
  4. 1:12Columns apart: DSM
  5. 1:49Both at once: PAX
  6. 2:20Inside one page: what the CPU loads
  7. 2:57Pages read on the real order_items
  8. 3:47What real column stores add
  9. 4:23The code: the same average, two layouts
  10. 4:53Proof: Postgres is a row store
  11. 5:58Trade-offs
  12. 6:31Recap
  13. 7:02Next: The Buffer Pool