Note
This view is available starting with V4.0.0.
Purpose
This view displays the list of tablets and the log stream information to which each tablet belongs in all tenants under the sys tenant.
Columns
| Column | Type | Nullable | Description |
|---|---|---|---|
| TENANT_ID | bigint(20) | NO | The tenant ID. |
| TABLET_ID | bigint(20) | NO | The tablet ID. |
| LS_ID | bigint(1) | NO | The log stream ID to which the tablet belongs. |
Sample query
Query the list of tablets in the log stream with ID 1001 for the tenant with ID 1002 under the sys tenant, and display the first five records.
obclient [oceanbase]> SELECT * FROM oceanbase.CDB_OB_TABLET_TO_LS WHERE TENANT_ID=1002 AND LS_ID=1001 LIMIT 5;
The query result is as follows:
+-----------+-----------+-------+
| TENANT_ID | TABLET_ID | LS_ID |
+-----------+-----------+-------+
| 1002 | 200004 | 1001 |
| 1002 | 200005 | 1001 |
| 1002 | 200007 | 1001 |
| 1002 | 200008 | 1001 |
| 1002 | 200009 | 1001 |
+-----------+-----------+-------+
5 rows in set
