Conceptual
Login

Row Width Decides How Many Rows Fit on a Page, and How Many Pages Your Query Reads

Because storage is read a page at a time, the number of pages a query must read is the number of rows it touches divided by how many rows fit on a page. Narrow rows pack tightly, perhaps a hundred to an 8 KB page; wide rows full of long text and spare columns pack loosely, so the same one million rows can cost ten thousand pages or a hundred thousand. This is the concrete reason SELECT * over a wide table is slower than selecting the three columns you need, and the reason a narrow table scans surprisingly fast.

Questions this Concept answers

  • Why does `SELECT *` over a wide table read more pages than selecting three narrow columns from it?