APPLIES TO: Azure Database for PostgreSQL - Flexible Server
You can use query store in a wide variety of scenarios in which tracking and maintaining predictable workload performance is critical. Consider the following examples:
Use query store views on the azure_sys
database of your server, to quickly identify the longest running queries. These queries tend to consume the most resources. Optimizing your longest running queries can improve performance by freeing up resources used by other queries running on your system.
Query store slices the performance data into time windows, so you can track the performance of a query over time. This helps you identify exactly which queries are contributing to an increase in overall time spent. As a result you can do scoped troubleshooting of your workload.
Tune expensive queriesWhen you identify a query with suboptimal performance, the action you take depends on the nature of the problem. Some of these actions might be:
Use query store to compare workload performance before and after an application change you plan to introduce, or before and after migration. Example scenarios for using query store to assess the impact of changes to workload performance:
In any of these scenarios, apply the following workflow:
Some workloads don't have dominant queries that you can tune to improve overall application performance. Those workloads are typically characterized with a relatively large number of unique queries, each of them consuming a portion of system resources. Each unique query is executed infrequently, so individually their runtime consumption isn't critical. On the other hand, given that the application is generating new queries all the time, a significant portion of system resources is spent on query compilation, which isn't optimal. Usually, this situation happens if your application generates queries (instead of using stored procedures or parameterized queries) or if it relies on object-relational mapping frameworks that generate queries by default.
If you are in control of the application code, you might consider rewriting the data access layer to use stored procedures or parameterized queries. However, this situation can also be improved without application changes, by forcing query parameterization for the entire database (all queries) or for the individual query templates with the same query hash.
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4