Queries - List By Database
依資料庫取得最上層查詢的清單。
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/topQueries?api-version=2014-04-01
URI 參數
| 名稱 | 位於 | 必要 | 類型 | Description |
|---|---|---|---|---|
|
database
|
path | True |
string |
資料庫的名稱。 |
|
resource
|
path | True |
string |
包含資源的資源群組名稱。 您可以從 Azure Resource Manager API 或入口網站取得此值。 |
|
server
|
path | True |
string |
伺服器的名稱。 |
|
subscription
|
path | True |
string |
識別 Azure 訂用帳戶的訂用帳戶標識碼。 |
|
api-version
|
query | True |
string |
要用於要求的 API 版本。 |
回應
| 名稱 | 類型 | Description |
|---|---|---|
| 200 OK |
還行 |
範例
List top queries
範例要求
GET https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/sqlcrudtest/databases/db1/topQueries?api-version=2014-04-01
範例回覆
{
"value": [
{
"type": "Microsoft.Sql/servers/databases/topQueries",
"numberOfTopQueries": 1,
"aggregationFunction": "sum",
"executionType": "any",
"observedMetric": "cpu",
"observationStartTime": "2017-07-11T16:21:54.0916567Z",
"observationEndTime": "2017-07-12T16:21:54.0916567Z",
"intervalType": "PT1H",
"queries": [
{
"queryId": "19",
"intervals": [
{
"intervalStartTime": "2017-07-11T16:00:00",
"executionCount": 12,
"metrics": [
{
"name": "cpu",
"displayName": "Cpu",
"unit": "percentage",
"value": 0.000763888888888889
},
{
"name": "io",
"displayName": "Physical Io Reads",
"unit": "percentage",
"value": 0
},
{
"name": "logIo",
"displayName": "Log Writes",
"unit": "percentage",
"value": 0
},
{
"name": "memory",
"displayName": "Memory consumption",
"unit": "KB",
"value": 0
},
{
"name": "duration",
"displayName": "Query duration",
"unit": "microseconds",
"value": 3308
}
]
}
]
}
]
}
]
}
定義
| 名稱 | Description |
|---|---|
|
Query |
用來匯總每個查詢計量的函式。 |
|
Query |
用來篩選傳回之查詢實例的執行類型。 |
|
Query |
資料庫查詢。 |
|
Query |
資料庫查詢。 |
|
Query |
測量單位 |
|
Query |
用於排序最上層計量的計量類型。 |
|
Query |
資料庫查詢。 |
|
Top |
資料庫查詢。 |
|
Top |
表示取得最高查詢要求的回應。 |
QueryAggregationFunction
用來匯總每個查詢計量的函式。
| 值 | Description |
|---|---|
| min | |
| max | |
| avg | |
| sum |
QueryExecutionType
用來篩選傳回之查詢實例的執行類型。
| 值 | Description |
|---|---|
| any | |
| regular | |
| irregular | |
| aborted | |
| exception |
QueryInterval
資料庫查詢。
| 名稱 | 類型 | Description |
|---|---|---|
| executionCount |
number (int32) |
此間隔期間執行查詢的次數。 |
| intervalStartTime |
string (date-time) |
測量間隔的開始時間(ISO8601格式)。 |
| metrics |
此間隔期間的查詢計量清單。 |
QueryMetric
資料庫查詢。
| 名稱 | 類型 | Description |
|---|---|---|
| displayName |
string |
要顯示在使用者介面中的計量名稱 |
| name |
string |
計量的名稱 |
| unit |
測量單位 |
|
| value |
number (double) |
測量值 |
QueryMetricUnit
測量單位
| 值 | Description |
|---|---|
| percentage | |
| KB | |
| microseconds |
QueryObservedMetricType
用於排序最上層計量的計量類型。
| 值 | Description |
|---|---|
| cpu | |
| io | |
| logio | |
| duration | |
| executionCount |
QueryStatistic
資料庫查詢。
| 名稱 | 類型 | Description |
|---|---|---|
| intervals |
查詢間隔的清單。 |
|
| queryId |
string |
查詢的識別碼 |
TopQueries
資料庫查詢。
| 名稱 | 類型 | Description |
|---|---|---|
| aggregationFunction |
用來匯總每個查詢計量的函式。 |
|
| executionType |
用來篩選傳回之查詢實例的執行類型。 |
|
| intervalType |
string |
間隔的持續時間(ISO8601持續時間格式)。 |
| numberOfTopQueries |
number (int32) |
要求的查詢數目。 |
| observationEndTime |
string (date-time) |
傳回之查詢的結束時間(ISO8601格式) |
| observationStartTime |
string (date-time) |
傳回查詢的開始時間(ISO8601格式) |
| observedMetric |
用於排序最上層計量的計量類型。 |
|
| queries |
查詢清單。 |
TopQueriesListResult
表示取得最高查詢要求的回應。
| 名稱 | 類型 | Description |
|---|---|---|
| value |
最上層查詢的清單。 |