Azure Database for PostgreSQL(单一服务器)中的性能建议Performance Recommendations in Azure Database for PostgreSQL - Single Server

适用于: Azure Database for PostgreSQL - 单一服务器版本 9.6、10、11Applies to: Azure Database for PostgreSQL - Single Server versions 9.6, 10, 11

性能建议功能会通过分析数据库来创建自定义的建议,以提高性能。The Performance Recommendations feature analyses your databases to create customized suggestions for improved performance. 为了生成建议,分析将查看各种数据库特征(包括架构)。To produce the recommendations, the analysis looks at various database characteristics including schema. 启用服务器上的查询存储即可充分利用性能建议功能。Enable Query Store on your server to fully utilize the Performance Recommendations feature. 实施任何性能建议后,应测试性能以评估这些更改的影响。After implementing any performance recommendation, you should test performance to evaluate the impact of those changes.


使用性能建议功能运行分析所需的 “所有者”或“参与者” 权限。Owner or Contributor permissions required to run analysis using the Performance Recommendations feature.

性能建议Performance recommendations

性能建议功能跨服务器分析工作负载以标识可能会提高性能的索引。The Performance Recommendations feature analyzes workloads across your server to identify indexes with the potential to improve performance.

从 PostgreSQL 服务器的 Azure 门户页上的菜单栏的“智能性能” 部分打开“性能建议” 。Open Performance Recommendations from the Intelligent Performance section of the menu bar on the Azure portal page for your PostgreSQL server.


选择“分析” 并选择数据库就会开始分析。Select Analyze and choose a database, which will begin the analysis. 分析可能需要几分钟的时间才能完成,具体取决于工作负载。Depending on your workload, th analysis may take several minutes to complete. 分析完成后,门户中将出现通知。Once the analysis is done, there will be a notification in the portal. 分析会执行数据库的深层检查。Analysis performs a deep examination of your database. 建议在非高峰期执行分析。We recommend you perform analysis during off-peak periods.

如果无发现,则 “建议”窗口将显示建议列表。The Recommendations window will show a list of recommendations if any were found.


不会自动应用建议。Recommendations are not automatically applied. 若要应用建议,请复制查询文本并从所选的客户端中运行。To apply the recommendation, copy the query text and run it from your client of choice. 记住通过测试和监视来评估建议。Remember to test and monitor to evaluate the recommendation.

建议类型Recommendation types

目前支持两种类型的建议:创建索引 和删除索引 。Currently, two types of recommendations are supported: Create Index and Drop Index.

创建索引建议Create Index recommendations

“创建索引”建议建议使用新索引来加快工作负载中最常运行或最耗时的查询。Create Index recommendations suggest new indexes to speed up the most frequently run or time-consuming queries in the workload. 此建议类型需要启用查询存储This recommendation type requires Query Store to be enabled. 查询存储收集查询信息并提供详细的查询运行时和频率统计信息,供分析用来提出建议。Query Store collects query information and provides the detailed query runtime and frequency statistics that the analysis uses to make the recommendation.

删除索引建议Drop Index recommendations

除了检测缺少的索引外,Azure Database for PostgreSQL 还会分析现有索引的性能。Besides detecting missing indexes, Azure Database for PostgreSQL analyzes the performance of existing indexes. 如果某个索引很少使用或者有冗余,则分析器会建议删除它。If an index is either rarely used or redundant, the analyzer recommends dropping it.


后续步骤Next steps