Performance & Scalability interview question · Most asked
What are the most common database-related performance problems?
Summary
N+1 queries, missing or wrong indexes, fetching too many rows or columns, deep OFFSET pagination, long transactions holding locks, too many connections, unbounded queries in hot paths, and running analytics on the OLTP database.
Longer Answer
Fix with eager loading, proper indexes, select only needed columns, keyset pagination, short transactions, pooling, and moving reporting to replicas/warehouses.
Key Points
- N+1 and missing indexes
- Over-fetching
- OFFSET pagination
- Lock contention
- Analytics on OLTP
More most-asked Performance & Scalability questions
- What is the difference between vertical and horizontal scaling?
- What's the difference between latency and throughput?
- How do you approach a performance problem methodically?
- How do load balancers work, and what algorithms do they use?
- Why are timeouts, retries and circuit breakers essential for performance and reliability?