All Products
Search
Document Center

AnalyticDB:DescribeTableStatistics

Last Updated:Jan 14, 2026

Retrieves table statistics from a specified AnalyticDB for MySQL cluster.

Operation description

Note

For more information about table statistics, see Monitoring information.

Try it now

Try this API in OpenAPI Explorer, no manual signing needed. Successful calls auto-generate SDK code matching your parameters. Download it with built-in credential security for local usage.

Test

RAM authorization

The table below describes the authorization required to call this API. You can define it in a Resource Access Management (RAM) policy. The table's columns are detailed below:

  • Action: The actions can be used in the Action element of RAM permission policy statements to grant permissions to perform the operation.

  • API: The API that you can call to perform the action.

  • Access level: The predefined level of access granted for each API. Valid values: create, list, get, update, and delete.

  • Resource type: The type of the resource that supports authorization to perform the action. It indicates if the action supports resource-level permission. The specified resource must be compatible with the action. Otherwise, the policy will be ineffective.

    • For APIs with resource-level permissions, required resource types are marked with an asterisk (*). Specify the corresponding Alibaba Cloud Resource Name (ARN) in the Resource element of the policy.

    • For APIs without resource-level permissions, it is shown as All Resources. Use an asterisk (*) in the Resource element of the policy.

  • Condition key: The condition keys defined by the service. The key allows for granular control, applying to either actions alone or actions associated with specific resources. In addition to service-specific condition keys, Alibaba Cloud provides a set of common condition keys applicable across all RAM-supported services.

  • Dependent action: The dependent actions required to run the action. To complete the action, the RAM user or the RAM role must have the permissions to perform all dependent actions.

Action

Access level

Resource type

Condition key

Dependent action

adb:DescribeTableStatistics

get

DBCluster

acs:adb:{#regionId}:{#accountId}:dbcluster/{#DBClusterId}

None None

Request parameters

Parameter

Type

Required

Description

Example

DBClusterId

string

Yes

The cluster ID.

Note

Call the DescribeDBClusters operation to query the cluster ID.

am-****************

PageSize

integer

No

The number of entries to return on each page. Valid values:

  • 30 (default)

  • 50

  • 100

30

PageNumber

integer

No

The page number. The value must be a positive integer. Default value: 1.

1

Order

string

No

The sorting rule for the returned results. The value is a JSON array that is ordered by the sequence of the elements in the array. Each element consists of Field and Type. Example: [{ "Field":"TableName", "Type":"Asc" }].

  • Field: the field by which to sort the results. Valid values: TableName, ColdDataSize, DataSize, PrimaryKeyIndexSize, RowCount, IndexSize, SchemaName, and PartitionCount.

  • Type: the sorting type. Valid values (case-insensitive):
    • Desc: descending.

    • Asc: ascending.

[ { "Field":"TableName", "Type":"Asc" } ]

RegionId

string

No

The region ID.

Note

Call the DescribeRegions operation to query the region ID.

cn-beijing

Keyword

string

No

The keyword for the query. Fuzzy search by table name is supported.

you_table_name

SchemaName

string

No

The database name.

cust_pay_instruction

Response elements

Element

Type

Description

Example

object

The list of information.

TotalCount

string

The total number of entries.

1

PageSize

string

The number of entries on the current page.

30

RequestId

string

The request ID.

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

PageNumber

string

The page number.

1

DBClusterId

string

The cluster ID.

am-****************

Items

object

TableStatisticRecords

array<object>

The list of table statistics.

object

The details.

SchemaName

string

The database name.

test_schema

TableName

string

The table name.

test_table

RowCount

integer

The number of rows in the table.

3

DataSize

integer

The data size of the table records, in bytes.

Note

The data size of table records does not include the data of common indexes and primary key indexes.

15592

IndexSize

integer

The data size of common indexes, in bytes.

3076

PrimaryKeyIndexSize

integer

The data size of primary key indexes, in bytes.

16340

PartitionCount

integer

The number of partitions.

1

ColdDataSize

integer

The total size of cold data, in bytes.

Note

This parameter is returned only for clusters of kernel version 3.1.3.4 or later.

0

SpaceRatio

number

The tablespace ratio, in percentage.

Note

Formula: Tablespace ratio = Total data size of the table / Total data size of the instance × 100.

66.23

TotalSize

integer

The total data size, in bytes.

Note

The total data size is calculated using one of the following formulas: Total data size = Hot data size + Cold data size, or Total data size = Data size of table records + Data size of common indexes + Data size of primary key indexes + Other data size.

1577

HotDataSize

integer

The size of hot data, in bytes.

1048576

OtherSize

integer

The size of other data, in bytes.

1048576

SchemaNames

string

The list of database names.

['adb_external_tpch_10gb', 'dw_bccb', 'dw_fm', 'dw_test', 'dw_yph']

Examples

Success response

JSON format

{
  "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
      }
    ]
  },
  "SchemaNames": "['adb_external_tpch_10gb', 'dw_bccb', 'dw_fm', 'dw_test', 'dw_yph']"
}

Error codes

See Error Codes for a complete list.

Release notes

See Release Notes for a complete list.