🔄Update: MySQL

This commit is contained in:
2025-09-25 20:14:36 +08:00
parent c4b62a4aa8
commit acf3132514
4 changed files with 115 additions and 0 deletions
+24
View File
@@ -0,0 +1,24 @@
# 联合索引
- 二级索引的一种
## 最左匹配
有序 -> 匹配
## 范围查询
> Q: `select * from t_table where a > 1 and b = 2` 联合索引(a, b)哪一个字段用到了联合索引的 B+Tree?
- a
- 在符合 `a > 1` 条件的 `b` 中,字段值是无序的。
> Q: `select * from t_table where a >= 1 and b = 2` 联合索引(a, b)哪一个字段用到了联合索引的 B+Tree?
- a, b
- 因为能确定唯一起始点
## 索引下推
- 提前判断减少回表