The Backend Engineering Show with Hussein Nasser
The Backend Engineering Show with Hussein Nasser
Hussein Nasser
A Deep Dive in How Slow SELECT * is
39 minutes Posted May 2, 2023 at 1:00 am.
Intro
Database Page Layout
How SELECT Works
No Index-Only Scans
Deserialization Cost
Not All Columns are Inline
Network Cost
Client Deserialization
0:00
39:23
Download MP3
Show notes
Fundamentals of Database Engineering udemy course (link redirects to udemy with coupon)
https://database.husseinnasser.com
In a row-store database engine, rows are stored in units called pages. Each page has a fixed header and contains multiple rows, with each row having a record header followed by its respective columns. When the database fetches a page and places it in the shared buffer pool, we gain access to all rows and columns within that page. So, the question arises: if we have all the columns readily available in memory, why would SELECT * be slow and costly? Is it really as slow as people claim it to be? And if so why is it so? In this post, we will explore these questions and more.
https://medium.com/@hnasr/how-slow-is-select-8d4308ca1f0c