drop table if exists listing;
set names utf8;
create table listing (
id int primary key auto_increment not null,
last_name char(30) not null,
first_name char(30) not null,
index name (last_name, first_name)
) default charset utf8;
show create table listing;
Table	Create Table
listing	CREATE TABLE `listing` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `last_name` char(30) NOT NULL,
  `first_name` char(30) NOT NULL,
  PRIMARY KEY (`id`),
  KEY `name` (`last_name`,`first_name`)
) ENGINE=mroonga DEFAULT CHARSET=utf8
insert into listing (last_name, first_name) values("Taro", "Yamada");
insert into listing (last_name, first_name) values("Taro", "Suzuki");
insert into listing (last_name, first_name) values("Jiro", "Yamada");
insert into listing (last_name, first_name) values("Taro", "Tanaka");
select * from listing
where last_name = "Taro" and (first_name >= "S" and first_name <= "Y");
id	last_name	first_name
2	Taro	Suzuki
4	Taro	Tanaka
drop index name on listing;
select * from listing
where last_name = "Taro" and (first_name >= "S" and first_name <= "Y");
id	last_name	first_name
2	Taro	Suzuki
4	Taro	Tanaka
create index new_name_index on listing (last_name, first_name);
select * from listing
where last_name = "Taro" and (first_name >= "S" and first_name <= "Y");
id	last_name	first_name
2	Taro	Suzuki
4	Taro	Tanaka
drop table listing;
