Slow Queries
Identify bottlenecks in your database
This functionality under Query Insights provides detailed information about slow queries in your database. It includes the following metrics:
- Max Time: The maximum time taken by the slowest query. In PostgreSQL and MySQL, this is often used to identify the most time-consuming queries that may need optimization.
- Mean Time: The average time taken by all queries. This metric provides a general overview of the query performance in your PostgreSQL or MySQL database.
- Shared Block Hit: The number of shared blocks hit by the query. In PostgreSQL, a high number of hits indicates that the data needed by the query is often found in the cache, which improves query performance. In MySQL, this is equivalent to the InnoDB Buffer Pool Hits.
- Shared Block Read: The number of shared blocks read by the query. In PostgreSQL, a high number of reads could indicate that the data needed by the query is not found in the cache and has to be read from disk, which can slow down query performance. In MySQL, this is equivalent to the InnoDB Buffer Pool Reads.
- Hit Cache Ratio: The ratio of the number of hits in the cache to the total number of cache lookups. In PostgreSQL and MySQL, a high hit cache ratio usually indicates good query performance.
- Calls: The number of calls made to the query. In PostgreSQL and MySQL, this can help identify frequently called queries that may benefit from optimization.
- Query: The actual SQL query. This is the exact SQL statement that was executed in the PostgreSQL or MySQL database.
These metrics can help you identify and optimize slow queries for better performance of your database.