All Products
Search
Document Center

AnalyticDB:DescribeDBInstanceIndexUsage

Last Updated:Jan 23, 2026

Queries the index usage of an AnalyticDB for PostgreSQL instance.

Operation description

Appropriate indexes can accelerate database queries. You can call this operation to query the index usage of an AnalyticDB for PostgreSQL instance.

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

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

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:
    • For mandatory resource types, indicate with a prefix of * .
    • 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:DescribeDBInstanceIndexUsageget
*DBInstance
acs:gpdb:*:{#accountId}:dbinstance/{#DBInstanceId}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
DBInstanceIdstringYes

The instance ID.

Note You can call the DescribeDBInstances operation to query the information about all AnalyticDB for PostgreSQL instances within a region, including instance IDs.
gp-bp12ga6v69h86****
PageSizeintegerNo

The number of entries per page. Valid values:

  • 30
  • 50
  • 100

Default value: 30.

20
PageNumberintegerNo

The page number. Pages start from page 1. Default value: 1.

1
DatabasestringNo

The name of the database.

test
OrderBystringNo

order by search condition

{Field: TableName, Type: Desc}

Response parameters

ParameterTypeDescriptionExample
object
RequestIdstring

The request ID.

B4CAF581-2AC7-41AD-8940-D56DF7AADF5B
TotalCountinteger

The total number of entries returned.

1
PageNumberinteger

The page number.

1
Itemsarray<object>

The queried index usage.

Itemsobject
DatabaseNamestring

The name of the database.

adbtest
SchemaNamestring

The name of the schema.

schema1
TableNamestring

The name of the table.

tab1_ptr_2010
IsPartitionTableboolean

Indicates whether the table is a partitioned table. Valid values:

  • true: The table is a partitioned table.
  • false: The table is not a partitioned table.
true
ParentTableNamestring

The name of the parent table.

tab1
IndexNamestring

The name of the index.

idx1
IndexSizestring

The size of the index. Unit: bytes.

10000
IndexScanTimesinteger

The number of index scans.

50000
IndexDefstring

The definition of the index.

CREATE INDEX idx1 ON schema1.tab1_ptr_2010
TimeLastUpdatedstring

The time when the table was last deleted, inserted, or updated.

2022-08-08T20:00:00Z

Examples

Sample success responses

JSONformat

{
  "RequestId": "B4CAF581-2AC7-41AD-8940-D56DF7AADF5B",
  "TotalCount": 1,
  "PageNumber": 1,
  "Items": [
    {
      "DatabaseName": "adbtest",
      "SchemaName": "schema1",
      "TableName": "tab1_ptr_2010",
      "IsPartitionTable": true,
      "ParentTableName": "tab1",
      "IndexName": "idx1",
      "IndexSize": 10000,
      "IndexScanTimes": 50000,
      "IndexDef": "CREATE INDEX idx1 ON schema1.tab1_ptr_2010",
      "TimeLastUpdated": "2022-08-08T20:00:00Z"
    }
  ]
}

Error codes

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2024-08-06The request parameters of the API has changed. The response structure of the API has changedView Change Details