Skip to content

Commit

Permalink
FIX the description of the row key (talent-plan#43)
Browse files Browse the repository at this point in the history
  • Loading branch information
ThySinner authored Jun 11, 2020
1 parent a7d00f9 commit 43bba73
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions courses/proj1-part2-README-zh_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,22 +31,22 @@
每行数据按照如下规则进行编码成 Key-Value pair:

```
Key: tablePrefix_recordPrefixSep_tableID_rowID
Key: tablePrefix_tableID_recordPrefixSep_rowID
Value: [col1, col2, col3, col4]
```

其中 Key 的 tablePrefix/recordPrefixSep 都是特定的字符串常量,用于在 KV 空间内区分其他数据。
对于索引,会为每一个索引分配表内唯一的 indexID,然后按照如下规则编码成 Key-Value pair:

```
Key: tablePrefix_indexPrefixSep_tableID_indexID_indexColumnsValue
Key: tablePrefix_tableID_indexPrefixSep_indexID_indexColumnsValue
Value: rowID
```

当然,我们还需要考虑非唯一索引,这个时候上面的方法就行不通了,我们需要将 rowID 也编码进 Key 里使之成为唯一的:

```
Key: tablePrefix_indexPrefixSep_tableID_indexID_ColumnsValue_rowID
Key: tablePrefix_tableID_indexPrefixSep_indexID_ColumnsValue_rowID
Value:null
```

Expand Down

0 comments on commit 43bba73

Please sign in to comment.