mysql> explain select * from restaurants where name like "あ%";
+----+-------------+-------------+------+---------------+------+---------+------+--------+-------------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+----+-------------+-------------+------+---------------+------+---------+------+--------+-------------+
| 1 | SIMPLE | restaurants | ALL | NULL | NULL | NULL | NULL | 211793 | Using where |
+----+-------------+-------------+------+---------------+------+---------+------+--------+-------------+
1 row in set (0.01 sec)
mysql> explain select * from restaurants where name like "%あ%";
+----+-------------+-------------+------+---------------+------+---------+------+--------+-------------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+----+-------------+-------------+------+---------------+------+---------+------+--------+-------------+
| 1 | SIMPLE | restaurants | ALL | NULL | NULL | NULL | NULL | 211793 | Using where |
+----+-------------+-------------+------+---------------+------+---------+------+--------+-------------+
1 row in set (0.01 sec)
mysql> explain select * from restaurants where name like "%あ";
+----+-------------+-------------+------+---------------+------+---------+------+--------+-------------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+----+-------------+-------------+------+---------------+------+---------+------+--------+-------------+
| 1 | SIMPLE | restaurants | ALL | NULL | NULL | NULL | NULL | 211793 | Using where |
+----+-------------+-------------+------+---------------+------+---------+------+--------+-------------+
1 row in set (0.01 sec)
mysql> ALTER TABLE `restaurants` CHANGE `name` `name` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ;
mysql> ALTER TABLE `restaurants` ADD INDEX `idx_name` ( `name` ) COMMENT '';
mysql> explain select * from restaurants where name like "あ%";
+----+-------------+-------------+-------+---------------+----------+---------+------+------+-------------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+----+-------------+-------------+-------+---------------+----------+---------+------+------+-------------+
| 1 | SIMPLE | restaurants | range | idx_name | idx_name | 767 | NULL | 1288 | Using where |
+----+-------------+-------------+-------+---------------+----------+---------+------+------+-------------+
1 row in set (0.01 sec)
mysql> explain select * from restaurants where name like "あ%";
+----+-------------+-------------+-------+---------------+----------+---------+------+------+-------------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+----+-------------+-------------+-------+---------------+----------+---------+------+------+-------------+
| 1 | SIMPLE | restaurants | range | idx_name | idx_name | 767 | NULL | 1288 | Using where |
+----+-------------+-------------+-------+---------------+----------+---------+------+------+-------------+
1 row in set (0.01 sec)
mysql> explain select * from restaurants where name like "%あ%";
+----+-------------+-------------+------+---------------+------+---------+------+--------+-------------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+----+-------------+-------------+------+---------------+------+---------+------+--------+-------------+
| 1 | SIMPLE | restaurants | ALL | NULL | NULL | NULL | NULL | 208434 | Using where |
+----+-------------+-------------+------+---------------+------+---------+------+--------+-------------+
1 row in set (0.01 sec)
mysql> explain select * from restaurants where name like "%あ";
+----+-------------+-------------+------+---------------+------+---------+------+--------+-------------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+----+-------------+-------------+------+---------------+------+---------+------+--------+-------------+
| 1 | SIMPLE | restaurants | ALL | NULL | NULL | NULL | NULL | 208434 | Using where |
+----+-------------+-------------+------+---------------+------+---------+------+--------+-------------+
1 row in set (0.01 sec)
mysql> explain select * from restaurants where name like "あ%";
+----+-------------+-------------+------+---------------+------+---------+------+--------+-------------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+----+-------------+-------------+------+---------------+------+---------+------+--------+-------------+
| 1 | SIMPLE | restaurants | ALL | NULL | NULL | NULL | NULL | 214008 | Using where |
+----+-------------+-------------+------+---------------+------+---------+------+--------+-------------+
1 row in set (0.03 sec)
mysql> explain select * from restaurants where name like "%あ%";
+----+-------------+-------------+------+---------------+------+---------+------+--------+-------------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+----+-------------+-------------+------+---------------+------+---------+------+--------+-------------+
| 1 | SIMPLE | restaurants | ALL | NULL | NULL | NULL | NULL | 214008 | Using where |
+----+-------------+-------------+------+---------------+------+---------+------+--------+-------------+
1 row in set (0.00 sec)
mysql> explain select * from restaurants where name like "%あ";
+----+-------------+-------------+------+---------------+------+---------+------+--------+-------------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+----+-------------+-------------+------+---------------+------+---------+------+--------+-------------+
| 1 | SIMPLE | restaurants | ALL | NULL | NULL | NULL | NULL | 214008 | Using where |
+----+-------------+-------------+------+---------------+------+---------+------+--------+-------------+
1 row in set (0.00 sec)
mysql> ALTER TABLE `restaurants` CHANGE `name` `name` VARCHAR( 255 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ;
mysql> ALTER TABLE `restaurants` ADD INDEX `idx_name` ( `name` ) COMMENT '';
mysql> explain select * from restaurants where name like "あ%";
+----+-------------+-------------+-------+---------------+----------+---------+------+------+-----------------------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+----+-------------+-------------+-------+---------------+----------+---------+------+------+-----------------------+
| 1 | SIMPLE | restaurants | range | idx_name | idx_name | 767 | NULL | 1288 | Using index condition |
+----+-------------+-------------+-------+---------------+----------+---------+------+------+-----------------------+
1 row in set (0.01 sec)
mysql> explain select * from restaurants where name like "%あ%";
+----+-------------+-------------+------+---------------+------+---------+------+--------+-------------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+----+-------------+-------------+------+---------------+------+---------+------+--------+-------------+
| 1 | SIMPLE | restaurants | ALL | NULL | NULL | NULL | NULL | 201385 | Using where |
+----+-------------+-------------+------+---------------+------+---------+------+--------+-------------+
1 row in set (0.01 sec)
mysql> explain select * from restaurants where name like "%あ";
+----+-------------+-------------+------+---------------+------+---------+------+--------+-------------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+----+-------------+-------------+------+---------------+------+---------+------+--------+-------------+
| 1 | SIMPLE | restaurants | ALL | NULL | NULL | NULL | NULL | 201385 | Using where |
+----+-------------+-------------+------+---------------+------+---------+------+--------+-------------+
1 row in set (0.01 sec)
mysql> ALTER TABLE `restaurants` CHANGE `name` `name` text CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ;
mysql> alter table restaurants add fulltext(`name`);
mysql> explain select * from restaurants where match(name) against('あ+');
+----+-------------+-------------+----------+---------------+------+---------+------+------+-------------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+----+-------------+-------------+----------+---------------+------+---------+------+------+-------------+
| 1 | SIMPLE | restaurants | fulltext | name | name | 0 | NULL | 1 | Using where |
+----+-------------+-------------+----------+---------------+------+---------+------+------+-------------+
1 row in set (0.00 sec)
mysql> explain select * from restaurants where match(name) against('+あ+');
+----+-------------+-------------+----------+---------------+------+---------+------+------+-------------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+----+-------------+-------------+----------+---------------+------+---------+------+------+-------------+
| 1 | SIMPLE | restaurants | fulltext | name | name | 0 | NULL | 1 | Using where |
+----+-------------+-------------+----------+---------------+------+---------+------+------+-------------+
1 row in set (0.01 sec)
mysql> explain select * from restaurants where match(name) against('+あ');
+----+-------------+-------------+----------+---------------+------+---------+------+------+-------------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+----+-------------+-------------+----------+---------------+------+---------+------+------+-------------+
| 1 | SIMPLE | restaurants | fulltext | name | name | 0 | NULL | 1 | Using where |
+----+-------------+-------------+----------+---------------+------+---------+------+------+-------------+
1 row in set (0.00 sec)