All Products
Search
Document Center

AnalyticDB:DescribeTableStatistics

Last Updated:Nov 10, 2025

Queries the table statistics of an AnalyticDB for MySQL cluster.

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
adb:DescribeTableStatisticsget
*DBCluster
acs:adb:{#regionId}:{#accountId}:dbcluster/{#DBClusterId}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
DBClusterIdstringYes

The cluster ID.

Note You can call the DescribeDBClusters operation to query the IDs of all AnalyticDB for MySQL clusters within a region.
amv-****************
PageSizeintegerNo

The number of entries per page.

30
PageNumberintegerNo

The page number.

1
OrderstringNo

The order by which to sort query results. Specify the parameter value in the JSON format.

Example:

[

    {

        "Field":"Name",

        "Type":"Asc"

    }

]

Field specifies the field by which to sort the query results. Set the value to Name. Type specifies the sorting order. Valid values: Desc and Asc.

Field and Type are case-insensitive.

[{"Field":"SchemaName","Type":"Desc"}]
RegionIdstringNo

The region ID

Note You can call the DescribeRegions operation to query the most recent region list.
cn-beijing
KeywordstringNo

The keyword that is used to query information by table name.

you_table_name
SchemaNamestringNo

The name of the database.

test

Response parameters

ParameterTypeDescriptionExample
object
TotalCountstring

The total number of entries returned.

693
PageSizestring

The number of entries per page.

30
RequestIdstring

The request ID.

4C4433FF-5D3A-4C3E-A19C-6D93B2******
PageNumberstring

The page number.

1
DBClusterIdstring

The cluster ID.

am-****************
Itemsarray<object>

The queried table statistics.

TableStatisticRecordsobject

The queried table statistics.

SchemaNamestring

The name of the database.

test_schema
TableNamestring

The name of the table.

test_table
RowCountlong

The number of rows in the table.

3
DataSizelong

The data size of the table. Unit: bytes.

15592
IndexSizelong

The data size of indexes. Unit: bytes.

3076
PrimaryKeyIndexSizelong

The data size of the primary key index. Unit: bytes.

16340
PartitionCountlong

The number of partitions.

1
ColdDataSizelong

The size of cold data. Unit: bytes.

Note This parameter is supported only for AnalyticDB for MySQL clusters of V3.1.3.4 or later.
4428120064
SpaceRatiodouble

The percentage of the table size. Unit: %.

Note Formula: Table storage percentage = Total data size of a table/Total data size of the cluster × 100%.
66.23
TotalSizelong

The total data size of the table. Unit: bytes.

Note The following formulas can be used to calculate the total data size:
  • Formula 1: Total data size = Hot data size + Cold data size.
  • Formula 2: Total data size = Data size of table records + Data size of regular indexes + Data size of primary key indexes + Data size of other data.
1577
HotDataSizelong

The size of hot data. Unit: bytes.

1048576
OtherSizelong

The data size of other data. Unit: bytes.

1048576
SchemaNamesstring

The names of databases.

['adb_platform', 'adb_ai', 'adb_data']

Examples

Sample success responses

JSONformat

{
  "TotalCount": 693,
  "PageSize": 30,
  "RequestId": "4C4433FF-5D3A-4C3E-A19C-6D93B2******",
  "PageNumber": 1,
  "DBClusterId": "am-****************",
  "Items": {
    "TableStatisticRecords": [
      {
        "SchemaName": "test_schema",
        "TableName": "test_table",
        "RowCount": 3,
        "DataSize": 15592,
        "IndexSize": 3076,
        "PrimaryKeyIndexSize": 16340,
        "PartitionCount": 1,
        "ColdDataSize": 4428120064,
        "SpaceRatio": 66.23,
        "TotalSize": 1577,
        "HotDataSize": 1048576,
        "OtherSize": 1048576
      }
    ]
  },
  "SchemaNames": "['adb_platform', 'adb_ai', 'adb_data']"
}

Error codes

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