diff options
author | serg@serg.mysql.com <> | 2002-11-17 18:58:03 +0100 |
---|---|---|
committer | serg@serg.mysql.com <> | 2002-11-17 18:58:03 +0100 |
commit | 0a75fe85d1069b500c7aaa92404f366be534ba6d (patch) | |
tree | 771a80d6c9d19b9007b8ba8a7f4e3a20fdddf247 /mysql-test/t | |
parent | 8796fc2dc555041acccef20785453d48d68e7022 (diff) | |
download | mariadb-git-0a75fe85d1069b500c7aaa92404f366be534ba6d.tar.gz |
merge::records_in_range and optimizer
Diffstat (limited to 'mysql-test/t')
-rw-r--r-- | mysql-test/t/merge.test | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/mysql-test/t/merge.test b/mysql-test/t/merge.test index 55a71cc0ab8..2199f50fb16 100644 --- a/mysql-test/t/merge.test +++ b/mysql-test/t/merge.test @@ -204,3 +204,36 @@ create temporary table t6 (a int not null) TYPE=MERGE UNION=(t4,t5); select * from t6; drop table if exists t1, t2, t3, t4, t5, t6; +# +# testing merge::records_in_range and optimizer +# + +DROP TABLE IF EXISTS t1, t2; +CREATE TABLE t1 ( + fileset_id tinyint(3) unsigned NOT NULL default '0', + file_code varchar(32) NOT NULL default '', + fileset_root_id tinyint(3) unsigned NOT NULL default '0', + PRIMARY KEY (fileset_id,file_code), + KEY files (fileset_id,fileset_root_id) +) TYPE=MyISAM; +INSERT INTO t1 VALUES (2, '0000000111', 1), (2, '0000000112', 1), (2, '0000000113', 1), +(2, '0000000114', 1), (2, '0000000115', 1), (2, '0000000116', 1), (2, '0000000117', 1), +(2, '0000000118', 1), (2, '0000000119', 1), (2, '0000000120', 1); +CREATE TABLE t2 ( + fileset_id tinyint(3) unsigned NOT NULL default '0', + file_code varchar(32) NOT NULL default '', + fileset_root_id tinyint(3) unsigned NOT NULL default '0', + PRIMARY KEY (fileset_id,file_code), + KEY files (fileset_id,fileset_root_id) +) TYPE=MRG_MyISAM UNION=(t1); + +EXPLAIN SELECT * FROM t2 IGNORE INDEX (files) WHERE fileset_id = 2 +AND file_code BETWEEN '0000000115' AND '0000000120' LIMIT 1; +EXPLAIN SELECT * FROM t2 WHERE fileset_id = 2 +AND file_code BETWEEN '0000000115' AND '0000000120' LIMIT 1; +EXPLAIN SELECT * FROM t1 WHERE fileset_id = 2 +AND file_code BETWEEN '0000000115' AND '0000000120' LIMIT 1; +EXPLAIN SELECT * FROM t2 WHERE fileset_id = 2 +AND file_code = '0000000115' LIMIT 1; +DROP TABLE IF EXISTS t1, t2; + |