Queries slow query logs by query ID.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | DescribeSQLLogByQueryId |
The operation that you want to perform. Set the value to DescribeSQLLogByQueryId. |
DBInstanceId | String | Yes | gp-**************** |
The ID of the instance. Note You can call the DescribeDBInstances operation to query details of all AnalyticDB for PostgreSQL instances in a specific
region, including instance IDs.
|
QueryId | String | Yes | 111111 |
The query ID. Note You can call the DescribeSlowSQLLogs operation to query the SQL query ID.
|
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
RequestId | String | 07F6177E-****-****-****-0723301340F3 |
The ID of the request. |
Items | Array of SQLLog |
Details of slow query logs. |
|
OperationClass | String | DQL |
The type of the query language. |
ExecuteState | String | success |
The execution state of the query. Valid values:
|
ExecuteCost | Float | 1 |
The execution duration of the query. Unit: seconds. |
SQLText | String | select ** from ** |
The SQL statement. |
SourcePort | Integer | 50514 |
The source port number. |
DBRole | String | master |
The role of the database. |
OperationType | String | select |
The type of the SQL statement. |
SourceIP | String | 192.**.**.121 |
The source IP address. |
SQLPlan | String | **** |
The SQL query plan. |
ReturnRowCounts | Long | 1 |
The number of entries returned. |
DBName | String | adbpgadmin |
The name of the database. |
OperationExecuteTime | String | 2021-03-15T17:02:32Z |
The time when the SQL statement was executed. |
ScanRowCounts | Long | 1 |
The number of entries scanned. |
AccountName | String | testadmin |
The database account. |
QueryId | String | 111111 |
The query ID. |
SliceIds | Array of String | 0,1,2 |
The slice IDs. |
Examples
Sample requests
http(s)://gpdb.aliyuncs.com/?Action=DescribeSQLLogByQueryId
&DBInstanceId=gp-****************
&QueryId=111111
&<Common request parameters>
Sample success responses
XML
format
HTTP/1.1 200 OK
Content-Type:application/xml
<DescribeSQLLogByQueryIdResponse>
<RequestId>07F6177E-****-****-****-0723301340F3</RequestId>
<Items>
<OperationClass>DQL</OperationClass>
<ExecuteState>success</ExecuteState>
<ExecuteCost>1</ExecuteCost>
<SQLText>select ** from **</SQLText>
<SourcePort>50514</SourcePort>
<DBRole>master</DBRole>
<OperationType>select</OperationType>
<SourceIP>192.**.**.121</SourceIP>
<SQLPlan>****</SQLPlan>
<ReturnRowCounts>1</ReturnRowCounts>
<DBName>adbpgadmin</DBName>
<OperationExecuteTime>2021-03-15T17:02:32Z</OperationExecuteTime>
<ScanRowCounts>1</ScanRowCounts>
<AccountName>testadmin</AccountName>
<QueryId>111111</QueryId>
<SliceIds>0,1,2</SliceIds>
</Items>
</DescribeSQLLogByQueryIdResponse>
JSON
format
HTTP/1.1 200 OK
Content-Type:application/json
{
"RequestId" : "07F6177E-****-****-****-0723301340F3",
"Items" : [ {
"OperationClass" : "DQL",
"ExecuteState" : "success",
"ExecuteCost" : 1,
"SQLText" : "select ** from **",
"SourcePort" : 50514,
"DBRole" : "master",
"OperationType" : "select",
"SourceIP" : "192.**.**.121",
"SQLPlan" : "****",
"ReturnRowCounts" : 1,
"DBName" : "adbpgadmin",
"OperationExecuteTime" : "2021-03-15T17:02:32Z",
"ScanRowCounts" : 1,
"AccountName" : "testadmin",
"QueryId" : "111111",
"SliceIds" : [ "0,1,2" ]
} ]
}
Error codes
For a list of error codes, visit the API Error Center.