# Key and Value Mapping with Partition for Local Primary Key Index

+ For example, `col1` is the primary key column
+ Mapping between key and value of clustered index table with partition

```
Key: PartitionID_~!@col1@!~
Value: [col2, col3, col4]
```

+  Mapping between key and value of non-clustered index table with partition
```
Key: PartitionID_~!@tidb_rowid@!~
Value: [col1, col2, col3, col4]
```

------------------------------------------------------------------------------
Each partition of the partitioned table is treated as an independent physical table in the TiKV layer, with its own partition ID.

In table partitioning, the partition ID is considered equivalent to the table ID. Each row in a partitioned table utilizes the `partition id + row id` as the encoded key. The partition ID is unique within the cluster scope.

`1.` Mapping for clustered index tables:
```
Key: PartitionID_col1
Value: [col2, col3, col4]
```

Here, `col1`, `col2`, `col3`, and `col4` represent the columns in the table, with `col1` serving as the primary key column.

`2.` Mapping for nonclustered index tables:
```
Key: PartitionID_tidb_rowid
Value: [col1, col2, col3, col4]
```

Here, `col1`, `col2`, `col3`, and `col4` represent the columns in the table. `_tidb_rowid` is an implicit column assigned by TiDB which is a 64-bit signed integer (`BIGINT`).