A Query That Got Slow With Growth
SELECT * FROM orders WHERE customer_id = 42 took 2 ms a year ago and 900 ms now. The table grew from 100,000 to 50 million rows. What's the most likely cause?
SELECT * FROM orders WHERE customer_id = 42
Choose one answer
Too many orders belong to the customer with id 42
The database server has become slower with age
SELECT * is always slow and must list its columns
SELECT *
No index on customer_id: each query scans the table
customer_id