From 7f8785a084e71cb518baa1b289e8d419b680d82a Mon Sep 17 00:00:00 2001 From: Namjae Kim Date: Mon, 3 Nov 2025 17:00:24 +0900 Subject: [PATCH 1/3] fix typo in index key encoding format (tableID -> TableID, indexID -> IndexID) --- tidb-computing.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tidb-computing.md b/tidb-computing.md index f401b0d22747b..1304547e0cb46 100644 --- a/tidb-computing.md +++ b/tidb-computing.md @@ -41,7 +41,7 @@ TiDB supports both primary keys and secondary indexes (both unique and non-uniqu For primary keys and unique indexes, it is needed to quickly locate the corresponding `RowID` based on the key-value pair, so such a key-value pair is encoded as follows. ``` -Key: tablePrefix{tableID}_indexPrefixSep{indexID}_indexedColumnsValue +Key: tablePrefix{TableID}_indexPrefixSep{IndexID}_indexedColumnsValue Value: RowID ``` From 1f2bd978e0bdd57111bee59c835e2b7b35620f95 Mon Sep 17 00:00:00 2001 From: houfaxin Date: Tue, 4 Nov 2025 16:41:01 +0800 Subject: [PATCH 2/3] Standardize key naming to use TableID and IndexID Updated documentation to consistently use 'TableID' and 'IndexID' instead of 'tableID' and 'indexID' in key encoding examples and API references for clarity and consistency. --- troubleshoot-hot-spot-issues.md | 8 ++++---- troubleshoot-write-conflicts.md | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/troubleshoot-hot-spot-issues.md b/troubleshoot-hot-spot-issues.md index d486dcca40015..5f1cbd369f40f 100644 --- a/troubleshoot-hot-spot-issues.md +++ b/troubleshoot-hot-spot-issues.md @@ -22,7 +22,7 @@ TiDB assigns a TableID to each table, an IndexID to each index, and a RowID to e Each row of data is encoded as a key-value pair according to the following rule: ``` -Key: tablePrefix{tableID}_recordPrefixSep{rowID} +Key: tablePrefix{TableID}_recordPrefixSep{RowID} Value: [col1, col2, col3, col4] ``` @@ -31,17 +31,17 @@ The `tablePrefix` and `recordPrefixSep` of the key are specific string constants For Index data, the key-value pair is encoded according to the following rule: ``` -Key: tablePrefix{tableID}_indexPrefixSep{indexID}_indexedColumnsValue +Key: tablePrefix{TableID}_indexPrefixSep{IndexID}_indexedColumnsValue Value: rowID ``` Index data has two types: the unique index and the non-unique index. - For unique indexes, you can follow the coding rules above. -- For non-unique indexes, a unique key cannot be constructed through this encoding, because the `tablePrefix{tableID}_indexPrefixSep{indexID}` of the same index is the same and the `ColumnsValue` of multiple rows might be the same. The encoding rule for non-unique indexes is as follows: +- For non-unique indexes, a unique key cannot be constructed through this encoding, because the `tablePrefix{TableID}_indexPrefixSep{IndexID}` of the same index is the same and the `ColumnsValue` of multiple rows might be the same. The encoding rule for non-unique indexes is as follows: ``` - Key: tablePrefix{tableID}_indexPrefixSep{indexID}_indexedColumnsValue_rowID + Key: tablePrefix{TableID}_indexPrefixSep{IndexID}_indexedColumnsValue_rowID Value: null ``` diff --git a/troubleshoot-write-conflicts.md b/troubleshoot-write-conflicts.md index c8363034bf772..4fa366069916a 100644 --- a/troubleshoot-write-conflicts.md +++ b/troubleshoot-write-conflicts.md @@ -78,10 +78,10 @@ You can use `tableID` to find the name of the related table: {{< copyable "" >}} ```shell -curl http://{TiDBIP}:10080/db-table/{tableID} +curl http://{TiDBIP}:10080/db-table/{TableID} ``` -You can use `indexID` and the table name to find the name of the related index: +You can use `IndexID` and the table name to find the name of the related index: {{< copyable "sql" >}} From ab6042a7eadca0fca8eb378eec491d69fc67b323 Mon Sep 17 00:00:00 2001 From: xixirangrang Date: Tue, 4 Nov 2025 17:00:00 +0800 Subject: [PATCH 3/3] Update troubleshoot-write-conflicts.md Co-authored-by: Aolin --- troubleshoot-write-conflicts.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/troubleshoot-write-conflicts.md b/troubleshoot-write-conflicts.md index 4fa366069916a..994e7f486b26b 100644 --- a/troubleshoot-write-conflicts.md +++ b/troubleshoot-write-conflicts.md @@ -81,7 +81,7 @@ You can use `tableID` to find the name of the related table: curl http://{TiDBIP}:10080/db-table/{TableID} ``` -You can use `IndexID` and the table name to find the name of the related index: +You can use `indexID` and the table name to find the name of the related index: {{< copyable "sql" >}}