comparison Data & storage
Row-oriented versus column-oriented storage
The same four cells can occupy one block or span four. A field from many rows can touch fewer column blocks, while the fields of one row can touch fewer row blocks. The difference is physical grouping, not result size.
What it means
Row-oriented storage keeps fields from the same row together. Column-oriented storage keeps values from the same column together across rows. A query’s projection is the set of fields it asks for. When the unit of reading is a whole block, asking for one field can bring along other fields in that row or more values from that column, depending on the layout.
Consider two copies of the same four-row, four-column table. Each cell occupies one abstract unit. In the row layout, each four-unit block holds one complete row; in the column layout, each four-unit block holds one complete column. To compare them, mark the same requested cells in both copies, then count each block containing a mark once, even if it contains several marks.
Try it
Start with Selected row IDs set to 0 1 2 3, Projected column IDs set to 0 (the first column), and Physical block layout evidence set to Explicitly known in this fixture.
Row-oriented versus column-oriented storage
Select projected columns and rows in a bounded synthetic table; display blocks touched under stated row/column layouts and what the estimate excludes.
Synthetic inputs only. This is not a measurement of your hardware or service.
Each row block stores four cells from one row; each column block stores four cells from one column. Count distinct touched blocks, not selected cells.
Same selected cells, different block layouts
- Row blocks touched
- R0 · R1 · R2 · R3
- Column blocks touched
- C0
- Row-layout cells read
- 16 units
- Column-layout cells read
- 4 units
| Row | Column |
|---|---|
| 0 | 0 |
| 1 | 0 |
| 2 | 0 |
| 3 | 0 |
Evaluated evidence
- Selected row IDs
- 0 · 1 · 2 · 3
- Projected column IDs
- 0
- Physical block layout evidence
- known
Synthetic4x4 table with one-unit cells and four-unit blocks. Compression, caching, indexes, row groups and storage-engine metadata are excluded. Not a benchmark or universal workload ranking.
About this model
Every input is local synthetic evidence. Numbers stay as raw text until this model validates them. The shown evaluated values come from the same result as the explanation.
Presets replace the entire scenario. Reset restores all starting fields, scenario selection and model state; it does not change the open or closed state of this help or article FAQ.
No external request, device command, stored-input history or measurement is performed.
The query requests four cells: one in each row, all in column 0. In the row layout, those cells lie in R0, R1, R2, and R3. Each block contributes one requested cell and three unrequested cells, so the count is 4 blocks × 4 units = 16 units. In the column layout, all four requested cells lie in C0: 1 block, 4 units.
Now try Select one row across its columns: row 0, columns 0 1 2 3. You still ask for four cells, but this time R0 contains all of them: 1 block, 4 units. In the column layout, the cells lie in C0, C1, C2, and C3: 4 blocks, 16 units. The counts reverse because the cells moved from a single column to a single row, not because the result got larger.
For your own comparison, enter unique IDs from 0 through 3 separated by single spaces, or enter none. With a known layout, none in either field means there are no requested cells and zero touched blocks. A repeated or out-of-range ID is invalid; it does not produce a count. Inspect the evidence boundary keeps the starting cells but sets the layout evidence to Unknown / evidence unavailable. The count is then unknown, not zero. Reset restores all three starting inputs and the initial simulation state, clearing errors, history, and any comparison.
In practice
Look for evidence of physical grouping rather than inferring it from the interface used to request the data. For example, Parquet is a column-oriented format. PostgreSQL 18 table pages contain row items as well as page headers and item identifiers. Neither example implies that a real page or column occupies one of the simulation’s four-unit blocks.
Use the counts to compare the same requested rows and fields under the same block size. They are not latency measurements: the simulation omits compression, index lookup, caching, prefetch, row groups, storage metadata, and alternative ways of packing cells into blocks. With the fixed packing here, a nonempty request touches one row block per selected row or one column block per projected column. Compare those two numbers for the query you care about; neither layout touches fewer blocks for every query shape.
Frequently asked questions
Editorial questions based on the listed sources and explicitly labeled local examples.
Why does projection matter?
Under the declared column layout, selecting one column can touch fewer blocks than reading complete rows containing unneeded columns. The lab counts those blocks rather than assuming that every query benefits equally.
Can a single-row lookup favor row layout?
In this fixed four-by-four layout, selecting one complete row touches one row block but one block in each of four columns. That is a counterexample to a universal column-layout winner, not a real query benchmark.
Do block counts predict latency?
No. The counts omit caching, access order, transfer size, compression, CPU work and concurrency. They explain a layout/projection relationship, not elapsed time.
Does the model include compression or indexes?
No. Every cell is one abstract unit, with four units per block. Actual PostgreSQL/Parquet layouts have their own metadata and structures; the sample does not encode either format.
Sources & model boundaries
Primary references used for this explanation. The interactive example is an educational model, not a live check.
- Apache Parquet overview
Overview. Parquet is a column-oriented format. Physical layout and projected columns are distinct from a general access API.
Checked .
- Database page layout
Page structure and row layout. PostgreSQL stores relations in pages with row/item structures; actual page overhead exists beyond selected value bytes.
Checked .