Slide 45
Slide 45 text
mysql> create index NameAndPopulation on City(Name,Population);
Query OK, 0 rows affected (0.05 sec)
Records: 0 Duplicates: 0 Warnings: 0
mysql> explain select * from City
where Name like "G%" and Population < 27000\G
*************************** 1. row ***************************
id: 1
select_type: SIMPLE
table: City
type: range
possible_keys: Name,Population,NameAndPopulation
key: Population
key_len: 4
ref: NULL
rows: 64
Extra: Using index condition; Using where
1 row in set (0.00 sec)
Friday 14 February 14