diff options
author | unknown <sergefp@mysql.com> | 2006-02-11 21:51:43 +0300 |
---|---|---|
committer | unknown <sergefp@mysql.com> | 2006-02-11 21:51:43 +0300 |
commit | 4b0cce48737bf90eb33e389706df824cc00d7e5c (patch) | |
tree | d894a207a1c4fad592a93902aac288cb1c465a91 /mysql-test/r/index_merge.result | |
parent | 96268d4a9a375fdd6e7effe530f26261bbd01d55 (diff) | |
download | mariadb-git-4b0cce48737bf90eb33e389706df824cc00d7e5c.tar.gz |
BUG#17314: Can't use index_merge/intersection for MERGE tables
1. Fix index access costs for MERGE tables, set block_size=myisam_block_size/#underlying_tables
instead of 0 which it was before.
2. Make index scans on MERGE table to return records in (key_tuple, merge_table_rowid) order,
instead of just (key_tuple) order. This makes an index scan on MERGE table to be truly a ROR-scan
which is a requirement for index_merge union/intersection.
myisammrg/myrg_queue.c:
BUG#17314: Make index scans on MERGE table return records ordered by (keytuple, merge_table_rowid).
mysql-test/r/index_merge.result:
Testcase for BUG#17314
mysql-test/r/merge.result:
BUG#17314: update testcase result
mysql-test/t/index_merge.test:
Testcase for BUG#17314
sql/ha_myisammrg.cc:
BUG#17314: For MERGE tables, set handler::block_size to myisam_block_size/#underlying_tables, and not to 0.
Diffstat (limited to 'mysql-test/r/index_merge.result')
-rw-r--r-- | mysql-test/r/index_merge.result | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/mysql-test/r/index_merge.result b/mysql-test/r/index_merge.result index db87253e19a..3a69f56cbd3 100644 --- a/mysql-test/r/index_merge.result +++ b/mysql-test/r/index_merge.result @@ -402,3 +402,25 @@ explain select * from t1 force index(cola,colb) WHERE cola = 'foo' AND colb = 'b id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 index_merge cola,colb cola,colb 3,3 NULL 24 Using intersect(cola,colb); Using where drop table t1; +create table t0 (a int); +insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); +create table t1 ( +a int, b int, +filler1 char(200), filler2 char(200), +key(a),key(b) +); +insert into t1 select @v:= A.a, @v, 't1', 'filler2' from t0 A, t0 B, t0 C; +create table t2 like t1; +create table t3 ( +a int, b int, +filler1 char(200), filler2 char(200), +key(a),key(b) +) engine=merge union=(t1,t2); +explain select * from t1 where a=1 and b=1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index_merge a,b a,b 5,5 NULL # Using intersect(a,b); Using where +explain select * from t3 where a=1 and b=1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t3 index_merge a,b a,b 5,5 NULL # Using intersect(a,b); Using where +drop table t3; +drop table t0, t1, t2; |