Query Statistics - List By Query
Lists a query's statistics.
GET https://management.azure.com/subscriptions/{subscriptionId}/resourceGroups/{resourceGroupName}/providers/Microsoft.Sql/servers/{serverName}/databases/{databaseName}/topQueries/{queryId}/statistics?api-version=2014-04-01
URI Parameters
Name | In | Required | Type | Description |
---|---|---|---|---|
database
|
path | True |
string |
The name of the database. |
query
|
path | True |
string |
The id of the query |
resource
|
path | True |
string |
The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. |
server
|
path | True |
string |
The name of the server. |
subscription
|
path | True |
string |
The subscription ID that identifies an Azure subscription. |
api-version
|
query | True |
string |
The API version to use for the request. |
Responses
Name | Type | Description |
---|---|---|
200 OK |
OK |
Examples
Get a query
Sample request
GET https://management.azure.com/subscriptions/00000000-1111-2222-3333-444444444444/resourceGroups/group1/providers/Microsoft.Sql/servers/sqlcrudtest/databases/db1/topQueries/19/statistics?api-version=2014-04-01
Sample response
{
"value": [
{
"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
}
]
}
]
}
]
}
Definitions
Name | Description |
---|---|
Query |
A database query. |
Query |
A database query. |
Query |
The unit of measurement |
Query |
A database query. |
Query |
Represents the response to a get query request. |
QueryInterval
A database query.
Name | Type | Description |
---|---|---|
executionCount |
number |
The number of times the query was executed during this interval. |
intervalStartTime |
string |
The start time of the measurement interval (ISO8601 format). |
metrics |
The list of query metrics during this interval. |
QueryMetric
A database query.
Name | Type | Description |
---|---|---|
displayName |
string |
The name of the metric for display in user interface |
name |
string |
The name of the metric |
unit |
The unit of measurement |
|
value |
number |
The measured value |
QueryMetricUnit
The unit of measurement
Name | Type | Description |
---|---|---|
KB |
string |
|
microseconds |
string |
|
percentage |
string |
QueryStatistic
A database query.
Name | Type | Description |
---|---|---|
intervals |
The list of query intervals. |
|
queryId |
string |
The id of the query |
QueryStatisticListResult
Represents the response to a get query request.
Name | Type | Description |
---|---|---|
value |
The query. |