---
title: "Tablet metadata"
url: "https://docs.yugabyte.com/stable/launch-and-manage/monitor-and-alert/tablet-metadata/"
---

# Tablet metadata

Columns of yb_local_tablets and yb_tablet_metadata.

Look up local and cluster-wide tablet placement, leadership, and state

## yb\_local\_tablets

The `yb_local_tablets` view returns metadata for [YSQL](/stable/api/ysql/ "YSQL"), [YCQL](/stable/api/ycql/ "YCQL"), and system [tablets](/stable/architecture/key-concepts/#tablet "tablets") on the node you are connected to. It shows the same information as `<yb-tserver-ip>:9000/tablets`.

When you join this view to [Active Session History](/stable/launch-and-manage/monitor-and-alert/active-session-history-monitor/#yb-active-session-history "Active Session History"), `wait_event_aux` stores only the first 15 characters of the tablet ID. Join on `SUBSTRING(tablet_id, 1, 15)`.

For queries against this view, see [yb\_local\_tablets](/stable/explore/observability/yb-local-tablets/ "yb_local_tablets").



### Columns

| Column                | Type  | Description                                                               |
|-----------------------|-------|---------------------------------------------------------------------------|
| tablet\_id            | text  | 16 byte UUID of the tablet.                                               |
| table\_id             | text  | 16 byte UUID of the table which the tablet is part of.                    |
| table\_type           | text  | Type of the table. Can be YSQL, YCQL, System, or Unknown.                 |
| namespace\_name       | text  | Name of the database or the keyspace.                                     |
| ysql\_schema\_name    | text  | YSQL schema name. Empty for YCQL, System, and Unknown table types.        |
| table\_name           | text  | Name of the table which the tablet is part of.                            |
| partition\_key\_start | bytea | Start key of the partition (inclusive).                                   |
| partition\_key\_end   | bytea | End key of the partition (exclusive).                                     |
| state                 | text  | State of the tablet. See [Tablet states](#tablet-states "Tablet states"). |

### Tablet states

The `state` column can have the following values:

| State                          | Description                                                                                                                                        |
|--------------------------------|----------------------------------------------------------------------------------------------------------------------------------------------------|
| TABLET\_DATA\_COPYING          | The tablet is doing remote bootstrap.                                                                                                              |
| TABLET\_DATA\_READY            | Fresh empty tablets or successfully remote bootstrapped tablets.                                                                                   |
| TABLET\_DATA\_DELETED          | The tablet replica has been deleted from this particular node because the tablet has been deleted from the table.                                  |
| TABLET\_DATA\_TOMBSTONED       | The tablet replica has been deleted from this particular node but the tablet itself is still part of the table and might have data on other nodes. |
| TABLET\_DATA\_SPLIT\_COMPLETED | The tablet split has been completed.                                                                                                               |
| TABLET\_DATA\_INIT\_STARTED    | The tablet has been initialized as a subtablet of another tablet undergoing a split.                                                               |

## yb\_tablet\_metadata

The `yb_tablet_metadata` view returns tablet placement and replica roles for the whole cluster. `yb_local_tablets` is limited to the node you are connected to. `yb_tablet_metadata` is the YSQL equivalent of the YCQL `system.partitions` table.

The view returns tablet information for YSQL objects and the system transaction table only. Use it to find every tablet of a table, the leader of a tablet, the tablet that holds a row in a [hash-sharded](/stable/architecture/docdb-sharding/sharding/#hash-sharding "hash-sharded") table, and the range boundaries of a [range-sharded](/stable/architecture/docdb-sharding/sharding/#range-sharding "range-sharded") table.

The `relname`, `start_range`, and `end_range` columns are masked for unprivileged users (shown as `<insufficient privilege>`). Only superusers or users with the `yb_db_admin` role can see the entire unmasked view.

For queries against this view, see [yb\_tablet\_metadata](/stable/explore/observability/yb-tablet-metadata/ "yb_tablet_metadata").



### Columns

| Column            | Type    | Description                                                                                |
|-------------------|---------|--------------------------------------------------------------------------------------------|
| tablet\_id        | text    | A unique identifier (UUID) representing the tablet.                                        |
| oid               | oid     | The object identifier (OID) for the table or index that the tablet belongs to.             |
| db\_name          | text    | Name of the database this relation belongs to.                                             |
| relname           | text    | Name of the table or index whose data is stored on the tablet.                             |
| start\_hash\_code | integer | Starting hash code (inclusive) for the tablet. NULL for range-sharded tables.              |
| end\_hash\_code   | integer | Ending hash code (exclusive) for the tablet. NULL for range-sharded tables.                |
| leader            | text    | IP address and port of the leader node for the tablet.                                     |
| replicas          | text\[] | Replica IP addresses and ports for the tablet, including the leader.                       |
| start\_range      | text    | Starting range key (inclusive) for the tablet. NULL for hash-sharded tables.               |
| end\_range        | text    | Ending range key (exclusive) for the tablet. NULL for hash-sharded tables.                 |
| tablet\_attrs     | json    | Reserved for future use. Currently empty.                                                  |
| tablet\_state     | text    | Current state of the tablet: `PREPARING`, `CREATING`, `RUNNING`, `REPLACED`, or `DELETED`. |
