All Products
Search
Document Center

AnalyticDB:DescribeTableStatistics

Last Updated:Aug 30, 2024

Queries the information about table statistics for an AnalyticDB for MySQL cluster.

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
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 a list of cluster IDs.
am-****************
PageSizeintegerNo

The number of entries per page. Valid values:

  • 30 (default)
  • 50
  • 100
30
PageNumberintegerNo

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

1
OrderstringNo

The order in which to sort the queried information. Specify this parameter as an ordered JSON array that consists of the Field and Type fields. Example: [{ "Field":"TableName", "Type":"Asc" }].

  • Field specifies the field that is used to sort the queried information. The following fields are supported: TableName, ColdDataSize, DataSize, PrimaryKeyIndexSize, RowCount, IndexSize, SchemaName, and PartitionCount.

  • Type specifies the sorting order. Valid values (case-insensitive):

    • Desc: descending order.
    • Asc: ascending order.
[ { "Field":"TableName", "Type":"Asc" } ]
RegionIdstringNo

The region ID of the cluster.

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

Response parameters

ParameterTypeDescriptionExample
object

The response parameters.

TotalCountstring

The total number of entries returned.

1
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.

object
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 table records. Unit: bytes.

Note The data size of table records, excluding the data size of regular index and primary key indexes.
15592
IndexSizelong

The data size of regular indexes. Unit: bytes.

3076
PrimaryKeyIndexSizelong

The data size of primary key indexes. Unit: bytes.

16340
PartitionCountlong

The number of partitions.

1
ColdDataSizelong

The cold data size. Unit: bytes.

Note The parameter is returned only for AnalyticDB for MySQL clusters of V3.1.3.4 or later.
0
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. 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 hot data size. Unit: bytes.

1048576
OtherSizelong

The data size of other data. Unit: bytes.

1048576

Examples

Sample success responses

JSONformat

{
  "TotalCount": "1",
  "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": 0,
        "SpaceRatio": 66.23,
        "TotalSize": 1577,
        "HotDataSize": 1048576,
        "OtherSize": 1048576
      }
    ]
  }
}

Error codes

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

Change history

Change timeSummary of changesOperation
2024-03-14The internal configuration of the API is changed, but the call is not affectedView Change Details
2024-02-20The request parameters of the API has changed. The response structure of the API has changedView Change Details