Skip to content
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
Original file line number Diff line number Diff line change
Expand Up @@ -509,7 +509,7 @@ a3406db9ae7144d17eb7df5bffe8b70bb5dd06b8 127.0.0.1:7002@17002 master - 0 1584428

#### 方案二:一致性哈希分区

一致性哈希算法将 **整个哈希值空间** 组织成一个虚拟的圆环,范围是 *[0 - 2<sup>32 - 1</sup>]*,对于每一个数据,根据 `key` 计算 hash 值,确数据在环上的位置,然后从此位置沿顺时针行走,找到的第一台服务器就是其应该映射到的服务器:
一致性哈希算法将 **整个哈希值空间** 组织成一个虚拟的圆环,范围是 *[0 , 2<sup>32</sup>-1]*,对于每一个数据,根据 `key` 计算 hash 值,确数据在环上的位置,然后从此位置沿顺时针行走,找到的第一台服务器就是其应该映射到的服务器:

![](https://upload-images.jianshu.io/upload_images/7896890-40e8a2c096c8da92.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)

Expand Down
2 changes: 1 addition & 1 deletion docs/database/数据库索引.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ B+树是有序的,在这种范围查询中,优势非常大,直接遍历比

**一张数据表有只能有一个主键,并且主键不能为null,不能重复。**

**在mysql的InnoDB的表中,当没有显示的指定表的主键时,InnoDB会自动先检查表中是否有唯一索引的字段,如果有,则选择改字段为默认的主键,否则InnoDB将会自动创建一个6Byte的自增主键。**
**在mysql的InnoDB的表中,当没有显示的指定表的主键时,InnoDB会自动先检查表中是否有唯一索引的字段,如果有,则选择该字段为默认的主键,否则InnoDB将会自动创建一个6Byte的自增主键。**

### 二级索引(辅助索引)
**二级索引又称为辅助索引,是因为二级索引的叶子节点存储的数据是主键。也就是说,通过二级索引,可以定位主键的位置。**
Expand Down