Queries the information about a query for an AnalyticDB for PostgreSQL instance.
Operation description
You can call this operation to query the information about a query for an AnalyticDB for PostgreSQL instance, including the SQL statement, execution plan text, and execution plan tree.
This operation is available only for instances of V6.3.10.1 or later in elastic storage mode. For information about how to view and update the minor version of an instance, see View the minor engine version and Update the minor engine version.
Debugging
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action
policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- The required resource types are displayed in bold characters.
- If the permissions cannot be granted at the resource level,
All Resources
is used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
gpdb:DescribeDiagnosisSQLInfo | Read |
|
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
DBInstanceId | string | Yes | The instance ID. Note
You can call the DescribeDBInstances operation to query details about all AnalyticDB for PostgreSQL instances within a region, including instance IDs.
| gp-bp12ga6v69h86**** |
QueryID | string | Yes | The query ID. It is a unique identifier of the query. Note
You can call the DescribeDiagnosisRecords operation to obtain query IDs.
| 71403480878**** |
Database | string | Yes | The name of the database. | adbtest |
Response parameters
The following table describes the QueryPlan parameter.
Parameter | Type | Example | Description |
---|---|---|---|
OpertorID | Integer | 1 | The ID of the operator in the execution plan. |
OperatorTypeID | integer | 10 | The type ID of the operator. |
OperatorType | String | AGG | The type of the operator. |
OperatorName | String | AGG-1 | The name of the operator. |
NodeWidth | Integer | 1 | The horizontal position of the node at the current level of the execution plan tree. The value of this parameter starts from 1. |
NodeDepth | Integer | 2 | The depth of the node in the execution plan tree. The value of this parameter starts from 1. |
LevelWidth | Integer | 1 | The total width of the level where the node resides in the execution plan tree. The value of this parameter starts from 1. |
MaxDepth | Integer | 2 | The maximum depth of the execution plan tree. The value of this parameter starts from 1 and is supported only for the root node. |
OutputRows | Integer | 10 | The number of rows output by the operator during query execution. |
InputRows | Integer | 1000 | The number of rows input by the operator during query execution. |
Memory | Float | 100 | The amount of memory used by the operator. Unit: KB. |
StartTime | String | 1652843003000 | The execution start time of the operator. |
EndTime | String | 1652843003100 | The execution end time of the operator. |
Duration | Float | 6 | The execution duration of the operator. Unit: milliseconds. |
DiskReadSize | Float | 55 | The amount of data that was read by the operator from disks. Unit: bytes. |
DiskReadTime | Float | 0.1 | The amount of time consumed for the operator to read data from disks. Unit: milliseconds. |
NetIOSize | Float | 3000 | The amount of data transmitted across nodes. Unit: bytes. |
NetIOTime | Float | 0.1 | The amount of time consumed to transmit data across nodes. Unit: milliseconds. |
MemoryPercent | Float | 20.11 | The percentage of the memory used by the operator. |
DurationPercent | Float | 16.11 | The percentage of the execution duration of the operator. |
DiskReadSizePercent | Float | 55.11 | The percentage of the amount of data that the operator reads from disks. |
DiskReadTimePercent | Float | 11.11 | The percentage of the amount of time consumed by the operator to read data from disks. |
NetIOSizePercent | Float | 30.11 | The percentage of the amount of data transmitted across nodes. |
NetIOTimePercent | Float | 11.11 | The percentage of the amount of time consumed to transmit data across nodes. |
Children | Operator structure | Recursive structure | The child node operator. The structure of a child node operator is the same as that of its parent node operator. The value of this parameter is null for the lowest-level child nodes. |
Examples
Sample success responses
JSON
format
{
"RequestId": "425AAA6A-63E0-1929-A1CE-3D9036CBC463",
"QueryID": "71403480878****",
"SessionID": "658****",
"StartTime": 1660719602199,
"Duration": 16,
"SQLStmt": "select n_live_tup, n_live_tup + n_dead_tup, pg_relation_size(table_name), last_vacuum from pg_stat_user_tables where relid = table_name::regclass",
"User": "adbpguser",
"Database": "adbtest",
"Status": "finished",
"QueryPlan": "{\\\"children\\\":********\\\"startTime\\\":1660719602199}",
"TextPlan": "******",
"SortedMetrics": "{\\\"costSort\\\":******:\\\"Seq Scan-9\\\",\\\"value\\\":0.0}]}",
"MaxOutputRows": "10"
}
Error codes
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|