Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

architecture: fix link #3365

Merged
merged 4 commits into from
May 27, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tidb-computing.md
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,7 @@ TiDB 的 SQL 层,即 TiDB Server,负责将 SQL 翻译成 Key-Value 操作,

### SQL 运算

最简单的方案就是通过上一节所述的[表中所有数据和 Key-Value 的映射关系](#1-表数据与-key-value-的映射关系)映射方案,将 SQL 查询映射为对 KV 的查询,再通过 KV 接口获取对应的数据,最后执行各种计算。
最简单的方案就是通过上一节所述的[表数据与 Key-Value 的映射关系](#表数据与-key-value-的映射关系)方案,将 SQL 查询映射为对 KV 的查询,再通过 KV 接口获取对应的数据,最后执行各种计算。

比如 `select count(*) from user where name = "TiDB"` 这样一个 SQL 语句,它需要读取表中所有的数据,然后检查 `name` 字段是否是 `TiDB`,如果是的话,则返回这一行。具体流程如下:

Expand Down
2 changes: 1 addition & 1 deletion tidb-storage.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ KeyN_Version1 -> Value
……
```

注意,对于同一个 Key 的多个版本,版本号较大的会被放在前面,版本号小的会被放在后面(见 [Key-Value](#key-value-pairs-键值对) 一节, Key 是有序的排列),这样当用户通过一个 Key + Version 来获取 Value 的时候,可以通过 Key 和 Version 构造出 MVCC 的 Key,也就是 Key_Version。然后可以直接通过 RocksDB 的 SeekPrefix(Key_Version) API,定位到第一个大于等于这个 Key_Version 的位置。
注意,对于同一个 Key 的多个版本,版本号较大的会被放在前面,版本号小的会被放在后面(见 [Key-Value](#key-value-pairs键值对) 一节, Key 是有序的排列),这样当用户通过一个 Key + Version 来获取 Value 的时候,可以通过 Key 和 Version 构造出 MVCC 的 Key,也就是 Key_Version。然后可以直接通过 RocksDB 的 SeekPrefix(Key_Version) API,定位到第一个大于等于这个 Key_Version 的位置。

## 分布式 ACID 事务

Expand Down