diff options
author | unknown <mleich@three.local.lan> | 2006-08-16 14:58:49 +0200 |
---|---|---|
committer | unknown <mleich@three.local.lan> | 2006-08-16 14:58:49 +0200 |
commit | 808237b083fe36ea393b7e05e1f6c78d8213c106 (patch) | |
tree | 81f556e3b022838904a67ae5a3d1a96a1e3d439b /mysql-test/r/index_merge_innodb.result | |
parent | 829d70d09c1d092f6c507825b75fe45424f0d86a (diff) | |
download | mariadb-git-808237b083fe36ea393b7e05e1f6c78d8213c106.tar.gz |
This changeset belongs to
WL#3397 Refactoring storage engine test cases (for falcon)
It contains also fixes according to code review.
Contents: Testcases which were in history dedicated to InnoDB or MyISAM only.
Modifications:
1. Shift the main testing code into include/<testing field>.inc
Introduce $variables which can be used to omit tests for features which are not supported by
certain storage engines.
2. The storage engine to be tested is assigned within the toplevel script (t/<whatever>_<engine>.test)
via variable $engine_type and the the main testing code is sourced from
include/<testing field>.inc
3. Some toplevel testscripts have to be renamed to
- avoid immediate or future namespace clashes
- show via filename which storage engine is tested
4. Minor code cleanup like remove trailing spaces, some additional comments ....
mysql-test/t/unsafe_binlog_innodb-master.opt:
Rename: mysql-test/t/innodb_unsafe_binlog-master.opt -> mysql-test/t/unsafe_binlog_innodb-master.opt
mysql-test/r/read_many_rows_innodb.result:
Rename: mysql-test/r/innodb-big.result -> mysql-test/r/read_many_rows_innodb.result
mysql-test/t/cache_innodb-master.opt:
Rename: mysql-test/t/innodb_cache-master.opt -> mysql-test/t/cache_innodb-master.opt
mysql-test/t/concurrent_innodb-master.opt:
Rename: mysql-test/t/innodb_concurrent-master.opt -> mysql-test/t/concurrent_innodb-master.opt
BitKeeper/deleted/.del-index_merge.result:
Delete: mysql-test/r/index_merge.result
BitKeeper/deleted/.del-index_merge_innodb.result:
Delete: mysql-test/r/index_merge_innodb.result
BitKeeper/deleted/.del-index_merge_innodb2.result:
Delete: mysql-test/r/index_merge_innodb2.result
BitKeeper/deleted/.del-index_merge_ror.result:
Delete: mysql-test/r/index_merge_ror.result
BitKeeper/deleted/.del-index_merge_ror_cpk.result:
Delete: mysql-test/r/index_merge_ror_cpk.result
mysql-test/r/index_merge_innodb.result:
BitKeeper file /home/matthias/Arbeit/mysql-5.1-engines/src-1/mysql-test/r/index_merge_innodb.result
mysql-test/t/index_merge_innodb.test:
BitKeeper file /home/matthias/Arbeit/mysql-5.1-engines/src-1/mysql-test/t/index_merge_innodb.test
mysql-test/t/index_merge_myisam.test:
BitKeeper file /home/matthias/Arbeit/mysql-5.1-engines/src-1/mysql-test/t/index_merge_myisam.test
mysql-test/include/concurrent.inc:
1. This file contains now the main testing code of the former t/innodb_concurrent.test.
2. It is now sourced by t/concurrent_innodb.test.
mysql-test/include/deadlock.inc:
1. This file contains now the main testing code of the former t/innodb-deadlock.test
2. It is now sourced by t/deadlock_innodb.test.
mysql-test/include/handler.inc:
1. This file contains now the main testing code of the former t/innodb_handler.test + t/handler.test.
2. It is now sourced by t/handler_myisam.test and t/handler_innodb.test.
mysql-test/include/index_merge1.inc:
1. This file contains now the main testing code of the former t/index_merge.test.
2. It is now sourced by t/index_merge_myisam.test.
mysql-test/include/index_merge2.inc:
1. This file contains now the main code of t/index_merge_innodb.test.
2. It is sourced by t/index_merge_myisam.test and t/index_merge_innodb.test.
mysql-test/include/index_merge_2sweeps.inc:
1. This file contains now the main code of the former t/index_merge_innodb2.test.
2. It is sourced by t/index_merge_myisam.test and t/index_merge_innodb.test.
mysql-test/include/index_merge_ror.inc:
1. This file contains now the main code of the former t/index_merge_ror.test.
2. It is sourced by t/index_merge_myisam.test.
mysql-test/include/index_merge_ror_cpk.inc:
1. This file contains now the main testing code of the former t/index_merge_ror_cpk.test.
2. It is now sourced by t/index_merge_myisam.test and t/index_merge_innodb.test.
mysql-test/include/mix1.inc:
1. This file contains now the main testing code of the t/innodb_mysql.test
2. The name mix1.inc was used because the test contains subtests for different fields.
3. It is sourced by t/innodb_mysql.test.
4. Fixes:
- Assign $other_engine_type instead of hardcoded MyISAM.
- improve comment
- remove redundant subtest
- analyze table t4 instead of wrong table t1
- remove not needed "eval set storage_engine = $engine_type;"
mysql-test/include/mix2.inc:
1. This file is a copy of the main testing code of the t/innodb.test
A copy has to be used, because t/innodb.test is to be maintained by INNOBASE only.
2. The name mix2.inc was used because the test contains subtests for different fields.
3. It is sourced by t/mix2_myisam.test.
4. Fixes:
- improved comment
- additional "eval SET SESSION STORAGE_ENGINE = $other_engine_type;" at beginning of tests
- assign $other_engine_type instead of hardcoded MyISAM or HEAP
- assign $other_engine_type where it is needed to preserve test logics
- correct logical bugs
- improve(extend) "checksum table" test
mysql-test/include/query_cache.inc:
1. This file contains now the main testing code of the former t/innodb_cache.test.
2. It is now sourced by t/cache_innodb.test
mysql-test/include/read_many_rows.inc:
1. This file contains now the main testing code of the former t/innodb_big.test.
2. It is now sourced by t/read_many_rows_innodb.test.
mysql-test/include/rowid_order.inc:
1. This file contains now the main testing code of t/rowid_order_innodb.test.
2. It is now sourced by t/rowid_order_innodb.test.
mysql-test/include/unsafe_binlog.inc:
1. This file contains now the main testing code of the former t/innodb_unsafe_binlog.test.
2. It is now sourced by t/unsafe_binlog_innodb.test.
mysql-test/r/cache_innodb.result:
Updated result
mysql-test/r/concurrent_innodb.result:
Updated result
mysql-test/r/deadlock_innodb.result:
Updated result
mysql-test/r/handler_innodb.result:
Updated result
mysql-test/r/handler_myisam.result:
Updated result
mysql-test/r/index_merge_myisam.result:
Updated result
mysql-test/r/innodb_mysql.result:
Updated result
mysql-test/r/mix2_myisam.result:
Updated result
mysql-test/r/rowid_order_innodb.result:
Updated result
mysql-test/r/unsafe_binlog_innodb.result:
Updated result
mysql-test/t/cache_innodb.test:
1. Renaming of t/innodb_cache.test to t/cache_innodb.test
2. Main code is now sourced from include/query_cache.inc.
mysql-test/t/concurrent_innodb.test:
1. Renaming of t/innodb_concurrent.test to t/concurrent_innodb.test
2. Main code is now sourced from include/concurrent.inc.
Attention: This test fails even in the old version. (BUG#21579).
--> added to t/disabled.def
mysql-test/t/deadlock_innodb.test:
1. Renaming of t/innodb_deadlock.test to t/deadlock_innodb.test
2. Main code is now sourced from include/deadlock.inc.
mysql-test/t/disabled.def:
Add the test concurrent_innodb because of
BUG#21579 2006-08-11 mleich innodb_concurrent random failures with varying differences
mysql-test/t/handler_innodb.test:
1. Renaming of t/innodb_handler.test to t/handler_innodb.test
2. Main code is now sourced from include/handler.inc.
include/handler.inc = united code of former t/handler.test and t/innodb_handler.test
mysql-test/t/handler_myisam.test:
1. Renaming of t/handler.test to t/handler_myisam.test
2. Main code is now sourced from include/handler.inc.
include/handler.inc = united code of former t/handler.test and t/handler_innodb.test.
mysql-test/t/innodb_mysql.test:
1. Main code is now sourced from include/mix1.inc.
2. Test was not renamed because t/innodb.test refers to it.
mysql-test/t/mix2_myisam.test:
New test: MyISAM variant of mix2 ( = t/innodb.test)
mysql-test/t/read_many_rows_innodb.test:
1. Renaming of t/innodb_big.test to t/read_many_rows_innodb.test
2. Main code is now sourced from include/read_many_rows.inc.
mysql-test/t/rowid_order_innodb.test:
Main code is now sourced from t/rowid_order.inc.
mysql-test/t/unsafe_binlog_innodb.test:
1. Renaming of t/innodb_unsafe_binlog.test to t/unsafe_binlog_innodb.test
2. Main code is now sourced from include/unsafe_binlog.inc.
Diffstat (limited to 'mysql-test/r/index_merge_innodb.result')
-rw-r--r-- | mysql-test/r/index_merge_innodb.result | 325 |
1 files changed, 292 insertions, 33 deletions
diff --git a/mysql-test/r/index_merge_innodb.result b/mysql-test/r/index_merge_innodb.result index ae25cc28101..d8cb4cab96d 100644 --- a/mysql-test/r/index_merge_innodb.result +++ b/mysql-test/r/index_merge_innodb.result @@ -1,11 +1,13 @@ +#---------------- Index merge test 2 ------------------------------------------- +SET SESSION STORAGE_ENGINE = InnoDB; drop table if exists t1,t2; create table t1 ( -key1 int not null, -key2 int not null, +key1 int not null, +key2 int not null, INDEX i1(key1), INDEX i2(key2) -) engine=innodb; +); explain select * from t1 where key1 < 5 or key2 > 197; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 index_merge i1,i2 i1,i2 4,4 NULL 8 Using sort_union(i1,i2); Using where @@ -26,7 +28,7 @@ key1 key2 2 198 3 197 4 196 -alter table t1 add str1 char (255) not null, +alter table t1 add str1 char (255) not null, add zeroval int not null default 0, add str2 char (255) not null, add str3 char (255) not null; @@ -60,7 +62,7 @@ key2 integer not null, filler char (200), index (key1), index (key2) -) engine=innodb; +); show warnings; Level Code Message explain select pk from t1 where key1 = 1 and key2 = 1; @@ -91,14 +93,14 @@ filler1 char (200), index i1(key1a, key1b), index i2(key2a, key2b), index i3(key3a, key3b) -) engine=innodb; +); create table t2 (a int); insert into t2 values (0),(1),(2),(3),(4),(NULL); -insert into t1 (key1a, key1b, key2a, key2b, key3a, key3b) +insert into t1 (key1a, key1b, key2a, key2b, key3a, key3b) select A.a, B.a, C.a, D.a, C.a, D.a from t2 A,t2 B,t2 C, t2 D; -insert into t1 (key1a, key1b, key2a, key2b, key3a, key3b) +insert into t1 (key1a, key1b, key2a, key2b, key3a, key3b) select key1a, key1b, key2a, key2b, key3a, key3b from t1; -insert into t1 (key1a, key1b, key2a, key2b, key3a, key3b) +insert into t1 (key1a, key1b, key2a, key2b, key3a, key3b) select key1a, key1b, key2a, key2b, key3a, key3b from t1; analyze table t1; Table Op Msg_type Msg_text @@ -106,19 +108,19 @@ test.t1 analyze status OK select count(*) from t1; count(*) 5184 -explain select count(*) from t1 where +explain select count(*) from t1 where key1a = 2 and key1b is null and key2a = 2 and key2b is null; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 index_merge i1,i2 i1,i2 10,10 NULL 4 Using intersect(i1,i2); Using where; Using index -select count(*) from t1 where +select count(*) from t1 where key1a = 2 and key1b is null and key2a = 2 and key2b is null; count(*) 4 -explain select count(*) from t1 where +explain select count(*) from t1 where key1a = 2 and key1b is null and key3a = 2 and key3b is null; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 index_merge i1,i3 i1,i3 10,10 NULL 4 Using intersect(i1,i3); Using where; Using index -select count(*) from t1 where +select count(*) from t1 where key1a = 2 and key1b is null and key3a = 2 and key3b is null; count(*) 4 @@ -127,8 +129,8 @@ create table t1 ( id1 int, id2 date , index idx2 (id1,id2), -index idx1 (id2) -) engine = innodb; +index idx1 (id2) +); insert into t1 values(1,'20040101'), (2,'20040102'); select * from t1 where id1 = 1 and id2= '20040101'; id1 id2 @@ -147,8 +149,8 @@ PRIMARY KEY (`oid`), KEY `fk_bbk_niederlassung` (`fk_bbk_niederlassung`), KEY `fk_wochentag` (`fk_wochentag`), KEY `ix_version` (`version`) -) ENGINE=InnoDB DEFAULT CHARSET=latin1; -insert into t1 values +) DEFAULT CHARSET=latin1; +insert into t1 values (1, 38, 1, '08:00:00', '13:00:00', 0, 1), (2, 38, 2, '08:00:00', '13:00:00', 0, 1), (3, 38, 3, '08:00:00', '13:00:00', 0, 1), @@ -174,25 +176,25 @@ insert into t1 values (23, 7, 3, '08:00:00', '13:00:00', 0, 1), (24, 7, 4, '08:00:00', '13:00:00', 0, 1), (25, 7, 5, '08:00:00', '13:00:00', 0, 1); -create view v1 as -select -zeit1.oid AS oid, +create view v1 as +select +zeit1.oid AS oid, zeit1.fk_bbk_niederlassung AS fk_bbk_niederlassung, zeit1.fk_wochentag AS fk_wochentag, -zeit1.uhrzeit_von AS uhrzeit_von, -zeit1.uhrzeit_bis AS uhrzeit_bis, +zeit1.uhrzeit_von AS uhrzeit_von, +zeit1.uhrzeit_bis AS uhrzeit_bis, zeit1.geloescht AS geloescht, zeit1.version AS version -from +from t1 zeit1 -where -(zeit1.version = +where +(zeit1.version = (select max(zeit2.version) AS `max(version)` - from t1 zeit2 -where -((zeit1.fk_bbk_niederlassung = zeit2.fk_bbk_niederlassung) and -(zeit1.fk_wochentag = zeit2.fk_wochentag) and -(zeit1.uhrzeit_von = zeit2.uhrzeit_von) and + from t1 zeit2 +where +((zeit1.fk_bbk_niederlassung = zeit2.fk_bbk_niederlassung) and +(zeit1.fk_wochentag = zeit2.fk_wochentag) and +(zeit1.uhrzeit_von = zeit2.uhrzeit_von) and (zeit1.uhrzeit_bis = zeit2.uhrzeit_bis) ) ) @@ -213,7 +215,7 @@ filler2 char(250) default NULL, PRIMARY KEY (t_cpac,t_vers,t_rele,t_cust), UNIQUE KEY IX_4 (t_cust,t_cpac,t_vers,t_rele), KEY IX_5 (t_vers,t_rele,t_cust) -) ENGINE=InnoDB; +); insert into t1 values ('tm','2.5 ','a ',' ','',''), ('tm','2.5U','a ','stnd','',''), ('da','3.3 ','b ',' ','',''), ('da','3.3U','b ','stnd','',''), @@ -275,10 +277,267 @@ primary key (pk), key idx1(a,b,c), key idx2(c), key idx3(kp1,kp2,kp3,kp4,kp5) -) engine=innodb default charset=latin1; +) default charset=latin1; set @fill=NULL; -SELECT COUNT(*) FROM t1 WHERE b = 0 AND a = 0 AND c = 13286427 AND +SELECT COUNT(*) FROM t1 WHERE b = 0 AND a = 0 AND c = 13286427 AND kp1='279' AND kp2='ELM0678' AND kp3='6' AND kp4='10' AND kp5 = 'R '; COUNT(*) 1 drop table t1; +#---------------- 2-sweeps read Index merge test 2 ------------------------------- +SET SESSION STORAGE_ENGINE = InnoDB; +drop table if exists t1; +create table t1 ( +pk int primary key, +key1 int, +key2 int, +filler char(200), +filler2 char(200), +index(key1), +index(key2) +); +select * from t1 where (key1 >= 2 and key1 <= 10) or (pk >= 4 and pk <=8 ); +pk key1 key2 filler filler2 +2 2 2 filler-data filler-data-2 +3 3 3 filler-data filler-data-2 +9 9 9 filler-data filler-data-2 +10 10 10 filler-data filler-data-2 +4 4 4 filler-data filler-data-2 +5 5 5 filler-data filler-data-2 +6 6 6 filler-data filler-data-2 +7 7 7 filler-data filler-data-2 +8 8 8 filler-data filler-data-2 +set @maxv=1000; +select * from t1 where +(pk < 5) or (pk > 10 and pk < 15) or (pk >= 50 and pk < 55 ) or (pk > @maxv-10) +or key1=18 or key1=60; +pk key1 key2 filler filler2 +18 18 18 filler-data filler-data-2 +60 60 60 filler-data filler-data-2 +1 1 1 filler-data filler-data-2 +2 2 2 filler-data filler-data-2 +3 3 3 filler-data filler-data-2 +4 4 4 filler-data filler-data-2 +11 11 11 filler-data filler-data-2 +12 12 12 filler-data filler-data-2 +13 13 13 filler-data filler-data-2 +14 14 14 filler-data filler-data-2 +50 50 50 filler-data filler-data-2 +51 51 51 filler-data filler-data-2 +52 52 52 filler-data filler-data-2 +53 53 53 filler-data filler-data-2 +54 54 54 filler-data filler-data-2 +991 991 991 filler-data filler-data-2 +992 992 992 filler-data filler-data-2 +993 993 993 filler-data filler-data-2 +994 994 994 filler-data filler-data-2 +995 995 995 filler-data filler-data-2 +996 996 996 filler-data filler-data-2 +997 997 997 filler-data filler-data-2 +998 998 998 filler-data filler-data-2 +999 999 999 filler-data filler-data-2 +1000 1000 1000 filler-data filler-data-2 +select * from t1 where +(pk < 5) or (pk > 10 and pk < 15) or (pk >= 50 and pk < 55 ) or (pk > @maxv-10) +or key1 < 3 or key1 > @maxv-11; +pk key1 key2 filler filler2 +990 990 990 filler-data filler-data-2 +1 1 1 filler-data filler-data-2 +2 2 2 filler-data filler-data-2 +3 3 3 filler-data filler-data-2 +4 4 4 filler-data filler-data-2 +11 11 11 filler-data filler-data-2 +12 12 12 filler-data filler-data-2 +13 13 13 filler-data filler-data-2 +14 14 14 filler-data filler-data-2 +50 50 50 filler-data filler-data-2 +51 51 51 filler-data filler-data-2 +52 52 52 filler-data filler-data-2 +53 53 53 filler-data filler-data-2 +54 54 54 filler-data filler-data-2 +991 991 991 filler-data filler-data-2 +992 992 992 filler-data filler-data-2 +993 993 993 filler-data filler-data-2 +994 994 994 filler-data filler-data-2 +995 995 995 filler-data filler-data-2 +996 996 996 filler-data filler-data-2 +997 997 997 filler-data filler-data-2 +998 998 998 filler-data filler-data-2 +999 999 999 filler-data filler-data-2 +1000 1000 1000 filler-data filler-data-2 +select * from t1 where +(pk < 5) or (pk > 10 and pk < 15) or (pk >= 50 and pk < 55 ) or (pk > @maxv-10) +or +(key1 < 5) or (key1 > 10 and key1 < 15) or (key1 >= 50 and key1 < 55 ) or (key1 > @maxv-10); +pk key1 key2 filler filler2 +1 1 1 filler-data filler-data-2 +2 2 2 filler-data filler-data-2 +3 3 3 filler-data filler-data-2 +4 4 4 filler-data filler-data-2 +11 11 11 filler-data filler-data-2 +12 12 12 filler-data filler-data-2 +13 13 13 filler-data filler-data-2 +14 14 14 filler-data filler-data-2 +50 50 50 filler-data filler-data-2 +51 51 51 filler-data filler-data-2 +52 52 52 filler-data filler-data-2 +53 53 53 filler-data filler-data-2 +54 54 54 filler-data filler-data-2 +991 991 991 filler-data filler-data-2 +992 992 992 filler-data filler-data-2 +993 993 993 filler-data filler-data-2 +994 994 994 filler-data filler-data-2 +995 995 995 filler-data filler-data-2 +996 996 996 filler-data filler-data-2 +997 997 997 filler-data filler-data-2 +998 998 998 filler-data filler-data-2 +999 999 999 filler-data filler-data-2 +1000 1000 1000 filler-data filler-data-2 +select * from t1 where +(pk > 10 and pk < 15) or (pk >= 50 and pk < 55 ) +or +(key1 < 5) or (key1 > @maxv-10); +pk key1 key2 filler filler2 +1 1 1 filler-data filler-data-2 +2 2 2 filler-data filler-data-2 +3 3 3 filler-data filler-data-2 +4 4 4 filler-data filler-data-2 +991 991 991 filler-data filler-data-2 +992 992 992 filler-data filler-data-2 +993 993 993 filler-data filler-data-2 +994 994 994 filler-data filler-data-2 +995 995 995 filler-data filler-data-2 +996 996 996 filler-data filler-data-2 +997 997 997 filler-data filler-data-2 +998 998 998 filler-data filler-data-2 +999 999 999 filler-data filler-data-2 +1000 1000 1000 filler-data filler-data-2 +11 11 11 filler-data filler-data-2 +12 12 12 filler-data filler-data-2 +13 13 13 filler-data filler-data-2 +14 14 14 filler-data filler-data-2 +50 50 50 filler-data filler-data-2 +51 51 51 filler-data filler-data-2 +52 52 52 filler-data filler-data-2 +53 53 53 filler-data filler-data-2 +54 54 54 filler-data filler-data-2 +drop table t1; +#---------------- Clustered PK ROR-index_merge tests ----------------------------- +SET SESSION STORAGE_ENGINE = InnoDB; +drop table if exists t1; +create table t1 +( +pk1 int not null, +pk2 int not null, +key1 int not null, +key2 int not null, +pktail1ok int not null, +pktail2ok int not null, +pktail3bad int not null, +pktail4bad int not null, +pktail5bad int not null, +pk2copy int not null, +badkey int not null, +filler1 char (200), +filler2 char (200), +key (key1), +key (key2), +/* keys with tails from CPK members */ +key (pktail1ok, pk1), +key (pktail2ok, pk1, pk2), +key (pktail3bad, pk2, pk1), +key (pktail4bad, pk1, pk2copy), +key (pktail5bad, pk1, pk2, pk2copy), +primary key (pk1, pk2) +); +explain select * from t1 where pk1 = 1 and pk2 < 80 and key1=0; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range PRIMARY,key1 PRIMARY 8 NULL 9 Using where +select * from t1 where pk1 = 1 and pk2 < 80 and key1=0; +pk1 pk2 key1 key2 pktail1ok pktail2ok pktail3bad pktail4bad pktail5bad pk2copy badkey filler1 filler2 +1 10 0 0 0 0 0 0 0 10 0 filler-data-10 filler2 +1 11 0 0 0 0 0 0 0 11 0 filler-data-11 filler2 +1 12 0 0 0 0 0 0 0 12 0 filler-data-12 filler2 +1 13 0 0 0 0 0 0 0 13 0 filler-data-13 filler2 +1 14 0 0 0 0 0 0 0 14 0 filler-data-14 filler2 +1 15 0 0 0 0 0 0 0 15 0 filler-data-15 filler2 +1 16 0 0 0 0 0 0 0 16 0 filler-data-16 filler2 +1 17 0 0 0 0 0 0 0 17 0 filler-data-17 filler2 +1 18 0 0 0 0 0 0 0 18 0 filler-data-18 filler2 +1 19 0 0 0 0 0 0 0 19 0 filler-data-19 filler2 +explain select pk1,pk2 from t1 where key1 = 10 and key2=10 and 2*pk1+1 < 2*96+1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index_merge key1,key2 key1,key2 4,4 NULL 1 Using intersect(key1,key2); Using where; Using index +select pk1,pk2 from t1 where key1 = 10 and key2=10 and 2*pk1+1 < 2*96+1; +pk1 pk2 +95 50 +95 51 +95 52 +95 53 +95 54 +95 55 +95 56 +95 57 +95 58 +95 59 +explain select * from t1 where badkey=1 and key1=10; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref key1 key1 4 const 100 Using where +explain select * from t1 where pk1 < 7500 and key1 = 10; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index_merge PRIMARY,key1 key1,PRIMARY 4,4 NULL ROWS Using intersect(key1,PRIMARY); Using where +explain select * from t1 where pktail1ok=1 and key1=10; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index_merge key1,pktail1ok key1,pktail1ok 4,4 NULL 1 Using intersect(key1,pktail1ok); Using where +explain select * from t1 where pktail2ok=1 and key1=10; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index_merge key1,pktail2ok key1,pktail2ok 4,4 NULL 1 Using intersect(key1,pktail2ok); Using where +explain select * from t1 where (pktail2ok=1 and pk1< 50000) or key1=10; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index_merge PRIMARY,key1,pktail2ok pktail2ok,key1 8,4 NULL 199 Using sort_union(pktail2ok,key1); Using where +explain select * from t1 where pktail3bad=1 and key1=10; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref key1,pktail3bad key1 4 const 100 Using where +explain select * from t1 where pktail4bad=1 and key1=10; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref key1,pktail4bad key1 4 const 100 Using where +explain select * from t1 where pktail5bad=1 and key1=10; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref key1,pktail5bad key1 4 const 100 Using where +explain select pk1,pk2,key1,key2 from t1 where key1 = 10 and key2=10 limit 10; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index_merge key1,key2 key1,key2 4,4 NULL 1 Using intersect(key1,key2); Using where; Using index +select pk1,pk2,key1,key2 from t1 where key1 = 10 and key2=10 limit 10; +pk1 pk2 key1 key2 +95 50 10 10 +95 51 10 10 +95 52 10 10 +95 53 10 10 +95 54 10 10 +95 55 10 10 +95 56 10 10 +95 57 10 10 +95 58 10 10 +95 59 10 10 +drop table t1; +create table t1 +( +RUNID varchar(22), +SUBMITNR varchar(5), +ORDERNR char(1), +PROGRAMM varchar(8), +TESTID varchar(4), +UCCHECK char(1), +ETEXT varchar(80), +ETEXT_TYPE char(1), +INFO char(1), +SEVERITY tinyint(3), +TADIRFLAG char(1), +PRIMARY KEY (RUNID,SUBMITNR,ORDERNR,PROGRAMM,TESTID,UCCHECK), +KEY `TVERM~KEY` (PROGRAMM,TESTID,UCCHECK) +) DEFAULT CHARSET=latin1; +update t1 set `ETEXT` = '', `ETEXT_TYPE`='', `INFO`='', `SEVERITY`='', `TADIRFLAG`='' +WHERE +`RUNID`= '' AND `SUBMITNR`= '' AND `ORDERNR`='' AND `PROGRAMM`='' AND +`TESTID`='' AND `UCCHECK`=''; +drop table t1; |