~drizzle-trunk/drizzle/development

1283.28.17 by Stewart Smith
implement index_read for multi column indexes
1
create table t1 (a int primary key, b int, c int, unique abcindex(a,b,c), unique bcindex(b,c));
2
insert into t1 values (1,1,1),(2,2,2),(3,3,3),(4,4,4),(5,5,5),(6,2,3),(7,2,4),(8,2,1);
3
explain select * from t1 force index (abcindex) where a=2 and b=2;
4
id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
1815.2.4 by Stewart Smith
make all HailDB tests using EXPLAIN substitute out the rows column as this will be non-exact from HailDB
5
1	SIMPLE	t1	ref	abcindex	abcindex	9	const,const	#	Using where; Using index
1283.28.17 by Stewart Smith
implement index_read for multi column indexes
6
select * from t1 force index (abcindex) where a=2 and b=2;
7
a	b	c
8
2	2	2
9
explain select a from t1 force index (bcindex) where b=2 and c>2;
10
id	select_type	table	type	possible_keys	key	key_len	ref	rows	Extra
1815.2.4 by Stewart Smith
make all HailDB tests using EXPLAIN substitute out the rows column as this will be non-exact from HailDB
11
1	SIMPLE	t1	range	bcindex	bcindex	10	NULL	#	Using where
1283.28.17 by Stewart Smith
implement index_read for multi column indexes
12
select a from t1 force index (bcindex) where b=2 and c>2;
13
a
14
6
15
7
16
DROP TABLE t1;