# 6.2 The IO Elevator ![The Elevator](assets/arch_wait_elevator.png) This is the most famous wait event in all of Postgres history. It is the **I/O Wait**. ## The Basement Reality As we saw in **[[Chapter 5 - The Hunger of Resources#The Lesson of the Desk|Chapter 5]]**, the difference between the warm Memory desk and the frozen Disk Cabinet is vast. When a Scout (Sequential Scan) realizes the Page he needs isn't in Memory, he has to call the basement. The Scout stands in front of the **I/O Elevator**. He pushes the button. And then... he waits. In "Elephant Time," this wait can last **four months**. During this time, the Scout isn't using any CPU. He isn't joining data. He is just standing there, staring at the elevator doors, tapping his foot. ## How to Spot It In your diagnostics tools (like `pg_stat_activity` or the Admiral's Battle Report), you will see these events labeled: - **`IO:DataFileRead`**: "I'm waiting for a worker to bring a page up from the basement." - **`IO:DataFileWrite`**: "I'm waiting for a worker to take this suitcase down to the basement." - **`IO:WALWrite`**: "I'm waiting to make sure my Pocket Diary note is bolted to the floor." If your database is "I/O Bound," it means your army is mostly just a group of people standing in front of elevator doors. The solution? Build a faster elevator (better storage) or, better yet, find a way to make sure the data is already on the desk (more Memory). --- [[Chapter 6/6.1 - Wait Events Overview|← 6.1 - Wait Events Overview]] | [[Chapter 6/6.0 - The Waiting Game|↑ 6.0 - The Waiting Game]] | [[Chapter 6/6.3 - Locks & Latches|6.3 - Locks & Latches →]]