null+****@clear*****
null+****@clear*****
2012年 2月 26日 (日) 23:51:10 JST
Kouhei Sutou 2012-02-26 23:51:10 +0900 (Sun, 26 Feb 2012)
New Revision: 5bd50ed119e112d323da8204bd423f46460464af
Log:
multiple-column-index: Use target type as the first column.
Modified files:
test/sql/suite/mroonga_storage/r/multiple_column_index_int.result
test/sql/suite/mroonga_storage/t/multiple_column_index_int.test
Modified: test/sql/suite/mroonga_storage/r/multiple_column_index_int.result (+5 -7)
===================================================================
--- test/sql/suite/mroonga_storage/r/multiple_column_index_int.result 2012-02-26 23:48:35 +0900 (6e47ba0)
+++ test/sql/suite/mroonga_storage/r/multiple_column_index_int.result 2012-02-26 23:51:10 +0900 (46160ba)
@@ -4,7 +4,7 @@ create table scores (
id int primary key auto_increment not null,
name char(30) not null,
score int not null,
-index property (name, score)
+index property (score, name)
) default charset utf8;
show create table scores;
Table Create Table
@@ -13,7 +13,7 @@ scores CREATE TABLE `scores` (
`name` char(30) NOT NULL,
`score` int(11) NOT NULL,
PRIMARY KEY (`id`),
- KEY `property` (`name`,`score`)
+ KEY `property` (`score`,`name`)
) ENGINE=mroonga DEFAULT CHARSET=utf8
insert into scores (name, score) values("Taro Yamada", 29);
insert into scores (name, score) values("Taro Yamada", -12);
@@ -25,15 +25,13 @@ id name score
2 Taro Yamada -12
3 Jiro Yamada 27
4 Taro Yamada 10
-select * from scores where name = "Taro Yamada";
+select * from scores where score = 29;
id name score
-2 Taro Yamada -12
-4 Taro Yamada 10
1 Taro Yamada 29
-select * from scores where name = "Taro Yamada" and score = 29;
+select * from scores where score = 29 and name = "Taro Yamada";
id name score
1 Taro Yamada 29
-select * from scores where name = "Taro Yamada" and (score >= -12 and score < 29);
+select * from scores where (score >= -12 and score < 29) and name = "Taro Yamada";
id name score
2 Taro Yamada -12
4 Taro Yamada 10
Modified: test/sql/suite/mroonga_storage/t/multiple_column_index_int.test (+4 -4)
===================================================================
--- test/sql/suite/mroonga_storage/t/multiple_column_index_int.test 2012-02-26 23:48:35 +0900 (2ba395a)
+++ test/sql/suite/mroonga_storage/t/multiple_column_index_int.test 2012-02-26 23:51:10 +0900 (2b244e5)
@@ -25,7 +25,7 @@ create table scores (
id int primary key auto_increment not null,
name char(30) not null,
score int not null,
- index property (name, score)
+ index property (score, name)
) default charset utf8;
show create table scores;
insert into scores (name, score) values("Taro Yamada", 29);
@@ -33,9 +33,9 @@ insert into scores (name, score) values("Taro Yamada", -12);
insert into scores (name, score) values("Jiro Yamada", 27);
insert into scores (name, score) values("Taro Yamada", 10);
select * from scores;
-select * from scores where name = "Taro Yamada";
-select * from scores where name = "Taro Yamada" and score = 29;
-select * from scores where name = "Taro Yamada" and (score >= -12 and score < 29);
+select * from scores where score = 29;
+select * from scores where score = 29 and name = "Taro Yamada";
+select * from scores where (score >= -12 and score < 29) and name = "Taro Yamada";
drop table scores;
--source include/have_mroonga_deinit.inc