All Products
Search
Document Center

AnalyticDB for PostgreSQL:DescribeDiagnosisSQLInfo

Last Updated:May 09, 2024

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

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer.

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.
OperationAccess levelResource typeCondition keyAssociated operation
gpdb:DescribeDiagnosisSQLInfoRead
  • All Resources
    *
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
DBInstanceIdstringYes

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****
QueryIDstringYes

The query ID. It is a unique identifier of the query.

Note You can call the DescribeDiagnosisRecords operation to obtain query IDs.
71403480878****
DatabasestringYes

The name of the database.

adbtest

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The request ID.

425AAA6A-63E0-1929-A1CE-3D9036CBC463
QueryIDstring

The query ID.

71403480878****
SessionIDstring

The ID of the session that contains the query.

658****
StartTimelong

The start time of the query. This value is a UNIX timestamp representing the number of milliseconds that have elapsed since January 1, 1970, 00:00:00 UTC.

1660719602199
Durationinteger

The execution duration of the query. Unit: seconds.

16
SQLStmtstring

The SQL statement.

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
Userstring

The username.

adbpguser
Databasestring

The name of the database.

adbtest
Statusstring

The execution state of the query. Valid values:

  • running
  • finished
finished
QueryPlanstring

The information about the operator.

{\"children\":********\"startTime\":1660719602199}
TextPlanstring

The information about the execution plan.

******
SortedMetricsstring

The sequence of metrics.

{\"costSort\":******:\"Seq Scan-9\",\"value\":0.0}]}
MaxOutputRowsstring

The maximum number of output rows.

10

The following table describes the QueryPlan parameter.

ParameterTypeExampleDescription
OpertorIDInteger1The ID of the operator in the execution plan.
OperatorTypeIDinteger10The type ID of the operator.
OperatorTypeStringAGGThe type of the operator.
OperatorNameStringAGG-1The name of the operator.
NodeWidthInteger1The horizontal position of the node at the current level of the execution plan tree. The value of this parameter starts from 1.
NodeDepthInteger2The depth of the node in the execution plan tree. The value of this parameter starts from 1.
LevelWidthInteger1The total width of the level where the node resides in the execution plan tree. The value of this parameter starts from 1.
MaxDepthInteger2The maximum depth of the execution plan tree. The value of this parameter starts from 1 and is supported only for the root node.
OutputRowsInteger10The number of rows output by the operator during query execution.
InputRowsInteger1000The number of rows input by the operator during query execution.
MemoryFloat100The amount of memory used by the operator. Unit: KB.
StartTimeString1652843003000The execution start time of the operator.
EndTimeString1652843003100The execution end time of the operator.
DurationFloat6The execution duration of the operator. Unit: milliseconds.
DiskReadSizeFloat55The amount of data that was read by the operator from disks. Unit: bytes.
DiskReadTimeFloat0.1The amount of time consumed for the operator to read data from disks. Unit: milliseconds.
NetIOSizeFloat3000The amount of data transmitted across nodes. Unit: bytes.
NetIOTimeFloat0.1The amount of time consumed to transmit data across nodes. Unit: milliseconds.
MemoryPercentFloat20.11The percentage of the memory used by the operator.
DurationPercentFloat16.11The percentage of the execution duration of the operator.
DiskReadSizePercentFloat55.11The percentage of the amount of data that the operator reads from disks.
DiskReadTimePercentFloat11.11The percentage of the amount of time consumed by the operator to read data from disks.
NetIOSizePercentFloat30.11The percentage of the amount of data transmitted across nodes.
NetIOTimePercentFloat11.11The percentage of the amount of time consumed to transmit data across nodes.
ChildrenOperator structureRecursive structureThe 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

JSONformat

{
  "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 timeSummary of changesOperation
No change history