From 76e444257b497582ea872691a69288f4f5720d04 Mon Sep 17 00:00:00 2001 From: CyC2018 <1029579233@qq.com> Date: Wed, 14 Mar 2018 17:14:31 +0800 Subject: [PATCH] auto commit --- notes/MySQL.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/notes/MySQL.md b/notes/MySQL.md index d63256c5..53b18b43 100644 --- a/notes/MySQL.md +++ b/notes/MySQL.md @@ -221,11 +221,11 @@ SELECT actor_id FROM sakila.actor WHERE actor_id + 1 = 5; ### 3.3 多列索引 -在需要使用多个列作为条件进行查询时,使用多列索引比使用多个单列索引性能更好。例如下面的语句中,最好把 actor_id 和 file_id 设置为多列索引。 +在需要使用多个列作为条件进行查询时,使用多列索引比使用多个单列索引性能更好。例如下面的语句中,最好把 actor_id 和 film_id 设置为多列索引。 ```sql -SELECT file_id, actor_ id FROM sakila.film_actor -WhERE actor_id = 1 OR film_id = 1; +SELECT film_id, actor_ id FROM sakila.film_actor +WhERE actor_id = 1 AND film_id = 1; ``` ### 3.4 索引列的顺序