System Design
16. Performance EngineeringAnimated
Database Query Profiling
Finding slow queries.
The idea
Slow query logs and EXPLAIN show where time goes.
Watch it work
Press play, pause, or step through. Some animations have settings you can change.
- client
- gateway / proxy
- service
- cache
- data store
- queue / stream
Step one: add indexes and cache.
- step:
- 1/4
- at:
- App servers
1/7
The green dot is a request moving through the system.
Step by step
- 1Enable the slow query log
- 2Find the worst queries
- 3Read their plans
- 4Index or rewrite them
Where it is used
Database tuning.
Watch out for
Fix the few queries that dominate.