質問編集履歴

1

fix

2020/08/11 16:42

投稿

daiki002
daiki002

スコア68

test CHANGED
File without changes
test CHANGED
@@ -48,7 +48,7 @@
48
48
 
49
49
  SQL1はwhere句でfirst_name, last_nameを指定しているので作成済みのインデックスの通りindexが利用されています。
50
50
 
51
- SQL2はwhere句でlast_nameのみを指定しているのですがpossible_keysがあるのでindexが利用されているように見ます。
51
+ SQL2はwhere句でfirst_nameのみを指定しているのですがpossible_keysがあるのでindexが利用されているように見ます。
52
52
 
53
53
 
54
54
 
@@ -78,11 +78,13 @@
78
78
 
79
79
  ```SQL
80
80
 
81
- select * from users where first_name = 'tarou1' and last_name = 'tanaka'
81
+ select * from users where first_name = 'tarou1'
82
82
 
83
- explain select * from users where first_name = 'tarou1' and last_name = 'tanaka'
83
+ explain select * from users where first_name = 'tarou1'
84
84
 
85
85
  ```
86
+
87
+
86
88
 
87
89
 
88
90
 
@@ -92,7 +94,9 @@
92
94
 
93
95
  | ---: | --- | --- | --- | --- | --- | --- | --- | ---: | --- |
94
96
 
95
- | 1 | SIMPLE | users | ref | first_name_last_name | first_name_last_name | 100 | const,const | 1 | Using index condition |
97
+ | 1 | SIMPLE | users | ref | first_name_last_name | first_name_last_name | 50 | const | 1 | Using index condition |
98
+
99
+
96
100
 
97
101
 
98
102