mirror of
https://github.com/Snailclimb/JavaGuide
synced 2025-06-16 18:10:13 +08:00
fix:少写了一个字
This commit is contained in:
parent
c3ed2d736b
commit
394a5ede03
@ -60,7 +60,7 @@ MySQL中的索引可以以一定顺序引用多列,这种索引叫作联合索
|
||||
```
|
||||
select * from user where name=xx and city=xx ; //可以命中索引
|
||||
select * from user where name=xx ; // 可以命中索引
|
||||
select * from user where city=xx; // 法命中索引
|
||||
select * from user where city=xx; // 无法命中索引
|
||||
```
|
||||
这里需要注意的是,查询的时候如果两个条件都用上了,但是顺序不同,如 `city= xx and name =xx`,那么现在的查询引擎会自动优化为匹配联合索引的顺序,这样是能够命中索引的.
|
||||
|
||||
@ -109,4 +109,4 @@ ALTER TABLE `table_name` ADD INDEX index_name ( `column1`, `column2`, `column3`
|
||||
- 《Java工程师修炼之道》
|
||||
- 《MySQL高性能书籍_第3版》
|
||||
- https://juejin.im/post/5b55b842f265da0f9e589e79
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user