您现在访问的是微软AZURE全球版技术文档网站,若需要访问由世纪互联运营的MICROSOFT AZURE中国区技术文档网站,请访问 https://docs.azure.cn.

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.

权限Permissions

使用性能建议功能运行分析所需的“所有者”或“参与者”权限。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. 根据工作负荷的不同,第5个分析可能需要几分钟才能完成。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

目前支持两种类型的建议: Create indexDrop indexCurrently, 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.

注意事项Considerations

后续步骤Next steps