Skip to content

Commit ad5caff

Browse files
committed
间隙锁前开后闭
1 parent 5b88733 commit ad5caff

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

notes/数据库系统原理.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -392,14 +392,14 @@ SELECT c FROM t WHERE c BETWEEN 10 and 20 FOR UPDATE;
392392

393393
## Next-Key Locks
394394

395-
它是 Record Locks 和 Gap Locks 的结合,不仅锁定一个记录上的索引,也锁定索引之间的间隙。例如一个索引包含以下值:10, 11, 13, and 20,那么就需要锁定以下区间:
395+
它是 Record Locks 和 Gap Locks 的结合,不仅锁定一个记录上的索引,也锁定索引之间的间隙,是一个前开后闭区间。例如一个索引包含以下值:10, 11, 13, and 20,那么就需要锁定以下区间:
396396

397397
```sql
398398
(-∞, 10]
399399
(10, 11]
400400
(11, 13]
401401
(13, 20]
402-
(20, +∞)
402+
(20, +supremum]
403403
```
404404

405405
# 七、关系数据库设计理论

0 commit comments

Comments
 (0)