๐ Row-oriented
Each record is stored together, side by side.
Data read from storage
The same table can be stored in different ways. Edit a few records, choose which columns to ask for, and see what a simple SELECT query needs to read in row-oriented and column-oriented storage.
| Row | id | name | department | salary | Actions |
|---|
Supports SELECT * or a comma-separated list of columns from employees, with an optional equality filter such as WHERE department = 'Design' or WHERE salary = 90000. Column names are id, name, department, and salary.
Each record is stored together, side by side.
Data read from storage
Values from the same column are stored together.
Data read from storage
This lab counts individual table cells accessed, not disk pages or bytes. For the row-oriented model, all columns in every row are read to find matching records and return the requested values. For the column-oriented model, an optional filter reads that column for every row, then reads requested columns only for matching rows. A filter column already read is not counted twice. Real database engines use indexes, compression, caching, and storage pages, so their physical I/O can differ.