查詢效能深入解析Query Performance Insight

適用範圍: Azure Database for PostgreSQL-9.6] 和 [10 的單一伺服器Applies to: Azure Database for PostgreSQL - Single Server 9.6 and 10

查詢效能深入解析可協助您快速找出執行時間最長的查詢、一段時間後的變化情形,以及受到哪些等候的影響。Query Performance Insight helps you to quickly identify what your longest running queries are, how they change over time, and what waits are affecting them.

PermissionsPermissions

需要擁有者參與者權限,才能檢視查詢效能深入解析中的查詢文字。Owner or Contributor permissions required to view the text of the queries in Query Performance Insight. 讀者可以檢視圖表與資料表,但無法檢視查詢文字。Reader can view charts and tables but not query text.

先決條件Prerequisites

資料必須存在於查詢存放區中,查詢效能深入解析才能運作。For Query Performance Insight to function, data must exist in the Query Store.

檢視效能深入解析Viewing performance insights

Azure 入口網站中的查詢效能深入解析檢視會以視覺效果呈現來自查詢存放區的重要資訊。The Query Performance Insight view in the Azure portal will surface visualizations on key information from Query Store.

在您的 Azure Database for PostgreSQL 伺服器的入口網站頁面中,選取查詢效能深入解析下方智慧型效能一節中的功能表列。In the portal page of your Azure Database for PostgreSQL server, select Query performance Insight under the Intelligent Performance section of the menu bar.

查詢效能深入解析長時間執行的查詢

長時間執行的查詢索引標籤會顯示前五個查詢的平均持續時間,每次執行,每隔 15 分鐘彙總。The Long running queries tab shows the top five queries by average duration per execution, aggregated in 15-minute intervals. 您可以從 [查詢數目] 下拉式清單中選取,以檢視更多查詢。You can view more queries by selecting from the Number of Queries drop down. 當您這樣做時,特定查詢識別碼的圖表色彩可能會有所變更。The chart colors may change for a specific Query ID when you do this.

您可以在圖表中按一下並拖曳來縮小到特定時間範圍。You can click and drag in the chart to narrow down to a specific time window. 或者,使用放大和縮小圖示,分別檢視一段較短或較長的時間。Alternatively, use the zoom in and out icons to view a smaller or larger period of time respectively.

圖表下方的資料表會提供該時間範圍內長時間執行之查詢的詳細資訊。The table below the chart gives more details about the long-running queries in that time window.

選取 [等候統計資料] 索引標籤,以檢視伺服器中等候的對應視覺效果。Select the Wait Statistics tab to view the corresponding visualizations on waits in the server.

查詢效能深入解析會等候統計資料

後續步驟Next steps