Skip to main content

SHOW TABLETS BELONG

Description

This statement is used to show tablets and information of their belonging table.

Syntax

SHOW TABLETS BELONG <tablet_id> [, <tablet_id>]...;

Required Parameters

1. <tablet_id>

One or more tablet IDs, separated by commas. Duplicate IDs will be deduplicated in the result.

Return Value

When using SHOW TABLETS BELONG <tablet_id> [, <tablet_id>]..., the following columns are returned:

ColumnDataTypeNote
DbNameStringThe name of the database that contains the tablet.
TableNameStringThe name of the table that contains the tablet.
TableSizeStringThe size of the table (e.g., "8.649 KB").
PartitionNumIntThe number of partitions in the table.
BucketNumIntThe number of buckets in the table.
ReplicaCountIntThe number of replicas in the table.
TabletIdsArrayThe list of tablet IDs that belong to the table.

Access Control Requirements

The user executing this SQL command must have at least the following privileges:

PrivilegeObjectNotes
Admin_privDatabaseRequired to execute administrative operations on the database, including managing tables, partitions, and system-level commands.

Examples

Show information about a specific tablet:

SHOW TABLETS BELONG 10145;
+--------+-----------+-----------+--------------+-----------+--------------+-----------+
| DbName | TableName | TableSize | PartitionNum | BucketNum | ReplicaCount | TabletIds |
+--------+-----------+-----------+--------------+-----------+--------------+-----------+
| test | sell_user | 8.649 KB | 1 | 4 | 4 | [10145] |
+--------+-----------+-----------+--------------+-----------+--------------+-----------+

Show information about multiple tablets:

SHOW TABLETS BELONG 27028,78880,78382,27028;
+---------------------+-----------+-----------+--------------+-----------+--------------+----------------+
| DbName | TableName | TableSize | PartitionNum | BucketNum | ReplicaCount | TabletIds |
+---------------------+-----------+-----------+--------------+-----------+--------------+----------------+
| default_cluster:db1 | kec | 613.000 B | 379 | 604 | 604 | [78880, 78382] |
| default_cluster:db1 | test | 1.874 KB | 1 | 1 | 1 | [27028] |
+---------------------+-----------+-----------+--------------+-----------+--------------+----------------+