Answering queries on StackOverflow
summary
Begins from concrete patterns: novices missing primary keys, indexing every column, and queries that are not sargable because indexed columns are wrapped in functions; recommends finding worst offenders via the slow log and pt-query-digest, fixing one heavy query often cures CPU spikes. Notes common fixes — add composite indexes, rewrite OR to UNION or CTEs, prefer set-based SQL over loops — and highlights features liked or missing such as the SEQUENCE table, windowing performance, materialized views, and better OR optimization.
AI-written summary · about
chapters (16)
- 0:00Introduction
- 1:13What is an index
- 3:30Finding the worst query
- 5:17Beginner users
- 6:16Getting over the hurdle
- 7:00Intermediate users
- 8:00Lack of index
- 9:14DBAs
- 10:21Default tuning
- 11:20Other resolution mechanisms
- 12:17Database maturity
- 13:42Ecosystem
- 15:44Ideal ecosystem
- 16:57User needs
- 17:59Sharding
- 20:16Conclusion
