Database performance is operational work that never ends. Queries slow as data grows; new code introduces inefficient queries; load patterns shift over time. Active monitoring catches problems early; reactive triage handles the ones that slip through.
This cluster covers the practical work of monitoring and optimizing database performance.
Monitoring fundamentals
The metrics that matter for database operations:
- Query latency: per-query and aggregated p50/p95/p99
- Throughput: queries per second
- Connection count: against connection limit
- Slow queries: queries exceeding threshold
- CPU and IOPS: resource utilization
- Cache hit ratio: shared buffer / page cache effectiveness
- Replication lag: for replica-based architectures
- Lock waits: contention indicator
Query optimization
The art of making queries fast:
- Indexes that match the query patterns
- EXPLAIN to understand the plan
- Avoid full table scans on large tables
- Pagination via cursor over offset (deep pages)
- Aggregate caching for expensive computations
Members
Adjacent