Why Your SQL Queries Are Slow
Welcome to **Phase 7: Performance Optimization**! Today is **Day 86**, and we're looking under the hood of the database engine.
The Physical Reality
When you run `SELECT * FROM users WHERE email = 'bob@example.com'`, the database doesn't just "Know" where Bob is.
If there is no index, it has to:
1. Open the file on the hard drive.
2. Read the first row.
3. Compare the email.
4. Read the second row...
5. ...and so on for every single row in the table.
This is called a **Full Table Scan**, and it's the biggest performance killer in SQL.
Why Scale Changes Everything
What we'll cover in Phase 7
Over the next 10 days, we'll learn:
Your Task for Today
Think about your most used table. How many rows does it have? If it's over 10,000, it's time to start thinking about performance.
*Day 87: Introduction to Indexes (B-Trees).*