From 394a5ede03c509c3a932ccb080b86413080b74f1 Mon Sep 17 00:00:00 2001 From: SnailClimb Date: Wed, 31 Oct 2018 15:03:20 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=E5=B0=91=E5=86=99=E4=BA=86?= =?UTF-8?q?=E4=B8=80=E4=B8=AA=E5=AD=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 数据存储/MySQL Index.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/数据存储/MySQL Index.md b/数据存储/MySQL Index.md index dda0ba8b..27b82c8b 100644 --- a/数据存储/MySQL Index.md +++ b/数据存储/MySQL Index.md @@ -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 - \ No newline at end of file +