# Unique Secondary Index
![`smart`](UniqueIndexInClusteredPK_en_002_20231122.png)
![`smart`](UniqueIndexInNonClusteredPK_en_003_20231122.png)

------------------------------------------------------------------------------
The unique secondary index of clustered index table needs to be stored separately as an index.

The `KEY` of the TiKV entry of the index is `tableID + indexID + indexed column(s) unique value(s)`; the `VALUE` of the TiKV entry is the primary key value, which represents a specific row in the table. Therefore, the primary key stored in the value portion acts as a pointer to the table.

The primary key of clustered index table is the table itself, while the primary key of non-clustered index or implicit primary key table needs to be stored separately as an index.

For the unique secondary index, the TiKV entry `KEY` of the index is `tableID + indexID + indexed column(s) unique value(s)`; the TiKV entry `VALUE` is the `PK` or `_tidb_rowid`, which acts as a pointer to the table.
