Current Path : /home/usr.opt/mysql57/mysql-test/r/ |
FreeBSD hs32.drive.ne.jp 9.1-RELEASE FreeBSD 9.1-RELEASE #1: Wed Jan 14 12:18:08 JST 2015 root@hs32.drive.ne.jp:/sys/amd64/compile/hs32 amd64 |
Current File : //home/usr.opt/mysql57/mysql-test/r/index_merge_insert-and-replace.result |
DROP TABLE IF EXISTS t1; CREATE TABLE t1 ( key1 INT NOT NULL, key2 INT NOT NULL, key3 INT NOT NULL, key4 INT NOT NULL, key5 INT, key6 INT, key7 INT NOT NULL, key8 INT NOT NULL, INDEX i1(key1), INDEX i2(key2), INDEX i3(key3), INDEX i4(key4), INDEX i5(key5), INDEX i6(key6) ); ANALYZE TABLE t1; Table Op Msg_type Msg_text test.t1 analyze status OK DROP TABLE IF EXISTS t2; CREATE TABLE t2 LIKE t1; INSERT INTO t2 VALUES (rand()*6, rand()*6, rand()*6, rand()*6, rand()*6, rand()*6, rand()*6, rand()*6); INSERT INTO t2 VALUES (rand()*6, rand()*6, rand()*6, rand()*6, rand()*6, rand()*6, rand()*6, rand()*6); INSERT INTO t2 VALUES (rand()*6, rand()*6, rand()*6, rand()*6, rand()*6, rand()*6, rand()*6, rand()*6); INSERT INTO t2 VALUES (rand()*6, rand()*6, rand()*6, rand()*6, rand()*6, rand()*6, rand()*6, rand()*6); INSERT INTO t2 VALUES (rand()*6, rand()*6, rand()*6, rand()*6, rand()*6, rand()*6, rand()*6, rand()*6); INSERT INTO t2 VALUES (rand()*6, rand()*6, rand()*6, rand()*6, rand()*6, rand()*6, rand()*6, rand()*6); INSERT INTO t2 VALUES (rand()*6, rand()*6, rand()*6, rand()*6, rand()*6, rand()*6, rand()*6, rand()*6); INSERT INTO t2 VALUES (rand()*6, rand()*6, rand()*6, rand()*6, rand()*6, rand()*6, rand()*6, rand()*6); INSERT INTO t2 VALUES (rand()*6, rand()*6, rand()*6, rand()*6, rand()*6, rand()*6, rand()*6, rand()*6); INSERT INTO t2 VALUES (rand()*6, rand()*6, rand()*6, rand()*6, rand()*6, rand()*6, rand()*6, rand()*6); ANALYZE TABLE t2; Table Op Msg_type Msg_text test.t2 analyze status OK EXPLAIN REPLACE INTO t2 SELECT * FROM t1 WHERE key3=1025 OR key5 IS NULL; id select_type table partitions type possible_keys key key_len ref rows filtered Extra 1 REPLACE t2 NULL ALL NULL NULL NULL NULL # NULL NULL 1 SIMPLE t1 NULL index_merge i3,i5 i3,i5 4,5 NULL # 100.00 Using union(i3,i5); Using where SELECT COUNT(*) FROM t2; COUNT(*) 10 REPLACE INTO t2 SELECT * FROM t1 WHERE key3=1025 OR key5 IS NULL; SELECT COUNT(*) FROM t2; COUNT(*) 20 EXPLAIN REPLACE INTO t2 SELECT * FROM t1 WHERE key1=48 OR key4=2 OR key6=3; id select_type table partitions type possible_keys key key_len ref rows filtered Extra 1 REPLACE t2 NULL ALL NULL NULL NULL NULL # NULL NULL 1 SIMPLE t1 NULL index_merge i1,i4,i6 i1,i4,i6 4,4,5 NULL # 100.00 Using union(i1,i4,i6); Using where SELECT COUNT(*) FROM t2; COUNT(*) 20 REPLACE INTO t2 SELECT * FROM t1 WHERE key1=48 OR key4=2 OR key6=3; SELECT COUNT(*) FROM t2; COUNT(*) 24 EXPLAIN REPLACE INTO t2 SELECT * FROM t1 WHERE key1<2 OR key2<3; id select_type table partitions type possible_keys key key_len ref rows filtered Extra 1 REPLACE t2 NULL ALL NULL NULL NULL NULL # NULL NULL 1 SIMPLE t1 NULL index_merge i1,i2 i1,i2 4,4 NULL # 100.00 Using sort_union(i1,i2); Using where SELECT COUNT(*) FROM t2; COUNT(*) 24 REPLACE INTO t2 SELECT * FROM t1 WHERE key1<2 OR key2<3; SELECT COUNT(*) FROM t2; COUNT(*) 26 EXPLAIN REPLACE INTO t2 SELECT * FROM t1 WHERE (key1>30 AND key1<35) OR (key2>32 AND key2<40); id select_type table partitions type possible_keys key key_len ref rows filtered Extra 1 REPLACE t2 NULL ALL NULL NULL NULL NULL # NULL NULL 1 SIMPLE t1 NULL index_merge i1,i2 i1,i2 4,4 NULL # 100.00 Using sort_union(i1,i2); Using where SELECT COUNT(*) FROM t2; COUNT(*) 26 REPLACE INTO t2 SELECT * FROM t1 WHERE (key1>30 AND key1<35) OR (key2>32 AND key2<40); SELECT COUNT(*) FROM t2; COUNT(*) 35 EXPLAIN REPLACE INTO t2 SELECT * FROM t1 IGNORE INDEX(i2) WHERE key1<2 OR key2<3; id select_type table partitions type possible_keys key key_len ref rows filtered Extra 1 REPLACE t2 NULL ALL NULL NULL NULL NULL # NULL NULL 1 SIMPLE t1 NULL ALL i1 NULL NULL NULL # 55.55 Using where SELECT COUNT(*) FROM t2; COUNT(*) 35 REPLACE INTO t2 SELECT * FROM t1 IGNORE INDEX(i2) WHERE key1<2 OR key2<3; SELECT COUNT(*) FROM t2; COUNT(*) 37 INSERT INTO t1 VALUES (42,42,42,42,3,3,3,3),(4,4,6,6,6,6,4,4); EXPLAIN REPLACE INTO t2 SELECT * FROM t1 USE INDEX(i6,i3) WHERE (key4=42 AND key6=3) OR (key1=4 AND key3=6); id select_type table partitions type possible_keys key key_len ref rows filtered Extra 1 REPLACE t2 NULL ALL NULL NULL NULL NULL # NULL NULL 1 SIMPLE t1 NULL index_merge i3,i6 i6,i3 5,4 NULL # 1.00 Using union(i6,i3); Using where SELECT COUNT(*) FROM t2; COUNT(*) 37 REPLACE INTO t2 SELECT * FROM t1 USE INDEX(i6,i3) WHERE (key4=42 AND key6=3) OR (key1=4 AND key3=6); SELECT COUNT(*) FROM t2; COUNT(*) 39 EXPLAIN REPLACE INTO t2 SELECT * FROM t1 FORCE INDEX(i1,i2) WHERE (key1>1 OR key2>2); id select_type table partitions type possible_keys key key_len ref rows filtered Extra 1 REPLACE t2 NULL ALL NULL NULL NULL NULL # NULL NULL 1 SIMPLE t1 NULL index_merge i1,i2 i1,i2 4,4 NULL # 100.00 Using sort_union(i1,i2); Using where SELECT COUNT(*) FROM t2; COUNT(*) 39 REPLACE INTO t2 SELECT * FROM t1 FORCE INDEX(i1,i2) WHERE (key1>1 OR key2>2); SELECT COUNT(*) FROM t2; COUNT(*) 2097 INSERT INTO t1 VALUES (42,42,42,42,3,3,3,3),(4,4,6,6,6,6,4,4); EXPLAIN INSERT INTO t2 SELECT * FROM t1 WHERE (key4=42 AND key6=3) OR (key1=4 AND key3=6) AND key5<>50; id select_type table partitions type possible_keys key key_len ref rows filtered Extra 1 INSERT t2 NULL ALL NULL NULL NULL NULL # NULL NULL 1 SIMPLE t1 NULL index_merge i1,i3,i4,i5,i6 i4,i6,i1,i3 4,5,4,4 NULL # 100.00 Using union(intersect(i4,i6),intersect(i1,i3)); Using where SELECT COUNT(*) FROM t2; COUNT(*) 2097 INSERT INTO t2 SELECT * FROM t1 WHERE (key4=42 AND key6=3) OR (key1=4 AND key3=6) AND key5<>50; SELECT COUNT(*) FROM t2; COUNT(*) 2101 EXPLAIN INSERT INTO t2 SELECT * FROM t1 WHERE key2=10 OR key3=3 OR key4 <=> null; id select_type table partitions type possible_keys key key_len ref rows filtered Extra 1 INSERT t2 NULL ALL NULL NULL NULL NULL # NULL NULL 1 SIMPLE t1 NULL index_merge i2,i3,i4 i2,i3 4,4 NULL # 100.00 Using union(i2,i3); Using where SELECT COUNT(*) FROM t2; COUNT(*) 2101 INSERT INTO t2 SELECT * FROM t1 WHERE key2=10 OR key3=3 OR key4 <=> null ; SELECT COUNT(*) FROM t2; COUNT(*) 2104 EXPLAIN INSERT INTO t2 SELECT * FROM t1 IGNORE INDEX(i1) WHERE key1<2 OR key2<3; id select_type table partitions type possible_keys key key_len ref rows filtered Extra 1 INSERT t2 NULL ALL NULL NULL NULL NULL # NULL NULL 1 SIMPLE t1 NULL ALL i2 NULL NULL NULL # 55.55 Using where SELECT COUNT(*) FROM t2; COUNT(*) 2104 INSERT INTO t2 SELECT * FROM t1 IGNORE INDEX(i1) WHERE key1<2 OR key2<3; SELECT COUNT(*) FROM t2; COUNT(*) 2106 EXPLAIN INSERT INTO t2 SELECT * FROM t1 USE INDEX(i5,i6) WHERE (key1<2 OR key2<2) AND (key3<3 OR key4<3) AND (key5<5 OR key6<5);; id select_type table partitions type possible_keys key key_len ref rows filtered Extra 1 INSERT t2 NULL ALL NULL NULL NULL NULL # NULL NULL 1 SIMPLE t1 NULL index_merge i5,i6 i5,i6 5,5 NULL # 30.86 Using sort_union(i5,i6); Using where SELECT COUNT(*) FROM t2; COUNT(*) 2106 INSERT INTO t2 SELECT * FROM t1 USE INDEX(i5,i6) WHERE (key1<2 OR key2<2) AND (key3<3 OR key4<3) AND (key5<5 OR key6<5);; SELECT COUNT(*) FROM t2; COUNT(*) 2107 EXPLAIN INSERT INTO t2 SELECT * FROM t1 FORCE INDEX(i4,i5) WHERE (key4>3 OR key5>5); id select_type table partitions type possible_keys key key_len ref rows filtered Extra 1 INSERT t2 NULL ALL NULL NULL NULL NULL # NULL NULL 1 SIMPLE t1 NULL index_merge i4,i5 i4,i5 4,5 NULL # 100.00 Using sort_union(i4,i5); Using where SELECT COUNT(*) FROM t2; COUNT(*) 2107 INSERT INTO t2 SELECT * FROM t1 FORCE INDEX(i4,i5) WHERE (key4>3 OR key5>5); SELECT COUNT(*) FROM t2; COUNT(*) 4165 DROP TABLE IF EXISTS t1; CREATE TABLE t1 ( key1 INT NOT NULL, key2 INT NOT NULL, key3 INT NOT NULL, key4 INT NOT NULL, key5 INT, key6 INT, key7 INT NOT NULL, key8 INT NOT NULL, INDEX i1(key1,key2), INDEX i2(key2,key1), INDEX i3(key3,key4), INDEX i4(key4,key3), INDEX i5(key5,key6), INDEX i6(key6,key5), INDEX i7(key7,key8), INDEX i8(key8,key7) ); ANALYZE TABLE t1; Table Op Msg_type Msg_text test.t1 analyze status OK DROP TABLE IF EXISTS t2; CREATE TABLE t2 LIKE t1; INSERT INTO t2 VALUES (rand()*6, rand()*6, rand()*6, rand()*6, rand()*6, rand()*6, rand()*6, rand()*6); INSERT INTO t2 VALUES (rand()*6, rand()*6, rand()*6, rand()*6, rand()*6, rand()*6, rand()*6, rand()*6); INSERT INTO t2 VALUES (rand()*6, rand()*6, rand()*6, rand()*6, rand()*6, rand()*6, rand()*6, rand()*6); INSERT INTO t2 VALUES (rand()*6, rand()*6, rand()*6, rand()*6, rand()*6, rand()*6, rand()*6, rand()*6); INSERT INTO t2 VALUES (rand()*6, rand()*6, rand()*6, rand()*6, rand()*6, rand()*6, rand()*6, rand()*6); INSERT INTO t2 VALUES (rand()*6, rand()*6, rand()*6, rand()*6, rand()*6, rand()*6, rand()*6, rand()*6); INSERT INTO t2 VALUES (rand()*6, rand()*6, rand()*6, rand()*6, rand()*6, rand()*6, rand()*6, rand()*6); INSERT INTO t2 VALUES (rand()*6, rand()*6, rand()*6, rand()*6, rand()*6, rand()*6, rand()*6, rand()*6); INSERT INTO t2 VALUES (rand()*6, rand()*6, rand()*6, rand()*6, rand()*6, rand()*6, rand()*6, rand()*6); INSERT INTO t2 VALUES (rand()*6, rand()*6, rand()*6, rand()*6, rand()*6, rand()*6, rand()*6, rand()*6); ANALYZE TABLE t2; Table Op Msg_type Msg_text test.t2 analyze status OK EXPLAIN REPLACE INTO t2 SELECT * FROM t1 WHERE key3=1025 OR key5 IS NULL; id select_type table partitions type possible_keys key key_len ref rows filtered Extra 1 REPLACE t2 NULL ALL NULL NULL NULL NULL # NULL NULL 1 SIMPLE t1 NULL index_merge i3,i5 i3,i5 4,5 NULL # 100.00 Using sort_union(i3,i5); Using where SELECT COUNT(*) FROM t2; COUNT(*) 10 REPLACE INTO t2 SELECT * FROM t1 WHERE key3=1025 OR key5 IS NULL; SELECT COUNT(*) FROM t2; COUNT(*) 20 EXPLAIN REPLACE INTO t2 SELECT * FROM t1 WHERE key1=48 OR key4=2 OR key6=3; id select_type table partitions type possible_keys key key_len ref rows filtered Extra 1 REPLACE t2 NULL ALL NULL NULL NULL NULL # NULL NULL 1 SIMPLE t1 NULL index_merge i1,i4,i6 i1,i4,i6 4,4,5 NULL # 100.00 Using sort_union(i1,i4,i6); Using where SELECT COUNT(*) FROM t2; COUNT(*) 20 REPLACE INTO t2 SELECT * FROM t1 WHERE key1=48 OR key4=2 OR key6=3; SELECT COUNT(*) FROM t2; COUNT(*) 24 EXPLAIN REPLACE INTO t2 SELECT * FROM t1 WHERE key1<2 OR key2<3; id select_type table partitions type possible_keys key key_len ref rows filtered Extra 1 REPLACE t2 NULL ALL NULL NULL NULL NULL # NULL NULL 1 SIMPLE t1 NULL index_merge i1,i2 i1,i2 4,4 NULL # 100.00 Using sort_union(i1,i2); Using where SELECT COUNT(*) FROM t2; COUNT(*) 24 REPLACE INTO t2 SELECT * FROM t1 WHERE key1<2 OR key2<3; SELECT COUNT(*) FROM t2; COUNT(*) 26 EXPLAIN REPLACE INTO t2 SELECT * FROM t1 WHERE (key1>30 AND key1<35) OR (key2>32 AND key2<40); id select_type table partitions type possible_keys key key_len ref rows filtered Extra 1 REPLACE t2 NULL ALL NULL NULL NULL NULL # NULL NULL 1 SIMPLE t1 NULL index_merge i1,i2 i1,i2 4,4 NULL # 100.00 Using sort_union(i1,i2); Using where SELECT COUNT(*) FROM t2; COUNT(*) 26 REPLACE INTO t2 SELECT * FROM t1 WHERE (key1>30 AND key1<35) OR (key2>32 AND key2<40); SELECT COUNT(*) FROM t2; COUNT(*) 35 EXPLAIN REPLACE INTO t2 SELECT * FROM t1 IGNORE INDEX(i2) WHERE key1<2 OR key2<3; id select_type table partitions type possible_keys key key_len ref rows filtered Extra 1 REPLACE t2 NULL ALL NULL NULL NULL NULL # NULL NULL 1 SIMPLE t1 NULL ALL i1 NULL NULL NULL # 55.55 Using where SELECT COUNT(*) FROM t2; COUNT(*) 35 REPLACE INTO t2 SELECT * FROM t1 IGNORE INDEX(i2) WHERE key1<2 OR key2<3; SELECT COUNT(*) FROM t2; COUNT(*) 37 INSERT INTO t1 VALUES (42,42,42,42,3,3,3,3),(4,4,6,6,6,6,4,4); EXPLAIN REPLACE INTO t2 SELECT * FROM t1 USE INDEX(i6,i3) WHERE (key4=42 AND key6=3) OR (key1=4 AND key3=6); id select_type table partitions type possible_keys key key_len ref rows filtered Extra 1 REPLACE t2 NULL ALL NULL NULL NULL NULL # NULL NULL 1 SIMPLE t1 NULL index_merge i3,i6 i6,i3 5,4 NULL # 1.00 Using sort_union(i6,i3); Using where SELECT COUNT(*) FROM t2; COUNT(*) 37 REPLACE INTO t2 SELECT * FROM t1 USE INDEX(i6,i3) WHERE (key4=42 AND key6=3) OR (key1=4 AND key3=6); SELECT COUNT(*) FROM t2; COUNT(*) 39 EXPLAIN REPLACE INTO t2 SELECT * FROM t1 FORCE INDEX(i1,i2) WHERE (key1>1 OR key2>2); id select_type table partitions type possible_keys key key_len ref rows filtered Extra 1 REPLACE t2 NULL ALL NULL NULL NULL NULL # NULL NULL 1 SIMPLE t1 NULL index_merge i1,i2 i1,i2 4,4 NULL # 100.00 Using sort_union(i1,i2); Using where SELECT COUNT(*) FROM t2; COUNT(*) 39 REPLACE INTO t2 SELECT * FROM t1 FORCE INDEX(i1,i2) WHERE (key1>1 OR key2>2); SELECT COUNT(*) FROM t2; COUNT(*) 2097 INSERT INTO t1 VALUES (42,42,42,42,3,3,3,3),(4,4,6,6,6,6,4,4); EXPLAIN INSERT INTO t2 SELECT * FROM t1 WHERE (key4=42 AND key6=3) OR (key1=4 AND key3=6) AND key5<>50; id select_type table partitions type possible_keys key key_len ref rows filtered Extra 1 INSERT t2 NULL ALL NULL NULL NULL NULL # NULL NULL 1 SIMPLE t1 NULL index_merge i1,i3,i4,i5,i6 i4,i1 4,4 NULL # 0.83 Using sort_union(i4,i1); Using where SELECT COUNT(*) FROM t2; COUNT(*) 2097 INSERT INTO t2 SELECT * FROM t1 WHERE (key4=42 AND key6=3) OR (key1=4 AND key3=6) AND key5<>50; SELECT COUNT(*) FROM t2; COUNT(*) 2101 EXPLAIN INSERT INTO t2 SELECT * FROM t1 WHERE key2=10 OR key3=3 OR key4 <=> null; id select_type table partitions type possible_keys key key_len ref rows filtered Extra 1 INSERT t2 NULL ALL NULL NULL NULL NULL # NULL NULL 1 SIMPLE t1 NULL index_merge i2,i3,i4 i2,i3 4,4 NULL # 100.00 Using sort_union(i2,i3); Using where SELECT COUNT(*) FROM t2; COUNT(*) 2101 INSERT INTO t2 SELECT * FROM t1 WHERE key2=10 OR key3=3 OR key4 <=> null ; SELECT COUNT(*) FROM t2; COUNT(*) 2104 EXPLAIN INSERT INTO t2 SELECT * FROM t1 IGNORE INDEX(i1) WHERE key1<2 OR key2<3; id select_type table partitions type possible_keys key key_len ref rows filtered Extra 1 INSERT t2 NULL ALL NULL NULL NULL NULL # NULL NULL 1 SIMPLE t1 NULL ALL i2 NULL NULL NULL # 55.55 Using where SELECT COUNT(*) FROM t2; COUNT(*) 2104 INSERT INTO t2 SELECT * FROM t1 IGNORE INDEX(i1) WHERE key1<2 OR key2<3; SELECT COUNT(*) FROM t2; COUNT(*) 2106 EXPLAIN INSERT INTO t2 SELECT * FROM t1 USE INDEX(i5,i6) WHERE (key1<2 OR key2<2) AND (key3<3 OR key4<3) AND (key5<5 OR key6<5);; id select_type table partitions type possible_keys key key_len ref rows filtered Extra 1 INSERT t2 NULL ALL NULL NULL NULL NULL # NULL NULL 1 SIMPLE t1 NULL index_merge i5,i6 i5,i6 5,5 NULL # 30.86 Using sort_union(i5,i6); Using where SELECT COUNT(*) FROM t2; COUNT(*) 2106 INSERT INTO t2 SELECT * FROM t1 USE INDEX(i5,i6) WHERE (key1<2 OR key2<2) AND (key3<3 OR key4<3) AND (key5<5 OR key6<5);; SELECT COUNT(*) FROM t2; COUNT(*) 2107 EXPLAIN INSERT INTO t2 SELECT * FROM t1 FORCE INDEX(i4,i5) WHERE (key4>3 OR key5>5); id select_type table partitions type possible_keys key key_len ref rows filtered Extra 1 INSERT t2 NULL ALL NULL NULL NULL NULL # NULL NULL 1 SIMPLE t1 NULL index_merge i4,i5 i4,i5 4,5 NULL # 100.00 Using sort_union(i4,i5); Using where SELECT COUNT(*) FROM t2; COUNT(*) 2107 INSERT INTO t2 SELECT * FROM t1 FORCE INDEX(i4,i5) WHERE (key4>3 OR key5>5); SELECT COUNT(*) FROM t2; COUNT(*) 4165 DROP TABLE t1; DROP TABLE t2;