Prompt
What should I use to identify database bottlenecks
Latest observation
Oct 20, 2026
OpenAI APIWeb search: off
To identify database bottlenecks, use a mix of query analysis, monitoring metrics, and database profiling tools.
Best things to use
-
Slow query logs
- Show which queries are taking the longest.
- Great for finding missing indexes or bad query patterns.
-
Database performance metrics
- Look at:
- CPU usage
- Memory usage
- Disk I/O
- Lock waits / contention
- Connections / pool saturation
- Query latency
- These help tell whether the bottleneck is CPU, disk, locks, or connection limits.
- Look at:
-
EXPLAIN / query execution plans
- Use
EXPLAIN,EXPLAIN ANALYZE, or equivalent. - Shows whether queries are scanning full tables, using indexes, sorting heavily, or joining inefficiently.
- Use
-
Database monitoring tools
- Examples:
- PostgreSQL:
pg_stat_statements,auto_explain,EXPLAIN ANALYZE - MySQL: Performance Schema, slow query log,
EXPLAIN - SQL Server: Query Store, execution plans
- Oracle: AWR/ASH reports
- PostgreSQL:
- These are often the most useful for real bottleneck identification.
- Examples:
-
Application-level APM tools
- Example: Datadog, New Relic, AppDynamics, Dynatrace
- Helpful if you want to see how database time affects end-to-end request latency.
In practice
A good workflow is:
- Find the slowest queries.
- Check their execution plans.
- Correlate with metrics like CPU, I/O, locks, and connection usage.
- Confirm whether the problem is query design, indexing, schema, or infrastructure.
If you want, I can recommend the best tools for PostgreSQL, MySQL, or SQL Server specifically.