diff options
232 files changed, 8991 insertions, 6852 deletions
diff --git a/mysql-test/include/ctype_numconv.inc b/mysql-test/include/ctype_numconv.inc index d99942c5d5f..feca8cea932 100644 --- a/mysql-test/include/ctype_numconv.inc +++ b/mysql-test/include/ctype_numconv.inc @@ -1734,6 +1734,7 @@ CREATE TABLE t1 ( date_column DATE DEFAULT NULL, KEY(date_column)); INSERT INTO t1 VALUES (1,'2010-09-01'),(2,'2010-10-01'); +INSERT INTO t1 VALUES (3,'2012-09-01'),(4,'2012-10-01'),(5,'2012-10-01'); EXPLAIN SELECT * FROM t1 WHERE date_column BETWEEN '2010-09-01' AND '2010-10-01'; ALTER TABLE t1 MODIFY date_column DATETIME DEFAULT NULL; EXPLAIN SELECT * FROM t1 WHERE date_column BETWEEN '2010-09-01' AND '2010-10-01'; diff --git a/mysql-test/include/last_query_cost.inc b/mysql-test/include/last_query_cost.inc new file mode 100644 index 00000000000..a18fd9e4c04 --- /dev/null +++ b/mysql-test/include/last_query_cost.inc @@ -0,0 +1,5 @@ +--disable_query_log +--disable_column_names +show status like 'last_query_cost'; +--enable_column_names +--enable_query_log diff --git a/mysql-test/include/world.inc b/mysql-test/include/world.inc index 1e81c5c1aa7..a6f877ce0cd 100644 --- a/mysql-test/include/world.inc +++ b/mysql-test/include/world.inc @@ -4,6 +4,7 @@ # Table Country +BEGIN; INSERT IGNORE INTO Country VALUES ('AFG','Afghanistan',652090.00,22720000,1), ('NLD','Netherlands',41526.00,15864000,5), @@ -5339,5 +5340,6 @@ INSERT INTO CountryLanguage VALUES ('CHN','Dong',0.2), ('RUS','Belorussian',0.3), ('USA','Portuguese',0.2); +COMMIT; ANALYZE TABLE Country, City, CountryLanguage; diff --git a/mysql-test/main/costs.result b/mysql-test/main/costs.result new file mode 100644 index 00000000000..779a6b3ea40 --- /dev/null +++ b/mysql-test/main/costs.result @@ -0,0 +1,91 @@ +create table t1 (a int primary key, b int, c int, d int, e int, key ba (b,a), key bda (b,d,a), key cba (c,b,a), key cb (c,b), key d (d)) engine=aria; +insert into t1 select seq,seq,seq,seq,seq from seq_1_to_10; +insert into t1 values(20,2,2,2,2),(21,3,4,5,6); +# +# Get different scan costs +# +explain select sum(e) as "table_scan" from t1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 12 +Last_query_cost 6.100000 +explain select sum(a) as "index scan" from t1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index NULL PRIMARY 4 NULL 12 Using index +Last_query_cost 3.202929 +# +# Range scans should be used if we don't examine all rows in the table +# +explain select count(a) from t1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away +Last_query_cost 0.000000 +explain select count(*) from t1 where a > 0; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index PRIMARY PRIMARY 4 NULL 12 Using where; Using index +Last_query_cost 3.202929 +explain select count(*) from t1 where a > 1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index PRIMARY PRIMARY 4 NULL 12 Using where; Using index +Last_query_cost 3.202929 +explain select count(*) from t1 where a > 2; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL 11 Using where; Using index +Last_query_cost 2.997685 +# +# Shorter indexes are prefered over longer indexs +# +explain select sum(a+b) from t1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index NULL ba 9 NULL 12 Using index +Last_query_cost 3.204394 +explain select count(*) from t1 where b between 5 and 10; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range ba,bda ba 5 NULL 6 Using where; Using index +Last_query_cost 1.872197 +explain select sum(b+c) from t1 where b between 5 and 6 and c between 5 and 6; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range ba,bda,cba,cb cb 10 NULL 2 Using where; Using index +Last_query_cost 0.970781 +# Cost of 'd' should be slightly smaller as key 'ba' is longer than 'd' +explain select count(*) from t1 where b > 6; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range ba,bda ba 5 NULL 5 Using where; Using index +Last_query_cost 1.646831 +explain select count(*) from t1 where d > 6; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range d d 5 NULL 5 Using where; Using index +Last_query_cost 1.646343 +# +# Check covering index usage +# +explain select a,b,c from t1 where a=b; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index NULL cba 14 NULL 12 Using where; Using index +Last_query_cost 3.205859 +# +# Prefer ref keys over ranges +# +explain select count(*) from t1 where b=2; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref ba,bda ba 5 const 2 Using index +Last_query_cost 0.950732 +explain select count(*) from t1 where b=2 and c=2; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref ba,bda,cba,cb cb 10 const,const 2 Using index +Last_query_cost 0.950781 +explain select count(*) from t1 where b=3 and c between 3 and 4; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range ba,bda,cba,cb cb 10 NULL 2 Using where; Using index +Last_query_cost 0.970781 +# +# Prefer eq keys over ref keys +# +explain select a,b,e from t1 where a=10 or a=11; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL 2 Using index condition +Last_query_cost 2.520488 +explain select a,b,e from t1 where d=10 or d=11; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 range d d 5 NULL 2 Using index condition +Last_query_cost 2.520537 +drop table t1; diff --git a/mysql-test/main/costs.test b/mysql-test/main/costs.test new file mode 100644 index 00000000000..6dcc41b57a3 --- /dev/null +++ b/mysql-test/main/costs.test @@ -0,0 +1,75 @@ +# +# Test of cost calcuations. This test is using the Aria engine as the cost +# calculations are stable for it. +# +--source include/have_sequence.inc + +create table t1 (a int primary key, b int, c int, d int, e int, key ba (b,a), key bda (b,d,a), key cba (c,b,a), key cb (c,b), key d (d)) engine=aria; +insert into t1 select seq,seq,seq,seq,seq from seq_1_to_10; +insert into t1 values(20,2,2,2,2),(21,3,4,5,6); + +--echo # +--echo # Get different scan costs +--echo # + +explain select sum(e) as "table_scan" from t1; +--source include/last_query_cost.inc +explain select sum(a) as "index scan" from t1; +--source include/last_query_cost.inc + +--echo # +--echo # Range scans should be used if we don't examine all rows in the table +--echo # +explain select count(a) from t1; +--source include/last_query_cost.inc +explain select count(*) from t1 where a > 0; +--source include/last_query_cost.inc +explain select count(*) from t1 where a > 1; +--source include/last_query_cost.inc +explain select count(*) from t1 where a > 2; +--source include/last_query_cost.inc + +--echo # +--echo # Shorter indexes are prefered over longer indexs +--echo # +explain select sum(a+b) from t1; +--source include/last_query_cost.inc +explain select count(*) from t1 where b between 5 and 10; +--source include/last_query_cost.inc +explain select sum(b+c) from t1 where b between 5 and 6 and c between 5 and 6; +--source include/last_query_cost.inc + +--echo # Cost of 'd' should be slightly smaller as key 'ba' is longer than 'd' +explain select count(*) from t1 where b > 6; +--source include/last_query_cost.inc +explain select count(*) from t1 where d > 6; +--source include/last_query_cost.inc + + +--echo # +--echo # Check covering index usage +--echo # +explain select a,b,c from t1 where a=b; +--source include/last_query_cost.inc + +--echo # +--echo # Prefer ref keys over ranges +--echo # + +explain select count(*) from t1 where b=2; +--source include/last_query_cost.inc +explain select count(*) from t1 where b=2 and c=2; +--source include/last_query_cost.inc +explain select count(*) from t1 where b=3 and c between 3 and 4; +--source include/last_query_cost.inc + +--echo # +--echo # Prefer eq keys over ref keys +--echo # + +explain select a,b,e from t1 where a=10 or a=11; +--source include/last_query_cost.inc +explain select a,b,e from t1 where d=10 or d=11; +--source include/last_query_cost.inc + +drop table t1; diff --git a/mysql-test/main/cte_recursive.result b/mysql-test/main/cte_recursive.result index 20ebf4f0c81..e4f6c854129 100644 --- a/mysql-test/main/cte_recursive.result +++ b/mysql-test/main/cte_recursive.result @@ -4456,9 +4456,9 @@ id select_type table type possible_keys key key_len ref rows Extra 4 RECURSIVE UNION <derived2> ALL NULL NULL NULL NULL 2 5 RECURSIVE UNION <derived2> ALL NULL NULL NULL NULL 2 NULL UNION RESULT <union3,4,5> ALL NULL NULL NULL NULL NULL -2 DERIVED h ALL NULL NULL NULL NULL 12 -2 DERIVED <derived3> ALL NULL NULL NULL NULL 12 Using where; Using join buffer (flat, BNL join) -2 DERIVED w ALL NULL NULL NULL NULL 12 Using where; Using join buffer (incremental, BNL join) +2 DERIVED h ALL NULL NULL NULL NULL 12 Using where +2 DERIVED <derived3> ref key0 key0 5 test.h.id 2 +2 DERIVED w ALL NULL NULL NULL NULL 12 Using where; Using join buffer (flat, BNL join) prepare stmt from "with recursive ancestor_couples(h_id, h_name, h_dob, h_father, h_mother, w_id, w_name, w_dob, w_father, w_mother) diff --git a/mysql-test/main/ctype_binary.result b/mysql-test/main/ctype_binary.result index 05f31f13dc7..4936ea1d18f 100644 --- a/mysql-test/main/ctype_binary.result +++ b/mysql-test/main/ctype_binary.result @@ -2763,6 +2763,7 @@ id INT(11) DEFAULT NULL, date_column DATE DEFAULT NULL, KEY(date_column)); INSERT INTO t1 VALUES (1,'2010-09-01'),(2,'2010-10-01'); +INSERT INTO t1 VALUES (3,'2012-09-01'),(4,'2012-10-01'),(5,'2012-10-01'); EXPLAIN SELECT * FROM t1 WHERE date_column BETWEEN '2010-09-01' AND '2010-10-01'; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 range date_column date_column 4 NULL 2 Using index condition diff --git a/mysql-test/main/ctype_cp1251.result b/mysql-test/main/ctype_cp1251.result index 5d0bf3be615..1c41d4310de 100644 --- a/mysql-test/main/ctype_cp1251.result +++ b/mysql-test/main/ctype_cp1251.result @@ -3175,6 +3175,7 @@ id INT(11) DEFAULT NULL, date_column DATE DEFAULT NULL, KEY(date_column)); INSERT INTO t1 VALUES (1,'2010-09-01'),(2,'2010-10-01'); +INSERT INTO t1 VALUES (3,'2012-09-01'),(4,'2012-10-01'),(5,'2012-10-01'); EXPLAIN SELECT * FROM t1 WHERE date_column BETWEEN '2010-09-01' AND '2010-10-01'; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 range date_column date_column 4 NULL 2 Using index condition diff --git a/mysql-test/main/ctype_latin1.result b/mysql-test/main/ctype_latin1.result index 0b16d1cf6f2..5d203dd8a90 100644 --- a/mysql-test/main/ctype_latin1.result +++ b/mysql-test/main/ctype_latin1.result @@ -3484,6 +3484,7 @@ id INT(11) DEFAULT NULL, date_column DATE DEFAULT NULL, KEY(date_column)); INSERT INTO t1 VALUES (1,'2010-09-01'),(2,'2010-10-01'); +INSERT INTO t1 VALUES (3,'2012-09-01'),(4,'2012-10-01'),(5,'2012-10-01'); EXPLAIN SELECT * FROM t1 WHERE date_column BETWEEN '2010-09-01' AND '2010-10-01'; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 range date_column date_column 4 NULL 2 Using index condition diff --git a/mysql-test/main/ctype_ucs.result b/mysql-test/main/ctype_ucs.result index 6c14ca3ab66..98f1c54ad7a 100644 --- a/mysql-test/main/ctype_ucs.result +++ b/mysql-test/main/ctype_ucs.result @@ -1569,7 +1569,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 range a a 23 NULL 1 Using where; Using index EXPLAIN SELECT * FROM t1 WHERE a LIKE 'c%'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range a a 23 NULL 31 Using where; Using index +1 SIMPLE t1 index a a 23 NULL 31 Using where; Using index SELECT * FROM t1 WHERE a LIKE 'c%'; a ca @@ -1585,7 +1585,7 @@ ch ALTER TABLE t1 MODIFY a VARCHAR(10) CHARACTER SET ucs2 COLLATE ucs2_croatian_ci; EXPLAIN SELECT * FROM t1 WHERE a LIKE 'd%'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range a a 23 NULL 31 Using where; Using index +1 SIMPLE t1 index a a 23 NULL 31 Using where; Using index SELECT hex(concat('d',_ucs2 0x017E,'%')); hex(concat('d',_ucs2 0x017E,'%')) 0064017E0025 @@ -4368,6 +4368,7 @@ id INT(11) DEFAULT NULL, date_column DATE DEFAULT NULL, KEY(date_column)); INSERT INTO t1 VALUES (1,'2010-09-01'),(2,'2010-10-01'); +INSERT INTO t1 VALUES (3,'2012-09-01'),(4,'2012-10-01'),(5,'2012-10-01'); EXPLAIN SELECT * FROM t1 WHERE date_column BETWEEN '2010-09-01' AND '2010-10-01'; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 range date_column date_column 4 NULL 2 Using index condition diff --git a/mysql-test/main/ctype_utf8.result b/mysql-test/main/ctype_utf8.result index 6eebc8f4cf2..d469ba3ee9d 100644 --- a/mysql-test/main/ctype_utf8.result +++ b/mysql-test/main/ctype_utf8.result @@ -5235,6 +5235,7 @@ id INT(11) DEFAULT NULL, date_column DATE DEFAULT NULL, KEY(date_column)); INSERT INTO t1 VALUES (1,'2010-09-01'),(2,'2010-10-01'); +INSERT INTO t1 VALUES (3,'2012-09-01'),(4,'2012-10-01'),(5,'2012-10-01'); EXPLAIN SELECT * FROM t1 WHERE date_column BETWEEN '2010-09-01' AND '2010-10-01'; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 range date_column date_column 4 NULL 2 Using index condition diff --git a/mysql-test/main/derived.result b/mysql-test/main/derived.result index 006f41236f5..dc58bdca0ef 100644 --- a/mysql-test/main/derived.result +++ b/mysql-test/main/derived.result @@ -236,7 +236,7 @@ count(*) explain select count(*) from t1 INNER JOIN (SELECT A.E1, A.E2, A.E3 FROM t1 AS A WHERE A.E3 = (SELECT MAX(B.E3) FROM t1 AS B WHERE A.E2 = B.E2)) AS THEMAX ON t1.E1 = THEMAX.E2 AND t1.E1 = t1.E2; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY <derived2> ALL NULL NULL NULL NULL 2 -1 PRIMARY t1 eq_ref PRIMARY PRIMARY 4 THEMAX.E2 1 Using where +1 PRIMARY t1 ALL PRIMARY NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join) 2 DERIVED A ALL NULL NULL NULL NULL 2 Using where 3 DEPENDENT SUBQUERY B ALL NULL NULL NULL NULL 2 Using where drop table t1; diff --git a/mysql-test/main/derived_cond_pushdown.result b/mysql-test/main/derived_cond_pushdown.result index 558b960cb98..76f36299647 100644 --- a/mysql-test/main/derived_cond_pushdown.result +++ b/mysql-test/main/derived_cond_pushdown.result @@ -9684,11 +9684,22 @@ EXPLAIN "query_block": { "select_id": 1, "table": { - "table_name": "<derived2>", + "table_name": "t1", "access_type": "ALL", "rows": 2, "filtered": 100, - "attached_condition": "1 in (0,dt1.a)", + "attached_condition": "1 in (0,t1.a) and t1.a is not null" + }, + "table": { + "table_name": "<derived2>", + "access_type": "ref", + "possible_keys": ["key0"], + "key": "key0", + "key_length": "5", + "used_key_parts": ["a"], + "ref": ["test.t1.a"], + "rows": 2, + "filtered": 100, "materialized": { "query_block": { "select_id": 2, @@ -9706,18 +9717,6 @@ EXPLAIN } } } - }, - "block-nl-join": { - "table": { - "table_name": "t1", - "access_type": "ALL", - "rows": 2, - "filtered": 100 - }, - "buffer_type": "flat", - "buffer_size": "65", - "join_type": "BNL", - "attached_condition": "t1.a = dt1.a" } } } @@ -9743,11 +9742,22 @@ EXPLAIN "query_block": { "select_id": 1, "table": { - "table_name": "<derived2>", + "table_name": "t1", "access_type": "ALL", "rows": 2, "filtered": 100, - "attached_condition": "dt.a in (1,dt.a)", + "attached_condition": "t1.a in (1,t1.a) and t1.a is not null" + }, + "table": { + "table_name": "<derived2>", + "access_type": "ref", + "possible_keys": ["key0"], + "key": "key0", + "key_length": "5", + "used_key_parts": ["a"], + "ref": ["test.t1.a"], + "rows": 2, + "filtered": 100, "materialized": { "query_block": { "select_id": 2, @@ -9765,18 +9775,6 @@ EXPLAIN } } } - }, - "block-nl-join": { - "table": { - "table_name": "t1", - "access_type": "ALL", - "rows": 2, - "filtered": 100 - }, - "buffer_type": "flat", - "buffer_size": "119", - "join_type": "BNL", - "attached_condition": "t1.a = dt.a" } } } @@ -10376,11 +10374,22 @@ EXPLAIN "query_block": { "select_id": 1, "table": { - "table_name": "<derived3>", + "table_name": "t1", "access_type": "ALL", "rows": 2, "filtered": 100, - "attached_condition": "t.f2 < 2", + "attached_condition": "t1.f2 < 2 and t1.f2 is not null" + }, + "table": { + "table_name": "<derived3>", + "access_type": "ref", + "possible_keys": ["key0"], + "key": "key0", + "key_length": "5", + "used_key_parts": ["f2"], + "ref": ["test.t1.f2"], + "rows": 2, + "filtered": 100, "materialized": { "query_block": { "select_id": 3, @@ -10393,13 +10402,6 @@ EXPLAIN } } } - }, - "table": { - "table_name": "t1", - "access_type": "ALL", - "rows": 2, - "filtered": 100, - "attached_condition": "t1.f2 = t.f2" } } } @@ -10417,11 +10419,22 @@ EXPLAIN "query_block": { "select_id": 1, "table": { - "table_name": "<derived3>", + "table_name": "t1", "access_type": "ALL", "rows": 2, "filtered": 100, - "attached_condition": "t.f2 < 2", + "attached_condition": "t1.f2 < 2 and t1.f2 is not null" + }, + "table": { + "table_name": "<derived3>", + "access_type": "ref", + "possible_keys": ["key0"], + "key": "key0", + "key_length": "5", + "used_key_parts": ["f2"], + "ref": ["test.t1.f2"], + "rows": 1, + "filtered": 100, "materialized": { "query_block": { "select_id": 3, @@ -10436,18 +10449,6 @@ EXPLAIN } } } - }, - "block-nl-join": { - "table": { - "table_name": "t1", - "access_type": "ALL", - "rows": 2, - "filtered": 100 - }, - "buffer_type": "flat", - "buffer_size": "65", - "join_type": "BNL", - "attached_condition": "t1.f2 = t.f2" } } } @@ -14390,8 +14391,8 @@ a b c a b c 3 21 500 3 21 231 explain select * from v1,t2 where (v1.b=t2.b) and (v1.a<4); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY <derived2> ALL NULL NULL NULL NULL 3 Using where -1 PRIMARY t2 ALL NULL NULL NULL NULL 9 Using where; Using join buffer (flat, BNL join) +1 PRIMARY t2 ALL NULL NULL NULL NULL 9 Using where +1 PRIMARY <derived2> ref key0 key0 5 test.t2.b 2 Using where 2 DERIVED t3 range i1 i1 5 NULL 2 Using index condition 3 UNION t3 range i1 i1 5 NULL 1 Using index condition NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL @@ -14401,9 +14402,21 @@ EXPLAIN "query_block": { "select_id": 1, "table": { - "table_name": "<derived2>", + "table_name": "t2", "access_type": "ALL", - "rows": 3, + "rows": 9, + "filtered": 100, + "attached_condition": "t2.b is not null" + }, + "table": { + "table_name": "<derived2>", + "access_type": "ref", + "possible_keys": ["key0"], + "key": "key0", + "key_length": "5", + "used_key_parts": ["b"], + "ref": ["test.t2.b"], + "rows": 2, "filtered": 100, "attached_condition": "v1.a < 4", "materialized": { @@ -14449,18 +14462,6 @@ EXPLAIN } } } - }, - "block-nl-join": { - "table": { - "table_name": "t2", - "access_type": "ALL", - "rows": 9, - "filtered": 100 - }, - "buffer_type": "flat", - "buffer_size": "173", - "join_type": "BNL", - "attached_condition": "t2.b = v1.b" } } } @@ -16839,7 +16840,7 @@ DROP TABLE t1; CREATE TABLE t1 (pk1 INT PRIMARY KEY, f INT) ENGINE=Aria; INSERT INTO t1 VALUES (1,0),(2,0); CREATE TABLE t2 (pk2 INT PRIMARY KEY) ENGINE=Aria; -INSERT INTO t2 VALUES (1),(2),(3); +INSERT INTO t2 VALUES (1),(2),(3),(11),(12),(13); CREATE VIEW v2 AS SELECT pk2, COUNT(*) AS cnt FROM t2 GROUP BY pk2; SELECT * FROM t1 INNER JOIN v2 ON pk1 = pk2 WHERE f <> 5; pk1 f pk2 cnt @@ -17147,8 +17148,8 @@ explain extended select id, a from t1 where id in (select id from v1); id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL PRIMARY NULL NULL NULL 20 100.00 1 PRIMARY <derived3> ref key0 key0 4 test.t1.id 2 100.00 FirstMatch(t1) -3 LATERAL DERIVED t1 eq_ref PRIMARY PRIMARY 4 test.t1.id 1 100.00 -3 LATERAL DERIVED t2 ref ro_id ro_id 4 test.t1.id 1 100.00 Using where +3 DERIVED t1 ALL PRIMARY NULL NULL NULL 20 100.00 Using temporary; Using filesort +3 DERIVED t2 ref ro_id ro_id 4 test.t1.id 1 100.00 Using where Warnings: Note 1003 /* select#1 */ select `test`.`t1`.`id` AS `id`,`test`.`t1`.`a` AS `a` from `test`.`t1` semi join (`test`.`v1`) where `v1`.`id` = `test`.`t1`.`id` select id, a from t1 @@ -17185,10 +17186,10 @@ group by t1.id) dt); id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL PRIMARY NULL NULL NULL 20 100.00 1 PRIMARY <derived3> ref key0 key0 4 test.t1.id 2 100.00 FirstMatch(t1) -3 LATERAL DERIVED t1 eq_ref PRIMARY PRIMARY 4 test.t1.id 1 100.00 -3 LATERAL DERIVED t2 ref ro_id ro_id 4 test.t1.id 1 100.00 Using where +3 DERIVED t1 ALL PRIMARY NULL NULL NULL 20 100.00 Using temporary; Using filesort +3 DERIVED t2 ref ro_id ro_id 4 test.t1.id 1 100.00 Using where Warnings: -Note 1003 /* select#1 */ select `test`.`t1`.`id` AS `id`,`test`.`t1`.`a` AS `a` from `test`.`t1` semi join ((/* select#3 */ select `test`.`t1`.`id` AS `id`,`test`.`t1`.`a` AS `a` from `test`.`t1` left join `test`.`t2` on(`test`.`t2`.`ro_id` = `test`.`t1`.`id` and `test`.`t2`.`flag` = 1) where `test`.`t1`.`id` = `test`.`t1`.`id` group by `test`.`t1`.`id`) `dt`) where `dt`.`id` = `test`.`t1`.`id` +Note 1003 /* select#1 */ select `test`.`t1`.`id` AS `id`,`test`.`t1`.`a` AS `a` from `test`.`t1` semi join ((/* select#3 */ select `test`.`t1`.`id` AS `id`,`test`.`t1`.`a` AS `a` from `test`.`t1` left join `test`.`t2` on(`test`.`t2`.`ro_id` = `test`.`t1`.`id` and `test`.`t2`.`flag` = 1) where 1 group by `test`.`t1`.`id`) `dt`) where `dt`.`id` = `test`.`t1`.`id` drop view v1; drop table t1,t2; # diff --git a/mysql-test/main/derived_cond_pushdown.test b/mysql-test/main/derived_cond_pushdown.test index d738ed33128..7707280759e 100644 --- a/mysql-test/main/derived_cond_pushdown.test +++ b/mysql-test/main/derived_cond_pushdown.test @@ -3324,7 +3324,7 @@ CREATE TABLE t1 (pk1 INT PRIMARY KEY, f INT) ENGINE=Aria; INSERT INTO t1 VALUES (1,0),(2,0); CREATE TABLE t2 (pk2 INT PRIMARY KEY) ENGINE=Aria; -INSERT INTO t2 VALUES (1),(2),(3); +INSERT INTO t2 VALUES (1),(2),(3),(11),(12),(13); CREATE VIEW v2 AS SELECT pk2, COUNT(*) AS cnt FROM t2 GROUP BY pk2; diff --git a/mysql-test/main/derived_opt.result b/mysql-test/main/derived_opt.result index cf0c1cb617f..4033f381458 100644 --- a/mysql-test/main/derived_opt.result +++ b/mysql-test/main/derived_opt.result @@ -111,7 +111,7 @@ count(*) explain select count(*) from t1 INNER JOIN (SELECT A.E1, A.E2, A.E3 FROM t1 AS A WHERE A.E3 = (SELECT MAX(B.E3) FROM t1 AS B WHERE A.E2 = B.E2)) AS THEMAX ON t1.E1 = THEMAX.E2 AND t1.E1 = t1.E2; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY A ALL NULL NULL NULL NULL 2 Using where -1 PRIMARY t1 eq_ref PRIMARY PRIMARY 4 test.A.E2 1 Using where +1 PRIMARY t1 ALL PRIMARY NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join) 3 DEPENDENT SUBQUERY B ALL NULL NULL NULL NULL 2 Using where drop table t1; create table t1 (a int); diff --git a/mysql-test/main/derived_split_innodb.result b/mysql-test/main/derived_split_innodb.result index b30da26f7da..b0b004355e6 100644 --- a/mysql-test/main/derived_split_innodb.result +++ b/mysql-test/main/derived_split_innodb.result @@ -21,7 +21,7 @@ WHERE t.n1 = t1.n1 AND t.n2 = t1.n2 AND c1 = 'a' GROUP BY n1; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 ref c1,n1_c1_n2 c1 1 const 2 Using index condition; Using where; Using temporary; Using filesort 1 PRIMARY <derived2> ref key0 key0 8 test.t1.n1,test.t1.n2 2 -2 LATERAL DERIVED t1 ref c1,n1_c1_n2 n1_c1_n2 4 test.t1.n1 1 Using where; Using index +2 DERIVED t1 ref c1,n1_c1_n2 c1 1 const 2 Using index condition; Using where; Using temporary; Using filesort SELECT t1.n1 FROM t1, (SELECT n1, n2 FROM t1 WHERE c1 = 'a' GROUP BY n1) as t WHERE t.n1 = t1.n1 AND t.n2 = t1.n2 AND c1 = 'a' GROUP BY n1; n1 @@ -175,8 +175,8 @@ t1.a = dt.a; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 index a,a_2 a_2 10 NULL 6 Using where; Using index 1 PRIMARY <derived3> ref key0 key0 5 test.t1.a 2 -3 LATERAL DERIVED t1 ref a,a_2 a 5 test.t1.a 1 Using where; Using temporary; Using filesort -3 LATERAL DERIVED t2 ref c c 5 test.t1.b 1 Using index +3 DERIVED t1 index a,a_2 a_2 10 NULL 6 Using where; Using index; Using temporary; Using filesort +3 DERIVED t2 ref c c 5 test.t1.b 1 Using index DROP TABLE t1, t2; # # Bug mdev-25714: usage non-splitting covering index is cheaper than @@ -210,7 +210,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t2 ALL NULL NULL NULL NULL 1 1 PRIMARY t1 ref idx idx 4 test.t2.id 1 1 PRIMARY <derived2> ref key0 key0 9 test.t2.id,test.t1.id 2 -2 DERIVED t3 ref idx1,idx2 idx1 4 const 5 Using where; Using index +2 LATERAL DERIVED t3 ref idx1,idx2 idx2 4 test.t1.itemid 1 Using where select t1.id, t1.itemid, dt.id, t2.id from t1, (select itemid, max(id) as id from t3 where userid = 1 group by itemid) dt, diff --git a/mysql-test/main/derived_view.result b/mysql-test/main/derived_view.result index 3c13cc976aa..538fc3bc762 100644 --- a/mysql-test/main/derived_view.result +++ b/mysql-test/main/derived_view.result @@ -1805,14 +1805,14 @@ WHERE (t2.a ,t1.b) NOT IN (SELECT DISTINCT c,a FROM t3 t); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 2 1 PRIMARY t2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join) -2 DEPENDENT SUBQUERY t unique_subquery PRIMARY,c PRIMARY 4 func 1 Using where +2 DEPENDENT SUBQUERY t index_subquery PRIMARY,c c 8 func,func 2 Using index; Using where EXPLAIN SELECT * FROM t1 , t2 WHERE (t2.a ,t1.b) NOT IN (SELECT DISTINCT c,a FROM (SELECT * FROM t3) t); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 2 1 PRIMARY t2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join) -2 DEPENDENT SUBQUERY t3 unique_subquery PRIMARY,c PRIMARY 4 func 1 Using where +2 DEPENDENT SUBQUERY t3 index_subquery PRIMARY,c c 8 func,func 2 Using index; Using where SELECT * FROM t1 , t2 WHERE (t2.a ,t1.b) NOT IN (SELECT DISTINCT c,a FROM (SELECT * FROM t3) t); b a @@ -1855,8 +1855,8 @@ WHERE t3.b IN (SELECT v1.b FROM v1, t2 WHERE t2.c = v1.c AND t2.c = v1.b AND v1.b = t3.c); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t2 system NULL NULL NULL NULL 1 -1 PRIMARY <derived3> ref key1 key1 8 const,const 0 Start temporary -1 PRIMARY t3 ALL NULL NULL NULL NULL 2 Using where; End temporary; Using join buffer (flat, BNL join) +1 PRIMARY t3 ALL NULL NULL NULL NULL 2 Using where +1 PRIMARY <derived3> ref key1 key1 8 const,const 0 FirstMatch(t3) 3 DERIVED t1 ALL NULL NULL NULL NULL 3 Using where SELECT * FROM t3 WHERE t3.b IN (SELECT v1.b FROM v1, t2 diff --git a/mysql-test/main/distinct.result b/mysql-test/main/distinct.result index 284fe2ecd1a..bd0bba2de02 100644 --- a/mysql-test/main/distinct.result +++ b/mysql-test/main/distinct.result @@ -173,9 +173,9 @@ INSERT INTO t2 values (1),(2),(3); INSERT INTO t3 VALUES (1,'1'),(2,'2'),(1,'1'),(2,'2'); explain SELECT distinct t3.a FROM t3,t2,t1 WHERE t3.a=t1.b AND t1.a=t2.a; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 4 Using temporary +1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 4 Using where; Using temporary 1 SIMPLE t2 ref a a 4 test.t1.a 2 Using index -1 SIMPLE t3 index a a 5 NULL 6 Using where; Using index; Using join buffer (flat, BNL join) +1 SIMPLE t3 ref a a 5 test.t1.b 2 Using index SELECT distinct t3.a FROM t3,t2,t1 WHERE t3.a=t1.b AND t1.a=t2.a; a 1 diff --git a/mysql-test/main/explain.result b/mysql-test/main/explain.result index bc3c53d01d3..3c83ed6af2c 100644 --- a/mysql-test/main/explain.result +++ b/mysql-test/main/explain.result @@ -325,7 +325,7 @@ DROP TABLE t1; # Bug#56814 Explain + subselect + fulltext crashes server # CREATE TABLE t1(f1 VARCHAR(6) NOT NULL, -FULLTEXT KEY(f1),UNIQUE(f1)); +FULLTEXT KEY `fulltext` (f1), UNIQUE `unique` (f1)); INSERT INTO t1 VALUES ('test'); EXPLAIN SELECT 1 FROM t1 WHERE 1 > ALL((SELECT t1.f1 FROM t1 JOIN t1 a ON (MATCH(t1.f1) AGAINST ("")) @@ -333,7 +333,9 @@ WHERE t1.f1 GROUP BY t1.f1)); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 system NULL NULL NULL NULL 1 2 SUBQUERY a system NULL NULL NULL NULL 1 -2 SUBQUERY t1 fulltext f1_2,f1 f1 0 1 Using where +2 SUBQUERY t1 index unique,fulltext unique 8 NULL 1 Using where; Using index +Warnings: +Warning 1292 Truncated incorrect DOUBLE value: 'test' PREPARE stmt FROM 'EXPLAIN SELECT 1 FROM t1 WHERE 1 > ALL((SELECT t1.f1 FROM t1 RIGHT OUTER JOIN t1 a @@ -343,12 +345,16 @@ EXECUTE stmt; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 system NULL NULL NULL NULL 1 2 SUBQUERY a system NULL NULL NULL NULL 1 -2 SUBQUERY t1 fulltext f1_2,f1 f1 0 1 Using where +2 SUBQUERY t1 index unique,fulltext unique 8 NULL 1 Using where; Using index +Warnings: +Warning 1292 Truncated incorrect DOUBLE value: 'test' EXECUTE stmt; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 system NULL NULL NULL NULL 1 2 SUBQUERY a system NULL NULL NULL NULL 1 -2 SUBQUERY t1 fulltext f1_2,f1 f1 0 1 Using where +2 SUBQUERY t1 index unique,fulltext unique 8 NULL 1 Using where; Using index +Warnings: +Warning 1292 Truncated incorrect DOUBLE value: 'test' DEALLOCATE PREPARE stmt; PREPARE stmt FROM 'EXPLAIN SELECT 1 FROM t1 @@ -359,12 +365,15 @@ EXECUTE stmt; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 system NULL NULL NULL NULL 1 2 SUBQUERY a system NULL NULL NULL NULL 1 -2 SUBQUERY t1 fulltext f1_2,f1 f1 0 1 Using where +2 SUBQUERY t1 index unique,fulltext unique 8 NULL 1 Using where; Using index +Warnings: +Warning 1292 Truncated incorrect DOUBLE value: 'test' +INSERT into t1 values('test1'),('test2'),('test3'),('test4'),('test5'); EXECUTE stmt; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 system NULL NULL NULL NULL 1 -2 SUBQUERY a system NULL NULL NULL NULL 1 -2 SUBQUERY t1 fulltext f1_2,f1 f1 0 1 Using where +1 PRIMARY t1 index NULL unique 8 NULL 6 Using index +2 SUBQUERY t1 fulltext unique,fulltext fulltext 0 1 Using where +2 SUBQUERY a index NULL unique 8 NULL 6 Using index DEALLOCATE PREPARE stmt; DROP TABLE t1; End of 5.1 tests. diff --git a/mysql-test/main/explain.test b/mysql-test/main/explain.test index 0fa4a5af215..c8ed617590d 100644 --- a/mysql-test/main/explain.test +++ b/mysql-test/main/explain.test @@ -254,7 +254,7 @@ DROP TABLE t1; --echo # CREATE TABLE t1(f1 VARCHAR(6) NOT NULL, -FULLTEXT KEY(f1),UNIQUE(f1)); +FULLTEXT KEY `fulltext` (f1), UNIQUE `unique` (f1)); INSERT INTO t1 VALUES ('test'); EXPLAIN SELECT 1 FROM t1 @@ -279,6 +279,7 @@ PREPARE stmt FROM WHERE t1.f1 GROUP BY t1.f1))'; EXECUTE stmt; +INSERT into t1 values('test1'),('test2'),('test3'),('test4'),('test5'); EXECUTE stmt; DEALLOCATE PREPARE stmt; diff --git a/mysql-test/main/explain_json.result b/mysql-test/main/explain_json.result index 98a2fec91fa..70a6762f49c 100644 --- a/mysql-test/main/explain_json.result +++ b/mysql-test/main/explain_json.result @@ -778,9 +778,9 @@ drop table t0; # MDEV-7265: "Full scan on NULL key", the join case # CREATE TABLE t1 (a INT, KEY(a)); -INSERT INTO t1 VALUES (1),(2); +INSERT INTO t1 VALUES (1),(2),(5),(6),(7); CREATE TABLE t2 (b INT); -INSERT INTO t2 VALUES (3),(4); +INSERT INTO t2 VALUES (3),(4),(9),(10),(11); EXPLAIN FORMAT=JSON SELECT * FROM t1 AS outer_t1 WHERE a <> ALL ( SELECT a FROM t1, t2 WHERE b <> outer_t1.a ); EXPLAIN { @@ -792,7 +792,7 @@ EXPLAIN "key": "a", "key_length": "5", "used_key_parts": ["a"], - "rows": 2, + "rows": 5, "filtered": 100, "attached_condition": "!<in_optimizer>(outer_t1.a,<exists>(subquery#2))", "using_index": true @@ -811,7 +811,7 @@ EXPLAIN "key_length": "5", "used_key_parts": ["a"], "ref": ["func"], - "rows": 2, + "rows": 3, "filtered": 100, "attached_condition": "trigcond(<cache>(outer_t1.a) = t1.a or t1.a is null)", "using_index": true @@ -821,7 +821,7 @@ EXPLAIN "table": { "table_name": "t2", "access_type": "ALL", - "rows": 2, + "rows": 5, "filtered": 100 }, "buffer_type": "flat", diff --git a/mysql-test/main/explain_json.test b/mysql-test/main/explain_json.test index cfbc0cfa10c..e527b70c486 100644 --- a/mysql-test/main/explain_json.test +++ b/mysql-test/main/explain_json.test @@ -163,10 +163,10 @@ drop table t0; --echo # CREATE TABLE t1 (a INT, KEY(a)); -INSERT INTO t1 VALUES (1),(2); +INSERT INTO t1 VALUES (1),(2),(5),(6),(7); CREATE TABLE t2 (b INT); -INSERT INTO t2 VALUES (3),(4); +INSERT INTO t2 VALUES (3),(4),(9),(10),(11); EXPLAIN FORMAT=JSON SELECT * FROM t1 AS outer_t1 WHERE a <> ALL ( SELECT a FROM t1, t2 WHERE b <> outer_t1.a ); diff --git a/mysql-test/main/func_group.result b/mysql-test/main/func_group.result index 177f0950a77..0959bfe0f8e 100644 --- a/mysql-test/main/func_group.result +++ b/mysql-test/main/func_group.result @@ -604,11 +604,11 @@ AME AME explain select min(a1) from t1 where a1 > 'KKK' or a1 < 'XXX'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range PRIMARY PRIMARY 0 NULL 15 Using where; Using index +1 SIMPLE t1 index PRIMARY PRIMARY 3 NULL 15 Using where; Using index explain select min(a1) from t1 where (a1 < 'KKK' or a1 > 'KKK'); id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range PRIMARY PRIMARY 3 NULL 14 Using where; Using index +1 SIMPLE t1 index PRIMARY PRIMARY 3 NULL 15 Using where; Using index explain select max(a3) from t1 where a2 < 2 and a3 < 'SEA'; id select_type table type possible_keys key key_len ref rows Extra @@ -653,7 +653,7 @@ id select_type table type possible_keys key key_len ref rows Extra explain select concat(min(t1.a1),min(t2.a4)) from t1, t2 where t2.a4 <> 'AME'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 range k2 k2 4 NULL 6 Using where; Using index +1 SIMPLE t2 index k2 k2 4 NULL 7 Using where; Using index 1 SIMPLE t1 index NULL PRIMARY 3 NULL 15 Using index; Using join buffer (flat, BNL join) drop table t1, t2; create table t1 (a char(10)); @@ -1857,9 +1857,8 @@ NULL EXPLAIN EXTENDED SELECT MAX(a) FROM t1 WHERE (1,2) IN (SELECT a,b FROM t2 WHERE b<5) and a<10; id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 8 func,func 1 100.00 +1 PRIMARY t2 ALL NULL NULL NULL NULL 5 100.00 Using where; FirstMatch 1 PRIMARY t1 range a a 4 NULL 3 100.00 Using where; Using index; Using join buffer (flat, BNL join) -2 MATERIALIZED t2 ALL NULL NULL NULL NULL 5 100.00 Using where Warnings: Note 1003 select max(`test`.`t1`.`a`) AS `MAX(a)` from `test`.`t1` semi join (`test`.`t2`) where `test`.`t2`.`a` = 1 and `test`.`t2`.`b` = 2 and `test`.`t1`.`a` < 10 SELECT MAX(a) FROM t1 WHERE (1,2) IN (SELECT a,b FROM t2 WHERE b<5) and a<10; diff --git a/mysql-test/main/func_in.result b/mysql-test/main/func_in.result index 569fdfe4cbf..1363a017dfd 100644 --- a/mysql-test/main/func_in.result +++ b/mysql-test/main/func_in.result @@ -522,7 +522,7 @@ a b explain select f1 from t1 where f1 in ('a','b'); id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range t1f1_idx t1f1_idx 2 NULL 2 Using where; Using index +1 SIMPLE t1 index t1f1_idx t1f1_idx 2 NULL 3 Using where; Using index select f1 from t1 where f1 in (2,1); f1 1 diff --git a/mysql-test/main/greedy_optimizer.result b/mysql-test/main/greedy_optimizer.result index 1a9390b0384..a83d32e06dc 100644 --- a/mysql-test/main/greedy_optimizer.result +++ b/mysql-test/main/greedy_optimizer.result @@ -127,7 +127,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t6.c62 1 Using index show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 3350.237037 +Last_query_cost 2698.288350 explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 3 @@ -139,7 +139,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t6.c62 1 Using index show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 3350.237037 +Last_query_cost 2698.288350 explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 6 @@ -151,7 +151,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join) show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 1276.787037 +Last_query_cost 1561.741393 explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 6 @@ -163,7 +163,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join) show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 1276.787037 +Last_query_cost 1561.741393 explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 6 @@ -175,7 +175,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join) show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 1276.787037 +Last_query_cost 1565.285143 explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 6 @@ -187,7 +187,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join) show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 1276.787037 +Last_query_cost 1565.285143 set optimizer_prune_level=0; select @@optimizer_prune_level; @@optimizer_prune_level @@ -202,24 +202,24 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t2.c22 1 1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where; Using join buffer (flat, BNL join) 1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t4.c42 1 +1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using where; Using join buffer (flat, BNL join) 1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join) 1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t6.c62 1 Using index -1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using where; Using join buffer (flat, BNL join) show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 2705.237037 +Last_query_cost 2694.988350 explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where 1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t2.c22 1 1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where; Using join buffer (flat, BNL join) 1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t4.c42 1 +1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using where; Using join buffer (flat, BNL join) 1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join) 1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t6.c62 1 Using index -1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using where; Using join buffer (flat, BNL join) show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 2705.237037 +Last_query_cost 2694.988350 explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where @@ -231,7 +231,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join) show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 701.018727 +Last_query_cost 753.272751 explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where @@ -243,7 +243,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join) show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 701.018727 +Last_query_cost 753.272751 explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where @@ -255,7 +255,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join) show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 701.018727 +Last_query_cost 762.722751 explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where @@ -267,7 +267,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join) show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 701.018727 +Last_query_cost 762.722751 set optimizer_search_depth=1; select @@optimizer_search_depth; @@optimizer_search_depth @@ -283,7 +283,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t6.c62 1 Using index show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 3350.237037 +Last_query_cost 2698.288350 explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 3 @@ -295,7 +295,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t6.c62 1 Using index show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 3350.237037 +Last_query_cost 2698.288350 explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 3 Using where @@ -307,7 +307,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join) show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 1678.037037 +Last_query_cost 2070.748851 explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 3 Using where @@ -319,7 +319,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join) show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 1678.037037 +Last_query_cost 2070.748851 explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 3 Using where @@ -331,7 +331,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join) show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 1678.037037 +Last_query_cost 2075.473851 explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 3 Using where @@ -343,7 +343,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join) show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 1678.037037 +Last_query_cost 2075.473851 set optimizer_search_depth=62; select @@optimizer_search_depth; @@optimizer_search_depth @@ -354,24 +354,24 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t2.c22 1 1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where; Using join buffer (flat, BNL join) 1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t4.c42 1 +1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using where; Using join buffer (flat, BNL join) 1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join) 1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t6.c62 1 Using index -1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using where; Using join buffer (flat, BNL join) show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 2705.237037 +Last_query_cost 2694.988350 explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where 1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t2.c22 1 1 SIMPLE t4 ALL NULL NULL NULL NULL 12 Using where; Using join buffer (flat, BNL join) 1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t4.c42 1 +1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using where; Using join buffer (flat, BNL join) 1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join) 1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t6.c62 1 Using index -1 SIMPLE t1 ALL NULL NULL NULL NULL 3 Using where; Using join buffer (flat, BNL join) show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 2705.237037 +Last_query_cost 2694.988350 explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where @@ -383,7 +383,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join) show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 701.018727 +Last_query_cost 753.272751 explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where @@ -395,7 +395,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join) show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 701.018727 +Last_query_cost 753.272751 explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where @@ -407,7 +407,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join) show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 701.018727 +Last_query_cost 762.722751 explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 6 Using where @@ -419,7 +419,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join) show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 701.018727 +Last_query_cost 762.722751 set optimizer_prune_level=1; select @@optimizer_prune_level; @@optimizer_prune_level @@ -439,7 +439,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t6.c62 1 Using index show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 3350.237037 +Last_query_cost 2698.288350 explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 3 @@ -451,7 +451,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t6.c62 1 Using index show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 3350.237037 +Last_query_cost 2698.288350 explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 6 @@ -463,7 +463,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join) show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 1276.787037 +Last_query_cost 1561.741393 explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 6 @@ -475,7 +475,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join) show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 1276.787037 +Last_query_cost 1561.741393 explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 6 @@ -487,7 +487,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join) show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 1276.787037 +Last_query_cost 1565.285143 explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 6 @@ -499,7 +499,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join) show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 1276.787037 +Last_query_cost 1565.285143 set optimizer_search_depth=1; select @@optimizer_search_depth; @@optimizer_search_depth @@ -515,7 +515,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t6.c62 1 Using index show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 3350.237037 +Last_query_cost 2698.288350 explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 3 @@ -527,7 +527,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t6.c62 1 Using index show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 3350.237037 +Last_query_cost 2698.288350 explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 3 Using where @@ -539,7 +539,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join) show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 1678.037037 +Last_query_cost 2070.748851 explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 3 Using where @@ -551,7 +551,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join) show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 1678.037037 +Last_query_cost 2070.748851 explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 3 Using where @@ -563,7 +563,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join) show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 1678.037037 +Last_query_cost 2075.473851 explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 3 Using where @@ -575,7 +575,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join) show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 1678.037037 +Last_query_cost 2075.473851 set optimizer_search_depth=62; select @@optimizer_search_depth; @@optimizer_search_depth @@ -591,7 +591,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t6.c62 1 Using index show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 3350.237037 +Last_query_cost 2698.288350 explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c12 = t2.c21 and t2.c22 = t3.c31 and t3.c32 = t4.c41 and t4.c42 = t5.c51 and t5.c52 = t6.c61 and t6.c62 = t7.c71; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 3 @@ -603,7 +603,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t7 eq_ref PRIMARY PRIMARY 4 test.t6.c62 1 Using index show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 3350.237037 +Last_query_cost 2698.288350 explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 6 @@ -615,7 +615,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join) show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 1276.787037 +Last_query_cost 1561.741393 explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 6 @@ -627,7 +627,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join) show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 1276.787037 +Last_query_cost 1561.741393 explain select t1.c11 from t1, t2, t3, t4, t5, t6, t7 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 6 @@ -639,7 +639,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join) show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 1276.787037 +Last_query_cost 1565.285143 explain select t1.c11 from t7, t6, t5, t4, t3, t2, t1 where t1.c11 = t2.c21 and t1.c12 = t3.c31 and t1.c13 = t4.c41 and t1.c14 = t5.c51 and t1.c15 = t6.c61 and t1.c16 = t7.c71 and t2.c22 = t3.c32 and t2.c23 = t4.c42 and t2.c24 = t5.c52 and t2.c25 = t6.c62 and t2.c26 = t7.c72 and t3.c33 = t4.c43 and t3.c34 = t5.c53 and t3.c35 = t6.c63 and t3.c36 = t7.c73 and t4.c42 = t5.c54 and t4.c43 = t6.c64 and t4.c44 = t7.c74 and t5.c52 = t6.c65 and t5.c53 = t7.c75 and t6.c62 = t7.c76; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 ALL NULL NULL NULL NULL 6 @@ -651,7 +651,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t6 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join) show status like 'Last_query_cost'; Variable_name Value -Last_query_cost 1276.787037 +Last_query_cost 1565.285143 drop table t1,t2,t3,t4,t5,t6,t7; CREATE TABLE t1 (a int, b int, d int, i int); INSERT INTO t1 VALUES (1,1,1,1); diff --git a/mysql-test/main/group_by.result b/mysql-test/main/group_by.result index d0273fe2090..12c596d53e3 100644 --- a/mysql-test/main/group_by.result +++ b/mysql-test/main/group_by.result @@ -2457,7 +2457,7 @@ test.t1 analyze status OK EXPLAIN SELECT SQL_BUFFER_RESULT MIN(a), b FROM t1 WHERE t1.b = 'a' GROUP BY b; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref b b 4 const 6 Using where; Using index; Using temporary +1 SIMPLE t1 range b b 9 NULL 2 Using where; Using index for group-by; Using temporary SELECT SQL_BUFFER_RESULT MIN(a), b FROM t1 WHERE t1.b = 'a' GROUP BY b; MIN(a) b @@ -2465,7 +2465,7 @@ MIN(a) b EXPLAIN SELECT MIN(a), b FROM t1 WHERE t1.b = 'a' GROUP BY b; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref b b 4 const 6 Using where; Using index +1 SIMPLE t1 range b b 9 NULL 2 Using where; Using index for group-by SELECT MIN(a), b FROM t1 WHERE t1.b = 'a' GROUP BY b; MIN(a) b diff --git a/mysql-test/main/group_min_max.result b/mysql-test/main/group_min_max.result index 0539c938899..b2642fb1ba6 100644 --- a/mysql-test/main/group_min_max.result +++ b/mysql-test/main/group_min_max.result @@ -2080,7 +2080,7 @@ id select_type table type possible_keys key key_len ref rows Extra explain extended select a1,a2,min(b),max(b) from t1 where (a1 = 'b' or a1 = 'd' or a1 = 'a' or a1 = 'c') and (a2 > 'a') and (c > 'a111') group by a1,a2; id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 range idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_1 130 NULL 276 97.06 Using where; Using index +1 SIMPLE t1 range idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_1 130 NULL 276 100.00 Using where; Using index Warnings: Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2`,min(`test`.`t1`.`b`) AS `min(b)`,max(`test`.`t1`.`b`) AS `max(b)` from `test`.`t1` where (`test`.`t1`.`a1` = 'b' or `test`.`t1`.`a1` = 'd' or `test`.`t1`.`a1` = 'a' or `test`.`t1`.`a1` = 'c') and `test`.`t1`.`a2` > 'a' and `test`.`t1`.`c` > 'a111' group by `test`.`t1`.`a1`,`test`.`t1`.`a2` explain extended select a1,a2,b,min(c),max(c) from t1 @@ -2100,7 +2100,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 index NULL idx_t2_1 163 NULL 548 Using where; Using index explain extended select a1,a2,b from t1 where (a1 = 'b' or a1 = 'd' or a1 = 'a' or a1 = 'c') and (a2 > 'a') and (c > 'a111') group by a1,a2,b; id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 range idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_1 130 NULL 276 97.06 Using where; Using index +1 SIMPLE t1 range idx_t1_0,idx_t1_1,idx_t1_2 idx_t1_1 130 NULL 276 100.00 Using where; Using index Warnings: Note 1003 select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2`,`test`.`t1`.`b` AS `b` from `test`.`t1` where (`test`.`t1`.`a1` = 'b' or `test`.`t1`.`a1` = 'd' or `test`.`t1`.`a1` = 'a' or `test`.`t1`.`a1` = 'c') and `test`.`t1`.`a2` > 'a' and `test`.`t1`.`c` > 'a111' group by `test`.`t1`.`a1`,`test`.`t1`.`a2`,`test`.`t1`.`b` explain select a1,a2,min(b),c from t2 where (a2 = 'a') and (c = 'a111') group by a1; @@ -2368,11 +2368,11 @@ CREATE TABLE t2 (a int, b int, c int, PRIMARY KEY (a,b,c)); INSERT INTO t2 SELECT a,b,b FROM t1; explain SELECT MAX(b), a FROM t1 WHERE b < 2 AND a = 1 GROUP BY a; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range a,b a 10 NULL 6 Using where; Using index +1 SIMPLE t1 range a,b a 10 NULL 2 Using where; Using index for group-by insert into t1 select 1,seq from seq_1_to_100; explain SELECT MAX(b), a FROM t1 WHERE b < 2 AND a = 1 GROUP BY a; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range a,b a 10 NULL 6 Using where; Using index +1 SIMPLE t1 range a,b a 10 NULL 2 Using where; Using index for group-by analyze table t1; Table Op Msg_type Msg_text test.t1 analyze status Engine-independent statistics collected @@ -2460,7 +2460,7 @@ EXPLAIN SELECT (SELECT max(b) FROM t1 GROUP BY a HAVING a < 2) x FROM t1 AS t1_outer; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1_outer index NULL a 10 NULL 15 Using index -2 SUBQUERY t1 range a a 5 NULL 5 Using where; Using index +2 SUBQUERY t1 range a a 5 NULL 2 Using where; Using index for group-by EXPLAIN SELECT 1 FROM t1 AS t1_outer WHERE EXISTS (SELECT max(b) FROM t1 GROUP BY a HAVING a < 2); id select_type table type possible_keys key key_len ref rows Extra @@ -2470,31 +2470,31 @@ EXPLAIN SELECT 1 FROM t1 AS t1_outer WHERE (SELECT max(b) FROM t1 GROUP BY a HAVING a < 2) > 12; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE -2 SUBQUERY t1 range a a 5 NULL 5 Using where; Using index +2 SUBQUERY t1 range a a 5 NULL 2 Using where; Using index for group-by EXPLAIN SELECT 1 FROM t1 AS t1_outer WHERE a IN (SELECT max(b) FROM t1 GROUP BY a HAVING a < 2); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 2 1 PRIMARY t1_outer ref a a 5 <subquery2>.max(b) 3 Using index -2 MATERIALIZED t1 range a a 5 NULL 5 Using where; Using index +2 MATERIALIZED t1 range a a 5 NULL 2 Using where; Using index for group-by EXPLAIN SELECT 1 FROM t1 AS t1_outer GROUP BY a HAVING a > (SELECT max(b) FROM t1 GROUP BY a HAVING a < 2); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1_outer range NULL a 5 NULL 6 Using index for group-by -2 SUBQUERY t1 range a a 5 NULL 5 Using where; Using index +2 SUBQUERY t1 range a a 5 NULL 2 Using where; Using index for group-by EXPLAIN SELECT 1 FROM t1 AS t1_outer1 JOIN t1 AS t1_outer2 ON t1_outer1.a = (SELECT max(b) FROM t1 GROUP BY a HAVING a < 2) AND t1_outer1.b = t1_outer2.b; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1_outer1 ref a a 5 const 1 Using where; Using index 1 PRIMARY t1_outer2 index NULL a 10 NULL 15 Using where; Using index; Using join buffer (flat, BNL join) -2 SUBQUERY t1 range a a 5 NULL 5 Using where; Using index +2 SUBQUERY t1 range a a 5 NULL 2 Using where; Using index for group-by EXPLAIN SELECT (SELECT (SELECT max(b) FROM t1 GROUP BY a HAVING a < 2) x FROM t1 AS t1_outer) x2 FROM t1 AS t1_outer2; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1_outer2 index NULL a 10 NULL 15 Using index 2 SUBQUERY t1_outer index NULL a 10 NULL 15 Using index -3 SUBQUERY t1 range a a 5 NULL 5 Using where; Using index +3 SUBQUERY t1 range a a 5 NULL 2 Using where; Using index for group-by CREATE TABLE t3 LIKE t1; FLUSH STATUS; INSERT INTO t3 SELECT a,MAX(b) FROM t1 GROUP BY a; @@ -3794,7 +3794,7 @@ CREATE INDEX break_it ON t1 (a, b); EXPLAIN SELECT distinct a, b FROM t1 where a = '3' ORDER BY b; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref break_it break_it 5 const 6 Using where; Using index; Using filesort +1 SIMPLE t1 range break_it break_it 10 NULL 2 Using where; Using index for group-by; Using filesort SELECT distinct a, b FROM t1 where a = '3' ORDER BY b; a b 3 1 @@ -4036,10 +4036,10 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away explain select min(a) from t1 where a between "a" and "Cafeeeeeeeeeeeeeeeeeeeeeeeeee"; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range a a 13 NULL 2 Using where; Using index +1 SIMPLE t1 index a a 13 NULL 2 Using where; Using index explain select min(a) from t1 where a between "abbbbbbbbbbbbbbbbbbbb" and "Cafe2"; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range a a 13 NULL 2 Using where; Using index +1 SIMPLE t1 index a a 13 NULL 2 Using where; Using index drop table t1; # # MDEV-15433: Optimizer does not use group by optimization with distinct diff --git a/mysql-test/main/index_intersect.result b/mysql-test/main/index_intersect.result index 3ec98216479..79cd7a32c1a 100644 --- a/mysql-test/main/index_intersect.result +++ b/mysql-test/main/index_intersect.result @@ -75,7 +75,7 @@ EXPLAIN SELECT * FROM City WHERE Name LIKE 'M%' AND Population > 300000; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City range Population,Name Name 35 NULL # Using index condition; Using where +1 SIMPLE City index_merge Population,Name Name,Population 35,4 NULL # Using sort_intersect(Name,Population); Using where EXPLAIN SELECT * FROM City WHERE Name LIKE 'M%' AND Population > 7000000; @@ -355,9 +355,6 @@ COUNT(*) SELECT COUNT(*) FROM City WHERE Country LIKE 'C%'; COUNT(*) 551 -SELECT COUNT(*) FROM City WHERE Country LIKE 'B%'; -COUNT(*) -339 SELECT COUNT(*) FROM City WHERE Country LIKE 'J%'; COUNT(*) 256 @@ -370,7 +367,7 @@ EXPLAIN SELECT * FROM City WHERE Name BETWEEN 'G' AND 'K' AND Population > 1000000 AND Country LIKE 'J%'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City index_merge Population,Country,Name Population,Country,Name 4,3,35 NULL # Using sort_intersect(Population,Country,Name); Using where +1 SIMPLE City index_merge Population,Country,Name Population,Country 4,3 NULL # Using sort_intersect(Population,Country); Using where EXPLAIN SELECT * FROM City WHERE Name BETWEEN 'G' AND 'K' AND Population > 500000 AND Country LIKE 'C%'; @@ -476,7 +473,7 @@ EXPLAIN SELECT * FROM City WHERE ID BETWEEN 2001 AND 2500 AND Population > 300000 AND Country LIKE 'H%'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City index_merge PRIMARY,Population,Country Country,PRIMARY 3,4 NULL # Using sort_intersect(Country,PRIMARY); Using where +1 SIMPLE City range PRIMARY,Population,Country Country 3 NULL # Using index condition; Using where EXPLAIN SELECT * FROM City WHERE ID BETWEEN 3701 AND 4000 AND Population > 1000000 @@ -488,7 +485,7 @@ SELECT * FROM City WHERE ID BETWEEN 3001 AND 4000 AND Population > 600000 AND Country BETWEEN 'S' AND 'Z' ; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City range PRIMARY,Population,Country Population 4 NULL # Using index condition; Using where +1 SIMPLE City index_merge PRIMARY,Population,Country Population,Country 4,3 NULL # Using sort_intersect(Population,Country); Using where SELECT * FROM City USE INDEX () WHERE ID BETWEEN 501 AND 1000 AND Population > 700000 AND Country LIKE 'C%'; ID Name Country Population @@ -715,18 +712,18 @@ EXPLAIN SELECT * FROM City WHERE Name BETWEEN 'G' AND 'J' AND Population > 500000 AND Country LIKE 'C%'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City range Population,Country,Name Name 35 NULL # Using index condition; Using where +1 SIMPLE City index_merge Population,Country,Name Name,Country 35,3 NULL # Using sort_intersect(Name,Country); Using where EXPLAIN SELECT * FROM City WHERE ID BETWEEN 1 AND 500 AND Population > 700000 AND Country LIKE 'C%'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City range PRIMARY,Population,Country Population 4 NULL # Using index condition; Using where +1 SIMPLE City index_merge PRIMARY,Population,Country Population,PRIMARY 4,4 NULL # Using sort_intersect(Population,PRIMARY); Using where EXPLAIN SELECT * FROM City WHERE ID BETWEEN 3001 AND 4000 AND Population > 600000 AND Country BETWEEN 'S' AND 'Z'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City range PRIMARY,Population,Country Population 4 NULL # Using index condition; Using where +1 SIMPLE City index_merge PRIMARY,Population,Country Population,Country 4,3 NULL # Using sort_intersect(Population,Country); Using where SELECT * FROM City WHERE Name LIKE 'C%' AND Population > 1000000; ID Name Country Population @@ -966,7 +963,7 @@ EXPLAIN SELECT * FROM t1 WHERE (f1 < 535 OR f1 > 985) AND ( f4='r' OR f4 LIKE 'a%' ) ; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range PRIMARY,f4 f4 35 NULL # Using index condition; Using where +1 SIMPLE t1 index_merge PRIMARY,f4 f4,PRIMARY 35,4 NULL # Using sort_intersect(f4,PRIMARY); Using where SELECT * FROM t1 WHERE (f1 < 535 OR f1 > 985) AND ( f4='r' OR f4 LIKE 'a%' ) ; f1 f4 f5 diff --git a/mysql-test/main/index_intersect.test b/mysql-test/main/index_intersect.test index 26937fd5eef..d6208f67a92 100644 --- a/mysql-test/main/index_intersect.test +++ b/mysql-test/main/index_intersect.test @@ -120,7 +120,6 @@ SELECT COUNT(*) FROM City WHERE Name BETWEEN 'G' AND 'K'; SELECT COUNT(*) FROM City WHERE Population > 1000000; SELECT COUNT(*) FROM City WHERE Population > 500000; SELECT COUNT(*) FROM City WHERE Country LIKE 'C%'; -SELECT COUNT(*) FROM City WHERE Country LIKE 'B%'; SELECT COUNT(*) FROM City WHERE Country LIKE 'J%'; diff --git a/mysql-test/main/index_intersect_innodb.result b/mysql-test/main/index_intersect_innodb.result index 44407dbcd30..5ee4f88fddd 100644 --- a/mysql-test/main/index_intersect_innodb.result +++ b/mysql-test/main/index_intersect_innodb.result @@ -81,12 +81,12 @@ EXPLAIN SELECT * FROM City WHERE Name LIKE 'M%' AND Population > 300000; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City range Population,Name Name 35 NULL # Using index condition; Using where +1 SIMPLE City index_merge Population,Name Name,Population 35,4 NULL # Using sort_intersect(Name,Population); Using where EXPLAIN SELECT * FROM City WHERE Name LIKE 'M%' AND Population > 7000000; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City index_merge Population,Name Population,Name 4,35 NULL # Using sort_intersect(Population,Name); Using where +1 SIMPLE City range Population,Name Population 4 NULL # Using index condition; Using where SELECT * FROM City USE INDEX () WHERE Name LIKE 'C%' AND Population > 1000000; ID Name Country Population @@ -341,8 +341,8 @@ ID Name Country Population SELECT * FROM City WHERE Name LIKE 'M%' AND Population > 7000000; ID Name Country Population -1024 Mumbai (Bombay) IND 10500000 3580 Moscow RUS 8389200 +1024 Mumbai (Bombay) IND 10500000 SELECT COUNT(*) FROM City WHERE Name BETWEEN 'M' AND 'N'; COUNT(*) 301 @@ -361,9 +361,6 @@ COUNT(*) SELECT COUNT(*) FROM City WHERE Country LIKE 'C%'; COUNT(*) 551 -SELECT COUNT(*) FROM City WHERE Country LIKE 'B%'; -COUNT(*) -339 SELECT COUNT(*) FROM City WHERE Country LIKE 'J%'; COUNT(*) 256 @@ -371,17 +368,17 @@ EXPLAIN SELECT * FROM City WHERE Name BETWEEN 'M' AND 'N' AND Population > 1000000 AND Country LIKE 'C%'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City index_merge Population,Country,Name Population,Name,Country 4,35,3 NULL # Using sort_intersect(Population,Name,Country); Using where +1 SIMPLE City index_merge Population,Country,Name Population,Name 4,35 NULL # Using sort_intersect(Population,Name); Using where EXPLAIN SELECT * FROM City WHERE Name BETWEEN 'G' AND 'K' AND Population > 1000000 AND Country LIKE 'J%'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City index_merge Population,Country,Name Population,Country,Name 4,3,35 NULL # Using sort_intersect(Population,Country,Name); Using where +1 SIMPLE City index_merge Population,Country,Name Population,Country 4,3 NULL # Using sort_intersect(Population,Country); Using where EXPLAIN SELECT * FROM City WHERE Name BETWEEN 'G' AND 'K' AND Population > 500000 AND Country LIKE 'C%'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City range Population,Name,Country Name # NULL # Using index condition; Using where +1 SIMPLE City index_merge Population,Name,Country Name,Population,Country # NULL # Using sort_intersect(Name,Population,Country); Using where SELECT * FROM City USE INDEX () WHERE Name BETWEEN 'M' AND 'N' AND Population > 1000000 AND Country LIKE 'C%'; ID Name Country Population @@ -482,13 +479,13 @@ EXPLAIN SELECT * FROM City WHERE ID BETWEEN 2001 AND 2500 AND Population > 300000 AND Country LIKE 'H%'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City index_merge PRIMARY,Population,Country PRIMARY,Population,Country 4,4,7 NULL # Using sort_intersect(PRIMARY,Population,Country); Using where +1 SIMPLE City range PRIMARY,Population,Country Country 7 NULL # Using index condition; Using where EXPLAIN SELECT * FROM City WHERE ID BETWEEN 3701 AND 4000 AND Population > 1000000 AND Country BETWEEN 'S' AND 'Z'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City index_merge PRIMARY,Population,Country PRIMARY,Population,Country 4,4,7 NULL # Using sort_intersect(PRIMARY,Population,Country); Using where +1 SIMPLE City index_merge PRIMARY,Population,Country PRIMARY,Population 4,4 NULL # Using sort_intersect(PRIMARY,Population); Using where EXPLAIN SELECT * FROM City WHERE ID BETWEEN 3001 AND 4000 AND Population > 600000 @@ -721,7 +718,7 @@ EXPLAIN SELECT * FROM City WHERE Name BETWEEN 'G' AND 'J' AND Population > 500000 AND Country LIKE 'C%'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City range Population,Country,Name Name 35 NULL # Using index condition; Using where +1 SIMPLE City index_merge Population,Country,Name Name,Population,Country 35,4,3 NULL # Using sort_intersect(Name,Population,Country); Using where EXPLAIN SELECT * FROM City WHERE ID BETWEEN 1 AND 500 AND Population > 700000 AND Country LIKE 'C%'; @@ -732,7 +729,7 @@ SELECT * FROM City WHERE ID BETWEEN 3001 AND 4000 AND Population > 600000 AND Country BETWEEN 'S' AND 'Z'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City range PRIMARY,Population,Country PRIMARY 4 NULL # Using where +1 SIMPLE City index_merge PRIMARY,Population,Country PRIMARY,Population,Country 4,4,7 NULL # Using sort_intersect(PRIMARY,Population,Country); Using where SELECT * FROM City WHERE Name LIKE 'C%' AND Population > 1000000; ID Name Country Population diff --git a/mysql-test/main/index_merge_myisam.result b/mysql-test/main/index_merge_myisam.result index 053239b7fb1..89762b2407f 100644 --- a/mysql-test/main/index_merge_myisam.result +++ b/mysql-test/main/index_merge_myisam.result @@ -671,7 +671,7 @@ key1 key2 key3 key4 filler1 -1 -1 100 100 key4-key3 explain select key1,key2,key3 from t1 where key1=100 and key2=100 and key3=100; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 index_merge key1,key2,key3 key1,key2,key3 5,5,5 NULL 2 Using intersect(key1,key2,key3); Using where; Using index +1 SIMPLE t1 index_merge key1,key2,key3 key1,key2 5,5 NULL 77 Using intersect(key1,key2); Using where select key1,key2,key3 from t1 where key1=100 and key2=100 and key3=100; key1 key2 key3 100 100 100 @@ -756,7 +756,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ref sta_swt12a,sta_swt1a,sta_swt2a,sta_swt21a,st_a sta_swt21a 12 const,const,const 971 explain select * from t1 where st_b=1 and swt1b=1 and swt2b=1; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref stb_swt1a_2b,stb_swt1b,st_b stb_swt1a_2b 8 const,const 3879 Using where +1 SIMPLE t1 ref stb_swt1a_2b,stb_swt1b,st_b stb_swt1b 8 const,const 3885 Using where explain select * from t1 where st_a=1 and swt1a=1 and swt2a=1 and st_b=1 and swt1b=1 and swt2b=1; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 index_merge sta_swt12a,sta_swt1a,sta_swt2a,sta_swt21a,st_a,stb_swt1a_2b,stb_swt1b,st_b sta_swt12a,stb_swt1a_2b 12,12 NULL 58 Using intersect(sta_swt12a,stb_swt1a_2b); Using where @@ -898,7 +898,7 @@ INSERT INTO t1 (key1, key2, filler) SELECT seq/4, seq/8, 'filler-data' FROM seq_30_to_0; explain select pk from t1 where key1 = 1 and key2 = 1; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref key1,key2 key1 5 const 4 Using where +1 SIMPLE t1 index_merge key1,key2 key1,key2 5,4 NULL 1 Using intersect(key1,key2); Using where select pk from t1 where key2 = 1 and key1 = 1; pk 26 @@ -1475,7 +1475,7 @@ EXPLAIN SELECT t1.f1 FROM t1 WHERE (SELECT COUNT(*) FROM t2 WHERE t2.f3 = 'h' AND t2.f2 = t1.f1) = 0 AND t1.f1 = 2; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 system PRIMARY NULL NULL NULL 1 -2 SUBQUERY t2 ref f2,f3 f3 2 const 2 Using index condition; Using where +2 SUBQUERY t2 index_merge f2,f3 f3,f2 2,5 NULL 1 Using intersect(f3,f2); Using where; Using index DROP TABLE t1,t2; create table t0 (a int); insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); diff --git a/mysql-test/main/innodb_ext_key,off.rdiff b/mysql-test/main/innodb_ext_key,off.rdiff index 4d6c65c9971..75f5a3432b4 100644 --- a/mysql-test/main/innodb_ext_key,off.rdiff +++ b/mysql-test/main/innodb_ext_key,off.rdiff @@ -1,17 +1,20 @@ ---- innodb_ext_key.result -+++ innodb_ext_key,off.result +--- main/innodb_ext_key.result ++++ main/innodb_ext_key,off.reject @@ -9,7 +9,7 @@ explain select count(*) from lineitem where l_orderkey=130 and l_shipdate='1992-07-01'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE lineitem ref PRIMARY,i_l_shipdate,i_l_orderkey,i_l_orderkey_quantity i_l_shipdate 8 const,const 1 Using index -+1 SIMPLE lineitem ref PRIMARY,i_l_shipdate,i_l_orderkey,i_l_orderkey_quantity i_l_shipdate 4 const 6 Using where; Using index ++1 SIMPLE lineitem index_merge PRIMARY,i_l_shipdate,i_l_orderkey,i_l_orderkey_quantity i_l_orderkey,i_l_shipdate 4,4 NULL 1 Using intersect(i_l_orderkey,i_l_shipdate); Using where; Using index flush status; select count(*) from lineitem where l_orderkey=130 and l_shipdate='1992-07-01'; count(*) -@@ -19,7 +19,7 @@ +@@ -17,9 +17,9 @@ + show status like 'handler_read%'; + Variable_name Value Handler_read_first 0 - Handler_read_key 1 +-Handler_read_key 1 ++Handler_read_key 2 Handler_read_last 0 -Handler_read_next 1 +Handler_read_next 6 @@ -95,13 +98,16 @@ where l_shipdate='1992-07-01' and l_orderkey=130; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Select tables optimized away -+1 SIMPLE lineitem ref PRIMARY,i_l_shipdate,i_l_orderkey,i_l_orderkey_quantity i_l_shipdate 4 const 6 Using where; Using index ++1 SIMPLE lineitem index_merge PRIMARY,i_l_shipdate,i_l_orderkey,i_l_orderkey_quantity i_l_orderkey,i_l_shipdate 4,4 NULL 1 Using intersect(i_l_orderkey,i_l_shipdate); Using where; Using index flush status; select max(l_linenumber) from lineitem where l_shipdate='1992-07-01' and l_orderkey=130; -@@ -145,7 +145,7 @@ +@@ -143,9 +143,9 @@ + show status like 'handler_read%'; + Variable_name Value Handler_read_first 0 - Handler_read_key 1 +-Handler_read_key 1 ++Handler_read_key 2 Handler_read_last 0 -Handler_read_next 0 +Handler_read_next 6 @@ -249,7 +255,7 @@ drop table t1,t2,t3; # # Bug mdev-4340: performance regression with extended_keys=on -@@ -714,13 +714,13 @@ +@@ -725,13 +725,13 @@ select * from t1 force index(index_date_updated) where index_date_updated= 10 and index_id < 800; id select_type table type possible_keys key key_len ref rows Extra @@ -265,7 +271,7 @@ drop table t0,t1,t2; # # MDEV-11196: Error:Run-Time Check Failure #2 - Stack around the variable 'key_buff' -@@ -755,11 +755,12 @@ +@@ -766,13 +766,14 @@ "select_id": 1, "table": { "table_name": "t1", @@ -279,9 +285,12 @@ + "used_key_parts": ["f2"], + "ref": ["const"], "rows": 1, - "filtered": 100, +- "filtered": 50, ++ "filtered": 100, "index_condition": "t1.pk1 <= 5 and t1.pk2 <= 5 and t1.f2 = 'abc'", -@@ -788,8 +789,8 @@ + "attached_condition": "t1.f1 <= '3'" + } +@@ -799,8 +800,8 @@ "access_type": "range", "possible_keys": ["k1"], "key": "k1", @@ -290,5 +299,5 @@ + "key_length": "3007", + "used_key_parts": ["pk1", "f2"], "rows": 1, - "filtered": 100, + "filtered": 50, "index_condition": "t1.f2 <= 5 and t1.pk2 <= 5 and t1.pk1 = 'abc'", diff --git a/mysql-test/main/innodb_ext_key.result b/mysql-test/main/innodb_ext_key.result index 27c2299c2ec..8cc7cfce861 100644 --- a/mysql-test/main/innodb_ext_key.result +++ b/mysql-test/main/innodb_ext_key.result @@ -385,8 +385,8 @@ SELECT a FROM t1 AS t, t2 WHERE c = a AND b IN (SELECT b FROM t1, t2 WHERE b = t.b); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t index a,b b 7 NULL 10 Using index -1 PRIMARY t1 ref b b 3 test.t.b 2 Using index; Start temporary -1 PRIMARY t2 index NULL PRIMARY 4 NULL 11 Using index; End temporary; Using join buffer (flat, BNL join) +1 PRIMARY t1 ref b b 3 test.t.b 2 Using index +1 PRIMARY t2 index NULL PRIMARY 4 NULL 11 Using index; FirstMatch(t) 1 PRIMARY t2 eq_ref PRIMARY PRIMARY 4 test.t.a 1 Using index SELECT a FROM t1 AS t, t2 WHERE c = a AND b IN (SELECT b FROM t1, t2 WHERE b = t.b); @@ -638,14 +638,14 @@ test.t2 analyze status Engine-independent statistics collected test.t2 analyze status OK explain select a from t1 where b is null order by a desc limit 2; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 index b PRIMARY 8 NULL 2 Using where +1 SIMPLE t1 range b b 9 NULL 3 Using where; Using filesort select a from t1 where b is null order by a desc limit 2; a 3 2 explain select a from t2 where b is null order by a desc limit 2; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 range b b 9 NULL 3 Using where; Using filesort +1 SIMPLE t2 index b PRIMARY 8 NULL 2 Using where select a from t2 where b is null order by a desc limit 2; a 3 @@ -772,7 +772,7 @@ EXPLAIN "key_length": "3070", "used_key_parts": ["f2", "pk1"], "rows": 1, - "filtered": 100, + "filtered": 50, "index_condition": "t1.pk1 <= 5 and t1.pk2 <= 5 and t1.f2 = 'abc'", "attached_condition": "t1.f1 <= '3'" } @@ -802,7 +802,7 @@ EXPLAIN "key_length": "3011", "used_key_parts": ["pk1", "f2", "pk2"], "rows": 1, - "filtered": 100, + "filtered": 50, "index_condition": "t1.f2 <= 5 and t1.pk2 <= 5 and t1.pk1 = 'abc'", "attached_condition": "t1.f1 <= '3'" } diff --git a/mysql-test/main/innodb_icp.result b/mysql-test/main/innodb_icp.result index e08faa142cf..54594e2496a 100644 --- a/mysql-test/main/innodb_icp.result +++ b/mysql-test/main/innodb_icp.result @@ -436,8 +436,8 @@ SELECT * FROM t1 WHERE pk IN (SELECT it.pk FROM t2 JOIN t2 AS it ON it.i=it.i WHERE it.pk-t1.i<10); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL # Using where +2 DEPENDENT SUBQUERY t2 index NULL PRIMARY 4 NULL # Using index 2 DEPENDENT SUBQUERY it eq_ref PRIMARY PRIMARY 4 func # Using where -2 DEPENDENT SUBQUERY t2 index NULL PRIMARY 4 NULL # Using index; Using join buffer (flat, BNL join) SELECT * FROM t1 WHERE pk IN (SELECT it.pk FROM t2 JOIN t2 AS it ON it.i=it.i WHERE it.pk-t1.i<10); pk i diff --git a/mysql-test/main/join.result b/mysql-test/main/join.result index 6ea42ea6588..942fc3af4ea 100644 --- a/mysql-test/main/join.result +++ b/mysql-test/main/join.result @@ -880,7 +880,7 @@ select @a:= A.a + 10*(B.a + 10*C.a), @a, 'filler' from t1 A, t1 B, t1 C; insert into t3 select * from t2 where a < 800; explain select * from t2,t3 where t2.a < 200 and t2.b=t3.b; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 ALL a,b NULL NULL NULL 1000 Using where +1 SIMPLE t2 range a,b a 5 NULL 198 Using index condition; Using where 1 SIMPLE t3 ref b b 5 test.t2.b 1 drop table t1, t2, t3; create table t1 (a int); @@ -892,13 +892,14 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 10 show status like '%cost%'; Variable_name Value -Last_query_cost 6.016090 +Last_query_cost 4.008545 select 'The cost of accessing t1 (dont care if it changes' '^'; The cost of accessing t1 (dont care if it changes The cost of accessing t1 (dont care if it changes^ select 'vv: Following query must use ALL(t1), eq_ref(A), eq_ref(B): vv' Z; Z vv: Following query must use ALL(t1), eq_ref(A), eq_ref(B): vv +set @@optimizer_cache_hit_ratio=0; explain select * from t1, t2 A, t2 B where A.a = t1.a and B.a=A.b; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 10 Using where @@ -906,10 +907,11 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE B eq_ref PRIMARY PRIMARY 4 test.A.b 1 show status like '%cost%'; Variable_name Value -Last_query_cost 34.016090 -select '^^: The above should be ~= 20 + cost(select * from t1). Value less than 20 is an error' Z; +Last_query_cost 49.027829 +select '^^: The above should be ~= 40 + cost(select * from t1). Value less than 40 is an error' Z; Z -^^: The above should be ~= 20 + cost(select * from t1). Value less than 20 is an error +^^: The above should be ~= 40 + cost(select * from t1). Value less than 40 is an error +set @@optimizer_cache_hit_ratio=default; drop table t1, t2; CREATE TABLE t1 (a INT PRIMARY KEY, b INT); CREATE TABLE t2 (c INT PRIMARY KEY, d INT); @@ -1274,20 +1276,24 @@ test.t1 analyze status Engine-independent statistics collected test.t1 analyze status OK test.t2 analyze status Engine-independent statistics collected test.t2 analyze status OK +explain SELECT * FROM t1 JOIN t2 ON t1.v = t2.v WHERE t2.v IS NULL ORDER BY 1; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 ALL ix2 NULL NULL NULL 2 Using where; Using temporary; Using filesort +1 SIMPLE t1 ref ix1 ix1 5 test.t2.v 1 FLUSH STATUS; SELECT * FROM t1 JOIN t2 ON t1.v = t2.v WHERE t2.v IS NULL ORDER BY 1; pk v pk v SHOW STATUS LIKE 'Handler_read_%'; Variable_name Value Handler_read_first 0 -Handler_read_key 14 +Handler_read_key 0 Handler_read_last 0 Handler_read_next 0 Handler_read_prev 0 Handler_read_retry 0 Handler_read_rnd 0 Handler_read_rnd_deleted 0 -Handler_read_rnd_next 1 +Handler_read_rnd_next 4 DROP TABLE t1, t2; End of 5.1 tests # @@ -1473,8 +1479,8 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE DU system dog_id NULL NULL NULL 1 1 SIMPLE D system PRIMARY NULL NULL NULL 1 1 SIMPLE DSAR system NULL NULL NULL NULL 1 -1 SIMPLE DSA ref PRIMARY PRIMARY 4 const 3 Using where; Using index -1 SIMPLE DT ALL t_id NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join) +1 SIMPLE DT ALL t_id NULL NULL NULL 2 Using where +1 SIMPLE DSA ref PRIMARY PRIMARY 8 const,test.DT.t_id,func 1 Using index SELECT * FROM t5 DU, t1 D, t4 DT, t2 DSA, t3 DSAR WHERE DU.dog_id=D.dog_id AND D.dog_id=DT.dog_id AND D.birthday=DT.birthday AND DT.t_id=DSA.t_id AND DT.birthday=DSA.birthday AND DSA.dog_id=DSAR.dog_id; diff --git a/mysql-test/main/join.test b/mysql-test/main/join.test index bc8a83c0bb8..e21d0c12360 100644 --- a/mysql-test/main/join.test +++ b/mysql-test/main/join.test @@ -697,12 +697,11 @@ select 'The cost of accessing t1 (dont care if it changes' '^'; select 'vv: Following query must use ALL(t1), eq_ref(A), eq_ref(B): vv' Z; +set @@optimizer_cache_hit_ratio=0; explain select * from t1, t2 A, t2 B where A.a = t1.a and B.a=A.b; show status like '%cost%'; -select '^^: The above should be ~= 20 + cost(select * from t1). Value less than 20 is an error' Z; - - - +select '^^: The above should be ~= 40 + cost(select * from t1). Value less than 40 is an error' Z; +set @@optimizer_cache_hit_ratio=default; drop table t1, t2; # @@ -957,6 +956,9 @@ INSERT INTO t1 VALUES (3,'b'),(4,NULL),(5,'c'),(6,'cc'),(7,'d'), (8,'dd'),(9,'e'),(10,'ee'); INSERT INTO t2 VALUES (2,NULL); ANALYZE TABLE t1,t2; +# This will ensure that status tables are read now and not part of the later +# Handler_read% counts +explain SELECT * FROM t1 JOIN t2 ON t1.v = t2.v WHERE t2.v IS NULL ORDER BY 1; FLUSH STATUS; SELECT * FROM t1 JOIN t2 ON t1.v = t2.v WHERE t2.v IS NULL ORDER BY 1; SHOW STATUS LIKE 'Handler_read_%'; diff --git a/mysql-test/main/join_cache.result b/mysql-test/main/join_cache.result index f035503d0ef..807aea7465b 100644 --- a/mysql-test/main/join_cache.result +++ b/mysql-test/main/join_cache.result @@ -53,6 +53,7 @@ set join_cache_level=1; show variables like 'join_cache_level'; Variable_name Value join_cache_level 1 +# Query 1 EXPLAIN SELECT City.Name, Country.Name FROM City,Country WHERE City.Country=Country.Code AND @@ -60,6 +61,7 @@ Country.Name LIKE 'L%' AND City.Population > 100000; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE Country ALL NULL NULL NULL NULL 239 Using where 1 SIMPLE City ALL NULL NULL NULL NULL 4079 Using where; Using join buffer (flat, BNL join) +# Query 2 SELECT City.Name, Country.Name FROM City,Country WHERE City.Country=Country.Code AND Country.Name LIKE 'L%' AND City.Population > 100000; @@ -79,6 +81,7 @@ Tripoli Lebanon Tripoli Libyan Arab Jamahiriya Vientiane Laos Vilnius Lithuania +# Query 3 EXPLAIN SELECT City.Name, Country.Name, CountryLanguage.Language FROM City,Country,CountryLanguage @@ -91,6 +94,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE Country ALL NULL NULL NULL NULL 239 Using where 1 SIMPLE CountryLanguage ALL NULL NULL NULL NULL 984 Using where; Using join buffer (flat, BNL join) 1 SIMPLE City ALL NULL NULL NULL NULL 4079 Using where; Using join buffer (flat, BNL join) +# Query 4 SELECT City.Name, Country.Name, CountryLanguage.Language FROM City,Country,CountryLanguage WHERE City.Country=Country.Code AND @@ -131,6 +135,7 @@ set join_cache_level=2; show variables like 'join_cache_level'; Variable_name Value join_cache_level 2 +# join_cache_level 2, Query 1 EXPLAIN SELECT City.Name, Country.Name FROM City,Country WHERE City.Country=Country.Code AND @@ -138,6 +143,7 @@ Country.Name LIKE 'L%' AND City.Population > 100000; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE Country ALL NULL NULL NULL NULL 239 Using where 1 SIMPLE City ALL NULL NULL NULL NULL 4079 Using where; Using join buffer (flat, BNL join) +# join_cache_level 2, Query 2 SELECT City.Name, Country.Name FROM City,Country WHERE City.Country=Country.Code AND Country.Name LIKE 'L%' AND City.Population > 100000; @@ -157,6 +163,7 @@ Tripoli Lebanon Tripoli Libyan Arab Jamahiriya Vientiane Laos Vilnius Lithuania +# join_cache_level 2, Query 3 EXPLAIN SELECT City.Name, Country.Name, CountryLanguage.Language FROM City,Country,CountryLanguage @@ -169,6 +176,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE Country ALL NULL NULL NULL NULL 239 Using where 1 SIMPLE CountryLanguage ALL NULL NULL NULL NULL 984 Using where; Using join buffer (flat, BNL join) 1 SIMPLE City ALL NULL NULL NULL NULL 4079 Using where; Using join buffer (incremental, BNL join) +# join_cache_level 2, Query 4 SELECT City.Name, Country.Name, CountryLanguage.Language FROM City,Country,CountryLanguage WHERE City.Country=Country.Code AND @@ -209,6 +217,7 @@ set join_cache_level=3; show variables like 'join_cache_level'; Variable_name Value join_cache_level 3 +# join_cache_level 3, Query 1 EXPLAIN SELECT City.Name, Country.Name FROM City,Country WHERE City.Country=Country.Code AND @@ -216,6 +225,7 @@ Country.Name LIKE 'L%' AND City.Population > 100000; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE Country ALL NULL NULL NULL NULL 239 Using where 1 SIMPLE City hash_ALL NULL #hash#$hj 3 world.Country.Code 4079 Using where; Using join buffer (flat, BNLH join) +# join_cache_level 3, Query 2 SELECT City.Name, Country.Name FROM City,Country WHERE City.Country=Country.Code AND Country.Name LIKE 'L%' AND City.Population > 100000; @@ -235,6 +245,7 @@ Tripoli Lebanon Tripoli Libyan Arab Jamahiriya Vientiane Laos Vilnius Lithuania +# join_cache_level 3, Query 3 EXPLAIN SELECT City.Name, Country.Name, CountryLanguage.Language FROM City,Country,CountryLanguage @@ -247,6 +258,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE Country ALL NULL NULL NULL NULL 239 Using where 1 SIMPLE CountryLanguage hash_ALL NULL #hash#$hj 3 world.Country.Code 984 Using where; Using join buffer (flat, BNLH join) 1 SIMPLE City hash_ALL NULL #hash#$hj 3 world.Country.Code 4079 Using where; Using join buffer (flat, BNLH join) +# join_cache_level 3, Query 4 SELECT City.Name, Country.Name, CountryLanguage.Language FROM City,Country,CountryLanguage WHERE City.Country=Country.Code AND @@ -287,6 +299,7 @@ set join_cache_level=4; show variables like 'join_cache_level'; Variable_name Value join_cache_level 4 +# join_cache_level 4, Query 1 EXPLAIN SELECT City.Name, Country.Name FROM City,Country WHERE City.Country=Country.Code AND @@ -294,6 +307,7 @@ Country.Name LIKE 'L%' AND City.Population > 100000; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE Country ALL NULL NULL NULL NULL 239 Using where 1 SIMPLE City hash_ALL NULL #hash#$hj 3 world.Country.Code 4079 Using where; Using join buffer (flat, BNLH join) +# join_cache_level 4, Query 2 SELECT City.Name, Country.Name FROM City,Country WHERE City.Country=Country.Code AND Country.Name LIKE 'L%' AND City.Population > 100000; @@ -313,6 +327,7 @@ Tripoli Lebanon Tripoli Libyan Arab Jamahiriya Vientiane Laos Vilnius Lithuania +# join_cache_level 4, Query 3 EXPLAIN SELECT City.Name, Country.Name, CountryLanguage.Language FROM City,Country,CountryLanguage @@ -325,6 +340,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE Country ALL NULL NULL NULL NULL 239 Using where 1 SIMPLE CountryLanguage hash_ALL NULL #hash#$hj 3 world.Country.Code 984 Using where; Using join buffer (flat, BNLH join) 1 SIMPLE City hash_ALL NULL #hash#$hj 3 world.Country.Code 4079 Using where; Using join buffer (incremental, BNLH join) +# join_cache_level 4, Query 4 SELECT City.Name, Country.Name, CountryLanguage.Language FROM City,Country,CountryLanguage WHERE City.Country=Country.Code AND @@ -361,6 +377,7 @@ Ludwigshafen am Rhein Germany German Lungtan Taiwan Min L´Hospitalet de Llobregat Spain Spanish Lázaro Cárdenas Mexico Spanish +# join_cache_level 4, Query 5 SELECT Country.Name, Country.Population, City.Name, City.Population FROM Country LEFT JOIN City ON City.Country=Country.Code AND City.Population > 5000000 @@ -379,6 +396,7 @@ Canada 31147000 NULL NULL Cuba 11201000 NULL NULL Côte d?Ivoire 14786000 NULL NULL Czech Republic 10278100 NULL NULL +# join_cache_level 4, Query 6 SELECT Country.Name, Country.Population, City.Name, City.Population FROM Country LEFT JOIN City ON City.Country=Country.Code AND @@ -404,6 +422,7 @@ Czech Republic 10278100 NULL NULL CREATE INDEX City_Population ON City(Population); CREATE INDEX City_Name ON City(Name); ANALYZE TABLE City; +# After Analyze, Query 1 EXPLAIN SELECT Country.Name, Country.Population, City.Name, City.Population FROM Country LEFT JOIN City @@ -412,6 +431,7 @@ WHERE Country.Name LIKE 'C%' AND Country.Population > 10000000; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE Country ALL NULL NULL NULL NULL 239 Using where 1 SIMPLE City hash_range City_Population #hash#$hj:City_Population 3:4 world.Country.Code 24 Using where; Rowid-ordered scan; Using join buffer (flat, BNLH join) +# After Analyze, Query 2 SELECT Country.Name, Country.Population, City.Name, City.Population FROM Country LEFT JOIN City ON City.Country=Country.Code AND City.Population > 5000000 @@ -430,6 +450,7 @@ Canada 31147000 NULL NULL Cuba 11201000 NULL NULL Côte d?Ivoire 14786000 NULL NULL Czech Republic 10278100 NULL NULL +# After Analyze, Query 3 EXPLAIN SELECT Country.Name, Country.Population, City.Name, City.Population FROM Country LEFT JOIN City @@ -439,6 +460,7 @@ WHERE Country.Name LIKE 'C%' AND Country.Population > 10000000; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE Country ALL NULL NULL NULL NULL 239 Using where 1 SIMPLE City hash_index_merge City_Population,City_Name #hash#$hj:City_Population,City_Name 3:4,35 world.Country.Code 96 Using sort_union(City_Population,City_Name); Using where; Using join buffer (flat, BNLH join) +# After Analyze, Query 4 SELECT Country.Name, Country.Population, City.Name, City.Population FROM Country LEFT JOIN City ON City.Country=Country.Code AND @@ -471,6 +493,7 @@ join_buffer_size 256 show variables like 'join_cache_level'; Variable_name Value join_cache_level 1 +# join_cache_level 1, Join_buffer_size, Query 1 EXPLAIN SELECT City.Name, Country.Name FROM City,Country WHERE City.Country=Country.Code AND @@ -478,6 +501,7 @@ Country.Name LIKE 'L%' AND City.Population > 100000; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE Country ALL NULL NULL NULL NULL 239 Using where 1 SIMPLE City ALL NULL NULL NULL NULL 4079 Using where; Using join buffer (flat, BNL join) +# join_cache_level 1, Join_buffer_size, Query 2 SELECT City.Name, Country.Name FROM City,Country WHERE City.Country=Country.Code AND Country.Name LIKE 'L%' AND City.Population > 100000; @@ -497,6 +521,7 @@ Tripoli Lebanon Tripoli Libyan Arab Jamahiriya Vientiane Laos Vilnius Lithuania +# join_cache_level 1, Join_buffer_size, Query 3 EXPLAIN SELECT City.Name, Country.Name, CountryLanguage.Language FROM City,Country,CountryLanguage @@ -509,6 +534,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE Country ALL NULL NULL NULL NULL 239 Using where 1 SIMPLE CountryLanguage ALL NULL NULL NULL NULL 984 Using where; Using join buffer (flat, BNL join) 1 SIMPLE City ALL NULL NULL NULL NULL 4079 Using where; Using join buffer (flat, BNL join) +# join_cache_level 1, Join_buffer_size, Query 4 SELECT City.Name, Country.Name, CountryLanguage.Language FROM City,Country,CountryLanguage WHERE City.Country=Country.Code AND @@ -549,6 +575,7 @@ set join_cache_level=2; show variables like 'join_cache_level'; Variable_name Value join_cache_level 2 +# join_cache_level 2, Join_buffer_size, Query 1 EXPLAIN SELECT City.Name, Country.Name FROM City,Country WHERE City.Country=Country.Code AND @@ -556,6 +583,7 @@ Country.Name LIKE 'L%' AND City.Population > 100000; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE Country ALL NULL NULL NULL NULL 239 Using where 1 SIMPLE City ALL NULL NULL NULL NULL 4079 Using where; Using join buffer (flat, BNL join) +# join_cache_level 2, Join_buffer_size, Query 2 SELECT City.Name, Country.Name FROM City,Country WHERE City.Country=Country.Code AND Country.Name LIKE 'L%' AND City.Population > 100000; @@ -575,6 +603,7 @@ Tripoli Lebanon Tripoli Libyan Arab Jamahiriya Vientiane Laos Vilnius Lithuania +# join_cache_level 2, Join_buffer_size, Query 3 EXPLAIN SELECT City.Name, Country.Name, CountryLanguage.Language FROM City,Country,CountryLanguage @@ -587,6 +616,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE Country ALL NULL NULL NULL NULL 239 Using where 1 SIMPLE CountryLanguage ALL NULL NULL NULL NULL 984 Using where; Using join buffer (flat, BNL join) 1 SIMPLE City ALL NULL NULL NULL NULL 4079 Using where; Using join buffer (incremental, BNL join) +# join_cache_level 2, Join_buffer_size, Query 4 SELECT City.Name, Country.Name, CountryLanguage.Language FROM City,Country,CountryLanguage WHERE City.Country=Country.Code AND @@ -627,6 +657,7 @@ set join_cache_level=3; show variables like 'join_cache_level'; Variable_name Value join_cache_level 3 +# join_cache_level 3, Join_buffer_size, Query 1 EXPLAIN SELECT City.Name, Country.Name FROM City,Country WHERE City.Country=Country.Code AND @@ -634,6 +665,7 @@ Country.Name LIKE 'L%' AND City.Population > 100000; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE Country ALL NULL NULL NULL NULL 239 Using where 1 SIMPLE City hash_ALL NULL #hash#$hj 3 world.Country.Code 4079 Using where; Using join buffer (flat, BNLH join) +# join_cache_level 3, Join_buffer_size, Query 2 SELECT City.Name, Country.Name FROM City,Country WHERE City.Country=Country.Code AND Country.Name LIKE 'L%' AND City.Population > 100000; @@ -653,6 +685,7 @@ Tripoli Lebanon Tripoli Libyan Arab Jamahiriya Vientiane Laos Vilnius Lithuania +# join_cache_level 3, Join_buffer_size, Query 3 EXPLAIN SELECT City.Name, Country.Name, CountryLanguage.Language FROM City,Country,CountryLanguage @@ -665,6 +698,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE Country ALL NULL NULL NULL NULL 239 Using where 1 SIMPLE CountryLanguage hash_ALL NULL #hash#$hj 3 world.Country.Code 984 Using where; Using join buffer (flat, BNLH join) 1 SIMPLE City hash_ALL NULL #hash#$hj 3 world.Country.Code 4079 Using where; Using join buffer (flat, BNLH join) +# join_cache_level 3, Join_buffer_size, Query 4 SELECT City.Name, Country.Name, CountryLanguage.Language FROM City,Country,CountryLanguage WHERE City.Country=Country.Code AND @@ -705,6 +739,7 @@ set join_cache_level=4; show variables like 'join_cache_level'; Variable_name Value join_cache_level 4 +# join_cache_level 4, Join_buffer_size, Query 1 EXPLAIN SELECT City.Name, Country.Name FROM City,Country WHERE City.Country=Country.Code AND @@ -712,6 +747,7 @@ Country.Name LIKE 'L%' AND City.Population > 100000; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE Country ALL NULL NULL NULL NULL 239 Using where 1 SIMPLE City hash_ALL NULL #hash#$hj 3 world.Country.Code 4079 Using where; Using join buffer (flat, BNLH join) +# join_cache_level 4, Join_buffer_size, Query 2 SELECT City.Name, Country.Name FROM City,Country WHERE City.Country=Country.Code AND Country.Name LIKE 'L%' AND City.Population > 100000; @@ -731,6 +767,7 @@ Tripoli Lebanon Tripoli Libyan Arab Jamahiriya Vientiane Laos Vilnius Lithuania +# join_cache_level 4, Join_buffer_size, Query 3 EXPLAIN SELECT City.Name, Country.Name, CountryLanguage.Language FROM City,Country,CountryLanguage @@ -743,6 +780,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE Country ALL NULL NULL NULL NULL 239 Using where 1 SIMPLE CountryLanguage hash_ALL NULL #hash#$hj 3 world.Country.Code 984 Using where; Using join buffer (flat, BNLH join) 1 SIMPLE City hash_ALL NULL #hash#$hj 3 world.Country.Code 4079 Using where; Using join buffer (incremental, BNLH join) +# join_cache_level 4, Join_buffer_size, Query 4 SELECT City.Name, Country.Name, CountryLanguage.Language FROM City,Country,CountryLanguage WHERE City.Country=Country.Code AND @@ -816,6 +854,7 @@ set join_cache_level=3; show variables like 'join_cache_level'; Variable_name Value join_cache_level 3 +# Part 2, join_cache_level=3, Query 1 EXPLAIN SELECT City.Name, Country.Name FROM City,Country WHERE City.Country=Country.Code AND @@ -823,6 +862,7 @@ Country.Name LIKE 'L%' AND City.Population > 100000; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE Country range PRIMARY,Name Name 52 NULL 10 Using index condition; Rowid-ordered scan 1 SIMPLE City hash_ALL Population,Country #hash#Country 3 world.Country.Code 4079 Using where; Using join buffer (flat, BNLH join) +# Part 2, join_cache_level=3, Query 2 SELECT City.Name, Country.Name FROM City,Country WHERE City.Country=Country.Code AND Country.Name LIKE 'L%' AND City.Population > 100000; @@ -842,6 +882,7 @@ Tripoli Lebanon Tripoli Libyan Arab Jamahiriya Vientiane Laos Vilnius Lithuania +# Part 2, join_cache_level=3, Query 3 EXPLAIN SELECT City.Name, Country.Name, CountryLanguage.Language FROM City,Country,CountryLanguage @@ -851,9 +892,10 @@ City.Name LIKE 'L%' AND Country.Population > 3000000 AND CountryLanguage.Percentage > 50 AND LENGTH(Language) < LENGTH(City.Name) - 2; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City ALL Country NULL NULL NULL 4079 Using where -1 SIMPLE Country hash_ALL PRIMARY #hash#PRIMARY 3 world.City.Country 239 Using where; Using join buffer (flat, BNLH join) -1 SIMPLE CountryLanguage hash_ALL|filter PRIMARY,Percentage #hash#PRIMARY|Percentage 3|4 world.City.Country 984 (19%) Using where; Using join buffer (flat, BNLH join); Using rowid filter +1 SIMPLE Country ALL PRIMARY NULL NULL NULL 239 Using where +1 SIMPLE CountryLanguage hash_range PRIMARY,Percentage #hash#PRIMARY:Percentage 3:4 world.Country.Code 185 Using where; Rowid-ordered scan; Using join buffer (flat, BNLH join) +1 SIMPLE City hash_ALL Country #hash#Country 3 world.Country.Code 4079 Using where; Using join buffer (flat, BNLH join) +# Part 2, join_cache_level=3, Query 4 SELECT City.Name, Country.Name, CountryLanguage.Language FROM City,Country,CountryLanguage WHERE City.Country=Country.Code AND @@ -890,6 +932,7 @@ Ludwigshafen am Rhein Germany German Lungtan Taiwan Min L´Hospitalet de Llobregat Spain Spanish Lázaro Cárdenas Mexico Spanish +# Part 2, join_cache_level=3, Query 5 EXPLAIN SELECT Name FROM City WHERE City.Country IN (SELECT Code FROM Country WHERE Country.Name LIKE 'L%') AND @@ -897,6 +940,7 @@ City.Population > 100000; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY Country range PRIMARY,Name Name 52 NULL 10 Using index condition; Rowid-ordered scan 1 PRIMARY City hash_ALL Population,Country #hash#Country 3 world.Country.Code 4079 Using where; Using join buffer (flat, BNLH join) +# Part 2, join_cache_level=3, Query 6 SELECT Name FROM City WHERE City.Country IN (SELECT Code FROM Country WHERE Country.Name LIKE 'L%') AND City.Population > 100000; @@ -916,6 +960,7 @@ Kaunas Klaipeda ?iauliai Panevezys +# Part 2, join_cache_level=3, Query 7 EXPLAIN SELECT Country.Name, IF(ISNULL(CountryLanguage.Country), NULL, CountryLanguage.Percentage) FROM Country LEFT JOIN CountryLanguage ON @@ -925,6 +970,7 @@ Country.Population > 10000000; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE Country ALL NULL NULL NULL NULL 239 Using where 1 SIMPLE CountryLanguage hash_ALL PRIMARY #hash#PRIMARY 33 world.Country.Code,const 984 Using where; Using join buffer (flat, BNLH join) +# Part 2, join_cache_level=3, Query 8 SELECT Country.Name, IF(ISNULL(CountryLanguage.Country), NULL, CountryLanguage.Percentage) FROM Country LEFT JOIN CountryLanguage ON (CountryLanguage.Country=Country.Code AND Language='English') @@ -1016,6 +1062,7 @@ set join_cache_level=4; show variables like 'join_cache_level'; Variable_name Value join_cache_level 4 +# Part 2, join_cache_level=4, Query 1 EXPLAIN SELECT City.Name, Country.Name FROM City,Country WHERE City.Country=Country.Code AND @@ -1023,6 +1070,7 @@ Country.Name LIKE 'L%' AND City.Population > 100000; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE Country range PRIMARY,Name Name 52 NULL 10 Using index condition; Rowid-ordered scan 1 SIMPLE City hash_ALL Population,Country #hash#Country 3 world.Country.Code 4079 Using where; Using join buffer (flat, BNLH join) +# Part 2, join_cache_level=4, Query 2 SELECT City.Name, Country.Name FROM City,Country WHERE City.Country=Country.Code AND Country.Name LIKE 'L%' AND City.Population > 100000; @@ -1042,6 +1090,7 @@ Tripoli Lebanon Tripoli Libyan Arab Jamahiriya Vientiane Laos Vilnius Lithuania +# Part 2, join_cache_level=4, Query 3 EXPLAIN SELECT City.Name, Country.Name, CountryLanguage.Language FROM City,Country,CountryLanguage @@ -1051,9 +1100,10 @@ City.Name LIKE 'L%' AND Country.Population > 3000000 AND CountryLanguage.Percentage > 50 AND LENGTH(Language) < LENGTH(City.Name) - 2; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City ALL Country NULL NULL NULL 4079 Using where -1 SIMPLE Country hash_ALL PRIMARY #hash#PRIMARY 3 world.City.Country 239 Using where; Using join buffer (flat, BNLH join) -1 SIMPLE CountryLanguage hash_ALL|filter PRIMARY,Percentage #hash#PRIMARY|Percentage 3|4 world.City.Country 984 (19%) Using where; Using join buffer (incremental, BNLH join); Using rowid filter +1 SIMPLE Country ALL PRIMARY NULL NULL NULL 239 Using where +1 SIMPLE CountryLanguage hash_range PRIMARY,Percentage #hash#PRIMARY:Percentage 3:4 world.Country.Code 185 Using where; Rowid-ordered scan; Using join buffer (flat, BNLH join) +1 SIMPLE City hash_ALL Country #hash#Country 3 world.Country.Code 4079 Using where; Using join buffer (incremental, BNLH join) +# Part 2, join_cache_level=4, Query 4 SELECT City.Name, Country.Name, CountryLanguage.Language FROM City,Country,CountryLanguage WHERE City.Country=Country.Code AND @@ -1090,6 +1140,7 @@ Ludwigshafen am Rhein Germany German Lungtan Taiwan Min L´Hospitalet de Llobregat Spain Spanish Lázaro Cárdenas Mexico Spanish +# Part 2, join_cache_level=4, Query 5 EXPLAIN SELECT Name FROM City WHERE City.Country IN (SELECT Code FROM Country WHERE Country.Name LIKE 'L%') AND @@ -1097,6 +1148,7 @@ City.Population > 100000; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY Country range PRIMARY,Name Name 52 NULL 10 Using index condition; Rowid-ordered scan 1 PRIMARY City hash_ALL Population,Country #hash#Country 3 world.Country.Code 4079 Using where; Using join buffer (flat, BNLH join) +# Part 2, join_cache_level=4, Query 6 SELECT Name FROM City WHERE City.Country IN (SELECT Code FROM Country WHERE Country.Name LIKE 'L%') AND City.Population > 100000; @@ -1116,6 +1168,7 @@ Kaunas Klaipeda ?iauliai Panevezys +# Part 2, join_cache_level=4, Query 7 EXPLAIN SELECT Country.Name, IF(ISNULL(CountryLanguage.Country), NULL, CountryLanguage.Percentage) FROM Country LEFT JOIN CountryLanguage ON @@ -1125,6 +1178,7 @@ Country.Population > 10000000; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE Country ALL NULL NULL NULL NULL 239 Using where 1 SIMPLE CountryLanguage hash_ALL PRIMARY #hash#PRIMARY 33 world.Country.Code,const 984 Using where; Using join buffer (flat, BNLH join) +# Part 2, join_cache_level=4, Query 8 SELECT Country.Name, IF(ISNULL(CountryLanguage.Country), NULL, CountryLanguage.Percentage) FROM Country LEFT JOIN CountryLanguage ON (CountryLanguage.Country=Country.Code AND Language='English') @@ -1209,6 +1263,7 @@ Belarus NULL Venezuela NULL Russian Federation NULL Vietnam NULL +# Part 2, join_cache_level=4, Query 9 EXPLAIN SELECT Country.Name, Country.Population, City.Name, City.Population FROM Country LEFT JOIN City @@ -1217,6 +1272,7 @@ WHERE Country.Name LIKE 'C%' AND Country.Population > 10000000; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE Country range Name Name 52 NULL # Using index condition; Using where; Rowid-ordered scan 1 SIMPLE City hash_range Population,Country #hash#Country:Population 3:4 world.Country.Code # Using where; Rowid-ordered scan; Using join buffer (flat, BNLH join) +# Part 2, join_cache_level=4, Query 10 SELECT Country.Name, Country.Population, City.Name, City.Population FROM Country LEFT JOIN City ON City.Country=Country.Code AND City.Population > 5000000 @@ -1236,6 +1292,7 @@ Cuba 11201000 NULL NULL Côte d?Ivoire 14786000 NULL NULL Czech Republic 10278100 NULL NULL CREATE INDEX City_Name ON City(Name); +# Part 2, join_cache_level=4, City_Name, Query 1 EXPLAIN SELECT Country.Name, Country.Population, City.Name, City.Population FROM Country LEFT JOIN City @@ -1245,6 +1302,7 @@ WHERE Country.Name LIKE 'C%' AND Country.Population > 10000000; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE Country range Name Name 52 NULL 17 Using index condition; Using where; Rowid-ordered scan 1 SIMPLE City hash_index_merge Population,Country,City_Name #hash#Country:Population,City_Name 3:4,35 world.Country.Code 96 Using sort_union(Population,City_Name); Using where; Using join buffer (flat, BNLH join) +# Part 2, join_cache_level=4, City_Name, Query 2 SELECT Country.Name, Country.Population, City.Name, City.Population FROM Country LEFT JOIN City ON City.Country=Country.Code AND @@ -1310,9 +1368,9 @@ City.Name LIKE 'L%' AND Country.Population > 3000000 AND CountryLanguage.Percentage > 50 AND LENGTH(Language) < LENGTH(City.Name) - 2; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City ALL Country NULL NULL NULL 4079 Using where -1 SIMPLE Country eq_ref PRIMARY PRIMARY 3 world.City.Country 1 Using where; Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan -1 SIMPLE CountryLanguage ref|filter PRIMARY,Percentage PRIMARY|Percentage 3|4 world.City.Country 4 (19%) Using index condition(BKA); Using where; Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan; Using rowid filter +1 SIMPLE Country ALL PRIMARY NULL NULL NULL 239 Using where +1 SIMPLE CountryLanguage ref|filter PRIMARY,Percentage PRIMARY|Percentage 3|4 world.Country.Code 4 (19%) Using where; Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan; Using rowid filter +1 SIMPLE City ref Country Country 3 world.Country.Code 17 Using where; Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan SELECT City.Name, Country.Name, CountryLanguage.Language FROM City,Country,CountryLanguage WHERE City.Country=Country.Code AND @@ -1507,9 +1565,9 @@ City.Name LIKE 'L%' AND Country.Population > 3000000 AND CountryLanguage.Percentage > 50 AND LENGTH(Language) < LENGTH(City.Name) - 2; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City ALL Country NULL NULL NULL 4079 Using where -1 SIMPLE Country eq_ref PRIMARY PRIMARY 3 world.City.Country 1 Using where; Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan -1 SIMPLE CountryLanguage ref|filter PRIMARY,Percentage PRIMARY|Percentage 3|4 world.City.Country 4 (19%) Using index condition(BKA); Using where; Using join buffer (incremental, BKA join); Key-ordered Rowid-ordered scan; Using rowid filter +1 SIMPLE Country ALL PRIMARY NULL NULL NULL 239 Using where +1 SIMPLE CountryLanguage ref|filter PRIMARY,Percentage PRIMARY|Percentage 3|4 world.Country.Code 4 (19%) Using where; Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan; Using rowid filter +1 SIMPLE City ref Country Country 3 world.Country.Code 17 Using where; Using join buffer (incremental, BKA join); Key-ordered Rowid-ordered scan SELECT City.Name, Country.Name, CountryLanguage.Language FROM City,Country,CountryLanguage WHERE City.Country=Country.Code AND @@ -1704,9 +1762,9 @@ City.Name LIKE 'L%' AND Country.Population > 3000000 AND CountryLanguage.Percentage > 50 AND LENGTH(Language) < LENGTH(City.Name) - 2; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City ALL Country NULL NULL NULL 4079 Using where -1 SIMPLE Country eq_ref PRIMARY PRIMARY 3 world.City.Country 1 Using where; Using join buffer (flat, BKAH join); Key-ordered Rowid-ordered scan -1 SIMPLE CountryLanguage ref|filter PRIMARY,Percentage PRIMARY|Percentage 3|4 world.City.Country 4 (19%) Using index condition(BKA); Using where; Using join buffer (flat, BKAH join); Key-ordered Rowid-ordered scan; Using rowid filter +1 SIMPLE Country ALL PRIMARY NULL NULL NULL 239 Using where +1 SIMPLE CountryLanguage ref|filter PRIMARY,Percentage PRIMARY|Percentage 3|4 world.Country.Code 4 (19%) Using where; Using join buffer (flat, BKAH join); Key-ordered Rowid-ordered scan; Using rowid filter +1 SIMPLE City ref Country Country 3 world.Country.Code 17 Using where; Using join buffer (flat, BKAH join); Key-ordered Rowid-ordered scan SELECT City.Name, Country.Name, CountryLanguage.Language FROM City,Country,CountryLanguage WHERE City.Country=Country.Code AND @@ -1901,9 +1959,9 @@ City.Name LIKE 'L%' AND Country.Population > 3000000 AND CountryLanguage.Percentage > 50 AND LENGTH(Language) < LENGTH(City.Name) - 2; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City ALL Country NULL NULL NULL 4079 Using where -1 SIMPLE Country eq_ref PRIMARY PRIMARY 3 world.City.Country 1 Using where; Using join buffer (flat, BKAH join); Key-ordered Rowid-ordered scan -1 SIMPLE CountryLanguage ref|filter PRIMARY,Percentage PRIMARY|Percentage 3|4 world.City.Country 4 (19%) Using index condition(BKA); Using where; Using join buffer (incremental, BKAH join); Key-ordered Rowid-ordered scan; Using rowid filter +1 SIMPLE Country ALL PRIMARY NULL NULL NULL 239 Using where +1 SIMPLE CountryLanguage ref|filter PRIMARY,Percentage PRIMARY|Percentage 3|4 world.Country.Code 4 (19%) Using where; Using join buffer (flat, BKAH join); Key-ordered Rowid-ordered scan; Using rowid filter +1 SIMPLE City ref Country Country 3 world.Country.Code 17 Using where; Using join buffer (incremental, BKAH join); Key-ordered Rowid-ordered scan SELECT City.Name, Country.Name, CountryLanguage.Language FROM City,Country,CountryLanguage WHERE City.Country=Country.Code AND @@ -2102,9 +2160,9 @@ City.Name LIKE 'L%' AND Country.Population > 3000000 AND CountryLanguage.Percentage > 50 AND LENGTH(Language) < LENGTH(City.Name) - 2; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City ALL Country NULL NULL NULL 4079 Using where -1 SIMPLE Country hash_ALL PRIMARY #hash#PRIMARY 3 world.City.Country 239 Using where; Using join buffer (flat, BNLH join) -1 SIMPLE CountryLanguage hash_ALL|filter PRIMARY,Percentage #hash#PRIMARY|Percentage 3|4 world.City.Country 984 (19%) Using where; Using join buffer (flat, BNLH join); Using rowid filter +1 SIMPLE Country ALL PRIMARY NULL NULL NULL 239 Using where +1 SIMPLE CountryLanguage hash_range PRIMARY,Percentage #hash#PRIMARY:Percentage 3:4 world.Country.Code 185 Using where; Rowid-ordered scan; Using join buffer (flat, BNLH join) +1 SIMPLE City hash_ALL Country #hash#Country 3 world.Country.Code 4079 Using where; Using join buffer (flat, BNLH join) SELECT City.Name, Country.Name, CountryLanguage.Language FROM City,Country,CountryLanguage WHERE City.Country=Country.Code AND @@ -2206,9 +2264,9 @@ City.Name LIKE 'L%' AND Country.Population > 3000000 AND CountryLanguage.Percentage > 50 AND LENGTH(Language) < LENGTH(City.Name) - 2; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City ALL Country NULL NULL NULL 4079 Using where -1 SIMPLE Country hash_ALL PRIMARY #hash#PRIMARY 3 world.City.Country 239 Using where; Using join buffer (flat, BNLH join) -1 SIMPLE CountryLanguage hash_ALL|filter PRIMARY,Percentage #hash#PRIMARY|Percentage 3|4 world.City.Country 984 (19%) Using where; Using join buffer (incremental, BNLH join); Using rowid filter +1 SIMPLE Country ALL PRIMARY NULL NULL NULL 239 Using where +1 SIMPLE CountryLanguage hash_range PRIMARY,Percentage #hash#PRIMARY:Percentage 3:4 world.Country.Code 185 Using where; Rowid-ordered scan; Using join buffer (flat, BNLH join) +1 SIMPLE City hash_ALL Country #hash#Country 3 world.Country.Code 4079 Using where; Using join buffer (incremental, BNLH join) SELECT City.Name, Country.Name, CountryLanguage.Language FROM City,Country,CountryLanguage WHERE City.Country=Country.Code AND @@ -2310,9 +2368,9 @@ City.Name LIKE 'L%' AND Country.Population > 3000000 AND CountryLanguage.Percentage > 50 AND LENGTH(Language) < LENGTH(City.Name) - 2; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City ALL Country NULL NULL NULL 4079 Using where -1 SIMPLE Country eq_ref PRIMARY PRIMARY 3 world.City.Country 1 Using where; Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan -1 SIMPLE CountryLanguage ref|filter PRIMARY,Percentage PRIMARY|Percentage 3|4 world.City.Country 4 (19%) Using index condition(BKA); Using where; Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan; Using rowid filter +1 SIMPLE Country ALL PRIMARY NULL NULL NULL 239 Using where +1 SIMPLE CountryLanguage ref|filter PRIMARY,Percentage PRIMARY|Percentage 3|4 world.Country.Code 4 (19%) Using where; Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan; Using rowid filter +1 SIMPLE City ref Country Country 3 world.Country.Code 17 Using where; Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan SELECT City.Name, Country.Name, CountryLanguage.Language FROM City,Country,CountryLanguage WHERE City.Country=Country.Code AND @@ -2414,9 +2472,9 @@ City.Name LIKE 'L%' AND Country.Population > 3000000 AND CountryLanguage.Percentage > 50 AND LENGTH(Language) < LENGTH(City.Name) - 2; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City ALL Country NULL NULL NULL 4079 Using where -1 SIMPLE Country eq_ref PRIMARY PRIMARY 3 world.City.Country 1 Using where; Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan -1 SIMPLE CountryLanguage ref|filter PRIMARY,Percentage PRIMARY|Percentage 3|4 world.City.Country 4 (19%) Using index condition(BKA); Using where; Using join buffer (incremental, BKA join); Key-ordered Rowid-ordered scan; Using rowid filter +1 SIMPLE Country ALL PRIMARY NULL NULL NULL 239 Using where +1 SIMPLE CountryLanguage ref|filter PRIMARY,Percentage PRIMARY|Percentage 3|4 world.Country.Code 4 (19%) Using where; Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan; Using rowid filter +1 SIMPLE City ref Country Country 3 world.Country.Code 17 Using where; Using join buffer (incremental, BKA join); Key-ordered Rowid-ordered scan SELECT City.Name, Country.Name, CountryLanguage.Language FROM City,Country,CountryLanguage WHERE City.Country=Country.Code AND @@ -2518,9 +2576,9 @@ City.Name LIKE 'L%' AND Country.Population > 3000000 AND CountryLanguage.Percentage > 50 AND LENGTH(Language) < LENGTH(City.Name) - 2; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City ALL Country NULL NULL NULL 4079 Using where -1 SIMPLE Country eq_ref PRIMARY PRIMARY 3 world.City.Country 1 Using where; Using join buffer (flat, BKAH join); Key-ordered Rowid-ordered scan -1 SIMPLE CountryLanguage ref|filter PRIMARY,Percentage PRIMARY|Percentage 3|4 world.City.Country 4 (19%) Using index condition(BKA); Using where; Using join buffer (flat, BKAH join); Key-ordered Rowid-ordered scan; Using rowid filter +1 SIMPLE Country ALL PRIMARY NULL NULL NULL 239 Using where +1 SIMPLE CountryLanguage ref|filter PRIMARY,Percentage PRIMARY|Percentage 3|4 world.Country.Code 4 (19%) Using where; Using join buffer (flat, BKAH join); Key-ordered Rowid-ordered scan; Using rowid filter +1 SIMPLE City ref Country Country 3 world.Country.Code 17 Using where; Using join buffer (flat, BKAH join); Key-ordered Rowid-ordered scan SELECT City.Name, Country.Name, CountryLanguage.Language FROM City,Country,CountryLanguage WHERE City.Country=Country.Code AND @@ -2622,9 +2680,9 @@ City.Name LIKE 'L%' AND Country.Population > 3000000 AND CountryLanguage.Percentage > 50 AND LENGTH(Language) < LENGTH(City.Name) - 2; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City ALL Country NULL NULL NULL 4079 Using where -1 SIMPLE Country eq_ref PRIMARY PRIMARY 3 world.City.Country 1 Using where; Using join buffer (flat, BKAH join); Key-ordered Rowid-ordered scan -1 SIMPLE CountryLanguage ref|filter PRIMARY,Percentage PRIMARY|Percentage 3|4 world.City.Country 4 (19%) Using index condition(BKA); Using where; Using join buffer (incremental, BKAH join); Key-ordered Rowid-ordered scan; Using rowid filter +1 SIMPLE Country ALL PRIMARY NULL NULL NULL 239 Using where +1 SIMPLE CountryLanguage ref|filter PRIMARY,Percentage PRIMARY|Percentage 3|4 world.Country.Code 4 (19%) Using where; Using join buffer (flat, BKAH join); Key-ordered Rowid-ordered scan; Using rowid filter +1 SIMPLE City ref Country Country 3 world.Country.Code 17 Using where; Using join buffer (incremental, BKAH join); Key-ordered Rowid-ordered scan SELECT City.Name, Country.Name, CountryLanguage.Language FROM City,Country,CountryLanguage WHERE City.Country=Country.Code AND @@ -3067,15 +3125,15 @@ t1.metaid = t2.metaid AND t1.affiliateid = '2'; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t6 system PRIMARY NULL NULL NULL 1 1 SIMPLE t5 ref PRIMARY,t5_formattypeid t5_formattypeid 4 const 1 -1 SIMPLE t9 index PRIMARY,t9_subgenreid,t9_metaid PRIMARY 8 NULL 2 Using index; Using join buffer (flat, BNL join) -1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t9.metaid 1 Using join buffer (incremental, BKA join); Key-ordered Rowid-ordered scan -1 SIMPLE t7 ref PRIMARY PRIMARY 4 test.t9.metaid 1 Using index -1 SIMPLE t8 eq_ref PRIMARY PRIMARY 4 test.t7.artistid 1 Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan +1 SIMPLE t1 ref t1_affiliateid,t1_metaid t1_affiliateid 4 const 2 Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan +1 SIMPLE t7 ref PRIMARY PRIMARY 4 test.t1.metaid 1 Using index +1 SIMPLE t9 index PRIMARY,t9_subgenreid,t9_metaid PRIMARY 8 NULL 2 Using where; Using index; Using join buffer (flat, BNL join) +1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t1.metaid 1 Using join buffer (incremental, BKA join); Key-ordered Rowid-ordered scan +1 SIMPLE t8 eq_ref PRIMARY PRIMARY 4 test.t7.artistid 1 Using join buffer (incremental, BKA join); Key-ordered Rowid-ordered scan 1 SIMPLE t10 eq_ref PRIMARY,t10_genreid PRIMARY 4 test.t9.subgenreid 1 Using join buffer (incremental, BKA join); Key-ordered Rowid-ordered scan 1 SIMPLE t11 eq_ref PRIMARY PRIMARY 4 test.t10.genreid 1 Using join buffer (incremental, BKA join); Key-ordered Rowid-ordered scan -1 SIMPLE t3 ref t3_metaid,t3_formatid,t3_metaidformatid t3_metaidformatid 4 test.t9.metaid 1 Using index condition; Using join buffer (incremental, BKA join); Key-ordered Rowid-ordered scan +1 SIMPLE t3 ref t3_metaid,t3_formatid,t3_metaidformatid t3_metaidformatid 4 test.t1.metaid 1 Using index condition; Using join buffer (incremental, BKA join); Key-ordered Rowid-ordered scan 1 SIMPLE t4 eq_ref PRIMARY,t4_formatclassid,t4_formats_idx PRIMARY 4 test.t3.formatid 1 Using where; Using join buffer (incremental, BKA join); Key-ordered Rowid-ordered scan -1 SIMPLE t1 ref t1_affiliateid,t1_metaid t1_affiliateid 4 const 2 Using where; Using join buffer (incremental, BKA join); Key-ordered Rowid-ordered scan SELECT t1.uniquekey, t1.xml AS affiliateXml, t8.name AS artistName, t8.artistid, t11.name AS genreName, t11.genreid, t11.priority AS genrePriority, @@ -3191,7 +3249,7 @@ Warning 1292 Truncated incorrect join_buffer_size value: '32' set join_cache_level=8; EXPLAIN SELECT * FROM t1,t2 WHERE t1.a=t2.a AND t1.b >= 30; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range idx idx 5 NULL 3 Using index condition; Using where; Rowid-ordered scan +1 SIMPLE t1 ALL idx NULL NULL NULL 7 Using where 1 SIMPLE t2 ref idx idx 5 test.t1.a 2 Using join buffer (flat, BKAH join); Key-ordered Rowid-ordered scan SELECT * FROM t1,t2 WHERE t1.a=t2.a AND t1.b >= 30; a b a b @@ -3371,8 +3429,8 @@ set join_cache_level=6; set join_buffer_size=1024; EXPLAIN SELECT AVG(c) FROM t1,t2 WHERE t1.a=t2.b; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 2050 Using where -1 SIMPLE t2 ref idx idx 5 test.t1.a 640 Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan +1 SIMPLE t2 ALL idx NULL NULL NULL 1280 Using where +1 SIMPLE t1 hash_ALL NULL #hash#$hj 5 test.t2.b 2050 Using where; Using join buffer (flat, BNLH join) SELECT AVG(c) FROM t1,t2 WHERE t1.a=t2.b; AVG(c) 5.0000 @@ -4969,8 +5027,8 @@ FROM ((t1 LEFT JOIN (t2 JOIN t3 ON t2.a2 = t3.a3) ON t2.b2 = t1.a1) LEFT JOIN t4 ON t4.a4 <> 0) LEFT JOIN t5 ON t5.a5 = t2.a2; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 -1 SIMPLE t2 ALL PRIMARY NULL NULL NULL 1 Using where -1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t2.a2 1 Using index +1 SIMPLE t3 index PRIMARY PRIMARY 4 NULL 1 Using where; Using index +1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t3.a3 1 Using where 1 SIMPLE t4 ALL NULL NULL NULL NULL 1 Using where 1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t2.a2 1 Using where SELECT t4.a4, t5.b5 @@ -5054,13 +5112,15 @@ CREATE TABLE t2 ( f3 int(11), f2 varchar(1024), f4 varchar(10), PRIMARY KEY (f3) ); INSERT INTO t2 VALUES (6,'RPOYT','y'),(10,'JINQE','m'); +INSERT INTO t2 VALUES (100,'Q','q'),(101,'Q','q'),(102,'Q','q'),(103,'Q','q'); +INSERT INTO t2 VALUES (104,'Q','q'),(105,'Q','q'),(106,'Q','q'),(107,'Q','q'); SET SESSION join_cache_level = 1; SET SESSION optimizer_switch = 'index_condition_pushdown=off'; EXPLAIN SELECT * FROM t1,t2 WHERE t1.f1 = t2.f4 AND (t1.f3 = 1 AND t2.f3 = 4 OR t1.f3 = 2 AND t2.f3 = 6); id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL 2 Using where; Rowid-ordered scan +1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 2 Using where 1 SIMPLE t2 range PRIMARY PRIMARY 4 NULL 2 Using where; Rowid-ordered scan; Using join buffer (flat, BNL join) SELECT * FROM t1,t2 WHERE t1.f1 = t2.f4 AND (t1.f3 = 1 AND t2.f3 = 4 OR t1.f3 = 2 AND t2.f3 = 6); @@ -5070,7 +5130,7 @@ EXPLAIN SELECT * FROM t1,t2 WHERE t1.f1 = t2.f4 AND (t1.f3 = 1 AND t2.f3 = 4 OR t1.f3 = 2 AND t2.f3 = 6); id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL 2 Using index condition; Rowid-ordered scan +1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 2 Using where 1 SIMPLE t2 range PRIMARY PRIMARY 4 NULL 2 Using index condition; Using where; Rowid-ordered scan; Using join buffer (flat, BNL join) SELECT * FROM t1,t2 WHERE t1.f1 = t2.f4 AND (t1.f3 = 1 AND t2.f3 = 4 OR t1.f3 = 2 AND t2.f3 = 6); @@ -5523,7 +5583,7 @@ and t2.uid=t1.fid; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t3 ref uid uid 5 const 4 Using where; Start temporary 1 PRIMARY t4 eq_ref PRIMARY PRIMARY 4 test.t3.fid 1 Using index -1 PRIMARY t1 ALL uid NULL NULL NULL 11 Using where; End temporary; Using join buffer (flat, BNL join) +1 PRIMARY t1 ref uid uid 5 test.t3.fid 2 Using where; End temporary; Using join buffer (flat, BKAH join); Rowid-ordered scan 1 PRIMARY t2 eq_ref PRIMARY PRIMARY 4 test.t1.fid 1 Using join buffer (flat, BKAH join); Rowid-ordered scan select name from t2, t1 where t1.uid in (select t4.uid from t4, t3 where t3.uid=1 and t4.uid=t3.fid) @@ -6151,8 +6211,8 @@ a b c explain select t1.a, t1.b, t1.c from t1,t2 where t2.a = t1.a and t2.b = t1.b and t2.c=t1.c; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 2 Using where -1 SIMPLE t2 hash_index PRIMARY #hash#PRIMARY:PRIMARY 12:12 test.t1.c,test.t1.a,test.t1.b 2 Using index; Using join buffer (flat, BNLH join) +1 SIMPLE t2 index PRIMARY PRIMARY 12 NULL 2 Using index +1 SIMPLE t1 hash_ALL NULL #hash#$hj 15 test.t2.a,test.t2.b,test.t2.c 2 Using where; Using join buffer (flat, BNLH join) drop table t1,t2; set join_cache_level=@save_join_cache_level; # @@ -6197,7 +6257,7 @@ EXPLAIN "select_id": 1, "table": { "table_name": "a", - "access_type": "range", + "access_type": "index", "possible_keys": ["PRIMARY"], "key": "PRIMARY", "key_length": "4", diff --git a/mysql-test/main/join_cache.test b/mysql-test/main/join_cache.test index 4b659345db4..4b6231719c9 100644 --- a/mysql-test/main/join_cache.test +++ b/mysql-test/main/join_cache.test @@ -4,6 +4,7 @@ DROP DATABASE IF EXISTS world; --enable_warnings --source include/default_optimizer_switch.inc --source include/default_charset.inc +--source include/have_innodb.inc set @org_optimizer_switch=@@optimizer_switch; set @save_join_cache_level=@@join_cache_level; @@ -51,16 +52,19 @@ set join_cache_level=1; show variables like 'join_cache_level'; +--echo # Query 1 EXPLAIN SELECT City.Name, Country.Name FROM City,Country WHERE City.Country=Country.Code AND Country.Name LIKE 'L%' AND City.Population > 100000; +--echo # Query 2 --sorted_result SELECT City.Name, Country.Name FROM City,Country WHERE City.Country=Country.Code AND Country.Name LIKE 'L%' AND City.Population > 100000; +--echo # Query 3 EXPLAIN SELECT City.Name, Country.Name, CountryLanguage.Language FROM City,Country,CountryLanguage @@ -70,6 +74,7 @@ SELECT City.Name, Country.Name, CountryLanguage.Language CountryLanguage.Percentage > 50 AND LENGTH(Language) < LENGTH(City.Name) - 2; +--echo # Query 4 --sorted_result SELECT City.Name, Country.Name, CountryLanguage.Language FROM City,Country,CountryLanguage @@ -82,16 +87,19 @@ SELECT City.Name, Country.Name, CountryLanguage.Language set join_cache_level=2; show variables like 'join_cache_level'; +--echo # join_cache_level 2, Query 1 EXPLAIN SELECT City.Name, Country.Name FROM City,Country WHERE City.Country=Country.Code AND Country.Name LIKE 'L%' AND City.Population > 100000; +--echo # join_cache_level 2, Query 2 --sorted_result SELECT City.Name, Country.Name FROM City,Country WHERE City.Country=Country.Code AND Country.Name LIKE 'L%' AND City.Population > 100000; +--echo # join_cache_level 2, Query 3 EXPLAIN SELECT City.Name, Country.Name, CountryLanguage.Language FROM City,Country,CountryLanguage @@ -101,6 +109,7 @@ SELECT City.Name, Country.Name, CountryLanguage.Language CountryLanguage.Percentage > 50 AND LENGTH(Language) < LENGTH(City.Name) - 2; +--echo # join_cache_level 2, Query 4 --sorted_result SELECT City.Name, Country.Name, CountryLanguage.Language FROM City,Country,CountryLanguage @@ -113,16 +122,19 @@ SELECT City.Name, Country.Name, CountryLanguage.Language set join_cache_level=3; show variables like 'join_cache_level'; +--echo # join_cache_level 3, Query 1 EXPLAIN SELECT City.Name, Country.Name FROM City,Country WHERE City.Country=Country.Code AND Country.Name LIKE 'L%' AND City.Population > 100000; +--echo # join_cache_level 3, Query 2 --sorted_result SELECT City.Name, Country.Name FROM City,Country WHERE City.Country=Country.Code AND Country.Name LIKE 'L%' AND City.Population > 100000; +--echo # join_cache_level 3, Query 3 EXPLAIN SELECT City.Name, Country.Name, CountryLanguage.Language FROM City,Country,CountryLanguage @@ -132,7 +144,7 @@ SELECT City.Name, Country.Name, CountryLanguage.Language CountryLanguage.Percentage > 50 AND LENGTH(Language) < LENGTH(City.Name) - 2; - +--echo # join_cache_level 3, Query 4 --sorted_result SELECT City.Name, Country.Name, CountryLanguage.Language FROM City,Country,CountryLanguage @@ -146,16 +158,19 @@ SELECT City.Name, Country.Name, CountryLanguage.Language set join_cache_level=4; show variables like 'join_cache_level'; +--echo # join_cache_level 4, Query 1 EXPLAIN SELECT City.Name, Country.Name FROM City,Country WHERE City.Country=Country.Code AND Country.Name LIKE 'L%' AND City.Population > 100000; +--echo # join_cache_level 4, Query 2 --sorted_result SELECT City.Name, Country.Name FROM City,Country WHERE City.Country=Country.Code AND Country.Name LIKE 'L%' AND City.Population > 100000; +--echo # join_cache_level 4, Query 3 EXPLAIN SELECT City.Name, Country.Name, CountryLanguage.Language FROM City,Country,CountryLanguage @@ -165,6 +180,7 @@ SELECT City.Name, Country.Name, CountryLanguage.Language CountryLanguage.Percentage > 50 AND LENGTH(Language) < LENGTH(City.Name) - 2; +--echo # join_cache_level 4, Query 4 --sorted_result SELECT City.Name, Country.Name, CountryLanguage.Language FROM City,Country,CountryLanguage @@ -175,11 +191,13 @@ SELECT City.Name, Country.Name, CountryLanguage.Language LENGTH(Language) < LENGTH(City.Name) - 2; +--echo # join_cache_level 4, Query 5 SELECT Country.Name, Country.Population, City.Name, City.Population FROM Country LEFT JOIN City ON City.Country=Country.Code AND City.Population > 5000000 WHERE Country.Name LIKE 'C%' AND Country.Population > 10000000; +--echo # join_cache_level 4, Query 6 SELECT Country.Name, Country.Population, City.Name, City.Population FROM Country LEFT JOIN City ON City.Country=Country.Code AND @@ -193,17 +211,20 @@ CREATE INDEX City_Name ON City(Name); ANALYZE TABLE City; --enable_result_log +--echo # After Analyze, Query 1 EXPLAIN SELECT Country.Name, Country.Population, City.Name, City.Population FROM Country LEFT JOIN City ON City.Country=Country.Code AND City.Population > 5000000 WHERE Country.Name LIKE 'C%' AND Country.Population > 10000000; +--echo # After Analyze, Query 2 SELECT Country.Name, Country.Population, City.Name, City.Population FROM Country LEFT JOIN City ON City.Country=Country.Code AND City.Population > 5000000 WHERE Country.Name LIKE 'C%' AND Country.Population > 10000000; +--echo # After Analyze, Query 3 EXPLAIN SELECT Country.Name, Country.Population, City.Name, City.Population FROM Country LEFT JOIN City @@ -211,6 +232,7 @@ SELECT Country.Name, Country.Population, City.Name, City.Population (City.Population > 5000000 OR City.Name LIKE 'Za%') WHERE Country.Name LIKE 'C%' AND Country.Population > 10000000; +--echo # After Analyze, Query 4 SELECT Country.Name, Country.Population, City.Name, City.Population FROM Country LEFT JOIN City ON City.Country=Country.Code AND @@ -227,16 +249,19 @@ show variables like 'join_buffer_size'; show variables like 'join_cache_level'; +--echo # join_cache_level 1, Join_buffer_size, Query 1 EXPLAIN SELECT City.Name, Country.Name FROM City,Country WHERE City.Country=Country.Code AND Country.Name LIKE 'L%' AND City.Population > 100000; +--echo # join_cache_level 1, Join_buffer_size, Query 2 --sorted_result SELECT City.Name, Country.Name FROM City,Country WHERE City.Country=Country.Code AND Country.Name LIKE 'L%' AND City.Population > 100000; +--echo # join_cache_level 1, Join_buffer_size, Query 3 EXPLAIN SELECT City.Name, Country.Name, CountryLanguage.Language FROM City,Country,CountryLanguage @@ -246,6 +271,7 @@ SELECT City.Name, Country.Name, CountryLanguage.Language CountryLanguage.Percentage > 50 AND LENGTH(Language) < LENGTH(City.Name) - 2; +--echo # join_cache_level 1, Join_buffer_size, Query 4 --sorted_result SELECT City.Name, Country.Name, CountryLanguage.Language FROM City,Country,CountryLanguage @@ -258,16 +284,19 @@ SELECT City.Name, Country.Name, CountryLanguage.Language set join_cache_level=2; show variables like 'join_cache_level'; +--echo # join_cache_level 2, Join_buffer_size, Query 1 EXPLAIN SELECT City.Name, Country.Name FROM City,Country WHERE City.Country=Country.Code AND Country.Name LIKE 'L%' AND City.Population > 100000; +--echo # join_cache_level 2, Join_buffer_size, Query 2 --sorted_result SELECT City.Name, Country.Name FROM City,Country WHERE City.Country=Country.Code AND Country.Name LIKE 'L%' AND City.Population > 100000; +--echo # join_cache_level 2, Join_buffer_size, Query 3 EXPLAIN SELECT City.Name, Country.Name, CountryLanguage.Language FROM City,Country,CountryLanguage @@ -277,6 +306,7 @@ SELECT City.Name, Country.Name, CountryLanguage.Language CountryLanguage.Percentage > 50 AND LENGTH(Language) < LENGTH(City.Name) - 2; +--echo # join_cache_level 2, Join_buffer_size, Query 4 --sorted_result SELECT City.Name, Country.Name, CountryLanguage.Language FROM City,Country,CountryLanguage @@ -289,16 +319,19 @@ SELECT City.Name, Country.Name, CountryLanguage.Language set join_cache_level=3; show variables like 'join_cache_level'; +--echo # join_cache_level 3, Join_buffer_size, Query 1 EXPLAIN SELECT City.Name, Country.Name FROM City,Country WHERE City.Country=Country.Code AND Country.Name LIKE 'L%' AND City.Population > 100000; +--echo # join_cache_level 3, Join_buffer_size, Query 2 --sorted_result SELECT City.Name, Country.Name FROM City,Country WHERE City.Country=Country.Code AND Country.Name LIKE 'L%' AND City.Population > 100000; +--echo # join_cache_level 3, Join_buffer_size, Query 3 EXPLAIN SELECT City.Name, Country.Name, CountryLanguage.Language FROM City,Country,CountryLanguage @@ -308,6 +341,7 @@ SELECT City.Name, Country.Name, CountryLanguage.Language CountryLanguage.Percentage > 50 AND LENGTH(Language) < LENGTH(City.Name) - 2; +--echo # join_cache_level 3, Join_buffer_size, Query 4 --sorted_result SELECT City.Name, Country.Name, CountryLanguage.Language FROM City,Country,CountryLanguage @@ -320,16 +354,19 @@ SELECT City.Name, Country.Name, CountryLanguage.Language set join_cache_level=4; show variables like 'join_cache_level'; +--echo # join_cache_level 4, Join_buffer_size, Query 1 EXPLAIN SELECT City.Name, Country.Name FROM City,Country WHERE City.Country=Country.Code AND Country.Name LIKE 'L%' AND City.Population > 100000; +--echo # join_cache_level 4, Join_buffer_size, Query 2 --sorted_result SELECT City.Name, Country.Name FROM City,Country WHERE City.Country=Country.Code AND Country.Name LIKE 'L%' AND City.Population > 100000; +--echo # join_cache_level 4, Join_buffer_size, Query 3 EXPLAIN SELECT City.Name, Country.Name, CountryLanguage.Language FROM City,Country,CountryLanguage @@ -339,6 +376,7 @@ SELECT City.Name, Country.Name, CountryLanguage.Language CountryLanguage.Percentage > 50 AND LENGTH(Language) < LENGTH(City.Name) - 2; +--echo # join_cache_level 4, Join_buffer_size, Query 4 --sorted_result SELECT City.Name, Country.Name, CountryLanguage.Language FROM City,Country,CountryLanguage @@ -372,16 +410,19 @@ show variables like 'join_buffer_size'; set join_cache_level=3; show variables like 'join_cache_level'; +--echo # Part 2, join_cache_level=3, Query 1 EXPLAIN SELECT City.Name, Country.Name FROM City,Country WHERE City.Country=Country.Code AND Country.Name LIKE 'L%' AND City.Population > 100000; +--echo # Part 2, join_cache_level=3, Query 2 --sorted_result SELECT City.Name, Country.Name FROM City,Country WHERE City.Country=Country.Code AND Country.Name LIKE 'L%' AND City.Population > 100000; +--echo # Part 2, join_cache_level=3, Query 3 EXPLAIN SELECT City.Name, Country.Name, CountryLanguage.Language FROM City,Country,CountryLanguage @@ -391,6 +432,7 @@ SELECT City.Name, Country.Name, CountryLanguage.Language CountryLanguage.Percentage > 50 AND LENGTH(Language) < LENGTH(City.Name) - 2; +--echo # Part 2, join_cache_level=3, Query 4 --sorted_result SELECT City.Name, Country.Name, CountryLanguage.Language FROM City,Country,CountryLanguage @@ -400,15 +442,18 @@ SELECT City.Name, Country.Name, CountryLanguage.Language CountryLanguage.Percentage > 50 AND LENGTH(Language) < LENGTH(City.Name) - 2; +--echo # Part 2, join_cache_level=3, Query 5 EXPLAIN SELECT Name FROM City WHERE City.Country IN (SELECT Code FROM Country WHERE Country.Name LIKE 'L%') AND City.Population > 100000; +--echo # Part 2, join_cache_level=3, Query 6 SELECT Name FROM City WHERE City.Country IN (SELECT Code FROM Country WHERE Country.Name LIKE 'L%') AND City.Population > 100000; +--echo # Part 2, join_cache_level=3, Query 7 EXPLAIN SELECT Country.Name, IF(ISNULL(CountryLanguage.Country), NULL, CountryLanguage.Percentage) FROM Country LEFT JOIN CountryLanguage ON @@ -416,6 +461,7 @@ SELECT Country.Name, IF(ISNULL(CountryLanguage.Country), NULL, CountryLanguage.P WHERE Country.Population > 10000000; +--echo # Part 2, join_cache_level=3, Query 8 SELECT Country.Name, IF(ISNULL(CountryLanguage.Country), NULL, CountryLanguage.Percentage) FROM Country LEFT JOIN CountryLanguage ON (CountryLanguage.Country=Country.Code AND Language='English') @@ -426,16 +472,19 @@ show variables like 'join_buffer_size'; set join_cache_level=4; show variables like 'join_cache_level'; +--echo # Part 2, join_cache_level=4, Query 1 EXPLAIN SELECT City.Name, Country.Name FROM City,Country WHERE City.Country=Country.Code AND Country.Name LIKE 'L%' AND City.Population > 100000; +--echo # Part 2, join_cache_level=4, Query 2 --sorted_result SELECT City.Name, Country.Name FROM City,Country WHERE City.Country=Country.Code AND Country.Name LIKE 'L%' AND City.Population > 100000; +--echo # Part 2, join_cache_level=4, Query 3 EXPLAIN SELECT City.Name, Country.Name, CountryLanguage.Language FROM City,Country,CountryLanguage @@ -445,6 +494,7 @@ SELECT City.Name, Country.Name, CountryLanguage.Language CountryLanguage.Percentage > 50 AND LENGTH(Language) < LENGTH(City.Name) - 2; +--echo # Part 2, join_cache_level=4, Query 4 --sorted_result SELECT City.Name, Country.Name, CountryLanguage.Language FROM City,Country,CountryLanguage @@ -454,15 +504,18 @@ SELECT City.Name, Country.Name, CountryLanguage.Language CountryLanguage.Percentage > 50 AND LENGTH(Language) < LENGTH(City.Name) - 2; +--echo # Part 2, join_cache_level=4, Query 5 EXPLAIN SELECT Name FROM City WHERE City.Country IN (SELECT Code FROM Country WHERE Country.Name LIKE 'L%') AND City.Population > 100000; +--echo # Part 2, join_cache_level=4, Query 6 SELECT Name FROM City WHERE City.Country IN (SELECT Code FROM Country WHERE Country.Name LIKE 'L%') AND City.Population > 100000; +--echo # Part 2, join_cache_level=4, Query 7 EXPLAIN SELECT Country.Name, IF(ISNULL(CountryLanguage.Country), NULL, CountryLanguage.Percentage) FROM Country LEFT JOIN CountryLanguage ON @@ -470,13 +523,14 @@ SELECT Country.Name, IF(ISNULL(CountryLanguage.Country), NULL, CountryLanguage.P WHERE Country.Population > 10000000; +--echo # Part 2, join_cache_level=4, Query 8 SELECT Country.Name, IF(ISNULL(CountryLanguage.Country), NULL, CountryLanguage.Percentage) FROM Country LEFT JOIN CountryLanguage ON (CountryLanguage.Country=Country.Code AND Language='English') WHERE Country.Population > 10000000; - +--echo # Part 2, join_cache_level=4, Query 9 --replace_column 9 # EXPLAIN SELECT Country.Name, Country.Population, City.Name, City.Population @@ -484,6 +538,7 @@ SELECT Country.Name, Country.Population, City.Name, City.Population ON City.Country=Country.Code AND City.Population > 5000000 WHERE Country.Name LIKE 'C%' AND Country.Population > 10000000; +--echo # Part 2, join_cache_level=4, Query 10 SELECT Country.Name, Country.Population, City.Name, City.Population FROM Country LEFT JOIN City ON City.Country=Country.Code AND City.Population > 5000000 @@ -491,6 +546,7 @@ SELECT Country.Name, Country.Population, City.Name, City.Population CREATE INDEX City_Name ON City(Name); +--echo # Part 2, join_cache_level=4, City_Name, Query 1 EXPLAIN SELECT Country.Name, Country.Population, City.Name, City.Population FROM Country LEFT JOIN City @@ -498,6 +554,7 @@ SELECT Country.Name, Country.Population, City.Name, City.Population (City.Population > 5000000 OR City.Name LIKE 'Za%') WHERE Country.Name LIKE 'C%' AND Country.Population > 10000000; +--echo # Part 2, join_cache_level=4, City_Name, Query 2 SELECT Country.Name, Country.Population, City.Name, City.Population FROM Country LEFT JOIN City ON City.Country=Country.Code AND @@ -3175,6 +3232,8 @@ CREATE TABLE t2 ( f3 int(11), f2 varchar(1024), f4 varchar(10), PRIMARY KEY (f3) ); INSERT INTO t2 VALUES (6,'RPOYT','y'),(10,'JINQE','m'); +INSERT INTO t2 VALUES (100,'Q','q'),(101,'Q','q'),(102,'Q','q'),(103,'Q','q'); +INSERT INTO t2 VALUES (104,'Q','q'),(105,'Q','q'),(106,'Q','q'),(107,'Q','q'); SET SESSION join_cache_level = 1; @@ -3777,8 +3836,6 @@ drop table t0,t1,t2; --echo # of LEFT JOIN operations when using join buffer --echo # ---source include/have_innodb.inc - CREATE TABLE t1 ( id int(11) NOT NULL AUTO_INCREMENT, col1 varchar(255) NOT NULL DEFAULT '', diff --git a/mysql-test/main/join_nested.result b/mysql-test/main/join_nested.result index 2c66733adea..b63436326ec 100644 --- a/mysql-test/main/join_nested.result +++ b/mysql-test/main/join_nested.result @@ -1062,9 +1062,9 @@ t0.b=t1.b AND (t8.b=t9.b OR t8.c IS NULL) AND (t9.a=1); id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t0 ref idx_a idx_a 5 const 2 100.00 +1 SIMPLE t0 ALL idx_a NULL NULL NULL 3 66.67 Using where +1 SIMPLE t1 ref idx_b idx_b 5 test.t0.b 2 100.00 1 SIMPLE t9 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (flat, BNL join) -1 SIMPLE t1 ALL idx_b NULL NULL NULL 7 75.00 Using where; Using join buffer (flat, BNL join) 1 SIMPLE t2 ALL NULL NULL NULL NULL 8 100.00 Using where 1 SIMPLE t3 ALL NULL NULL NULL NULL 2 100.00 Using where 1 SIMPLE t4 ref idx_b idx_b 5 test.t2.b 2 100.00 Using where @@ -1111,20 +1111,20 @@ t0.b=t1.b AND a b a b a b a b a b a b a b a b a b a b 1 2 2 2 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1 1 1 2 2 2 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1 2 +1 2 3 2 4 2 1 2 3 2 2 2 6 2 2 2 0 2 1 2 1 2 3 2 4 2 1 2 3 2 3 1 6 2 1 1 NULL NULL 1 1 -1 2 3 2 4 2 1 2 3 2 3 3 NULL NULL NULL NULL NULL NULL 1 1 -1 2 3 2 4 2 1 2 4 2 3 1 6 2 1 1 NULL NULL 1 1 -1 2 3 2 4 2 1 2 4 2 3 3 NULL NULL NULL NULL NULL NULL 1 1 -1 2 3 2 5 3 NULL NULL NULL NULL 3 1 6 2 1 1 NULL NULL 1 1 -1 2 3 2 5 3 NULL NULL NULL NULL 3 3 NULL NULL NULL NULL NULL NULL 1 1 1 2 3 2 4 2 1 2 3 2 3 1 6 2 1 1 NULL NULL 1 2 -1 2 3 2 4 2 1 2 3 2 2 2 6 2 2 2 0 2 1 2 +1 2 3 2 4 2 1 2 3 2 3 3 NULL NULL NULL NULL NULL NULL 1 1 1 2 3 2 4 2 1 2 3 2 3 3 NULL NULL NULL NULL NULL NULL 1 2 -1 2 3 2 4 2 1 2 4 2 3 1 6 2 1 1 NULL NULL 1 2 1 2 3 2 4 2 1 2 4 2 2 2 6 2 2 2 0 2 1 2 +1 2 3 2 4 2 1 2 4 2 3 1 6 2 1 1 NULL NULL 1 1 +1 2 3 2 4 2 1 2 4 2 3 1 6 2 1 1 NULL NULL 1 2 +1 2 3 2 4 2 1 2 4 2 3 3 NULL NULL NULL NULL NULL NULL 1 1 1 2 3 2 4 2 1 2 4 2 3 3 NULL NULL NULL NULL NULL NULL 1 2 -1 2 3 2 5 3 NULL NULL NULL NULL 3 1 6 2 1 1 NULL NULL 1 2 1 2 3 2 5 3 NULL NULL NULL NULL 2 2 6 2 2 2 0 2 1 2 +1 2 3 2 5 3 NULL NULL NULL NULL 3 1 6 2 1 1 NULL NULL 1 1 +1 2 3 2 5 3 NULL NULL NULL NULL 3 1 6 2 1 1 NULL NULL 1 2 +1 2 3 2 5 3 NULL NULL NULL NULL 3 3 NULL NULL NULL NULL NULL NULL 1 1 1 2 3 2 5 3 NULL NULL NULL NULL 3 3 NULL NULL NULL NULL NULL NULL 1 2 SELECT t2.a,t2.b FROM t2; @@ -1744,9 +1744,9 @@ ON t4.carrier = t1.carrier; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 index package_id package_id 5 NULL 45 Using where; Using index 1 SIMPLE t1 eq_ref PRIMARY PRIMARY 4 test.t2.package_id 1 +1 SIMPLE t3 ref package_id package_id 5 test.t2.package_id 1 Using index 1 SIMPLE t4 eq_ref PRIMARY,id PRIMARY 2 test.t1.carrier 1 Using where 1 SIMPLE t5 ref carrier_id carrier_id 5 test.t4.id 22 Using index -1 SIMPLE t3 ref package_id package_id 5 test.t2.package_id 1 Using index SELECT COUNT(*) FROM ((t2 JOIN t1 ON t2.package_id = t1.id) JOIN t3 ON t3.package_id = t1.id) diff --git a/mysql-test/main/join_nested.test b/mysql-test/main/join_nested.test index 864218371f4..f0c6a9b65e0 100644 --- a/mysql-test/main/join_nested.test +++ b/mysql-test/main/join_nested.test @@ -637,6 +637,7 @@ SELECT t0.a,t0.b,t1.a,t1.b,t2.a,t2.b,t3.a,t3.b,t4.a,t4.b, (t8.b=t9.b OR t8.c IS NULL) AND (t9.a=1); +--sorted_result SELECT t0.a,t0.b,t1.a,t1.b,t2.a,t2.b,t3.a,t3.b,t4.a,t4.b, t5.a,t5.b,t6.a,t6.b,t7.a,t7.b,t8.a,t8.b,t9.a,t9.b FROM t0,t1 diff --git a/mysql-test/main/join_nested_jcl6.result b/mysql-test/main/join_nested_jcl6.result index 795e22c3ed2..40fe97d7e34 100644 --- a/mysql-test/main/join_nested_jcl6.result +++ b/mysql-test/main/join_nested_jcl6.result @@ -920,16 +920,16 @@ t0.b=t1.b AND id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t0 ALL NULL NULL NULL NULL 3 100.00 Using where 1 SIMPLE t1 hash_ALL NULL #hash#$hj 5 test.t0.b 3 100.00 Using where; Using join buffer (flat, BNLH join) +1 SIMPLE t9 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (incremental, BNL join) 1 SIMPLE t5 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (incremental, BNL join) 1 SIMPLE t7 hash_ALL NULL #hash#$hj 5 test.t5.b 2 100.00 Using where; Using join buffer (incremental, BNLH join) 1 SIMPLE t6 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (incremental, BNL join) 1 SIMPLE t8 hash_ALL NULL #hash#$hj 5 test.t5.b 2 100.00 Using where; Using join buffer (incremental, BNLH join) 1 SIMPLE t2 ALL NULL NULL NULL NULL 8 100.00 Using where; Using join buffer (incremental, BNL join) -1 SIMPLE t4 hash_ALL NULL #hash#$hj 5 test.t2.b 2 100.00 Using where; Using join buffer (incremental, BNLH join) 1 SIMPLE t3 ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (incremental, BNL join) -1 SIMPLE t9 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (incremental, BNL join) +1 SIMPLE t4 hash_ALL NULL #hash#$hj 5 test.t2.b 2 100.00 Using where; Using join buffer (incremental, BNLH join) Warnings: -Note 1003 select `test`.`t0`.`a` AS `a`,`test`.`t0`.`b` AS `b`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t5`.`a` AS `a`,`test`.`t5`.`b` AS `b`,`test`.`t6`.`a` AS `a`,`test`.`t6`.`b` AS `b`,`test`.`t7`.`a` AS `a`,`test`.`t7`.`b` AS `b`,`test`.`t8`.`a` AS `a`,`test`.`t8`.`b` AS `b`,`test`.`t9`.`a` AS `a`,`test`.`t9`.`b` AS `b` from `test`.`t0` join `test`.`t1` left join (`test`.`t2` left join (`test`.`t3` join `test`.`t4`) on(`test`.`t3`.`a` = 1 and `test`.`t4`.`b` = `test`.`t2`.`b` and `test`.`t2`.`a` > 0 and `test`.`t2`.`b` is not null) join `test`.`t5` left join (`test`.`t6` join `test`.`t7` left join `test`.`t8` on(`test`.`t8`.`b` = `test`.`t5`.`b` and `test`.`t6`.`b` < 10 and `test`.`t5`.`b` is not null)) on(`test`.`t7`.`b` = `test`.`t5`.`b` and `test`.`t6`.`b` >= 2 and `test`.`t5`.`b` is not null)) on((`test`.`t3`.`b` = 2 or `test`.`t3`.`c` is null) and (`test`.`t6`.`b` = 2 or `test`.`t6`.`c` is null) and (`test`.`t5`.`b` = `test`.`t0`.`b` or `test`.`t3`.`c` is null or `test`.`t6`.`c` is null or `test`.`t8`.`c` is null) and `test`.`t1`.`a` <> 2) join `test`.`t9` where `test`.`t0`.`a` = 1 and `test`.`t1`.`b` = `test`.`t0`.`b` and `test`.`t9`.`a` = 1 and (`test`.`t2`.`a` >= 4 or `test`.`t2`.`c` is null) and (`test`.`t3`.`a` < 5 or `test`.`t3`.`c` is null) and (`test`.`t3`.`b` = `test`.`t4`.`b` or `test`.`t3`.`c` is null or `test`.`t4`.`c` is null) and (`test`.`t5`.`a` >= 2 or `test`.`t5`.`c` is null) and (`test`.`t6`.`a` >= 4 or `test`.`t6`.`c` is null) and (`test`.`t7`.`a` <= 2 or `test`.`t7`.`c` is null) and (`test`.`t8`.`a` < 1 or `test`.`t8`.`c` is null) and (`test`.`t9`.`b` = `test`.`t8`.`b` or `test`.`t8`.`c` is null) +Note 1003 select `test`.`t0`.`a` AS `a`,`test`.`t0`.`b` AS `b`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b`,`test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t3`.`a` AS `a`,`test`.`t3`.`b` AS `b`,`test`.`t4`.`a` AS `a`,`test`.`t4`.`b` AS `b`,`test`.`t5`.`a` AS `a`,`test`.`t5`.`b` AS `b`,`test`.`t6`.`a` AS `a`,`test`.`t6`.`b` AS `b`,`test`.`t7`.`a` AS `a`,`test`.`t7`.`b` AS `b`,`test`.`t8`.`a` AS `a`,`test`.`t8`.`b` AS `b`,`test`.`t9`.`a` AS `a`,`test`.`t9`.`b` AS `b` from `test`.`t0` join `test`.`t1` left join (`test`.`t2` left join (`test`.`t3` join `test`.`t4`) on(`test`.`t3`.`a` = 1 and `test`.`t4`.`b` = `test`.`t2`.`b` and `test`.`t2`.`a` > 0 and `test`.`t2`.`b` is not null) join `test`.`t5` left join (`test`.`t6` join `test`.`t7` left join `test`.`t8` on(`test`.`t8`.`b` = `test`.`t5`.`b` and `test`.`t6`.`b` < 10 and `test`.`t5`.`b` is not null)) on(`test`.`t7`.`b` = `test`.`t5`.`b` and `test`.`t6`.`b` >= 2 and `test`.`t5`.`b` is not null)) on((`test`.`t3`.`b` = 2 or `test`.`t3`.`c` is null) and (`test`.`t6`.`b` = 2 or `test`.`t6`.`c` is null) and (`test`.`t5`.`b` = `test`.`t0`.`b` or `test`.`t3`.`c` is null or `test`.`t6`.`c` is null or `test`.`t8`.`c` is null) and `test`.`t1`.`a` <> 2) join `test`.`t9` where `test`.`t0`.`a` = 1 and `test`.`t1`.`b` = `test`.`t0`.`b` and `test`.`t9`.`a` = 1 and (`test`.`t2`.`a` >= 4 or `test`.`t2`.`c` is null) and (`test`.`t3`.`a` < 5 or `test`.`t3`.`c` is null) and (`test`.`t4`.`b` = `test`.`t3`.`b` or `test`.`t3`.`c` is null or `test`.`t4`.`c` is null) and (`test`.`t5`.`a` >= 2 or `test`.`t5`.`c` is null) and (`test`.`t6`.`a` >= 4 or `test`.`t6`.`c` is null) and (`test`.`t7`.`a` <= 2 or `test`.`t7`.`c` is null) and (`test`.`t8`.`a` < 1 or `test`.`t8`.`c` is null) and (`test`.`t8`.`b` = `test`.`t9`.`b` or `test`.`t8`.`c` is null) INSERT INTO t4 VALUES (-3,12,0), (-4,13,0), (-1,11,0), (-3,11,0), (-5,15,0); INSERT INTO t5 VALUES (-3,11,0), (-2,12,0), (-3,13,0), (-4,12,0); CREATE INDEX idx_b ON t4(b); @@ -1071,9 +1071,9 @@ t0.b=t1.b AND (t8.b=t9.b OR t8.c IS NULL) AND (t9.a=1); id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t0 ref idx_a idx_a 5 const 2 100.00 -1 SIMPLE t9 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (flat, BNL join) -1 SIMPLE t1 ALL idx_b NULL NULL NULL 7 75.00 Using where; Using join buffer (incremental, BNL join) +1 SIMPLE t0 ALL idx_a NULL NULL NULL 3 66.67 Using where +1 SIMPLE t1 ref idx_b idx_b 5 test.t0.b 2 100.00 Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan +1 SIMPLE t9 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (incremental, BNL join) 1 SIMPLE t2 ALL NULL NULL NULL NULL 8 100.00 Using where; Using join buffer (incremental, BNL join) 1 SIMPLE t3 ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (incremental, BNL join) 1 SIMPLE t4 ref idx_b idx_b 5 test.t2.b 2 100.00 Using where; Using join buffer (incremental, BKA join); Key-ordered Rowid-ordered scan @@ -1118,14 +1118,16 @@ t0.b=t1.b AND (t8.b=t9.b OR t8.c IS NULL) AND (t9.a=1); a b a b a b a b a b a b a b a b a b a b -1 2 3 2 4 2 1 2 4 2 2 2 6 2 2 2 0 2 1 2 +1 2 2 2 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1 1 +1 2 2 2 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1 2 1 2 3 2 4 2 1 2 3 2 2 2 6 2 2 2 0 2 1 2 1 2 3 2 4 2 1 2 3 2 3 1 6 2 1 1 NULL NULL 1 1 1 2 3 2 4 2 1 2 3 2 3 1 6 2 1 1 NULL NULL 1 2 -1 2 3 2 4 2 1 2 4 2 3 1 6 2 1 1 NULL NULL 1 1 -1 2 3 2 4 2 1 2 4 2 3 1 6 2 1 1 NULL NULL 1 2 1 2 3 2 4 2 1 2 3 2 3 3 NULL NULL NULL NULL NULL NULL 1 1 1 2 3 2 4 2 1 2 3 2 3 3 NULL NULL NULL NULL NULL NULL 1 2 +1 2 3 2 4 2 1 2 4 2 2 2 6 2 2 2 0 2 1 2 +1 2 3 2 4 2 1 2 4 2 3 1 6 2 1 1 NULL NULL 1 1 +1 2 3 2 4 2 1 2 4 2 3 1 6 2 1 1 NULL NULL 1 2 1 2 3 2 4 2 1 2 4 2 3 3 NULL NULL NULL NULL NULL NULL 1 1 1 2 3 2 4 2 1 2 4 2 3 3 NULL NULL NULL NULL NULL NULL 1 2 1 2 3 2 5 3 NULL NULL NULL NULL 2 2 6 2 2 2 0 2 1 2 @@ -1133,8 +1135,6 @@ a b a b a b a b a b a b a b a b a b a b 1 2 3 2 5 3 NULL NULL NULL NULL 3 1 6 2 1 1 NULL NULL 1 2 1 2 3 2 5 3 NULL NULL NULL NULL 3 3 NULL NULL NULL NULL NULL NULL 1 1 1 2 3 2 5 3 NULL NULL NULL NULL 3 3 NULL NULL NULL NULL NULL NULL 1 2 -1 2 2 2 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1 1 -1 2 2 2 NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL NULL 1 2 SELECT t2.a,t2.b FROM t2; a b @@ -1753,9 +1753,9 @@ ON t4.carrier = t1.carrier; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 index package_id package_id 5 NULL 45 Using where; Using index 1 SIMPLE t1 eq_ref PRIMARY PRIMARY 4 test.t2.package_id 1 Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan +1 SIMPLE t3 ref package_id package_id 5 test.t2.package_id 1 Using index 1 SIMPLE t4 eq_ref PRIMARY,id PRIMARY 2 test.t1.carrier 1 Using where 1 SIMPLE t5 ref carrier_id carrier_id 5 test.t4.id 22 Using index -1 SIMPLE t3 ref package_id package_id 5 test.t2.package_id 1 Using index SELECT COUNT(*) FROM ((t2 JOIN t1 ON t2.package_id = t1.id) JOIN t3 ON t3.package_id = t1.id) @@ -2033,8 +2033,8 @@ ON t6.b >= 2 AND t5.b=t7.b AND (t8.a > 0 OR t8.c IS NULL) AND t6.a>0 AND t7.a>0; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t5 ALL NULL NULL NULL NULL 3 -1 SIMPLE t7 range PRIMARY,b_i PRIMARY 4 NULL 2 Using where; Rowid-ordered scan; Using join buffer (flat, BNL join) -1 SIMPLE t6 range|filter PRIMARY,b_i PRIMARY|b_i 4|5 NULL 3 (86%) Using where; Rowid-ordered scan; Using join buffer (incremental, BNL join); Using rowid filter +1 SIMPLE t7 ref|filter PRIMARY,b_i b_i|PRIMARY 5|4 test.t5.b 2 (29%) Using where; Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan; Using rowid filter +1 SIMPLE t6 ALL PRIMARY,b_i NULL NULL NULL 7 Using where; Using join buffer (incremental, BNL join) 1 SIMPLE t8 ref b_i b_i 5 test.t5.b 2 Using where; Using join buffer (incremental, BKA join); Key-ordered Rowid-ordered scan SELECT t5.a,t5.b,t6.a,t6.b,t7.a,t7.b,t8.a,t8.b FROM t5 diff --git a/mysql-test/main/join_outer.result b/mysql-test/main/join_outer.result index fcffeb6d161..184897aa726 100644 --- a/mysql-test/main/join_outer.result +++ b/mysql-test/main/join_outer.result @@ -2276,7 +2276,7 @@ id select_type table type possible_keys key key_len ref rows Extra explain select * from t1 left join t2 on t2.c is null; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 9 -1 SIMPLE t2 ALL c NULL NULL NULL 1000 Using where +1 SIMPLE t2 ref c c 5 const 393 Using where drop table t1,t2; # # MDEV-10006: optimizer doesn't convert outer join to inner on views with WHERE clause diff --git a/mysql-test/main/join_outer_innodb.result b/mysql-test/main/join_outer_innodb.result index 6f87048cdc1..33f5062ec16 100644 --- a/mysql-test/main/join_outer_innodb.result +++ b/mysql-test/main/join_outer_innodb.result @@ -440,6 +440,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t4 eq_ref PRIMARY PRIMARY 4 test.t1.a2 1 Using index 1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t4.d1 1 Using where 1 SIMPLE t6 eq_ref PRIMARY PRIMARY 4 test.t1.a3 1 Using where; Using index +1 SIMPLE t10 eq_ref PRIMARY PRIMARY 1 test.t1.a6 1 1 SIMPLE t8 eq_ref PRIMARY PRIMARY 1 test.t1.a4 1 Using index 1 SIMPLE t7 eq_ref PRIMARY PRIMARY 1 test.t1.a7 1 1 SIMPLE t9 ref PRIMARY PRIMARY 1 test.t1.a4 1 @@ -453,7 +454,6 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t14 eq_ref PRIMARY PRIMARY 2 test.t1.a8 1 Using where 1 SIMPLE t15 eq_ref PRIMARY PRIMARY 2 test.t1.a9 1 Using where; Using index 1 SIMPLE t16 ref PRIMARY PRIMARY 2 test.t15.o1 1 Using where -1 SIMPLE t10 ALL PRIMARY NULL NULL NULL 3 Using where; Using join buffer (flat, BNL join) explain select * from v1; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL a4,a6,a5,a7 NULL NULL NULL 3 Using where @@ -462,6 +462,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t4 eq_ref PRIMARY PRIMARY 4 test.t1.a2 1 Using index 1 SIMPLE t5 eq_ref PRIMARY PRIMARY 4 test.t4.d1 1 Using where 1 SIMPLE t6 eq_ref PRIMARY PRIMARY 4 test.t1.a3 1 Using where; Using index +1 SIMPLE t10 eq_ref PRIMARY PRIMARY 1 test.t1.a6 1 1 SIMPLE t8 eq_ref PRIMARY PRIMARY 1 test.t1.a4 1 Using index 1 SIMPLE t7 eq_ref PRIMARY PRIMARY 1 test.t1.a7 1 1 SIMPLE t9 ref PRIMARY PRIMARY 1 test.t1.a4 1 @@ -475,7 +476,6 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t14 eq_ref PRIMARY PRIMARY 2 test.t1.a8 1 Using where 1 SIMPLE t15 eq_ref PRIMARY PRIMARY 2 test.t1.a9 1 Using where; Using index 1 SIMPLE t16 ref PRIMARY PRIMARY 2 test.t15.o1 1 Using where -1 SIMPLE t10 ALL PRIMARY NULL NULL NULL 3 Using where; Using join buffer (flat, BNL join) drop view v1; drop table t1,t2,t3,t4,t5,t6,t7,t8,t9,t10,t11,t12,t13,t14,t15,t16; # diff --git a/mysql-test/main/join_outer_jcl6.result b/mysql-test/main/join_outer_jcl6.result index 371518e5e4e..d7147b273e5 100644 --- a/mysql-test/main/join_outer_jcl6.result +++ b/mysql-test/main/join_outer_jcl6.result @@ -2283,7 +2283,7 @@ id select_type table type possible_keys key key_len ref rows Extra explain select * from t1 left join t2 on t2.c is null; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 9 -1 SIMPLE t2 ALL c NULL NULL NULL 1000 Using where; Using join buffer (flat, BNL join) +1 SIMPLE t2 ref c c 5 const 393 Using where; Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan drop table t1,t2; # # MDEV-10006: optimizer doesn't convert outer join to inner on views with WHERE clause diff --git a/mysql-test/main/key.result b/mysql-test/main/key.result index a35d1c872e6..2ebee91f824 100644 --- a/mysql-test/main/key.result +++ b/mysql-test/main/key.result @@ -232,11 +232,14 @@ numeropost 1 EXPLAIN SELECT numeropost FROM t1 WHERE numreponse='1'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 const numreponse numreponse 4 const 1 Using index +1 SIMPLE t1 const numreponse numreponse 4 const 1 FLUSH TABLES; SELECT numeropost FROM t1 WHERE numreponse='1'; numeropost 1 +EXPLAIN SELECT numreponse+0 FROM t1 WHERE numreponse='1'; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 const numreponse numreponse 4 const 1 Using index drop table t1; create table t1 (c varchar(30) character set utf8, t text character set utf8, unique (c(2)), unique (t(3))) engine=myisam; show create table t1; @@ -611,7 +614,7 @@ EXPLAIN SELECT 1 FROM t1 AS t1_outer WHERE (SELECT max(b) FROM t1 GROUP BY a HAVING a < 2) > 12; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE -2 SUBQUERY t1 range a a 5 NULL 5 Using where; Using index +2 SUBQUERY t1 range a a 5 NULL 2 Using where; Using index for group-by SELECT 1 as RES FROM t1 AS t1_outer WHERE (SELECT max(b) FROM t1 GROUP BY a HAVING a < 2) > 12; RES @@ -629,19 +632,19 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 6 Using temporary; Using filesort SHOW STATUS LIKE 'Last_query_cost'; Variable_name Value -Last_query_cost 10.412184 +Last_query_cost 8.806592 EXPLAIN SELECT a, SUM( b ) FROM t1 USE INDEX( a ) GROUP BY a; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 6 Using temporary; Using filesort SHOW STATUS LIKE 'Last_query_cost'; Variable_name Value -Last_query_cost 10.412184 +Last_query_cost 8.806592 EXPLAIN SELECT a, SUM( b ) FROM t1 FORCE INDEX( a ) GROUP BY a; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 index NULL a 5 NULL 6 SHOW STATUS LIKE 'Last_query_cost'; Variable_name Value -Last_query_cost 15.399000 +Last_query_cost 8.806592 DROP TABLE t1; # # MDEV-21480: Unique key using ref access though eq_ref access can be used diff --git a/mysql-test/main/key.test b/mysql-test/main/key.test index 4e3e02c8add..5c5ba69dd0c 100644 --- a/mysql-test/main/key.test +++ b/mysql-test/main/key.test @@ -230,9 +230,12 @@ drop table t1; CREATE TABLE t1 (numeropost mediumint(8) unsigned NOT NULL default '0', numreponse int(10) unsigned NOT NULL auto_increment, PRIMARY KEY (numeropost,numreponse), UNIQUE KEY numreponse (numreponse)); INSERT INTO t1 (numeropost,numreponse) VALUES ('1','1'),('1','2'),('2','3'),('2','4'); SELECT numeropost FROM t1 WHERE numreponse='1'; +# No 'Using index' EXPLAIN SELECT numeropost FROM t1 WHERE numreponse='1'; FLUSH TABLES; SELECT numeropost FROM t1 WHERE numreponse='1'; +# This one will have 'Using index' +EXPLAIN SELECT numreponse+0 FROM t1 WHERE numreponse='1'; drop table t1; # diff --git a/mysql-test/main/key_cache.result b/mysql-test/main/key_cache.result index c8bdc979387..0e6bad70af0 100644 --- a/mysql-test/main/key_cache.result +++ b/mysql-test/main/key_cache.result @@ -440,25 +440,25 @@ VARIABLE_NAME VARIABLE_VALUE KEY_BLOCKS_NOT_FLUSHED 0 KEY_BLOCKS_USED 4 KEY_BLOCKS_WARM 0 -KEY_READ_REQUESTS 22 +KEY_READ_REQUESTS 21 KEY_READS 0 KEY_WRITE_REQUESTS 26 KEY_WRITES 6 select variable_value into @key_blocks_unused from information_schema.session_status where variable_name = 'Key_blocks_unused'; select * from information_schema.key_caches where segment_number is null; KEY_CACHE_NAME SEGMENTS SEGMENT_NUMBER FULL_SIZE BLOCK_SIZE USED_BLOCKS UNUSED_BLOCKS DIRTY_BLOCKS READ_REQUESTS READS WRITE_REQUESTS WRITES -default NULL NULL 2097152 1024 4 # 0 22 0 26 6 +default NULL NULL 2097152 1024 4 # 0 21 0 26 6 small NULL NULL 1048576 1024 1 # 0 1 0 2 1 delete from t2 where a='zzzz'; select * from information_schema.key_caches where segment_number is null; KEY_CACHE_NAME SEGMENTS SEGMENT_NUMBER FULL_SIZE BLOCK_SIZE USED_BLOCKS UNUSED_BLOCKS DIRTY_BLOCKS READ_REQUESTS READS WRITE_REQUESTS WRITES -default NULL NULL 2097152 1024 4 # 0 29 0 32 9 +default NULL NULL 2097152 1024 4 # 0 28 0 32 9 small NULL NULL 1048576 1024 1 # 0 1 0 2 1 delete from t1; delete from t2; select * from information_schema.key_caches where segment_number is null; KEY_CACHE_NAME SEGMENTS SEGMENT_NUMBER FULL_SIZE BLOCK_SIZE USED_BLOCKS UNUSED_BLOCKS DIRTY_BLOCKS READ_REQUESTS READS WRITE_REQUESTS WRITES -default NULL NULL 2097152 1024 4 # 0 29 0 32 9 +default NULL NULL 2097152 1024 4 # 0 28 0 32 9 small NULL NULL 1048576 1024 1 # 0 1 0 2 1 set global key_cache_segments=2; select @@key_cache_segments; @@ -488,7 +488,7 @@ VARIABLE_NAME VARIABLE_VALUE KEY_BLOCKS_NOT_FLUSHED 0 KEY_BLOCKS_USED 4 KEY_BLOCKS_WARM 0 -KEY_READ_REQUESTS 22 +KEY_READ_REQUESTS 21 KEY_READS 0 KEY_WRITE_REQUESTS 26 KEY_WRITES 6 @@ -497,13 +497,13 @@ variable_value < @key_blocks_unused 1 select * from information_schema.key_caches where segment_number is null; KEY_CACHE_NAME SEGMENTS SEGMENT_NUMBER FULL_SIZE BLOCK_SIZE USED_BLOCKS UNUSED_BLOCKS DIRTY_BLOCKS READ_REQUESTS READS WRITE_REQUESTS WRITES -default 2 NULL 2097152 1024 4 # 0 22 0 26 6 +default 2 NULL 2097152 1024 4 # 0 21 0 26 6 small NULL NULL 1048576 1024 1 # 0 1 0 2 1 delete from t1; delete from t2; select * from information_schema.key_caches where segment_number is null; KEY_CACHE_NAME SEGMENTS SEGMENT_NUMBER FULL_SIZE BLOCK_SIZE USED_BLOCKS UNUSED_BLOCKS DIRTY_BLOCKS READ_REQUESTS READS WRITE_REQUESTS WRITES -default 2 NULL 2097152 1024 4 # 0 22 0 26 6 +default 2 NULL 2097152 1024 4 # 0 21 0 26 6 small NULL NULL 1048576 1024 1 # 0 1 0 2 1 set global key_cache_segments=1; select @@key_cache_segments; @@ -533,7 +533,7 @@ VARIABLE_NAME VARIABLE_VALUE KEY_BLOCKS_NOT_FLUSHED 0 KEY_BLOCKS_USED 4 KEY_BLOCKS_WARM 0 -KEY_READ_REQUESTS 22 +KEY_READ_REQUESTS 21 KEY_READS 0 KEY_WRITE_REQUESTS 26 KEY_WRITES 6 @@ -542,13 +542,13 @@ variable_value = @key_blocks_unused 1 select * from information_schema.key_caches where segment_number is null; KEY_CACHE_NAME SEGMENTS SEGMENT_NUMBER FULL_SIZE BLOCK_SIZE USED_BLOCKS UNUSED_BLOCKS DIRTY_BLOCKS READ_REQUESTS READS WRITE_REQUESTS WRITES -default 1 NULL 2097152 1024 4 # 0 22 0 26 6 +default 1 NULL 2097152 1024 4 # 0 21 0 26 6 small NULL NULL 1048576 1024 1 # 0 1 0 2 1 delete from t1; delete from t2; select * from information_schema.key_caches where segment_number is null; KEY_CACHE_NAME SEGMENTS SEGMENT_NUMBER FULL_SIZE BLOCK_SIZE USED_BLOCKS UNUSED_BLOCKS DIRTY_BLOCKS READ_REQUESTS READS WRITE_REQUESTS WRITES -default 1 NULL 2097152 1024 4 # 0 22 0 26 6 +default 1 NULL 2097152 1024 4 # 0 21 0 26 6 small NULL NULL 1048576 1024 1 # 0 1 0 2 1 flush tables; flush status; @@ -586,7 +586,7 @@ update t1 set p=3 where p=1; update t2 set i=2 where i=1; select * from information_schema.key_caches where segment_number is null; KEY_CACHE_NAME SEGMENTS SEGMENT_NUMBER FULL_SIZE BLOCK_SIZE USED_BLOCKS UNUSED_BLOCKS DIRTY_BLOCKS READ_REQUESTS READS WRITE_REQUESTS WRITES -default 2 NULL 32768 1024 4 # 0 22 0 26 6 +default 2 NULL 32768 1024 4 # 0 21 0 26 6 small NULL NULL 1048576 1024 1 # 0 0 0 0 0 insert into t1(a) select a from t1; insert into t1(a) select a from t1; @@ -606,7 +606,7 @@ insert into t2(i,a) select i,a from t2; insert into t2(i,a) select i,a from t2; select * from information_schema.key_caches where segment_number is null; KEY_CACHE_NAME SEGMENTS SEGMENT_NUMBER FULL_SIZE BLOCK_SIZE USED_BLOCKS UNUSED_BLOCKS DIRTY_BLOCKS READ_REQUESTS READS WRITE_REQUESTS WRITES -default 2 NULL 32768 1024 # # 0 6733 # 3684 103 +default 2 NULL 32768 1024 # # 0 6732 # 3684 103 small NULL NULL 1048576 1024 # # 0 0 # 0 0 select * from t1 where p between 1010 and 1020 ; p a @@ -625,7 +625,7 @@ p i a 1020 3 zzzz select * from information_schema.key_caches where segment_number is null; KEY_CACHE_NAME SEGMENTS SEGMENT_NUMBER FULL_SIZE BLOCK_SIZE USED_BLOCKS UNUSED_BLOCKS DIRTY_BLOCKS READ_REQUESTS READS WRITE_REQUESTS WRITES -default 2 NULL 32768 1024 # # 0 6750 # 3684 103 +default 2 NULL 32768 1024 # # 0 6749 # 3684 103 small NULL NULL 1048576 1024 # # 0 0 # 0 0 flush tables; flush status; @@ -699,7 +699,7 @@ update t2 set p=p+3000, i=2 where a='qqqq'; select * from information_schema.key_caches where key_cache_name like "key%" and segment_number is null; KEY_CACHE_NAME SEGMENTS SEGMENT_NUMBER FULL_SIZE BLOCK_SIZE USED_BLOCKS UNUSED_BLOCKS DIRTY_BLOCKS READ_REQUESTS READS WRITE_REQUESTS WRITES -keycache1 7 NULL 262143 2048 25 # 0 2082 25 1071 19 +keycache1 7 NULL 262143 2048 25 # 0 2114 25 1071 19 set global keycache2.key_buffer_size=1024*1024; cache index t2 in keycache2; Table Op Msg_type Msg_text @@ -712,7 +712,7 @@ keycache2 NULL NULL 1048576 1024 6 # 0 6 6 3 3 select * from information_schema.key_caches where key_cache_name like "key%" and segment_number is null; KEY_CACHE_NAME SEGMENTS SEGMENT_NUMBER FULL_SIZE BLOCK_SIZE USED_BLOCKS UNUSED_BLOCKS DIRTY_BLOCKS READ_REQUESTS READS WRITE_REQUESTS WRITES -keycache1 7 NULL 262143 2048 25 # 0 2082 25 1071 19 +keycache1 7 NULL 262143 2048 25 # 0 2114 25 1071 19 keycache2 NULL NULL 1048576 1024 6 # 0 6 6 3 3 cache index t2 in keycache1; Table Op Msg_type Msg_text @@ -753,7 +753,7 @@ select * from information_schema.key_caches where segment_number is null; KEY_CACHE_NAME SEGMENTS SEGMENT_NUMBER FULL_SIZE BLOCK_SIZE USED_BLOCKS UNUSED_BLOCKS DIRTY_BLOCKS READ_REQUESTS READS WRITE_REQUESTS WRITES default 2 NULL 32768 1024 # # 0 3172 24 1552 18 small NULL NULL 1048576 1024 # # 0 0 0 0 0 -keycache1 7 NULL 262143 2048 # # 0 3229 43 1594 30 +keycache1 7 NULL 262143 2048 # # 0 3277 43 1594 30 keycache2 NULL NULL 1048576 1024 # # 0 6 6 3 3 set global keycache1.key_cache_block_size=2*1024; insert into t2 values (7000, 3, 'yyyy'); diff --git a/mysql-test/main/limit_rows_examined.result b/mysql-test/main/limit_rows_examined.result index f0a22b8f3f2..e87dd25cac9 100644 --- a/mysql-test/main/limit_rows_examined.result +++ b/mysql-test/main/limit_rows_examined.result @@ -255,7 +255,7 @@ select * from t1i where c1 IN (select * from t2i where c2 > ' ') LIMIT ROWS EXAMINED 6; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1i range PRIMARY PRIMARY 2 NULL 4 Using where; Using index +1 PRIMARY t1i index PRIMARY PRIMARY 2 NULL 4 Using where; Using index 1 PRIMARY t2i eq_ref PRIMARY PRIMARY 2 test.t1i.c1 1 Using index select * from t1i where c1 IN (select * from t2i where c2 > ' ') @@ -395,7 +395,7 @@ select * from t1i where c1 IN (select * from t2i where c2 > ' ') LIMIT ROWS EXAMINED 17; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1i index NULL PRIMARY 2 NULL 4 Using where; Using index -2 MATERIALIZED t2i range PRIMARY PRIMARY 2 NULL 4 Using where; Using index +2 MATERIALIZED t2i index PRIMARY PRIMARY 2 NULL 4 Using where; Using index select * from t1i where c1 IN (select * from t2i where c2 > ' ') LIMIT ROWS EXAMINED 17; c1 diff --git a/mysql-test/main/long_unique.result b/mysql-test/main/long_unique.result index 4521eaa11d0..99643c17a0a 100644 --- a/mysql-test/main/long_unique.result +++ b/mysql-test/main/long_unique.result @@ -1196,20 +1196,20 @@ ERROR 42S22: Unknown column 'DB_ROW_HASH_1' in 'IN/ALL/ANY subquery' select DB_ROW_HASH_1, DB_ROW_HASH_2 from t1,t2 where DB_ROW_HASH_1 in (select DB_ROW_HASH_1 from t2); DB_ROW_HASH_1 DB_ROW_HASH_2 11 1 -22 2 -33 3 -44 4 11 1 -22 2 -33 3 -44 4 11 1 -22 2 -33 3 -44 4 11 1 22 2 +22 2 +22 2 +22 2 +33 3 +33 3 33 3 +33 3 +44 4 +44 4 +44 4 44 4 select * from t2 where DB_ROW_HASH_1 in (select DB_ROW_HASH_1 from t1); DB_ROW_HASH_1 DB_ROW_HASH_2 diff --git a/mysql-test/main/long_unique.test b/mysql-test/main/long_unique.test index c2cf3f635ce..0d91913fd7b 100644 --- a/mysql-test/main/long_unique.test +++ b/mysql-test/main/long_unique.test @@ -389,6 +389,7 @@ select DB_ROW_HASH_1, DB_ROW_HASH_2 from t1; select DB_ROW_HASH_1, DB_ROW_HASH_2 from t1,t2; --error ER_BAD_FIELD_ERROR select * from t1 where DB_ROW_HASH_1 in (select DB_ROW_HASH_1 from t2); +--sorted_result select DB_ROW_HASH_1, DB_ROW_HASH_2 from t1,t2 where DB_ROW_HASH_1 in (select DB_ROW_HASH_1 from t2); select * from t2 where DB_ROW_HASH_1 in (select DB_ROW_HASH_1 from t1); --error ER_BAD_FIELD_ERROR diff --git a/mysql-test/main/multi_update.result b/mysql-test/main/multi_update.result index a6bfe843738..3ec9ea0caa5 100644 --- a/mysql-test/main/multi_update.result +++ b/mysql-test/main/multi_update.result @@ -1092,8 +1092,8 @@ a b c a b c set optimizer_switch='firstmatch=off'; explain update t1, t2 set t2.c=1 where t1.a=t2.a and t1.b in (select b from t3 where t3.c< t2.c) order by t2.c, t1.c limit 10; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t2 ALL NULL NULL NULL NULL 10 Using temporary; Using filesort -1 PRIMARY t1 ALL a NULL NULL NULL 10 Using where +1 PRIMARY t2 ALL NULL NULL NULL NULL 10 Using where; Using temporary; Using filesort +1 PRIMARY t1 ref a a 5 test.t2.a 1 1 PRIMARY t3 ALL NULL NULL NULL NULL 10 Using where; Start temporary; End temporary update t1, t2 set t2.c=1 where t1.a=t2.a and t1.b in (select b from t3 where t3.c<=t2.c) order by t2.c, t1.c limit 5; select * from t2; diff --git a/mysql-test/main/myisam.result b/mysql-test/main/myisam.result index 5c551a25afa..ff2ea680138 100644 --- a/mysql-test/main/myisam.result +++ b/mysql-test/main/myisam.result @@ -641,10 +641,14 @@ create table t1 ( a tinytext, b char(1), index idx (a(1),b) ); insert into t1 values (null,''), (null,''); explain select count(*) from t1 where a is null; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref idx idx 4 const 2 Using where +1 SIMPLE t1 ALL idx NULL NULL NULL 2 Using where select count(*) from t1 where a is null; count(*) 2 +insert into t1 values (1,''), (2,''); +explain select count(*) from t1 where a is null; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref idx idx 4 const 2 Using where drop table t1; create table t1 (c1 int, c2 varchar(4) not null default '', key(c2(3))) default charset=utf8; @@ -2533,6 +2537,7 @@ DROP TABLE t1, t2, t3; # # BUG#51307 - widespread corruption with partitions and insert...select # +call mtr.add_suppression("Enabling keys got errno 12 on test.t1, retrying"); CREATE TABLE t1(a CHAR(255), KEY(a)); SELECT * FROM t1, t1 AS a1; a a diff --git a/mysql-test/main/myisam.test b/mysql-test/main/myisam.test index 2ae4da671e6..096be265cb4 100644 --- a/mysql-test/main/myisam.test +++ b/mysql-test/main/myisam.test @@ -595,6 +595,8 @@ create table t1 ( a tinytext, b char(1), index idx (a(1),b) ); insert into t1 values (null,''), (null,''); explain select count(*) from t1 where a is null; select count(*) from t1 where a is null; +insert into t1 values (1,''), (2,''); +explain select count(*) from t1 where a is null; drop table t1; # @@ -1678,6 +1680,9 @@ DROP TABLE t1, t2, t3; --echo # --echo # BUG#51307 - widespread corruption with partitions and insert...select --echo # + +call mtr.add_suppression("Enabling keys got errno 12 on test.t1, retrying"); + CREATE TABLE t1(a CHAR(255), KEY(a)); SELECT * FROM t1, t1 AS a1; SET myisam_sort_buffer_size=4; diff --git a/mysql-test/main/myisam_explain_non_select_all.result b/mysql-test/main/myisam_explain_non_select_all.result index 83e18f3906f..9714685df88 100644 --- a/mysql-test/main/myisam_explain_non_select_all.result +++ b/mysql-test/main/myisam_explain_non_select_all.result @@ -256,9 +256,8 @@ FLUSH STATUS; FLUSH TABLES; EXPLAIN EXTENDED SELECT * FROM t1 WHERE 1 IN (SELECT 1 FROM t2 WHERE t2.b < 3); id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00 -1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 100.00 -2 MATERIALIZED t2 ALL NULL NULL NULL NULL 3 100.00 Using where +1 PRIMARY t2 ALL NULL NULL NULL NULL 3 100.00 Using where; FirstMatch +1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00 Using join buffer (flat, BNL join) Warnings: Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` semi join (`test`.`t2`) where `test`.`t2`.`b` < 3 # Status of EXPLAIN EXTENDED "equivalent" SELECT query execution @@ -268,8 +267,8 @@ Warnings: Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead # Status of "equivalent" SELECT query execution: Variable_name Value -Handler_read_key 5 -Handler_read_rnd_next 8 +Handler_read_key 4 +Handler_read_rnd_next 5 # Status of testing query execution: Variable_name Value Handler_read_key 4 @@ -791,12 +790,12 @@ Warnings: Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead EXPLAIN DELETE FROM t1 WHERE t1.a > 0 ORDER BY t1.a; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL 3 Using where +1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 6 Using where; Using filesort FLUSH STATUS; FLUSH TABLES; EXPLAIN EXTENDED DELETE FROM t1 WHERE t1.a > 0 ORDER BY t1.a; id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL 3 100.00 Using where +1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 6 100.00 Using where; Using filesort # Status of EXPLAIN EXTENDED query Variable_name Value Handler_read_key 3 @@ -819,8 +818,11 @@ Handler_read_next 3 # Status of testing query execution: Variable_name Value Handler_delete 3 -Handler_read_key 4 -Handler_read_next 3 +Handler_read_key 3 +Handler_read_rnd 3 +Handler_read_rnd_next 7 +Sort_rows 3 +Sort_scan 1 DROP TABLE t1; #17 @@ -1494,12 +1496,12 @@ Warnings: Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead EXPLAIN DELETE FROM t2 WHERE b = 10 ORDER BY a, c LIMIT 5; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 ALL NULL NULL NULL NULL 26 Using where; Using filesort +1 SIMPLE t2 index NULL a 15 NULL 5 Using where FLUSH STATUS; FLUSH TABLES; EXPLAIN EXTENDED DELETE FROM t2 WHERE b = 10 ORDER BY a, c LIMIT 5; id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t2 ALL NULL NULL NULL NULL 26 100.00 Using where; Using filesort +1 SIMPLE t2 index NULL a 15 NULL 5 100.00 Using where # Status of EXPLAIN EXTENDED query Variable_name Value Handler_read_key 8 @@ -1523,11 +1525,9 @@ Handler_read_next 26 # Status of testing query execution: Variable_name Value Handler_delete 1 +Handler_read_first 1 Handler_read_key 8 -Handler_read_rnd 1 -Handler_read_rnd_next 27 -Sort_rows 1 -Sort_scan 1 +Handler_read_next 26 DROP TABLE t1, t2; #32 @@ -2009,12 +2009,12 @@ Warnings: Warning 1287 '<select expression> INTO <destination>;' is deprecated and will be removed in a future release. Please use 'SELECT <select list> INTO <destination> FROM...' instead EXPLAIN UPDATE t2 SET d = 10 WHERE b = 10 ORDER BY a, c LIMIT 5; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 ALL NULL NULL NULL NULL 26 Using where; Using filesort +1 SIMPLE t2 index NULL a 15 NULL 5 Using where; Using buffer FLUSH STATUS; FLUSH TABLES; EXPLAIN EXTENDED UPDATE t2 SET d = 10 WHERE b = 10 ORDER BY a, c LIMIT 5; id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t2 ALL NULL NULL NULL NULL 26 100.00 Using where; Using filesort +1 SIMPLE t2 index NULL a 15 NULL 5 100.00 Using where; Using buffer # Status of EXPLAIN EXTENDED query Variable_name Value Handler_read_key 8 @@ -2037,13 +2037,11 @@ Handler_read_key 8 Handler_read_next 26 # Status of testing query execution: Variable_name Value +Handler_read_first 1 Handler_read_key 8 +Handler_read_next 26 Handler_read_rnd 1 -Handler_read_rnd_next 27 Handler_update 1 -Sort_priority_queue_sorts 1 -Sort_rows 1 -Sort_scan 1 DROP TABLE t1, t2; #42 diff --git a/mysql-test/main/myisam_icp.result b/mysql-test/main/myisam_icp.result index d0614913480..803b16ecd79 100644 --- a/mysql-test/main/myisam_icp.result +++ b/mysql-test/main/myisam_icp.result @@ -407,7 +407,7 @@ WHERE (pk BETWEEN 4 AND 5 OR pk < 2) AND c1 < 240 ORDER BY c1 LIMIT 1; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range|filter PRIMARY,k1 PRIMARY|k1 4|5 NULL 3 (50%) Using index condition; Using where; Rowid-ordered scan; Using filesort; Using rowid filter +1 SIMPLE t1 range PRIMARY,k1 PRIMARY 4 NULL 3 Using index condition; Using where; Rowid-ordered scan; Using filesort DROP TABLE t1; # # @@ -429,8 +429,8 @@ SELECT * FROM t1 WHERE pk IN (SELECT it.pk FROM t2 JOIN t2 AS it ON it.i=it.i WHERE it.pk-t1.i<10); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL # Using where +2 DEPENDENT SUBQUERY t2 index NULL PRIMARY 4 NULL # Using index 2 DEPENDENT SUBQUERY it eq_ref PRIMARY PRIMARY 4 func # Using index condition -2 DEPENDENT SUBQUERY t2 index NULL PRIMARY 4 NULL # Using index; Using join buffer (flat, BNL join) SELECT * FROM t1 WHERE pk IN (SELECT it.pk FROM t2 JOIN t2 AS it ON it.i=it.i WHERE it.pk-t1.i<10); pk i @@ -506,7 +506,7 @@ WHERE (t2.pk <= 4 AND t1.pk IN (2,1)) OR (t1.pk > 1 AND t2.pk BETWEEN 6 AND 6); id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 range PRIMARY PRIMARY 4 NULL 1 Using index condition; Rowid-ordered scan -1 SIMPLE t2 range PRIMARY PRIMARY 4 NULL 2 Using index condition; Using where; Rowid-ordered scan; Using join buffer (flat, BNL join) +1 SIMPLE t2 ALL PRIMARY NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join) SELECT c2 FROM t1 JOIN t2 ON t1.c1 = t2.c1 WHERE (t2.pk <= 4 AND t1.pk IN (2,1)) OR (t1.pk > 1 AND t2.pk BETWEEN 6 AND 6); @@ -922,7 +922,7 @@ DROP TABLE t1; # Bug#870046: ICP for a GROUP BY query # CREATE TABLE t1 (a int, b varchar(1), c varchar(1), INDEX idx(b)); -INSERT INTO t1 VALUES (2,'x','x'), (5,'x','y'); +INSERT INTO t1 VALUES (2,'x','x'), (5,'x','y'), (6,'a','b'), (7,'a','b'); SET SESSION optimizer_switch='index_condition_pushdown=off'; EXPLAIN SELECT a, MIN(c) FROM t1 WHERE b = 'x' AND c > 'x' GROUP BY a; diff --git a/mysql-test/main/myisam_icp.test b/mysql-test/main/myisam_icp.test index a115d0f7caa..7b4ff23b50e 100644 --- a/mysql-test/main/myisam_icp.test +++ b/mysql-test/main/myisam_icp.test @@ -215,7 +215,7 @@ DROP TABLE t1; --echo # CREATE TABLE t1 (a int, b varchar(1), c varchar(1), INDEX idx(b)); -INSERT INTO t1 VALUES (2,'x','x'), (5,'x','y'); +INSERT INTO t1 VALUES (2,'x','x'), (5,'x','y'), (6,'a','b'), (7,'a','b'); SET SESSION optimizer_switch='index_condition_pushdown=off'; EXPLAIN diff --git a/mysql-test/main/mysqld--help.result b/mysql-test/main/mysqld--help.result index a8aa461c863..704a40a8c24 100644 --- a/mysql-test/main/mysqld--help.result +++ b/mysql-test/main/mysqld--help.result @@ -693,6 +693,11 @@ The following specify which files/extra groups are read (specified before remain max_connections*5 or max_connections + table_cache*2 (whichever is larger) number of file descriptors (Automatically configured unless set explicitly) + --optimizer-cache-hit-ratio=# + Expected hit rate of the row and index cache in storage + engines. The value should be an integer between 0 and 99, + where 0 means cache is empty and 99 means that value is + almost always in the cache --optimizer-max-sel-arg-weight=# The maximum weight of the SEL_ARG graph. Set to 0 for no limit @@ -1654,6 +1659,7 @@ old-alter-table DEFAULT old-mode UTF8_IS_UTF8MB3 old-passwords FALSE old-style-user-limits FALSE +optimizer-cache-hit-ratio 50 optimizer-max-sel-arg-weight 32000 optimizer-prune-level 1 optimizer-search-depth 62 diff --git a/mysql-test/main/negation_elimination.result b/mysql-test/main/negation_elimination.result index 7b9a76d86b2..0ad23e547b0 100644 --- a/mysql-test/main/negation_elimination.result +++ b/mysql-test/main/negation_elimination.result @@ -4,7 +4,7 @@ insert into t1 values (NULL), (0), (1), (2), (3), (4), (5), (6), (7), (8), (9), (10), (11), (12), (13), (14), (15), (16), (17), (18), (19); explain select * from t1 where not(not(a)); id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range a a 5 NULL 20 Using where; Using index +1 SIMPLE t1 index a a 5 NULL 21 Using where; Using index select * from t1 where not(not(a)); a 1 @@ -55,7 +55,7 @@ a 10 explain select * from t1 where not(a = 10); id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range a a 5 NULL 19 Using where; Using index +1 SIMPLE t1 index a a 5 NULL 21 Using where; Using index select * from t1 where not(a = 10); a 0 @@ -500,7 +500,7 @@ NULL NULL 3 1 explain extended select a, not(not(a)), not(a <= 2 and not(a)), not(a not like "1"), not (a not in (1,2)), not(a != 2) from t1 where not(not(a)) having not(not(a)); id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 range a a 5 NULL 4 100.00 Using where; Using index +1 SIMPLE t1 index a a 5 NULL 5 80.00 Using where; Using index Warnings: Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`a` <> 0 AS `not(not(a))`,`test`.`t1`.`a` > 2 or `test`.`t1`.`a` <> 0 AS `not(a <= 2 and not(a))`,`test`.`t1`.`a` like '1' AS `not(a not like "1")`,`test`.`t1`.`a` in (1,2) AS `not (a not in (1,2))`,`test`.`t1`.`a` = 2 AS `not(a != 2)` from `test`.`t1` where `test`.`t1`.`a` <> 0 having `test`.`t1`.`a` <> 0 drop table t1; diff --git a/mysql-test/main/null_key.result b/mysql-test/main/null_key.result index d59a1cd0a2e..572d7302b74 100644 --- a/mysql-test/main/null_key.result +++ b/mysql-test/main/null_key.result @@ -160,12 +160,12 @@ a b 7 NULL explain select * from t1 where (a = 7 or a is null) and (b=7 or b is null); id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range a,b a 10 NULL 4 Using where; Using index +1 SIMPLE t1 ref_or_null a,b a 5 const 5 Using where; Using index select * from t1 where (a = 7 or a is null) and (b=7 or b is null); a b -NULL 7 7 NULL 7 7 +NULL 7 explain select * from t1 where (a = 7 or a is null) and (a = 7 or a is null); id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ref_or_null a a 5 const 5 Using where; Using index @@ -258,10 +258,11 @@ PRIMARY KEY (id) ) ENGINE=MyISAM; INSERT INTO t1 VALUES (1,NULL),(2,NULL),(3,1),(4,2),(5,NULL),(6,NULL),(7,3),(8,4),(9,NULL),(10,NULL); INSERT INTO t1 VALUES (11,5),(12,6),(13,7),(14,8),(15,9); +INSERT INTO t1 VALUES (1000,1000),(1010,1010); INSERT INTO t2 VALUES (1,NULL),(2,NULL),(3,1),(4,2),(5,NULL),(6,NULL),(7,3),(8,4),(9,NULL),(10,NULL); explain select id from t1 where uniq_id is null; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL idx1 NULL NULL NULL 15 Using where +1 SIMPLE t1 ref idx1 idx1 5 const 6 Using index condition explain select id from t1 where uniq_id =1; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 const idx1 idx1 5 const 1 @@ -285,6 +286,7 @@ id 110 DELETE FROM t1 WHERE uniq_id IS NULL; DELETE FROM t2 WHERE uniq_id IS NULL; +DELETE FROM t1 WHERE id >= 1000; SELECT * FROM t1 ORDER BY uniq_id, id; id uniq_id 3 1 diff --git a/mysql-test/main/null_key.test b/mysql-test/main/null_key.test index a5781cc8524..90ed142d5c7 100644 --- a/mysql-test/main/null_key.test +++ b/mysql-test/main/null_key.test @@ -104,6 +104,7 @@ CREATE TABLE t2 ( INSERT INTO t1 VALUES (1,NULL),(2,NULL),(3,1),(4,2),(5,NULL),(6,NULL),(7,3),(8,4),(9,NULL),(10,NULL); INSERT INTO t1 VALUES (11,5),(12,6),(13,7),(14,8),(15,9); +INSERT INTO t1 VALUES (1000,1000),(1010,1010); INSERT INTO t2 VALUES (1,NULL),(2,NULL),(3,1),(4,2),(5,NULL),(6,NULL),(7,3),(8,4),(9,NULL),(10,NULL); # # Check IS NULL optimization @@ -122,6 +123,12 @@ select id from t2 where uniq_id is null; # DELETE FROM t1 WHERE uniq_id IS NULL; DELETE FROM t2 WHERE uniq_id IS NULL; + +# +# Delete extra records that were used to force null optimization +# +DELETE FROM t1 WHERE id >= 1000; + # # Select what is left -- notice the difference # diff --git a/mysql-test/main/opt_trace.result b/mysql-test/main/opt_trace.result index 64a5b18f415..7241f4362ba 100644 --- a/mysql-test/main/opt_trace.result +++ b/mysql-test/main/opt_trace.result @@ -118,7 +118,8 @@ select * from v1 { "table": "t1", "table_scan": { "rows": 2, - "cost": 2.004394531 + "read_cost": 1.102197266, + "read_and_compare_cost": 1.602197266 } } ] @@ -129,23 +130,29 @@ select * from v1 { "plan_prefix": [], "table": "t1", "best_access_path": { + "plan_details": { + "record_count": 1 + }, "considered_access_paths": [ { "access_type": "scan", - "resulting_rows": 1, - "cost": 2.404394531, + "rows": 2, + "rows_after_scan": 1, + "rows_after_filter": 1, + "cost": 1.602197266, + "index_only": false, "chosen": true } ], "chosen_access_method": { "type": "scan", "records": 1, - "cost": 2.404394531, + "cost": 1.602197266, "uses_join_buffering": false } }, "rows_for_plan": 1, - "cost_for_plan": 2.604394531, + "cost_for_plan": 1.602197266, "estimated_join_cardinality": 1 } ] @@ -153,7 +160,8 @@ select * from v1 { { "best_join_order": ["t1"], "best_access_method": { - "cost": 2.603394531 + "rows": 1, + "cost": 1.602197266 } }, { @@ -272,7 +280,8 @@ select * from (select * from t1 where t1.a=1)q { "table": "t1", "table_scan": { "rows": 2, - "cost": 2.004394531 + "read_cost": 1.102197266, + "read_and_compare_cost": 1.602197266 } } ] @@ -283,23 +292,29 @@ select * from (select * from t1 where t1.a=1)q { "plan_prefix": [], "table": "t1", "best_access_path": { + "plan_details": { + "record_count": 1 + }, "considered_access_paths": [ { "access_type": "scan", - "resulting_rows": 1, - "cost": 2.404394531, + "rows": 2, + "rows_after_scan": 1, + "rows_after_filter": 1, + "cost": 1.602197266, + "index_only": false, "chosen": true } ], "chosen_access_method": { "type": "scan", "records": 1, - "cost": 2.404394531, + "cost": 1.602197266, "uses_join_buffering": false } }, "rows_for_plan": 1, - "cost_for_plan": 2.604394531, + "cost_for_plan": 1.602197266, "estimated_join_cardinality": 1 } ] @@ -307,7 +322,8 @@ select * from (select * from t1 where t1.a=1)q { { "best_join_order": ["t1"], "best_access_method": { - "cost": 2.603394531 + "rows": 1, + "cost": 1.602197266 } }, { @@ -431,7 +447,8 @@ select * from v2 { "table": "t1", "table_scan": { "rows": 2, - "cost": 2.004394531 + "read_cost": 1.102197266, + "read_and_compare_cost": 1.602197266 } } ] @@ -442,11 +459,17 @@ select * from v2 { "plan_prefix": [], "table": "t1", "best_access_path": { + "plan_details": { + "record_count": 1 + }, "considered_access_paths": [ { "access_type": "scan", - "resulting_rows": 1, - "cost": 2.404394531, + "rows": 2, + "rows_after_scan": 1, + "rows_after_filter": 1, + "cost": 1.602197266, + "index_only": false, "chosen": true, "use_tmp_table": true } @@ -454,12 +477,12 @@ select * from v2 { "chosen_access_method": { "type": "scan", "records": 1, - "cost": 2.404394531, + "cost": 1.602197266, "uses_join_buffering": false } }, "rows_for_plan": 1, - "cost_for_plan": 2.604394531, + "cost_for_plan": 1.602197266, "cost_for_sorting": 1, "estimated_join_cardinality": 1 } @@ -468,7 +491,8 @@ select * from v2 { { "best_join_order": ["t1"], "best_access_method": { - "cost": 3.603394531 + "rows": 1, + "cost": 2.602197266 } }, { @@ -507,7 +531,8 @@ select * from v2 { "table": "<derived2>", "table_scan": { "rows": 2, - "cost": 2 + "read_cost": 2, + "read_and_compare_cost": 2.5 } } ] @@ -518,23 +543,29 @@ select * from v2 { "plan_prefix": [], "table": "<derived2>", "best_access_path": { + "plan_details": { + "record_count": 1 + }, "considered_access_paths": [ { "access_type": "scan", - "resulting_rows": 2, - "cost": 2.4, + "rows": 2, + "rows_after_scan": 2, + "rows_after_filter": 2, + "cost": 2.5, + "index_only": false, "chosen": true } ], "chosen_access_method": { "type": "scan", "records": 2, - "cost": 2.4, + "cost": 2.5, "uses_join_buffering": false } }, "rows_for_plan": 2, - "cost_for_plan": 2.8, + "cost_for_plan": 2.5, "estimated_join_cardinality": 2 } ] @@ -542,7 +573,8 @@ select * from v2 { { "best_join_order": ["<derived2>"], "best_access_method": { - "cost": 2.799 + "rows": 2, + "cost": 2.5 } }, { @@ -648,7 +680,8 @@ explain select * from v2 { "table": "t2", "table_scan": { "rows": 10, - "cost": 2.021972656 + "read_cost": 1.510986328, + "read_and_compare_cost": 4.010986328 } } ] @@ -659,23 +692,29 @@ explain select * from v2 { "plan_prefix": [], "table": "t2", "best_access_path": { + "plan_details": { + "record_count": 1 + }, "considered_access_paths": [ { "access_type": "scan", - "resulting_rows": 10, - "cost": 4.021972656, + "rows": 10, + "rows_after_scan": 10, + "rows_after_filter": 10, + "cost": 4.010986328, + "index_only": false, "chosen": true } ], "chosen_access_method": { "type": "scan", "records": 10, - "cost": 4.021972656, + "cost": 4.010986328, "uses_join_buffering": false } }, "rows_for_plan": 10, - "cost_for_plan": 6.021972656, + "cost_for_plan": 4.010986328, "estimated_join_cardinality": 10 } ] @@ -683,7 +722,8 @@ explain select * from v2 { { "best_join_order": ["t2"], "best_access_method": { - "cost": 6.020972656 + "rows": 10, + "cost": 4.010986328 } }, { @@ -768,7 +808,8 @@ explain select * from v1 { "table": "t1", "table_scan": { "rows": 10, - "cost": 2.021972656 + "read_cost": 1.510986328, + "read_and_compare_cost": 4.010986328 } } ] @@ -779,11 +820,17 @@ explain select * from v1 { "plan_prefix": [], "table": "t1", "best_access_path": { + "plan_details": { + "record_count": 1 + }, "considered_access_paths": [ { "access_type": "scan", - "resulting_rows": 10, - "cost": 4.021972656, + "rows": 10, + "rows_after_scan": 10, + "rows_after_filter": 10, + "cost": 4.010986328, + "index_only": false, "chosen": true, "use_tmp_table": true } @@ -791,12 +838,12 @@ explain select * from v1 { "chosen_access_method": { "type": "scan", "records": 10, - "cost": 4.021972656, + "cost": 4.010986328, "uses_join_buffering": false } }, "rows_for_plan": 10, - "cost_for_plan": 6.021972656, + "cost_for_plan": 4.010986328, "cost_for_sorting": 10, "estimated_join_cardinality": 10 } @@ -805,7 +852,8 @@ explain select * from v1 { { "best_join_order": ["t1"], "best_access_method": { - "cost": 16.02097266 + "rows": 10, + "cost": 14.01098633 } }, { @@ -838,7 +886,8 @@ explain select * from v1 { "table": "<derived2>", "table_scan": { "rows": 10, - "cost": 10 + "read_cost": 10, + "read_and_compare_cost": 12.5 } } ] @@ -849,23 +898,29 @@ explain select * from v1 { "plan_prefix": [], "table": "<derived2>", "best_access_path": { + "plan_details": { + "record_count": 1 + }, "considered_access_paths": [ { "access_type": "scan", - "resulting_rows": 10, - "cost": 12, + "rows": 10, + "rows_after_scan": 10, + "rows_after_filter": 10, + "cost": 12.5, + "index_only": false, "chosen": true } ], "chosen_access_method": { "type": "scan", "records": 10, - "cost": 12, + "cost": 12.5, "uses_join_buffering": false } }, "rows_for_plan": 10, - "cost_for_plan": 14, + "cost_for_plan": 12.5, "estimated_join_cardinality": 10 } ] @@ -873,7 +928,8 @@ explain select * from v1 { { "best_join_order": ["<derived2>"], "best_access_method": { - "cost": 13.999 + "rows": 10, + "cost": 12.5 } }, { @@ -1004,14 +1060,16 @@ explain select * from t1,t2 where t1.a=t2.b+2 and t2.a= t1.b { "table": "t1", "table_scan": { "rows": 100, - "cost": 2.317382812 + "read_cost": 6.158691406, + "read_and_compare_cost": 31.15869141 } }, { "table": "t2", "table_scan": { "rows": 100, - "cost": 2.317382812 + "read_cost": 6.158691406, + "read_and_compare_cost": 31.15869141 } } ] @@ -1022,28 +1080,37 @@ explain select * from t1,t2 where t1.a=t2.b+2 and t2.a= t1.b { "plan_prefix": [], "table": "t1", "best_access_path": { + "plan_details": { + "record_count": 1 + }, "considered_access_paths": [ { "access_type": "scan", - "resulting_rows": 100, - "cost": 22.31738281, + "rows": 100, + "rows_after_scan": 100, + "rows_after_filter": 100, + "cost": 31.15869141, + "index_only": false, "chosen": true } ], "chosen_access_method": { "type": "scan", "records": 100, - "cost": 22.31738281, + "cost": 31.15869141, "uses_join_buffering": false } }, "rows_for_plan": 100, - "cost_for_plan": 42.31738281, + "cost_for_plan": 31.15869141, "rest_of_plan": [ { "plan_prefix": ["t1"], "table": "t2", "best_access_path": { + "plan_details": { + "record_count": 100 + }, "considered_access_paths": [ { "access_type": "ref", @@ -1051,28 +1118,28 @@ explain select * from t1,t2 where t1.a=t2.b+2 and t2.a= t1.b { "used_range_estimates": false, "cause": "not available", "rows": 1, - "found_matching_rows_cost": 2.200585794, - "startup_cost": 0, - "rows": 1, - "cost": 220.0585794, + "cost": 125.0585794, "chosen": true }, { - "access_type": "scan", - "resulting_rows": 75, - "cost": 1522.317383, + "access_type": "scan_with_join_cache", + "rows": 100, + "rows_after_scan": 75, + "rows_after_filter": 75, + "cost": 1906.158691, + "index_only": false, "chosen": false } ], "chosen_access_method": { "type": "ref", "records": 1, - "cost": 220.0585794, + "cost": 125.0585794, "uses_join_buffering": false } }, "rows_for_plan": 100, - "cost_for_plan": 282.3759623, + "cost_for_plan": 156.2172709, "estimated_join_cardinality": 100 } ] @@ -1081,28 +1148,37 @@ explain select * from t1,t2 where t1.a=t2.b+2 and t2.a= t1.b { "plan_prefix": [], "table": "t2", "best_access_path": { + "plan_details": { + "record_count": 1 + }, "considered_access_paths": [ { "access_type": "scan", - "resulting_rows": 100, - "cost": 22.31738281, + "rows": 100, + "rows_after_scan": 100, + "rows_after_filter": 100, + "cost": 31.15869141, + "index_only": false, "chosen": true } ], "chosen_access_method": { "type": "scan", "records": 100, - "cost": 22.31738281, + "cost": 31.15869141, "uses_join_buffering": false } }, "rows_for_plan": 100, - "cost_for_plan": 42.31738281, + "cost_for_plan": 31.15869141, "rest_of_plan": [ { "plan_prefix": ["t2"], "table": "t1", "best_access_path": { + "plan_details": { + "record_count": 100 + }, "considered_access_paths": [ { "access_type": "ref", @@ -1110,28 +1186,28 @@ explain select * from t1,t2 where t1.a=t2.b+2 and t2.a= t1.b { "used_range_estimates": false, "cause": "not available", "rows": 1, - "found_matching_rows_cost": 2.200585794, - "startup_cost": 0, - "rows": 1, - "cost": 220.0585794, + "cost": 125.0585794, "chosen": true }, { - "access_type": "scan", - "resulting_rows": 75, - "cost": 1522.317383, + "access_type": "scan_with_join_cache", + "rows": 100, + "rows_after_scan": 75, + "rows_after_filter": 75, + "cost": 1906.158691, + "index_only": false, "chosen": false } ], "chosen_access_method": { "type": "ref", "records": 1, - "cost": 220.0585794, + "cost": 125.0585794, "uses_join_buffering": false } }, "rows_for_plan": 100, - "cost_for_plan": 282.3759623, + "cost_for_plan": 156.2172709, "pruned_by_cost": true } ] @@ -1141,7 +1217,8 @@ explain select * from t1,t2 where t1.a=t2.b+2 and t2.a= t1.b { { "best_join_order": ["t1", "t2"], "best_access_method": { - "cost": 282.3749623 + "rows": 100, + "cost": 156.2172709 } }, { @@ -1223,7 +1300,7 @@ EXPLAIN SELECT DISTINCT a FROM t1 { "range_analysis": { "table_scan": { "rows": 65536, - "cost": 13255.2 + "cost": 16457 }, "potential_range_indexes": [ { @@ -1239,9 +1316,8 @@ EXPLAIN SELECT DISTINCT a FROM t1 { ], "best_covering_index_scan": { "index": "a", - "cost": 13377.39141, - "chosen": false, - "cause": "cost" + "cost": 14898.29141, + "chosen": true }, "group_index_range": { "distinct_query": true, @@ -1294,10 +1370,15 @@ EXPLAIN SELECT DISTINCT a FROM t1 { "plan_prefix": [], "table": "t1", "best_access_path": { + "plan_details": { + "record_count": 1 + }, "considered_access_paths": [ { "access_type": "index_merge", - "resulting_rows": 5, + "rows": 5, + "rows_after_scan": 5, + "rows_after_filter": 5, "cost": 6.5, "chosen": true } @@ -1310,7 +1391,7 @@ EXPLAIN SELECT DISTINCT a FROM t1 { } }, "rows_for_plan": 5, - "cost_for_plan": 7.5, + "cost_for_plan": 6.5, "estimated_join_cardinality": 5 } ] @@ -1318,7 +1399,8 @@ EXPLAIN SELECT DISTINCT a FROM t1 { { "best_join_order": ["t1"], "best_access_method": { - "cost": 7.499 + "rows": 5, + "cost": 6.5 } }, { @@ -1414,7 +1496,7 @@ EXPLAIN SELECT MIN(d) FROM t1 where b=2 and c=3 group by a { "range_analysis": { "table_scan": { "rows": 7, - "cost": 5.429052734 + "cost": 2.764526367 }, "potential_range_indexes": [ { @@ -1425,7 +1507,7 @@ EXPLAIN SELECT MIN(d) FROM t1 where b=2 and c=3 group by a { ], "best_covering_index_scan": { "index": "a", - "cost": 2.409226263, + "cost": 2.084226263, "chosen": true }, "setup_range_conditions": [], @@ -1487,11 +1569,17 @@ EXPLAIN SELECT MIN(d) FROM t1 where b=2 and c=3 group by a { "plan_prefix": [], "table": "t1", "best_access_path": { + "plan_details": { + "record_count": 1 + }, "considered_access_paths": [ { "access_type": "scan", - "resulting_rows": 1, - "cost": 3.429052734, + "rows": 7, + "rows_after_scan": 1, + "rows_after_filter": 1, + "cost": 2.084226263, + "index_only": true, "chosen": true, "use_tmp_table": true } @@ -1499,12 +1587,12 @@ EXPLAIN SELECT MIN(d) FROM t1 where b=2 and c=3 group by a { "chosen_access_method": { "type": "scan", "records": 1, - "cost": 3.429052734, + "cost": 2.084226263, "uses_join_buffering": false } }, "rows_for_plan": 1, - "cost_for_plan": 3.629052734, + "cost_for_plan": 2.084226263, "cost_for_sorting": 1, "estimated_join_cardinality": 1 } @@ -1513,7 +1601,8 @@ EXPLAIN SELECT MIN(d) FROM t1 where b=2 and c=3 group by a { { "best_join_order": ["t1"], "best_access_method": { - "cost": 4.628052734 + "rows": 1, + "cost": 3.084226263 } }, { @@ -1537,7 +1626,7 @@ EXPLAIN SELECT MIN(d) FROM t1 where b=2 and c=3 group by a { "reconsidering_access_paths_for_index_ordering": { "clause": "GROUP BY", "fanout": 1, - "read_time": 3.430052734, + "read_time": 2.084226263, "table": "t1", "rows_estimation": 7, "possible_keys": [ @@ -1545,8 +1634,8 @@ EXPLAIN SELECT MIN(d) FROM t1 where b=2 and c=3 group by a { "index": "a", "can_resolve_order": true, "updated_limit": 7, - "index_scan_time": 7, - "records": 7, + "index_scan_cost": 2.084226263, + "rows": 7, "chosen": true } ] @@ -1635,7 +1724,7 @@ EXPLAIN SELECT id,MIN(a),MAX(a) FROM t1 WHERE a>=20010104e0 GROUP BY id { "range_analysis": { "table_scan": { "rows": 16, - "cost": 7.23125 + "cost": 5.015625 }, "potential_range_indexes": [ { @@ -1646,7 +1735,7 @@ EXPLAIN SELECT id,MIN(a),MAX(a) FROM t1 WHERE a>=20010104e0 GROUP BY id { ], "best_covering_index_scan": { "index": "id", - "cost": 4.21171589, + "cost": 4.11171589, "chosen": true }, "setup_range_conditions": [], @@ -1708,10 +1797,15 @@ EXPLAIN SELECT id,MIN(a),MAX(a) FROM t1 WHERE a>=20010104e0 GROUP BY id { "plan_prefix": [], "table": "t1", "best_access_path": { + "plan_details": { + "record_count": 1 + }, "considered_access_paths": [ { "access_type": "index_merge", - "resulting_rows": 9, + "rows": 9, + "rows_after_scan": 9, + "rows_after_filter": 9, "cost": 3.25, "chosen": true, "use_tmp_table": true @@ -1725,7 +1819,7 @@ EXPLAIN SELECT id,MIN(a),MAX(a) FROM t1 WHERE a>=20010104e0 GROUP BY id { } }, "rows_for_plan": 9, - "cost_for_plan": 5.05, + "cost_for_plan": 3.25, "cost_for_sorting": 9, "estimated_join_cardinality": 9 } @@ -1734,7 +1828,8 @@ EXPLAIN SELECT id,MIN(a),MAX(a) FROM t1 WHERE a>=20010104e0 GROUP BY id { { "best_join_order": ["t1"], "best_access_method": { - "cost": 14.049 + "rows": 9, + "cost": 12.25 } }, { @@ -1826,7 +1921,7 @@ EXPLAIN SELECT * FROM t1 WHERE a = 20010104e0 GROUP BY id { "range_analysis": { "table_scan": { "rows": 16, - "cost": 7.23125 + "cost": 5.015625 }, "potential_range_indexes": [ { @@ -1837,7 +1932,7 @@ EXPLAIN SELECT * FROM t1 WHERE a = 20010104e0 GROUP BY id { ], "best_covering_index_scan": { "index": "id", - "cost": 4.21171589, + "cost": 4.11171589, "chosen": true }, "setup_range_conditions": [], @@ -1899,10 +1994,15 @@ EXPLAIN SELECT * FROM t1 WHERE a = 20010104e0 GROUP BY id { "plan_prefix": [], "table": "t1", "best_access_path": { + "plan_details": { + "record_count": 1 + }, "considered_access_paths": [ { "access_type": "index_merge", - "resulting_rows": 9, + "rows": 9, + "rows_after_scan": 9, + "rows_after_filter": 9, "cost": 3.25, "chosen": true, "use_tmp_table": true @@ -1916,7 +2016,7 @@ EXPLAIN SELECT * FROM t1 WHERE a = 20010104e0 GROUP BY id { } }, "rows_for_plan": 9, - "cost_for_plan": 5.05, + "cost_for_plan": 3.25, "cost_for_sorting": 9, "estimated_join_cardinality": 9 } @@ -1925,7 +2025,8 @@ EXPLAIN SELECT * FROM t1 WHERE a = 20010104e0 GROUP BY id { { "best_join_order": ["t1"], "best_access_method": { - "cost": 14.049 + "rows": 9, + "cost": 12.25 } }, { @@ -2063,7 +2164,7 @@ explain select * from t1 where a=1 and b=2 order by c limit 1 { "range_analysis": { "table_scan": { "rows": 1000, - "cost": 232.5644531 + "cost": 265.2822266 }, "potential_range_indexes": [ { @@ -2092,7 +2193,7 @@ explain select * from t1 where a=1 and b=2 order by c limit 1 { "using_mrr": false, "index_only": false, "rows": 180, - "cost": 216.2943776, + "cost": 135.6693776, "chosen": true }, { @@ -2102,7 +2203,7 @@ explain select * from t1 where a=1 and b=2 order by c limit 1 { "using_mrr": false, "index_only": false, "rows": 21, - "cost": 25.36242739, + "cost": 16.28742739, "chosen": true } ], @@ -2123,7 +2224,7 @@ explain select * from t1 where a=1 and b=2 order by c limit 1 { "ranges": ["(1,2) <= (a,b) <= (1,2)"] }, "rows_for_plan": 21, - "cost_for_plan": 25.36242739, + "cost_for_plan": 16.28742739, "chosen": true } } @@ -2133,12 +2234,12 @@ explain select * from t1 where a=1 and b=2 order by c limit 1 { "rowid_filters": [ { "key": "a_b", - "build_cost": 0.886777098, + "build_cost": 1.127362357, "rows": 21 }, { "key": "a_c", - "build_cost": 10.52169992, + "build_cost": 6.264109827, "rows": 180 } ] @@ -2172,16 +2273,16 @@ explain select * from t1 where a=1 and b=2 order by c limit 1 { "plan_prefix": [], "table": "t1", "best_access_path": { + "plan_details": { + "record_count": 1 + }, "considered_access_paths": [ { "access_type": "ref", "index": "a_c", "used_range_estimates": true, "rows": 180, - "found_matching_rows_cost": 216.2743776, - "startup_cost": 0, - "rows": 180, - "cost": 216.2743776, + "cost": 135.6493776, "chosen": true }, { @@ -2189,10 +2290,7 @@ explain select * from t1 where a=1 and b=2 order by c limit 1 { "index": "a_b", "used_range_estimates": true, "rows": 21, - "found_matching_rows_cost": 25.34242739, - "startup_cost": 0, - "rows": 21, - "cost": 25.34242739, + "cost": 16.26742739, "chosen": true }, { @@ -2204,12 +2302,12 @@ explain select * from t1 where a=1 and b=2 order by c limit 1 { "chosen_access_method": { "type": "ref", "records": 21, - "cost": 25.34242739, + "cost": 16.26742739, "uses_join_buffering": false } }, "rows_for_plan": 21, - "cost_for_plan": 29.54242739, + "cost_for_plan": 16.26742739, "estimated_join_cardinality": 21 } ] @@ -2217,7 +2315,8 @@ explain select * from t1 where a=1 and b=2 order by c limit 1 { { "best_join_order": ["t1"], "best_access_method": { - "cost": 29.54142739 + "rows": 21, + "cost": 16.26742739 } }, { @@ -2241,7 +2340,7 @@ explain select * from t1 where a=1 and b=2 order by c limit 1 { "reconsidering_access_paths_for_index_ordering": { "clause": "ORDER BY", "fanout": 1, - "read_time": 25.34342739, + "read_time": 16.26742739, "table": "t1", "rows_estimation": 21, "possible_keys": [ @@ -2249,7 +2348,7 @@ explain select * from t1 where a=1 and b=2 order by c limit 1 { "index": "a_a", "can_resolve_order": true, "updated_limit": 47, - "index_scan_time": 47, + "index_scan_cost": 35.77753234, "usable": false, "cause": "cost" }, @@ -2257,9 +2356,9 @@ explain select * from t1 where a=1 and b=2 order by c limit 1 { "index": "a_c", "can_resolve_order": true, "updated_limit": 47, - "range_scan_time": 4.331020747, - "index_scan_time": 4.331020747, - "records": 180, + "index_scan_cost": 35.78900415, + "range_scan_cost": 6.375520747, + "rows": 180, "chosen": true }, { @@ -2304,7 +2403,7 @@ explain select * from t1 where a=1 and b=2 order by c limit 1 { "using_mrr": false, "index_only": false, "rows": 180, - "cost": 216.2943776, + "cost": 135.6693776, "chosen": true } ], @@ -2325,7 +2424,7 @@ explain select * from t1 where a=1 and b=2 order by c limit 1 { "ranges": ["(1) <= (a) <= (1)"] }, "rows_for_plan": 180, - "cost_for_plan": 216.2943776, + "cost_for_plan": 135.6693776, "chosen": true } } @@ -2431,7 +2530,8 @@ select t1.a from t1 left join t2 on t1.a=t2.a { "table": "t1", "table_scan": { "rows": 4, - "cost": 2.006835938 + "read_cost": 1.203417969, + "read_and_compare_cost": 2.203417969 } }, { @@ -2448,23 +2548,29 @@ select t1.a from t1 left join t2 on t1.a=t2.a { "plan_prefix": ["t2"], "table": "t1", "best_access_path": { + "plan_details": { + "record_count": 1 + }, "considered_access_paths": [ { "access_type": "scan", - "resulting_rows": 4, - "cost": 2.806835937, + "rows": 4, + "rows_after_scan": 4, + "rows_after_filter": 4, + "cost": 2.203417969, + "index_only": false, "chosen": true } ], "chosen_access_method": { "type": "scan", "records": 4, - "cost": 2.806835937, + "cost": 2.203417969, "uses_join_buffering": false } }, "rows_for_plan": 4, - "cost_for_plan": 3.606835937, + "cost_for_plan": 2.203417969, "estimated_join_cardinality": 4 } ] @@ -2472,7 +2578,8 @@ select t1.a from t1 left join t2 on t1.a=t2.a { { "best_join_order": ["t2", "t1"], "best_access_method": { - "cost": 3.605835937 + "rows": 4, + "cost": 2.203417969 } }, { @@ -2571,14 +2678,16 @@ explain select * from t1 left join t2 on t2.a=t1.a { "table": "t1", "table_scan": { "rows": 4, - "cost": 2.006835938 + "read_cost": 1.203417969, + "read_and_compare_cost": 2.203417969 } }, { "table": "t2", "table_scan": { "rows": 2, - "cost": 2.004394531 + "read_cost": 1.102197266, + "read_and_compare_cost": 1.602197266 } } ] @@ -2589,55 +2698,64 @@ explain select * from t1 left join t2 on t2.a=t1.a { "plan_prefix": [], "table": "t1", "best_access_path": { + "plan_details": { + "record_count": 1 + }, "considered_access_paths": [ { "access_type": "scan", - "resulting_rows": 4, - "cost": 2.806835937, + "rows": 4, + "rows_after_scan": 4, + "rows_after_filter": 4, + "cost": 2.203417969, + "index_only": false, "chosen": true } ], "chosen_access_method": { "type": "scan", "records": 4, - "cost": 2.806835937, + "cost": 2.203417969, "uses_join_buffering": false } }, "rows_for_plan": 4, - "cost_for_plan": 3.606835937, + "cost_for_plan": 2.203417969, "rest_of_plan": [ { "plan_prefix": ["t1"], "table": "t2", "best_access_path": { + "plan_details": { + "record_count": 4 + }, "considered_access_paths": [ { "access_type": "eq_ref", "index": "PRIMARY", "rows": 1, - "found_matching_rows_cost": 1.2, - "startup_cost": 0, - "rows": 1, - "cost": 4.8, + "cost": 5.002147913, "chosen": true }, { "access_type": "scan", - "resulting_rows": 1.5, - "cost": 10.81757812, + "rows": 2, + "rows_after_scan": 1.5, + "rows_after_filter": 1.5, + "cost": 6.408789063, + "index_only": false, "chosen": false } ], "chosen_access_method": { "type": "eq_ref", "records": 1, - "cost": 4.8, + "cost": 5.002147913, "uses_join_buffering": false } }, "rows_for_plan": 4, - "cost_for_plan": 9.206835937, + "cost_for_plan": 7.205565882, "estimated_join_cardinality": 4 } ] @@ -2647,7 +2765,8 @@ explain select * from t1 left join t2 on t2.a=t1.a { { "best_join_order": ["t1", "t2"], "best_access_method": { - "cost": 9.205835937 + "rows": 4, + "cost": 7.205565882 } }, { @@ -2780,7 +2899,8 @@ explain select t1.a from t1 left join (t2 join t3 on t2.b=t3.b) on t2.a=t1.a and "table": "t1", "table_scan": { "rows": 4, - "cost": 2.006835938 + "read_cost": 1.203417969, + "read_and_compare_cost": 2.203417969 } }, { @@ -2803,23 +2923,29 @@ explain select t1.a from t1 left join (t2 join t3 on t2.b=t3.b) on t2.a=t1.a and "plan_prefix": ["t3", "t2"], "table": "t1", "best_access_path": { + "plan_details": { + "record_count": 1 + }, "considered_access_paths": [ { "access_type": "scan", - "resulting_rows": 4, - "cost": 2.806835937, + "rows": 4, + "rows_after_scan": 4, + "rows_after_filter": 4, + "cost": 2.203417969, + "index_only": false, "chosen": true } ], "chosen_access_method": { "type": "scan", "records": 4, - "cost": 2.806835937, + "cost": 2.203417969, "uses_join_buffering": false } }, "rows_for_plan": 4, - "cost_for_plan": 3.606835937, + "cost_for_plan": 2.203417969, "estimated_join_cardinality": 4 } ] @@ -2827,7 +2953,8 @@ explain select t1.a from t1 left join (t2 join t3 on t2.b=t3.b) on t2.a=t1.a and { "best_join_order": ["t3", "t2", "t1"], "best_access_method": { - "cost": 3.605835937 + "rows": 4, + "cost": 2.203417969 } }, { @@ -2987,14 +3114,16 @@ explain extended select * from t1 where a in (select pk from t10) { "table": "t1", "table_scan": { "rows": 3, - "cost": 2.006591797 + "read_cost": 1.153295898, + "read_and_compare_cost": 1.903295898 } }, { "table": "t10", "table_scan": { "rows": 10, - "cost": 2.021972656 + "read_cost": 1.510986328, + "read_and_compare_cost": 4.010986328 } } ] @@ -3013,23 +3142,29 @@ explain extended select * from t1 where a in (select pk from t10) { "plan_prefix": [], "table": "t10", "best_access_path": { + "plan_details": { + "record_count": 1 + }, "considered_access_paths": [ { "access_type": "scan", - "resulting_rows": 10, - "cost": 4.021972656, + "rows": 10, + "rows_after_scan": 10, + "rows_after_filter": 10, + "cost": 4.010986328, + "index_only": false, "chosen": true } ], "chosen_access_method": { "type": "scan", "records": 10, - "cost": 4.021972656, + "cost": 4.010986328, "uses_join_buffering": false } }, "rows_for_plan": 10, - "cost_for_plan": 6.021972656, + "cost_for_plan": 4.010986328, "estimated_join_cardinality": 10 } ] @@ -3043,61 +3178,76 @@ explain extended select * from t1 where a in (select pk from t10) { "plan_prefix": [], "table": "t1", "best_access_path": { + "plan_details": { + "record_count": 1 + }, "considered_access_paths": [ { "access_type": "scan", - "resulting_rows": 3, - "cost": 2.606591797, + "rows": 3, + "rows_after_scan": 3, + "rows_after_filter": 3, + "cost": 1.903295898, + "index_only": false, "chosen": true } ], "chosen_access_method": { "type": "scan", "records": 3, - "cost": 2.606591797, + "cost": 1.903295898, "uses_join_buffering": false } }, "rows_for_plan": 3, - "cost_for_plan": 3.206591797, + "cost_for_plan": 1.903295898, "semijoin_strategy_choice": [], "rest_of_plan": [ { "plan_prefix": ["t1"], "table": "t10", "best_access_path": { + "plan_details": { + "record_count": 3 + }, "considered_access_paths": [ { - "access_type": "scan", - "resulting_rows": 10, - "cost": 10.02197266, + "access_type": "scan_with_join_cache", + "rows": 10, + "rows_after_scan": 10, + "rows_after_filter": 10, + "cost": 11.51098633, + "index_only": false, "chosen": true } ], "chosen_access_method": { "type": "scan", "records": 10, - "cost": 10.02197266, + "cost": 11.51098633, "uses_join_buffering": true } }, "rows_for_plan": 30, - "cost_for_plan": 19.22856445, + "cost_for_plan": 13.41428223, "semijoin_strategy_choice": [ { "strategy": "FirstMatch", "records": 3, - "read_time": 19.22856445 + "cost": 13.41428223 }, { "strategy": "SJ-Materialization", "records": 3, - "cost": 7.878564453 + "cost": 7.564282227 }, { "strategy": "DuplicateWeedout", "records": 3, - "read_time": 35.72856445 + "dups_cost": 13.41428223, + "write_cost": 2.5, + "full_lookup_cost": 15, + "total_cost": 30.91428223 }, { "chosen_strategy": "SJ-Materialization" @@ -3111,23 +3261,29 @@ explain extended select * from t1 where a in (select pk from t10) { "plan_prefix": [], "table": "t10", "best_access_path": { + "plan_details": { + "record_count": 1 + }, "considered_access_paths": [ { "access_type": "scan", - "resulting_rows": 10, - "cost": 4.021972656, + "rows": 10, + "rows_after_scan": 10, + "rows_after_filter": 10, + "cost": 4.010986328, + "index_only": false, "chosen": true } ], "chosen_access_method": { "type": "scan", "records": 10, - "cost": 4.021972656, + "cost": 4.010986328, "uses_join_buffering": false } }, "rows_for_plan": 10, - "cost_for_plan": 6.021972656, + "cost_for_plan": 4.010986328, "semijoin_strategy_choice": [], "pruned_by_heuristic": true } @@ -3148,7 +3304,8 @@ explain extended select * from t1 where a in (select pk from t10) { { "best_join_order": ["t1", "<subquery2>"], "best_access_method": { - "cost": 7.877564453 + "rows": 3, + "cost": 7.564282227 } }, { @@ -3311,7 +3468,7 @@ explain select * from t1 where pk = 2 and a=5 and b=1 { "range_analysis": { "table_scan": { "rows": 10, - "cost": 6.031738281 + "cost": 3.515869141 }, "potential_range_indexes": [ { @@ -3332,7 +3489,7 @@ explain select * from t1 where pk = 2 and a=5 and b=1 { ], "best_covering_index_scan": { "index": "pk_a_b", - "cost": 3.010739566, + "cost": 2.760739566, "chosen": true }, "setup_range_conditions": [], @@ -3345,7 +3502,7 @@ explain select * from t1 where pk = 2 and a=5 and b=1 { "using_mrr": false, "index_only": false, "rows": 1, - "cost": 1.345585794, + "cost": 1.270585794, "chosen": true }, { @@ -3355,7 +3512,7 @@ explain select * from t1 where pk = 2 and a=5 and b=1 { "using_mrr": false, "index_only": false, "rows": 1, - "cost": 1.345829876, + "cost": 1.270829876, "chosen": false, "cause": "cost" }, @@ -3366,7 +3523,7 @@ explain select * from t1 where pk = 2 and a=5 and b=1 { "using_mrr": false, "index_only": true, "rows": 1, - "cost": 0.346073957, + "cost": 0.746073957, "chosen": true } ], @@ -3374,10 +3531,10 @@ explain select * from t1 where pk = 2 and a=5 and b=1 { "intersecting_indexes": [ { "index": "pk", - "index_scan_cost": 1.000585794, - "cumulated_index_scan_cost": 1.000585794, - "disk_sweep_cost": 0.90078125, - "cumulative_total_cost": 1.901367044, + "index_scan_cost": 0.525585794, + "cumulated_index_scan_cost": 0.525585794, + "disk_sweep_cost": 0.75, + "cumulative_total_cost": 1.275585794, "usable": true, "matching_rows_now": 1, "intersect_covering_with_this_index": false, @@ -3415,7 +3572,7 @@ explain select * from t1 where pk = 2 and a=5 and b=1 { "ranges": ["(2,5,1) <= (pk,a,b) <= (2,5,1)"] }, "rows_for_plan": 1, - "cost_for_plan": 0.346073957, + "cost_for_plan": 0.746073957, "chosen": true } } @@ -3425,17 +3582,17 @@ explain select * from t1 where pk = 2 and a=5 and b=1 { "rowid_filters": [ { "key": "pk", - "build_cost": 0.130585794, + "build_cost": 0.526585794, "rows": 1 }, { "key": "pk_a", - "build_cost": 0.130829876, + "build_cost": 0.526829876, "rows": 1 }, { "key": "pk_a_b", - "build_cost": 0.131073957, + "build_cost": 0.527073957, "rows": 1 } ] @@ -3469,16 +3626,16 @@ explain select * from t1 where pk = 2 and a=5 and b=1 { "plan_prefix": [], "table": "t1", "best_access_path": { + "plan_details": { + "record_count": 1 + }, "considered_access_paths": [ { "access_type": "ref", "index": "pk", "used_range_estimates": true, "rows": 1, - "found_matching_rows_cost": 1.325585794, - "startup_cost": 0, - "rows": 1, - "cost": 1.325585794, + "cost": 1.250585794, "chosen": true }, { @@ -3486,10 +3643,7 @@ explain select * from t1 where pk = 2 and a=5 and b=1 { "index": "pk_a", "used_range_estimates": true, "rows": 1, - "found_matching_rows_cost": 1.325829876, - "startup_cost": 0, - "rows": 1, - "cost": 1.325829876, + "cost": 1.250829876, "chosen": false, "cause": "cost" }, @@ -3498,10 +3652,7 @@ explain select * from t1 where pk = 2 and a=5 and b=1 { "index": "pk_a_b", "used_range_estimates": true, "rows": 1, - "found_matching_rows_cost": 0.326073957, - "startup_cost": 0, - "rows": 1, - "cost": 0.326073957, + "cost": 0.726073957, "chosen": true }, { @@ -3513,12 +3664,12 @@ explain select * from t1 where pk = 2 and a=5 and b=1 { "chosen_access_method": { "type": "ref", "records": 1, - "cost": 0.326073957, + "cost": 0.726073957, "uses_join_buffering": false } }, "rows_for_plan": 1, - "cost_for_plan": 0.526073957, + "cost_for_plan": 0.726073957, "estimated_join_cardinality": 1 } ] @@ -3526,7 +3677,8 @@ explain select * from t1 where pk = 2 and a=5 and b=1 { { "best_join_order": ["t1"], "best_access_method": { - "cost": 0.525073957 + "rows": 1, + "cost": 0.726073957 } }, { @@ -3623,7 +3775,8 @@ select f1(a) from t1 { "table": "t1", "table_scan": { "rows": 4, - "cost": 2.006835938 + "read_cost": 1.203417969, + "read_and_compare_cost": 2.203417969 } } ] @@ -3634,23 +3787,29 @@ select f1(a) from t1 { "plan_prefix": [], "table": "t1", "best_access_path": { + "plan_details": { + "record_count": 1 + }, "considered_access_paths": [ { "access_type": "scan", - "resulting_rows": 4, - "cost": 2.806835937, + "rows": 4, + "rows_after_scan": 4, + "rows_after_filter": 4, + "cost": 2.203417969, + "index_only": false, "chosen": true } ], "chosen_access_method": { "type": "scan", "records": 4, - "cost": 2.806835937, + "cost": 2.203417969, "uses_join_buffering": false } }, "rows_for_plan": 4, - "cost_for_plan": 3.606835937, + "cost_for_plan": 2.203417969, "estimated_join_cardinality": 4 } ] @@ -3658,7 +3817,8 @@ select f1(a) from t1 { { "best_join_order": ["t1"], "best_access_method": { - "cost": 3.605835937 + "rows": 4, + "cost": 2.203417969 } }, { @@ -3723,7 +3883,8 @@ select f2(a) from t1 { "table": "t1", "table_scan": { "rows": 4, - "cost": 2.006835938 + "read_cost": 1.203417969, + "read_and_compare_cost": 2.203417969 } } ] @@ -3734,23 +3895,29 @@ select f2(a) from t1 { "plan_prefix": [], "table": "t1", "best_access_path": { + "plan_details": { + "record_count": 1 + }, "considered_access_paths": [ { "access_type": "scan", - "resulting_rows": 4, - "cost": 2.806835937, + "rows": 4, + "rows_after_scan": 4, + "rows_after_filter": 4, + "cost": 2.203417969, + "index_only": false, "chosen": true } ], "chosen_access_method": { "type": "scan", "records": 4, - "cost": 2.806835937, + "cost": 2.203417969, "uses_join_buffering": false } }, "rows_for_plan": 4, - "cost_for_plan": 3.606835937, + "cost_for_plan": 2.203417969, "estimated_join_cardinality": 4 } ] @@ -3758,7 +3925,8 @@ select f2(a) from t1 { { "best_join_order": ["t1"], "best_access_method": { - "cost": 3.605835937 + "rows": 4, + "cost": 2.203417969 } }, { @@ -3800,7 +3968,7 @@ a 2 select length(trace) from INFORMATION_SCHEMA.OPTIMIZER_TRACE; length(trace) -2226 +2530 set optimizer_trace_max_mem_size=100; select * from t1; a @@ -3814,7 +3982,7 @@ select * from t1 { "join_preparation": { "select_id": 1, "steps": [ - 2126 0 + 2430 0 set optimizer_trace_max_mem_size=0; select * from t1; a @@ -3822,7 +3990,7 @@ a 2 select * from INFORMATION_SCHEMA.OPTIMIZER_TRACE; QUERY TRACE MISSING_BYTES_BEYOND_MAX_MEM_SIZE INSUFFICIENT_PRIVILEGES -select * from t1 2226 0 +select * from t1 2530 0 drop table t1; set optimizer_trace='enabled=off'; set @@optimizer_trace_max_mem_size= @save_optimizer_trace_max_mem_size; @@ -3847,7 +4015,7 @@ explain delete from t0 where t0.a<3 { "range_analysis": { "table_scan": { "rows": 10, - "cost": 6.021972656 + "cost": 3.510986328 }, "potential_range_indexes": [ { @@ -3866,7 +4034,7 @@ explain delete from t0 where t0.a<3 { "using_mrr": false, "index_only": false, "rows": 3, - "cost": 3.746757383, + "cost": 2.771757383, "chosen": true } ], @@ -3884,7 +4052,7 @@ explain delete from t0 where t0.a<3 { "ranges": ["(NULL) < (a) < (3)"] }, "rows_for_plan": 3, - "cost_for_plan": 3.746757383, + "cost_for_plan": 2.771757383, "chosen": true } } @@ -3985,7 +4153,7 @@ explain delete t0,t1 from t0, t1 where t0.a=t1.a and t1.a<3 { "range_analysis": { "table_scan": { "rows": 10, - "cost": 6.021972656 + "cost": 3.510986328 }, "potential_range_indexes": [ { @@ -3996,7 +4164,7 @@ explain delete t0,t1 from t0, t1 where t0.a=t1.a and t1.a<3 { ], "best_covering_index_scan": { "index": "a", - "cost": 3.005857945, + "cost": 2.755857945, "chosen": true }, "setup_range_conditions": [], @@ -4009,7 +4177,7 @@ explain delete t0,t1 from t0, t1 where t0.a=t1.a and t1.a<3 { "using_mrr": false, "index_only": true, "rows": 3, - "cost": 0.746757383, + "cost": 1.196757383, "chosen": true } ], @@ -4030,7 +4198,7 @@ explain delete t0,t1 from t0, t1 where t0.a=t1.a and t1.a<3 { "ranges": ["(NULL) < (a) < (3)"] }, "rows_for_plan": 3, - "cost_for_plan": 0.746757383, + "cost_for_plan": 1.196757383, "chosen": true } } @@ -4050,7 +4218,7 @@ explain delete t0,t1 from t0, t1 where t0.a=t1.a and t1.a<3 { "range_analysis": { "table_scan": { "rows": 10, - "cost": 6.021972656 + "cost": 3.510986328 }, "potential_range_indexes": [ { @@ -4061,7 +4229,7 @@ explain delete t0,t1 from t0, t1 where t0.a=t1.a and t1.a<3 { ], "best_covering_index_scan": { "index": "a", - "cost": 3.005857945, + "cost": 2.755857945, "chosen": true }, "setup_range_conditions": [], @@ -4074,7 +4242,7 @@ explain delete t0,t1 from t0, t1 where t0.a=t1.a and t1.a<3 { "using_mrr": false, "index_only": true, "rows": 3, - "cost": 0.746757383, + "cost": 1.196757383, "chosen": true } ], @@ -4095,7 +4263,7 @@ explain delete t0,t1 from t0, t1 where t0.a=t1.a and t1.a<3 { "ranges": ["(NULL) < (a) < (3)"] }, "rows_for_plan": 3, - "cost_for_plan": 0.746757383, + "cost_for_plan": 1.196757383, "chosen": true } } @@ -4118,28 +4286,36 @@ explain delete t0,t1 from t0, t1 where t0.a=t1.a and t1.a<3 { "plan_prefix": [], "table": "t0", "best_access_path": { + "plan_details": { + "record_count": 1 + }, "considered_access_paths": [ { "access_type": "range", - "resulting_rows": 3, - "cost": 0.746757383, + "rows": 3, + "rows_after_scan": 3, + "rows_after_filter": 3, + "cost": 1.196757383, "chosen": true } ], "chosen_access_method": { "type": "range", "records": 3, - "cost": 0.746757383, + "cost": 1.196757383, "uses_join_buffering": false } }, "rows_for_plan": 3, - "cost_for_plan": 1.346757383, + "cost_for_plan": 1.196757383, "rest_of_plan": [ { "plan_prefix": ["t0"], "table": "t1", "best_access_path": { + "plan_details": { + "record_count": 3 + }, "considered_access_paths": [ { "access_type": "ref", @@ -4147,10 +4323,7 @@ explain delete t0,t1 from t0, t1 where t0.a=t1.a and t1.a<3 { "used_range_estimates": false, "cause": "not better than ref estimates", "rows": 1, - "found_matching_rows_cost": 1.200585794, - "startup_cost": 0, - "rows": 1, - "cost": 3.601757383, + "cost": 2.176757383, "chosen": true }, { @@ -4162,12 +4335,12 @@ explain delete t0,t1 from t0, t1 where t0.a=t1.a and t1.a<3 { "chosen_access_method": { "type": "ref", "records": 1, - "cost": 3.601757383, + "cost": 2.176757383, "uses_join_buffering": false } }, "rows_for_plan": 3, - "cost_for_plan": 5.548514767, + "cost_for_plan": 3.373514767, "estimated_join_cardinality": 3 } ] @@ -4176,28 +4349,36 @@ explain delete t0,t1 from t0, t1 where t0.a=t1.a and t1.a<3 { "plan_prefix": [], "table": "t1", "best_access_path": { + "plan_details": { + "record_count": 1 + }, "considered_access_paths": [ { "access_type": "range", - "resulting_rows": 3, - "cost": 0.746757383, + "rows": 3, + "rows_after_scan": 3, + "rows_after_filter": 3, + "cost": 1.196757383, "chosen": true } ], "chosen_access_method": { "type": "range", "records": 3, - "cost": 0.746757383, + "cost": 1.196757383, "uses_join_buffering": false } }, "rows_for_plan": 3, - "cost_for_plan": 1.346757383, + "cost_for_plan": 1.196757383, "rest_of_plan": [ { "plan_prefix": ["t1"], "table": "t0", "best_access_path": { + "plan_details": { + "record_count": 3 + }, "considered_access_paths": [ { "access_type": "ref", @@ -4206,10 +4387,7 @@ explain delete t0,t1 from t0, t1 where t0.a=t1.a and t1.a<3 { "used_range_estimates": false, "cause": "not better than ref estimates", "rows": 2, - "found_matching_rows_cost": 1.401171589, - "startup_cost": 0, - "rows": 2, - "cost": 4.203514767, + "cost": 2.853514767, "chosen": true }, { @@ -4221,12 +4399,12 @@ explain delete t0,t1 from t0, t1 where t0.a=t1.a and t1.a<3 { "chosen_access_method": { "type": "ref", "records": 2, - "cost": 4.203514767, + "cost": 2.853514767, "uses_join_buffering": false } }, "rows_for_plan": 6, - "cost_for_plan": 6.75027215, + "cost_for_plan": 4.05027215, "pruned_by_cost": true } ] @@ -4236,7 +4414,8 @@ explain delete t0,t1 from t0, t1 where t0.a=t1.a and t1.a<3 { { "best_join_order": ["t0", "t1"], "best_access_method": { - "cost": 5.547514767 + "rows": 3, + "cost": 3.373514767 } }, { @@ -4346,7 +4525,8 @@ explain select * from (select rand() from t1)q { "table": "t1", "table_scan": { "rows": 3, - "cost": 2.005126953 + "read_cost": 1.152563477, + "read_and_compare_cost": 1.902563477 } } ] @@ -4357,23 +4537,29 @@ explain select * from (select rand() from t1)q { "plan_prefix": [], "table": "t1", "best_access_path": { + "plan_details": { + "record_count": 1 + }, "considered_access_paths": [ { "access_type": "scan", - "resulting_rows": 3, - "cost": 2.605126953, + "rows": 3, + "rows_after_scan": 3, + "rows_after_filter": 3, + "cost": 1.902563477, + "index_only": false, "chosen": true } ], "chosen_access_method": { "type": "scan", "records": 3, - "cost": 2.605126953, + "cost": 1.902563477, "uses_join_buffering": false } }, "rows_for_plan": 3, - "cost_for_plan": 3.205126953, + "cost_for_plan": 1.902563477, "estimated_join_cardinality": 3 } ] @@ -4381,7 +4567,8 @@ explain select * from (select rand() from t1)q { { "best_join_order": ["t1"], "best_access_method": { - "cost": 3.204126953 + "rows": 3, + "cost": 1.902563477 } }, { @@ -4414,7 +4601,8 @@ explain select * from (select rand() from t1)q { "table": "<derived2>", "table_scan": { "rows": 3, - "cost": 3 + "read_cost": 3, + "read_and_compare_cost": 3.75 } } ] @@ -4425,23 +4613,29 @@ explain select * from (select rand() from t1)q { "plan_prefix": [], "table": "<derived2>", "best_access_path": { + "plan_details": { + "record_count": 1 + }, "considered_access_paths": [ { "access_type": "scan", - "resulting_rows": 3, - "cost": 3.6, + "rows": 3, + "rows_after_scan": 3, + "rows_after_filter": 3, + "cost": 3.75, + "index_only": false, "chosen": true } ], "chosen_access_method": { "type": "scan", "records": 3, - "cost": 3.6, + "cost": 3.75, "uses_join_buffering": false } }, "rows_for_plan": 3, - "cost_for_plan": 4.2, + "cost_for_plan": 3.75, "estimated_join_cardinality": 3 } ] @@ -4449,7 +4643,8 @@ explain select * from (select rand() from t1)q { { "best_join_order": ["<derived2>"], "best_access_method": { - "cost": 4.199 + "rows": 3, + "cost": 3.75 } }, { @@ -4602,21 +4797,24 @@ explain select * from t1 where a in (select t_inner_1.a from t1 t_inner_1, t1 t_ "table": "t1", "table_scan": { "rows": 3, - "cost": 2.005126953 + "read_cost": 1.152563477, + "read_and_compare_cost": 1.902563477 } }, { "table": "t_inner_1", "table_scan": { "rows": 3, - "cost": 2.005126953 + "read_cost": 1.152563477, + "read_and_compare_cost": 1.902563477 } }, { "table": "t_inner_2", "table_scan": { "rows": 3, - "cost": 2.005126953 + "read_cost": 1.152563477, + "read_and_compare_cost": 1.902563477 } } ] @@ -4635,45 +4833,57 @@ explain select * from t1 where a in (select t_inner_1.a from t1 t_inner_1, t1 t_ "plan_prefix": [], "table": "t_inner_1", "best_access_path": { + "plan_details": { + "record_count": 1 + }, "considered_access_paths": [ { "access_type": "scan", - "resulting_rows": 3, - "cost": 2.605126953, + "rows": 3, + "rows_after_scan": 3, + "rows_after_filter": 3, + "cost": 1.902563477, + "index_only": false, "chosen": true } ], "chosen_access_method": { "type": "scan", "records": 3, - "cost": 2.605126953, + "cost": 1.902563477, "uses_join_buffering": false } }, "rows_for_plan": 3, - "cost_for_plan": 3.205126953, + "cost_for_plan": 1.902563477, "rest_of_plan": [ { "plan_prefix": ["t_inner_1"], "table": "t_inner_2", "best_access_path": { + "plan_details": { + "record_count": 3 + }, "considered_access_paths": [ { - "access_type": "scan", - "resulting_rows": 3, - "cost": 4.405126953, + "access_type": "scan_with_join_cache", + "rows": 3, + "rows_after_scan": 3, + "rows_after_filter": 3, + "cost": 4.152563477, + "index_only": false, "chosen": true } ], "chosen_access_method": { "type": "scan", "records": 3, - "cost": 4.405126953, + "cost": 4.152563477, "uses_join_buffering": true } }, "rows_for_plan": 9, - "cost_for_plan": 9.410253906, + "cost_for_plan": 6.055126953, "estimated_join_cardinality": 9 } ] @@ -4682,23 +4892,29 @@ explain select * from t1 where a in (select t_inner_1.a from t1 t_inner_1, t1 t_ "plan_prefix": [], "table": "t_inner_2", "best_access_path": { + "plan_details": { + "record_count": 1 + }, "considered_access_paths": [ { "access_type": "scan", - "resulting_rows": 3, - "cost": 2.605126953, + "rows": 3, + "rows_after_scan": 3, + "rows_after_filter": 3, + "cost": 1.902563477, + "index_only": false, "chosen": true } ], "chosen_access_method": { "type": "scan", "records": 3, - "cost": 2.605126953, + "cost": 1.902563477, "uses_join_buffering": false } }, "rows_for_plan": 3, - "cost_for_plan": 3.205126953, + "cost_for_plan": 1.902563477, "pruned_by_heuristic": true } ] @@ -4712,84 +4928,105 @@ explain select * from t1 where a in (select t_inner_1.a from t1 t_inner_1, t1 t_ "plan_prefix": [], "table": "t1", "best_access_path": { + "plan_details": { + "record_count": 1 + }, "considered_access_paths": [ { "access_type": "scan", - "resulting_rows": 3, - "cost": 2.605126953, + "rows": 3, + "rows_after_scan": 3, + "rows_after_filter": 3, + "cost": 1.902563477, + "index_only": false, "chosen": true } ], "chosen_access_method": { "type": "scan", "records": 3, - "cost": 2.605126953, + "cost": 1.902563477, "uses_join_buffering": false } }, "rows_for_plan": 3, - "cost_for_plan": 3.205126953, + "cost_for_plan": 1.902563477, "semijoin_strategy_choice": [], "rest_of_plan": [ { "plan_prefix": ["t1"], "table": "t_inner_1", "best_access_path": { + "plan_details": { + "record_count": 3 + }, "considered_access_paths": [ { - "access_type": "scan", - "resulting_rows": 3, - "cost": 4.405126953, + "access_type": "scan_with_join_cache", + "rows": 3, + "rows_after_scan": 3, + "rows_after_filter": 3, + "cost": 4.152563477, + "index_only": false, "chosen": true } ], "chosen_access_method": { "type": "scan", "records": 3, - "cost": 4.405126953, + "cost": 4.152563477, "uses_join_buffering": true } }, "rows_for_plan": 9, - "cost_for_plan": 9.410253906, + "cost_for_plan": 6.055126953, "semijoin_strategy_choice": [], "rest_of_plan": [ { "plan_prefix": ["t1", "t_inner_1"], "table": "t_inner_2", "best_access_path": { + "plan_details": { + "record_count": 9 + }, "considered_access_paths": [ { - "access_type": "scan", - "resulting_rows": 3, - "cost": 8.005126953, + "access_type": "scan_with_join_cache", + "rows": 3, + "rows_after_scan": 3, + "rows_after_filter": 3, + "cost": 10.00256348, + "index_only": false, "chosen": true } ], "chosen_access_method": { "type": "scan", "records": 3, - "cost": 8.005126953, + "cost": 10.00256348, "uses_join_buffering": true } }, "rows_for_plan": 27, - "cost_for_plan": 22.81538086, + "cost_for_plan": 16.05769043, "semijoin_strategy_choice": [ { "strategy": "FirstMatch", "records": 3, - "read_time": 48.86665039 + "cost": 24.7333252 }, { "strategy": "SJ-Materialization", "records": 3, - "cost": 10.81538086 + "cost": 9.55769043 }, { "strategy": "DuplicateWeedout", "records": 3, - "read_time": 27.31538086 + "dups_cost": 16.05769043, + "write_cost": 1.45, + "full_lookup_cost": 4.05, + "total_cost": 21.55769043 }, { "chosen_strategy": "SJ-Materialization" @@ -4803,23 +5040,29 @@ explain select * from t1 where a in (select t_inner_1.a from t1 t_inner_1, t1 t_ "plan_prefix": ["t1"], "table": "t_inner_2", "best_access_path": { + "plan_details": { + "record_count": 3 + }, "considered_access_paths": [ { - "access_type": "scan", - "resulting_rows": 3, - "cost": 4.405126953, + "access_type": "scan_with_join_cache", + "rows": 3, + "rows_after_scan": 3, + "rows_after_filter": 3, + "cost": 4.152563477, + "index_only": false, "chosen": true } ], "chosen_access_method": { "type": "scan", "records": 3, - "cost": 4.405126953, + "cost": 4.152563477, "uses_join_buffering": true } }, "rows_for_plan": 9, - "cost_for_plan": 9.410253906, + "cost_for_plan": 6.055126953, "semijoin_strategy_choice": [], "pruned_by_heuristic": true } @@ -4829,23 +5072,29 @@ explain select * from t1 where a in (select t_inner_1.a from t1 t_inner_1, t1 t_ "plan_prefix": [], "table": "t_inner_1", "best_access_path": { + "plan_details": { + "record_count": 1 + }, "considered_access_paths": [ { "access_type": "scan", - "resulting_rows": 3, - "cost": 2.605126953, + "rows": 3, + "rows_after_scan": 3, + "rows_after_filter": 3, + "cost": 1.902563477, + "index_only": false, "chosen": true } ], "chosen_access_method": { "type": "scan", "records": 3, - "cost": 2.605126953, + "cost": 1.902563477, "uses_join_buffering": false } }, "rows_for_plan": 3, - "cost_for_plan": 3.205126953, + "cost_for_plan": 1.902563477, "semijoin_strategy_choice": [], "pruned_by_heuristic": true }, @@ -4853,23 +5102,29 @@ explain select * from t1 where a in (select t_inner_1.a from t1 t_inner_1, t1 t_ "plan_prefix": [], "table": "t_inner_2", "best_access_path": { + "plan_details": { + "record_count": 1 + }, "considered_access_paths": [ { "access_type": "scan", - "resulting_rows": 3, - "cost": 2.605126953, + "rows": 3, + "rows_after_scan": 3, + "rows_after_filter": 3, + "cost": 1.902563477, + "index_only": false, "chosen": true } ], "chosen_access_method": { "type": "scan", "records": 3, - "cost": 2.605126953, + "cost": 1.902563477, "uses_join_buffering": false } }, "rows_for_plan": 3, - "cost_for_plan": 3.205126953, + "cost_for_plan": 1.902563477, "semijoin_strategy_choice": [], "pruned_by_heuristic": true } @@ -4893,7 +5148,8 @@ explain select * from t1 where a in (select t_inner_1.a from t1 t_inner_1, t1 t_ { "best_join_order": ["t1", "<subquery2>"], "best_access_method": { - "cost": 10.81438086 + "rows": 3, + "cost": 9.55769043 } }, { @@ -4945,11 +5201,11 @@ explain select * from t1 t_outer_1,t2 t_outer_2 where t_outer_1.a in (select t_ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t_outer_1 ALL NULL NULL NULL NULL 3 -1 PRIMARY t_inner_1 ALL NULL NULL NULL NULL 3 Using where; Start temporary; Using join buffer (flat, BNL join) -1 PRIMARY t_inner_2 ALL NULL NULL NULL NULL 9 End temporary; Using join buffer (incremental, BNL join) -1 PRIMARY t_inner_4 ALL NULL NULL NULL NULL 3 Start temporary; Using join buffer (incremental, BNL join) +1 PRIMARY t_inner_1 ALL NULL NULL NULL NULL 3 Using where; Using join buffer (flat, BNL join) +1 PRIMARY t_inner_2 ALL NULL NULL NULL NULL 9 FirstMatch(t_outer_1); Using join buffer (incremental, BNL join) 1 PRIMARY t_outer_2 ALL NULL NULL NULL NULL 9 Using join buffer (incremental, BNL join) -1 PRIMARY t_inner_3 ALL NULL NULL NULL NULL 9 Using where; End temporary; Using join buffer (incremental, BNL join) +1 PRIMARY t_inner_4 ALL NULL NULL NULL NULL 3 Using join buffer (incremental, BNL join) +1 PRIMARY t_inner_3 ALL NULL NULL NULL NULL 9 Using where; FirstMatch(t_outer_2); Using join buffer (incremental, BNL join) select * from INFORMATION_SCHEMA.OPTIMIZER_TRACE; QUERY TRACE MISSING_BYTES_BEYOND_MAX_MEM_SIZE INSUFFICIENT_PRIVILEGES explain select * from t1 t_outer_1,t2 t_outer_2 where t_outer_1.a in (select t_inner_1.a from t2 t_inner_2, t1 t_inner_1) and @@ -5108,42 +5364,48 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "table": "t_outer_1", "table_scan": { "rows": 3, - "cost": 2.005126953 + "read_cost": 1.152563477, + "read_and_compare_cost": 1.902563477 } }, { "table": "t_outer_2", "table_scan": { "rows": 9, - "cost": 2.015380859 + "read_cost": 1.45769043, + "read_and_compare_cost": 3.70769043 } }, { "table": "t_inner_2", "table_scan": { "rows": 9, - "cost": 2.015380859 + "read_cost": 1.45769043, + "read_and_compare_cost": 3.70769043 } }, { "table": "t_inner_1", "table_scan": { "rows": 3, - "cost": 2.005126953 + "read_cost": 1.152563477, + "read_and_compare_cost": 1.902563477 } }, { "table": "t_inner_3", "table_scan": { "rows": 9, - "cost": 2.015380859 + "read_cost": 1.45769043, + "read_and_compare_cost": 3.70769043 } }, { "table": "t_inner_4", "table_scan": { "rows": 3, - "cost": 2.005126953 + "read_cost": 1.152563477, + "read_and_compare_cost": 1.902563477 } } ] @@ -5169,82 +5431,103 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "plan_prefix": [], "table": "t_outer_1", "best_access_path": { + "plan_details": { + "record_count": 1 + }, "considered_access_paths": [ { "access_type": "scan", - "resulting_rows": 3, - "cost": 2.605126953, + "rows": 3, + "rows_after_scan": 3, + "rows_after_filter": 3, + "cost": 1.902563477, + "index_only": false, "chosen": true } ], "chosen_access_method": { "type": "scan", "records": 3, - "cost": 2.605126953, + "cost": 1.902563477, "uses_join_buffering": false } }, "rows_for_plan": 3, - "cost_for_plan": 3.205126953, + "cost_for_plan": 1.902563477, "semijoin_strategy_choice": [], "rest_of_plan": [ { "plan_prefix": ["t_outer_1"], "table": "t_inner_1", "best_access_path": { + "plan_details": { + "record_count": 3 + }, "considered_access_paths": [ { - "access_type": "scan", - "resulting_rows": 3, - "cost": 4.405126953, + "access_type": "scan_with_join_cache", + "rows": 3, + "rows_after_scan": 3, + "rows_after_filter": 3, + "cost": 4.152563477, + "index_only": false, "chosen": true } ], "chosen_access_method": { "type": "scan", "records": 3, - "cost": 4.405126953, + "cost": 4.152563477, "uses_join_buffering": true } }, "rows_for_plan": 9, - "cost_for_plan": 9.410253906, + "cost_for_plan": 6.055126953, "semijoin_strategy_choice": [], "rest_of_plan": [ { "plan_prefix": ["t_outer_1", "t_inner_1"], "table": "t_inner_2", "best_access_path": { + "plan_details": { + "record_count": 9 + }, "considered_access_paths": [ { - "access_type": "scan", - "resulting_rows": 9, - "cost": 20.01538086, + "access_type": "scan_with_join_cache", + "rows": 9, + "rows_after_scan": 9, + "rows_after_filter": 9, + "cost": 28.00769043, + "index_only": false, "chosen": true } ], "chosen_access_method": { "type": "scan", "records": 9, - "cost": 20.01538086, + "cost": 28.00769043, "uses_join_buffering": true } }, "rows_for_plan": 81, - "cost_for_plan": 45.62563477, + "cost_for_plan": 34.06281738, "semijoin_strategy_choice": [ { "strategy": "FirstMatch", "records": 3, - "read_time": 81.35893555 + "cost": 40.97946777 }, { "strategy": "DuplicateWeedout", "records": 3, - "read_time": 58.22563477 + "dups_cost": 34.06281738, + "write_cost": 1.45, + "full_lookup_cost": 12.15, + "total_cost": 47.66281738 }, { - "chosen_strategy": "DuplicateWeedout" + "chosen_strategy": "FirstMatch" } ], "rest_of_plan": [ @@ -5252,23 +5535,29 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "plan_prefix": ["t_outer_1", "t_inner_1", "t_inner_2"], "table": "t_outer_2", "best_access_path": { + "plan_details": { + "record_count": 3 + }, "considered_access_paths": [ { - "access_type": "scan", - "resulting_rows": 9, - "cost": 9.215380859, + "access_type": "scan_with_join_cache", + "rows": 9, + "rows_after_scan": 9, + "rows_after_filter": 9, + "cost": 13.15769043, + "index_only": false, "chosen": true } ], "chosen_access_method": { "type": "scan", "records": 9, - "cost": 9.215380859, + "cost": 13.15769043, "uses_join_buffering": true } }, "rows_for_plan": 27, - "cost_for_plan": 72.84101562, + "cost_for_plan": 54.1371582, "semijoin_strategy_choice": [], "rest_of_plan": [ { @@ -5280,23 +5569,29 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { ], "table": "t_inner_4", "best_access_path": { + "plan_details": { + "record_count": 27 + }, "considered_access_paths": [ { - "access_type": "scan", - "resulting_rows": 3, - "cost": 18.80512695, + "access_type": "scan_with_join_cache", + "rows": 3, + "rows_after_scan": 3, + "rows_after_filter": 3, + "cost": 34.30256348, + "index_only": false, "chosen": true } ], "chosen_access_method": { "type": "scan", "records": 3, - "cost": 18.80512695, + "cost": 34.30256348, "uses_join_buffering": true } }, "rows_for_plan": 81, - "cost_for_plan": 107.8461426, + "cost_for_plan": 88.43972168, "semijoin_strategy_choice": [], "rest_of_plan": [ { @@ -5309,36 +5604,45 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { ], "table": "t_inner_3", "best_access_path": { + "plan_details": { + "record_count": 81 + }, "considered_access_paths": [ { - "access_type": "scan", - "resulting_rows": 9, - "cost": 149.6153809, + "access_type": "scan_with_join_cache", + "rows": 9, + "rows_after_scan": 9, + "rows_after_filter": 9, + "cost": 331.7576904, + "index_only": false, "chosen": true } ], "chosen_access_method": { "type": "scan", "records": 9, - "cost": 149.6153809, + "cost": 331.7576904, "uses_join_buffering": true } }, "rows_for_plan": 729, - "cost_for_plan": 403.2615234, + "cost_for_plan": 420.1974121, "semijoin_strategy_choice": [ { "strategy": "FirstMatch", "records": 27, - "read_time": 776.225293 + "cost": 405.8292969 }, { "strategy": "DuplicateWeedout", "records": 27, - "read_time": 516.6615234 + "dups_cost": 420.1974121, + "write_cost": 5.05, + "full_lookup_cost": 109.35, + "total_cost": 534.5974121 }, { - "chosen_strategy": "DuplicateWeedout" + "chosen_strategy": "FirstMatch" } ], "estimated_join_cardinality": 27 @@ -5354,23 +5658,29 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { ], "table": "t_inner_3", "best_access_path": { + "plan_details": { + "record_count": 27 + }, "considered_access_paths": [ { - "access_type": "scan", - "resulting_rows": 9, - "cost": 52.41538086, + "access_type": "scan_with_join_cache", + "rows": 9, + "rows_after_scan": 9, + "rows_after_filter": 9, + "cost": 100.9076904, + "index_only": false, "chosen": true } ], "chosen_access_method": { "type": "scan", "records": 9, - "cost": 52.41538086, + "cost": 100.9076904, "uses_join_buffering": true } }, "rows_for_plan": 243, - "cost_for_plan": 173.8563965, + "cost_for_plan": 155.0448486, "semijoin_strategy_choice": [], "pruned_by_heuristic": true } @@ -5380,23 +5690,29 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "plan_prefix": ["t_outer_1", "t_inner_1", "t_inner_2"], "table": "t_inner_4", "best_access_path": { + "plan_details": { + "record_count": 3 + }, "considered_access_paths": [ { - "access_type": "scan", - "resulting_rows": 3, - "cost": 4.405126953, + "access_type": "scan_with_join_cache", + "rows": 3, + "rows_after_scan": 3, + "rows_after_filter": 3, + "cost": 5.052563477, + "index_only": false, "chosen": true } ], "chosen_access_method": { "type": "scan", "records": 3, - "cost": 4.405126953, + "cost": 5.052563477, "uses_join_buffering": true } }, "rows_for_plan": 9, - "cost_for_plan": 64.43076172, + "cost_for_plan": 46.03203125, "semijoin_strategy_choice": [], "rest_of_plan": [ { @@ -5408,23 +5724,29 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { ], "table": "t_outer_2", "best_access_path": { + "plan_details": { + "record_count": 9 + }, "considered_access_paths": [ { - "access_type": "scan", - "resulting_rows": 9, - "cost": 20.01538086, + "access_type": "scan_with_join_cache", + "rows": 9, + "rows_after_scan": 9, + "rows_after_filter": 9, + "cost": 36.10769043, + "index_only": false, "chosen": true } ], "chosen_access_method": { "type": "scan", "records": 9, - "cost": 20.01538086, + "cost": 36.10769043, "uses_join_buffering": true } }, "rows_for_plan": 81, - "cost_for_plan": 100.6461426, + "cost_for_plan": 82.13972168, "semijoin_strategy_choice": [], "rest_of_plan": [ { @@ -5437,34 +5759,43 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { ], "table": "t_inner_3", "best_access_path": { + "plan_details": { + "record_count": 81 + }, "considered_access_paths": [ { - "access_type": "scan", - "resulting_rows": 9, - "cost": 149.6153809, + "access_type": "scan_with_join_cache", + "rows": 9, + "rows_after_scan": 9, + "rows_after_filter": 9, + "cost": 331.7576904, + "index_only": false, "chosen": true } ], "chosen_access_method": { "type": "scan", "records": 9, - "cost": 149.6153809, + "cost": 331.7576904, "uses_join_buffering": true } }, "rows_for_plan": 729, - "cost_for_plan": 396.0615234, + "cost_for_plan": 413.8974121, "semijoin_strategy_choice": [ { "strategy": "DuplicateWeedout", "records": 27, - "read_time": 509.4615234 + "dups_cost": 413.8974121, + "write_cost": 5.05, + "full_lookup_cost": 109.35, + "total_cost": 528.2974121 }, { "chosen_strategy": "DuplicateWeedout" } ], - "estimated_join_cardinality": 27 + "pruned_by_cost": true } ] }, @@ -5477,23 +5808,29 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { ], "table": "t_inner_3", "best_access_path": { + "plan_details": { + "record_count": 9 + }, "considered_access_paths": [ { - "access_type": "scan", - "resulting_rows": 9, - "cost": 20.01538086, + "access_type": "scan_with_join_cache", + "rows": 9, + "rows_after_scan": 9, + "rows_after_filter": 9, + "cost": 36.10769043, + "index_only": false, "chosen": true } ], "chosen_access_method": { "type": "scan", "records": 9, - "cost": 20.01538086, + "cost": 36.10769043, "uses_join_buffering": true } }, "rows_for_plan": 81, - "cost_for_plan": 100.6461426, + "cost_for_plan": 82.13972168, "semijoin_strategy_choice": [], "pruned_by_heuristic": true } @@ -5503,23 +5840,29 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "plan_prefix": ["t_outer_1", "t_inner_1", "t_inner_2"], "table": "t_inner_3", "best_access_path": { + "plan_details": { + "record_count": 3 + }, "considered_access_paths": [ { - "access_type": "scan", - "resulting_rows": 9, - "cost": 9.215380859, + "access_type": "scan_with_join_cache", + "rows": 9, + "rows_after_scan": 9, + "rows_after_filter": 9, + "cost": 13.15769043, + "index_only": false, "chosen": true } ], "chosen_access_method": { "type": "scan", "records": 9, - "cost": 9.215380859, + "cost": 13.15769043, "uses_join_buffering": true } }, "rows_for_plan": 27, - "cost_for_plan": 72.84101562, + "cost_for_plan": 54.1371582, "semijoin_strategy_choice": [], "pruned_by_heuristic": true } @@ -5529,178 +5872,100 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "plan_prefix": ["t_outer_1", "t_inner_1"], "table": "t_outer_2", "best_access_path": { + "plan_details": { + "record_count": 9 + }, "considered_access_paths": [ { - "access_type": "scan", - "resulting_rows": 9, - "cost": 20.01538086, + "access_type": "scan_with_join_cache", + "rows": 9, + "rows_after_scan": 9, + "rows_after_filter": 9, + "cost": 28.00769043, + "index_only": false, "chosen": true } ], "chosen_access_method": { "type": "scan", "records": 9, - "cost": 20.01538086, + "cost": 28.00769043, "uses_join_buffering": true } }, "rows_for_plan": 81, - "cost_for_plan": 45.62563477, + "cost_for_plan": 34.06281738, "semijoin_strategy_choice": [], "rest_of_plan": [ { "plan_prefix": ["t_outer_1", "t_inner_1", "t_outer_2"], "table": "t_inner_2", "best_access_path": { + "plan_details": { + "record_count": 81 + }, "considered_access_paths": [ { - "access_type": "scan", - "resulting_rows": 9, - "cost": 149.6153809, + "access_type": "scan_with_join_cache", + "rows": 9, + "rows_after_scan": 9, + "rows_after_filter": 9, + "cost": 258.8576904, + "index_only": false, "chosen": true } ], "chosen_access_method": { "type": "scan", "records": 9, - "cost": 149.6153809, + "cost": 258.8576904, "uses_join_buffering": true } }, "rows_for_plan": 729, - "cost_for_plan": 341.0410156, + "cost_for_plan": 292.9205078, "semijoin_strategy_choice": [ { "strategy": "DuplicateWeedout", "records": 27, - "read_time": 454.4410156 + "dups_cost": 292.9205078, + "write_cost": 5.05, + "full_lookup_cost": 109.35, + "total_cost": 407.3205078 }, { "chosen_strategy": "DuplicateWeedout" } ], - "rest_of_plan": [ - { - "plan_prefix": [ - "t_outer_1", - "t_inner_1", - "t_outer_2", - "t_inner_2" - ], - "table": "t_inner_4", - "best_access_path": { - "considered_access_paths": [ - { - "access_type": "scan", - "resulting_rows": 3, - "cost": 18.80512695, - "chosen": true - } - ], - "chosen_access_method": { - "type": "scan", - "records": 3, - "cost": 18.80512695, - "uses_join_buffering": true - } - }, - "rows_for_plan": 81, - "cost_for_plan": 489.4461426, - "semijoin_strategy_choice": [], - "rest_of_plan": [ - { - "plan_prefix": [ - "t_outer_1", - "t_inner_1", - "t_outer_2", - "t_inner_2", - "t_inner_4" - ], - "table": "t_inner_3", - "best_access_path": { - "considered_access_paths": [ - { - "access_type": "scan", - "resulting_rows": 9, - "cost": 149.6153809, - "chosen": true - } - ], - "chosen_access_method": { - "type": "scan", - "records": 9, - "cost": 149.6153809, - "uses_join_buffering": true - } - }, - "rows_for_plan": 729, - "cost_for_plan": 784.8615234, - "semijoin_strategy_choice": [ - { - "strategy": "DuplicateWeedout", - "records": 27, - "read_time": 898.2615234 - }, - { - "chosen_strategy": "DuplicateWeedout" - } - ], - "pruned_by_cost": true - } - ] - }, - { - "plan_prefix": [ - "t_outer_1", - "t_inner_1", - "t_outer_2", - "t_inner_2" - ], - "table": "t_inner_3", - "best_access_path": { - "considered_access_paths": [ - { - "access_type": "scan", - "resulting_rows": 9, - "cost": 52.41538086, - "chosen": true - } - ], - "chosen_access_method": { - "type": "scan", - "records": 9, - "cost": 52.41538086, - "uses_join_buffering": true - } - }, - "rows_for_plan": 243, - "cost_for_plan": 555.4563965, - "semijoin_strategy_choice": [], - "pruned_by_cost": true - } - ] + "pruned_by_cost": true }, { "plan_prefix": ["t_outer_1", "t_inner_1", "t_outer_2"], "table": "t_inner_4", "best_access_path": { + "plan_details": { + "record_count": 81 + }, "considered_access_paths": [ { - "access_type": "scan", - "resulting_rows": 3, - "cost": 51.20512695, + "access_type": "scan_with_join_cache", + "rows": 3, + "rows_after_scan": 3, + "rows_after_filter": 3, + "cost": 86.95256348, + "index_only": false, "chosen": true } ], "chosen_access_method": { "type": "scan", "records": 3, - "cost": 51.20512695, + "cost": 86.95256348, "uses_join_buffering": true } }, "rows_for_plan": 243, - "cost_for_plan": 145.4307617, + "cost_for_plan": 121.0153809, "semijoin_strategy_choice": [], "rest_of_plan": [ { @@ -5712,23 +5977,29 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { ], "table": "t_inner_2", "best_access_path": { + "plan_details": { + "record_count": 243 + }, "considered_access_paths": [ { - "access_type": "scan", - "resulting_rows": 9, - "cost": 441.2153809, + "access_type": "scan_with_join_cache", + "rows": 9, + "rows_after_scan": 9, + "rows_after_filter": 9, + "cost": 878.5076904, + "index_only": false, "chosen": true } ], "chosen_access_method": { "type": "scan", "records": 9, - "cost": 441.2153809, + "cost": 878.5076904, "uses_join_buffering": true } }, "rows_for_plan": 2187, - "cost_for_plan": 1024.046143, + "cost_for_plan": 999.5230713, "semijoin_strategy_choice": [], "pruned_by_cost": true }, @@ -5741,23 +6012,29 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { ], "table": "t_inner_3", "best_access_path": { + "plan_details": { + "record_count": 243 + }, "considered_access_paths": [ { - "access_type": "scan", - "resulting_rows": 9, - "cost": 441.2153809, + "access_type": "scan_with_join_cache", + "rows": 9, + "rows_after_scan": 9, + "rows_after_filter": 9, + "cost": 878.5076904, + "index_only": false, "chosen": true } ], "chosen_access_method": { "type": "scan", "records": 9, - "cost": 441.2153809, + "cost": 878.5076904, "uses_join_buffering": true } }, "rows_for_plan": 2187, - "cost_for_plan": 1024.046143, + "cost_for_plan": 999.5230713, "semijoin_strategy_choice": [], "pruned_by_cost": true } @@ -5767,93 +6044,31 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "plan_prefix": ["t_outer_1", "t_inner_1", "t_outer_2"], "table": "t_inner_3", "best_access_path": { + "plan_details": { + "record_count": 81 + }, "considered_access_paths": [ { - "access_type": "scan", - "resulting_rows": 9, - "cost": 149.6153809, + "access_type": "scan_with_join_cache", + "rows": 9, + "rows_after_scan": 9, + "rows_after_filter": 9, + "cost": 258.8576904, + "index_only": false, "chosen": true } ], "chosen_access_method": { "type": "scan", "records": 9, - "cost": 149.6153809, + "cost": 258.8576904, "uses_join_buffering": true } }, "rows_for_plan": 729, - "cost_for_plan": 341.0410156, + "cost_for_plan": 292.9205078, "semijoin_strategy_choice": [], - "rest_of_plan": [ - { - "plan_prefix": [ - "t_outer_1", - "t_inner_1", - "t_outer_2", - "t_inner_3" - ], - "table": "t_inner_4", - "best_access_path": { - "considered_access_paths": [ - { - "access_type": "scan", - "resulting_rows": 3, - "cost": 440.005127, - "chosen": true - } - ], - "chosen_access_method": { - "type": "scan", - "records": 3, - "cost": 440.005127, - "uses_join_buffering": true - } - }, - "rows_for_plan": 2187, - "cost_for_plan": 1218.446143, - "semijoin_strategy_choice": [ - { - "strategy": "FirstMatch", - "records": 81, - "read_time": 3420.209033 - }, - { - "chosen_strategy": "FirstMatch" - } - ], - "pruned_by_cost": true - }, - { - "plan_prefix": [ - "t_outer_1", - "t_inner_1", - "t_outer_2", - "t_inner_3" - ], - "table": "t_inner_2", - "best_access_path": { - "considered_access_paths": [ - { - "access_type": "scan", - "resulting_rows": 9, - "cost": 1316.015381, - "chosen": true - } - ], - "chosen_access_method": { - "type": "scan", - "records": 9, - "cost": 1316.015381, - "uses_join_buffering": true - } - }, - "rows_for_plan": 6561, - "cost_for_plan": 2969.256396, - "semijoin_strategy_choice": [], - "pruned_by_cost": true - } - ] + "pruned_by_heuristic": true } ] }, @@ -5861,46 +6076,58 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "plan_prefix": ["t_outer_1", "t_inner_1"], "table": "t_inner_4", "best_access_path": { + "plan_details": { + "record_count": 9 + }, "considered_access_paths": [ { - "access_type": "scan", - "resulting_rows": 3, - "cost": 8.005126953, + "access_type": "scan_with_join_cache", + "rows": 3, + "rows_after_scan": 3, + "rows_after_filter": 3, + "cost": 10.00256348, + "index_only": false, "chosen": true } ], "chosen_access_method": { "type": "scan", "records": 3, - "cost": 8.005126953, + "cost": 10.00256348, "uses_join_buffering": true } }, "rows_for_plan": 27, - "cost_for_plan": 22.81538086, + "cost_for_plan": 16.05769043, "semijoin_strategy_choice": [], "rest_of_plan": [ { "plan_prefix": ["t_outer_1", "t_inner_1", "t_inner_4"], "table": "t_outer_2", "best_access_path": { + "plan_details": { + "record_count": 27 + }, "considered_access_paths": [ { - "access_type": "scan", - "resulting_rows": 9, - "cost": 52.41538086, + "access_type": "scan_with_join_cache", + "rows": 9, + "rows_after_scan": 9, + "rows_after_filter": 9, + "cost": 88.75769043, + "index_only": false, "chosen": true } ], "chosen_access_method": { "type": "scan", "records": 9, - "cost": 52.41538086, + "cost": 88.75769043, "uses_join_buffering": true } }, "rows_for_plan": 243, - "cost_for_plan": 123.8307617, + "cost_for_plan": 104.8153809, "semijoin_strategy_choice": [], "rest_of_plan": [ { @@ -5912,23 +6139,29 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { ], "table": "t_inner_2", "best_access_path": { + "plan_details": { + "record_count": 243 + }, "considered_access_paths": [ { - "access_type": "scan", - "resulting_rows": 9, - "cost": 441.2153809, + "access_type": "scan_with_join_cache", + "rows": 9, + "rows_after_scan": 9, + "rows_after_filter": 9, + "cost": 878.5076904, + "index_only": false, "chosen": true } ], "chosen_access_method": { "type": "scan", "records": 9, - "cost": 441.2153809, + "cost": 878.5076904, "uses_join_buffering": true } }, "rows_for_plan": 2187, - "cost_for_plan": 1002.446143, + "cost_for_plan": 983.3230713, "semijoin_strategy_choice": [], "pruned_by_cost": true }, @@ -5941,23 +6174,29 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { ], "table": "t_inner_3", "best_access_path": { + "plan_details": { + "record_count": 243 + }, "considered_access_paths": [ { - "access_type": "scan", - "resulting_rows": 9, - "cost": 441.2153809, + "access_type": "scan_with_join_cache", + "rows": 9, + "rows_after_scan": 9, + "rows_after_filter": 9, + "cost": 878.5076904, + "index_only": false, "chosen": true } ], "chosen_access_method": { "type": "scan", "records": 9, - "cost": 441.2153809, + "cost": 878.5076904, "uses_join_buffering": true } }, "rows_for_plan": 2187, - "cost_for_plan": 1002.446143, + "cost_for_plan": 983.3230713, "semijoin_strategy_choice": [], "pruned_by_cost": true } @@ -5967,23 +6206,29 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "plan_prefix": ["t_outer_1", "t_inner_1", "t_inner_4"], "table": "t_inner_2", "best_access_path": { + "plan_details": { + "record_count": 27 + }, "considered_access_paths": [ { - "access_type": "scan", - "resulting_rows": 9, - "cost": 52.41538086, + "access_type": "scan_with_join_cache", + "rows": 9, + "rows_after_scan": 9, + "rows_after_filter": 9, + "cost": 88.75769043, + "index_only": false, "chosen": true } ], "chosen_access_method": { "type": "scan", "records": 9, - "cost": 52.41538086, + "cost": 88.75769043, "uses_join_buffering": true } }, "rows_for_plan": 243, - "cost_for_plan": 123.8307617, + "cost_for_plan": 104.8153809, "semijoin_strategy_choice": [], "pruned_by_heuristic": true }, @@ -5991,23 +6236,29 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "plan_prefix": ["t_outer_1", "t_inner_1", "t_inner_4"], "table": "t_inner_3", "best_access_path": { + "plan_details": { + "record_count": 27 + }, "considered_access_paths": [ { - "access_type": "scan", - "resulting_rows": 9, - "cost": 52.41538086, + "access_type": "scan_with_join_cache", + "rows": 9, + "rows_after_scan": 9, + "rows_after_filter": 9, + "cost": 88.75769043, + "index_only": false, "chosen": true } ], "chosen_access_method": { "type": "scan", "records": 9, - "cost": 52.41538086, + "cost": 88.75769043, "uses_join_buffering": true } }, "rows_for_plan": 243, - "cost_for_plan": 123.8307617, + "cost_for_plan": 104.8153809, "semijoin_strategy_choice": [], "pruned_by_heuristic": true } @@ -6017,46 +6268,58 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "plan_prefix": ["t_outer_1", "t_inner_1"], "table": "t_inner_3", "best_access_path": { + "plan_details": { + "record_count": 9 + }, "considered_access_paths": [ { - "access_type": "scan", - "resulting_rows": 9, - "cost": 20.01538086, + "access_type": "scan_with_join_cache", + "rows": 9, + "rows_after_scan": 9, + "rows_after_filter": 9, + "cost": 28.00769043, + "index_only": false, "chosen": true } ], "chosen_access_method": { "type": "scan", "records": 9, - "cost": 20.01538086, + "cost": 28.00769043, "uses_join_buffering": true } }, "rows_for_plan": 81, - "cost_for_plan": 45.62563477, + "cost_for_plan": 34.06281738, "semijoin_strategy_choice": [], "rest_of_plan": [ { "plan_prefix": ["t_outer_1", "t_inner_1", "t_inner_3"], "table": "t_outer_2", "best_access_path": { + "plan_details": { + "record_count": 81 + }, "considered_access_paths": [ { - "access_type": "scan", - "resulting_rows": 9, - "cost": 149.6153809, + "access_type": "scan_with_join_cache", + "rows": 9, + "rows_after_scan": 9, + "rows_after_filter": 9, + "cost": 258.8576904, + "index_only": false, "chosen": true } ], "chosen_access_method": { "type": "scan", "records": 9, - "cost": 149.6153809, + "cost": 258.8576904, "uses_join_buffering": true } }, "rows_for_plan": 729, - "cost_for_plan": 341.0410156, + "cost_for_plan": 292.9205078, "semijoin_strategy_choice": [], "rest_of_plan": [ { @@ -6068,23 +6331,29 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { ], "table": "t_inner_4", "best_access_path": { + "plan_details": { + "record_count": 729 + }, "considered_access_paths": [ { - "access_type": "scan", - "resulting_rows": 3, - "cost": 440.005127, + "access_type": "scan_with_join_cache", + "rows": 3, + "rows_after_scan": 3, + "rows_after_filter": 3, + "cost": 876.7025635, + "index_only": false, "chosen": true } ], "chosen_access_method": { "type": "scan", "records": 3, - "cost": 440.005127, + "cost": 876.7025635, "uses_join_buffering": true } }, "rows_for_plan": 2187, - "cost_for_plan": 1218.446143, + "cost_for_plan": 1169.623071, "semijoin_strategy_choice": [], "pruned_by_cost": true }, @@ -6097,23 +6366,29 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { ], "table": "t_inner_2", "best_access_path": { + "plan_details": { + "record_count": 729 + }, "considered_access_paths": [ { - "access_type": "scan", - "resulting_rows": 9, - "cost": 1316.015381, + "access_type": "scan_with_join_cache", + "rows": 9, + "rows_after_scan": 9, + "rows_after_filter": 9, + "cost": 2628.10769, + "index_only": false, "chosen": true } ], "chosen_access_method": { "type": "scan", "records": 9, - "cost": 1316.015381, + "cost": 2628.10769, "uses_join_buffering": true } }, "rows_for_plan": 6561, - "cost_for_plan": 2969.256396, + "cost_for_plan": 2921.028198, "semijoin_strategy_choice": [], "pruned_by_cost": true } @@ -6123,23 +6398,29 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "plan_prefix": ["t_outer_1", "t_inner_1", "t_inner_3"], "table": "t_inner_4", "best_access_path": { + "plan_details": { + "record_count": 81 + }, "considered_access_paths": [ { - "access_type": "scan", - "resulting_rows": 3, - "cost": 51.20512695, + "access_type": "scan_with_join_cache", + "rows": 3, + "rows_after_scan": 3, + "rows_after_filter": 3, + "cost": 86.95256348, + "index_only": false, "chosen": true } ], "chosen_access_method": { "type": "scan", "records": 3, - "cost": 51.20512695, + "cost": 86.95256348, "uses_join_buffering": true } }, "rows_for_plan": 243, - "cost_for_plan": 145.4307617, + "cost_for_plan": 121.0153809, "semijoin_strategy_choice": [], "rest_of_plan": [ { @@ -6151,23 +6432,29 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { ], "table": "t_outer_2", "best_access_path": { + "plan_details": { + "record_count": 243 + }, "considered_access_paths": [ { - "access_type": "scan", - "resulting_rows": 9, - "cost": 441.2153809, + "access_type": "scan_with_join_cache", + "rows": 9, + "rows_after_scan": 9, + "rows_after_filter": 9, + "cost": 878.5076904, + "index_only": false, "chosen": true } ], "chosen_access_method": { "type": "scan", "records": 9, - "cost": 441.2153809, + "cost": 878.5076904, "uses_join_buffering": true } }, "rows_for_plan": 2187, - "cost_for_plan": 1024.046143, + "cost_for_plan": 999.5230713, "semijoin_strategy_choice": [], "pruned_by_cost": true }, @@ -6180,23 +6467,29 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { ], "table": "t_inner_2", "best_access_path": { + "plan_details": { + "record_count": 243 + }, "considered_access_paths": [ { - "access_type": "scan", - "resulting_rows": 9, - "cost": 441.2153809, + "access_type": "scan_with_join_cache", + "rows": 9, + "rows_after_scan": 9, + "rows_after_filter": 9, + "cost": 878.5076904, + "index_only": false, "chosen": true } ], "chosen_access_method": { "type": "scan", "records": 9, - "cost": 441.2153809, + "cost": 878.5076904, "uses_join_buffering": true } }, "rows_for_plan": 2187, - "cost_for_plan": 1024.046143, + "cost_for_plan": 999.5230713, "semijoin_strategy_choice": [], "pruned_by_cost": true } @@ -6206,23 +6499,29 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "plan_prefix": ["t_outer_1", "t_inner_1", "t_inner_3"], "table": "t_inner_2", "best_access_path": { + "plan_details": { + "record_count": 81 + }, "considered_access_paths": [ { - "access_type": "scan", - "resulting_rows": 9, - "cost": 149.6153809, + "access_type": "scan_with_join_cache", + "rows": 9, + "rows_after_scan": 9, + "rows_after_filter": 9, + "cost": 258.8576904, + "index_only": false, "chosen": true } ], "chosen_access_method": { "type": "scan", "records": 9, - "cost": 149.6153809, + "cost": 258.8576904, "uses_join_buffering": true } }, "rows_for_plan": 729, - "cost_for_plan": 341.0410156, + "cost_for_plan": 292.9205078, "semijoin_strategy_choice": [], "pruned_by_heuristic": true } @@ -6234,23 +6533,29 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "plan_prefix": ["t_outer_1"], "table": "t_inner_2", "best_access_path": { + "plan_details": { + "record_count": 3 + }, "considered_access_paths": [ { - "access_type": "scan", - "resulting_rows": 9, - "cost": 9.215380859, + "access_type": "scan_with_join_cache", + "rows": 9, + "rows_after_scan": 9, + "rows_after_filter": 9, + "cost": 10.45769043, + "index_only": false, "chosen": true } ], "chosen_access_method": { "type": "scan", "records": 9, - "cost": 9.215380859, + "cost": 10.45769043, "uses_join_buffering": true } }, "rows_for_plan": 27, - "cost_for_plan": 17.82050781, + "cost_for_plan": 12.36025391, "semijoin_strategy_choice": [], "pruned_by_heuristic": true }, @@ -6258,23 +6563,29 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "plan_prefix": ["t_outer_1"], "table": "t_outer_2", "best_access_path": { + "plan_details": { + "record_count": 3 + }, "considered_access_paths": [ { - "access_type": "scan", - "resulting_rows": 9, - "cost": 9.215380859, + "access_type": "scan_with_join_cache", + "rows": 9, + "rows_after_scan": 9, + "rows_after_filter": 9, + "cost": 10.45769043, + "index_only": false, "chosen": true } ], "chosen_access_method": { "type": "scan", "records": 9, - "cost": 9.215380859, + "cost": 10.45769043, "uses_join_buffering": true } }, "rows_for_plan": 27, - "cost_for_plan": 17.82050781, + "cost_for_plan": 12.36025391, "semijoin_strategy_choice": [], "pruned_by_heuristic": true }, @@ -6282,23 +6593,29 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "plan_prefix": ["t_outer_1"], "table": "t_inner_4", "best_access_path": { + "plan_details": { + "record_count": 3 + }, "considered_access_paths": [ { - "access_type": "scan", - "resulting_rows": 3, - "cost": 4.405126953, + "access_type": "scan_with_join_cache", + "rows": 3, + "rows_after_scan": 3, + "rows_after_filter": 3, + "cost": 4.152563477, + "index_only": false, "chosen": true } ], "chosen_access_method": { "type": "scan", "records": 3, - "cost": 4.405126953, + "cost": 4.152563477, "uses_join_buffering": true } }, "rows_for_plan": 9, - "cost_for_plan": 9.410253906, + "cost_for_plan": 6.055126953, "semijoin_strategy_choice": [], "pruned_by_heuristic": true }, @@ -6306,23 +6623,29 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "plan_prefix": ["t_outer_1"], "table": "t_inner_3", "best_access_path": { + "plan_details": { + "record_count": 3 + }, "considered_access_paths": [ { - "access_type": "scan", - "resulting_rows": 9, - "cost": 9.215380859, + "access_type": "scan_with_join_cache", + "rows": 9, + "rows_after_scan": 9, + "rows_after_filter": 9, + "cost": 10.45769043, + "index_only": false, "chosen": true } ], "chosen_access_method": { "type": "scan", "records": 9, - "cost": 9.215380859, + "cost": 10.45769043, "uses_join_buffering": true } }, "rows_for_plan": 27, - "cost_for_plan": 17.82050781, + "cost_for_plan": 12.36025391, "semijoin_strategy_choice": [], "pruned_by_heuristic": true } @@ -6332,23 +6655,29 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "plan_prefix": [], "table": "t_inner_1", "best_access_path": { + "plan_details": { + "record_count": 1 + }, "considered_access_paths": [ { "access_type": "scan", - "resulting_rows": 3, - "cost": 2.605126953, + "rows": 3, + "rows_after_scan": 3, + "rows_after_filter": 3, + "cost": 1.902563477, + "index_only": false, "chosen": true } ], "chosen_access_method": { "type": "scan", "records": 3, - "cost": 2.605126953, + "cost": 1.902563477, "uses_join_buffering": false } }, "rows_for_plan": 3, - "cost_for_plan": 3.205126953, + "cost_for_plan": 1.902563477, "semijoin_strategy_choice": [], "pruned_by_heuristic": true }, @@ -6356,23 +6685,29 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "plan_prefix": [], "table": "t_inner_2", "best_access_path": { + "plan_details": { + "record_count": 1 + }, "considered_access_paths": [ { "access_type": "scan", - "resulting_rows": 9, - "cost": 3.815380859, + "rows": 9, + "rows_after_scan": 9, + "rows_after_filter": 9, + "cost": 3.70769043, + "index_only": false, "chosen": true } ], "chosen_access_method": { "type": "scan", "records": 9, - "cost": 3.815380859, + "cost": 3.70769043, "uses_join_buffering": false } }, "rows_for_plan": 9, - "cost_for_plan": 5.615380859, + "cost_for_plan": 3.70769043, "semijoin_strategy_choice": [], "pruned_by_heuristic": true }, @@ -6380,23 +6715,29 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "plan_prefix": [], "table": "t_outer_2", "best_access_path": { + "plan_details": { + "record_count": 1 + }, "considered_access_paths": [ { "access_type": "scan", - "resulting_rows": 9, - "cost": 3.815380859, + "rows": 9, + "rows_after_scan": 9, + "rows_after_filter": 9, + "cost": 3.70769043, + "index_only": false, "chosen": true } ], "chosen_access_method": { "type": "scan", "records": 9, - "cost": 3.815380859, + "cost": 3.70769043, "uses_join_buffering": false } }, "rows_for_plan": 9, - "cost_for_plan": 5.615380859, + "cost_for_plan": 3.70769043, "semijoin_strategy_choice": [], "pruned_by_heuristic": true }, @@ -6404,23 +6745,29 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "plan_prefix": [], "table": "t_inner_4", "best_access_path": { + "plan_details": { + "record_count": 1 + }, "considered_access_paths": [ { "access_type": "scan", - "resulting_rows": 3, - "cost": 2.605126953, + "rows": 3, + "rows_after_scan": 3, + "rows_after_filter": 3, + "cost": 1.902563477, + "index_only": false, "chosen": true } ], "chosen_access_method": { "type": "scan", "records": 3, - "cost": 2.605126953, + "cost": 1.902563477, "uses_join_buffering": false } }, "rows_for_plan": 3, - "cost_for_plan": 3.205126953, + "cost_for_plan": 1.902563477, "semijoin_strategy_choice": [], "pruned_by_heuristic": true }, @@ -6428,23 +6775,29 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "plan_prefix": [], "table": "t_inner_3", "best_access_path": { + "plan_details": { + "record_count": 1 + }, "considered_access_paths": [ { "access_type": "scan", - "resulting_rows": 9, - "cost": 3.815380859, + "rows": 9, + "rows_after_scan": 9, + "rows_after_filter": 9, + "cost": 3.70769043, + "index_only": false, "chosen": true } ], "chosen_access_method": { "type": "scan", "records": 9, - "cost": 3.815380859, + "cost": 3.70769043, "uses_join_buffering": false } }, "rows_for_plan": 9, - "cost_for_plan": 5.615380859, + "cost_for_plan": 3.70769043, "semijoin_strategy_choice": [], "pruned_by_heuristic": true } @@ -6453,10 +6806,114 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { { "fix_semijoin_strategies_for_picked_join_order": [ { - "semi_join_strategy": "DuplicateWeedout" + "semi_join_strategy": "FirstMatch", + "join_order": [ + { + "table": "t_inner_4" + }, + "best_access_path": { + "plan_details": { + "record_count": 27 + }, + "considered_access_paths": [ + { + "access_type": "scan", + "rows": 3, + "rows_after_scan": 3, + "rows_after_filter": 3, + "cost": 51.36921387, + "index_only": false, + "chosen": true + } + ], + "chosen_access_method": { + "type": "scan", + "records": 3, + "cost": 51.36921387, + "uses_join_buffering": false + } + }, + { + "table": "t_inner_3" + }, + "best_access_path": { + "plan_details": { + "record_count": 81 + }, + "considered_access_paths": [ + { + "access_type": "scan", + "rows": 9, + "rows_after_scan": 9, + "rows_after_filter": 9, + "cost": 300.3229248, + "index_only": false, + "chosen": true + } + ], + "chosen_access_method": { + "type": "scan", + "records": 9, + "cost": 300.3229248, + "uses_join_buffering": false + } + } + ] }, { - "semi_join_strategy": "DuplicateWeedout" + "semi_join_strategy": "FirstMatch", + "join_order": [ + { + "table": "t_inner_1" + }, + "best_access_path": { + "plan_details": { + "record_count": 3 + }, + "considered_access_paths": [ + { + "access_type": "scan", + "rows": 3, + "rows_after_scan": 3, + "rows_after_filter": 3, + "cost": 5.70769043, + "index_only": false, + "chosen": true + } + ], + "chosen_access_method": { + "type": "scan", + "records": 3, + "cost": 5.70769043, + "uses_join_buffering": false + } + }, + { + "table": "t_inner_2" + }, + "best_access_path": { + "plan_details": { + "record_count": 9 + }, + "considered_access_paths": [ + { + "access_type": "scan", + "rows": 9, + "rows_after_scan": 9, + "rows_after_filter": 9, + "cost": 33.36921387, + "index_only": false, + "chosen": true + } + ], + "chosen_access_method": { + "type": "scan", + "records": 9, + "cost": 33.36921387, + "uses_join_buffering": false + } + } + ] } ] }, @@ -6465,12 +6922,13 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "t_outer_1", "t_inner_1", "t_inner_2", - "t_inner_4", "t_outer_2", + "t_inner_4", "t_inner_3" ], "best_access_method": { - "cost": 509.4605234 + "rows": 27, + "cost": 405.8292969 } }, { @@ -6496,11 +6954,11 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "attached": null }, { - "table": "t_inner_4", + "table": "t_outer_2", "attached": null }, { - "table": "t_outer_2", + "table": "t_inner_4", "attached": null }, { @@ -6691,42 +7149,48 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "table": "t_outer_1", "table_scan": { "rows": 3, - "cost": 2.005126953 + "read_cost": 1.152563477, + "read_and_compare_cost": 1.902563477 } }, { "table": "t_outer_2", "table_scan": { "rows": 9, - "cost": 2.015380859 + "read_cost": 1.45769043, + "read_and_compare_cost": 3.70769043 } }, { "table": "t_inner_2", "table_scan": { "rows": 9, - "cost": 2.015380859 + "read_cost": 1.45769043, + "read_and_compare_cost": 3.70769043 } }, { "table": "t_inner_1", "table_scan": { "rows": 3, - "cost": 2.005126953 + "read_cost": 1.152563477, + "read_and_compare_cost": 1.902563477 } }, { "table": "t_inner_3", "table_scan": { "rows": 9, - "cost": 2.015380859 + "read_cost": 1.45769043, + "read_and_compare_cost": 3.70769043 } }, { "table": "t_inner_4", "table_scan": { "rows": 3, - "cost": 2.005126953 + "read_cost": 1.152563477, + "read_and_compare_cost": 1.902563477 } } ] @@ -6750,45 +7214,57 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "plan_prefix": [], "table": "t_inner_1", "best_access_path": { + "plan_details": { + "record_count": 1 + }, "considered_access_paths": [ { "access_type": "scan", - "resulting_rows": 3, - "cost": 2.605126953, + "rows": 3, + "rows_after_scan": 3, + "rows_after_filter": 3, + "cost": 1.902563477, + "index_only": false, "chosen": true } ], "chosen_access_method": { "type": "scan", "records": 3, - "cost": 2.605126953, + "cost": 1.902563477, "uses_join_buffering": false } }, "rows_for_plan": 3, - "cost_for_plan": 3.205126953, + "cost_for_plan": 1.902563477, "rest_of_plan": [ { "plan_prefix": ["t_inner_1"], "table": "t_inner_2", "best_access_path": { + "plan_details": { + "record_count": 3 + }, "considered_access_paths": [ { - "access_type": "scan", - "resulting_rows": 9, - "cost": 9.215380859, + "access_type": "scan_with_join_cache", + "rows": 9, + "rows_after_scan": 9, + "rows_after_filter": 9, + "cost": 10.45769043, + "index_only": false, "chosen": true } ], "chosen_access_method": { "type": "scan", "records": 9, - "cost": 9.215380859, + "cost": 10.45769043, "uses_join_buffering": true } }, "rows_for_plan": 27, - "cost_for_plan": 17.82050781, + "cost_for_plan": 12.36025391, "estimated_join_cardinality": 27 } ] @@ -6797,23 +7273,29 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "plan_prefix": [], "table": "t_inner_2", "best_access_path": { + "plan_details": { + "record_count": 1 + }, "considered_access_paths": [ { "access_type": "scan", - "resulting_rows": 9, - "cost": 3.815380859, + "rows": 9, + "rows_after_scan": 9, + "rows_after_filter": 9, + "cost": 3.70769043, + "index_only": false, "chosen": true } ], "chosen_access_method": { "type": "scan", "records": 9, - "cost": 3.815380859, + "cost": 3.70769043, "uses_join_buffering": false } }, "rows_for_plan": 9, - "cost_for_plan": 5.615380859, + "cost_for_plan": 3.70769043, "pruned_by_heuristic": true } ] @@ -6824,45 +7306,57 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "plan_prefix": [], "table": "t_inner_4", "best_access_path": { + "plan_details": { + "record_count": 1 + }, "considered_access_paths": [ { "access_type": "scan", - "resulting_rows": 3, - "cost": 2.605126953, + "rows": 3, + "rows_after_scan": 3, + "rows_after_filter": 3, + "cost": 1.902563477, + "index_only": false, "chosen": true } ], "chosen_access_method": { "type": "scan", "records": 3, - "cost": 2.605126953, + "cost": 1.902563477, "uses_join_buffering": false } }, "rows_for_plan": 3, - "cost_for_plan": 3.205126953, + "cost_for_plan": 1.902563477, "rest_of_plan": [ { "plan_prefix": ["t_inner_4"], "table": "t_inner_3", "best_access_path": { + "plan_details": { + "record_count": 3 + }, "considered_access_paths": [ { - "access_type": "scan", - "resulting_rows": 9, - "cost": 9.215380859, + "access_type": "scan_with_join_cache", + "rows": 9, + "rows_after_scan": 9, + "rows_after_filter": 9, + "cost": 10.45769043, + "index_only": false, "chosen": true } ], "chosen_access_method": { "type": "scan", "records": 9, - "cost": 9.215380859, + "cost": 10.45769043, "uses_join_buffering": true } }, "rows_for_plan": 27, - "cost_for_plan": 17.82050781, + "cost_for_plan": 12.36025391, "estimated_join_cardinality": 27 } ] @@ -6871,23 +7365,29 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "plan_prefix": [], "table": "t_inner_3", "best_access_path": { + "plan_details": { + "record_count": 1 + }, "considered_access_paths": [ { "access_type": "scan", - "resulting_rows": 9, - "cost": 3.815380859, + "rows": 9, + "rows_after_scan": 9, + "rows_after_filter": 9, + "cost": 3.70769043, + "index_only": false, "chosen": true } ], "chosen_access_method": { "type": "scan", "records": 9, - "cost": 3.815380859, + "cost": 3.70769043, "uses_join_buffering": false } }, "rows_for_plan": 9, - "cost_for_plan": 5.615380859, + "cost_for_plan": 3.70769043, "pruned_by_heuristic": true } ] @@ -6901,84 +7401,105 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "plan_prefix": [], "table": "t_outer_1", "best_access_path": { + "plan_details": { + "record_count": 1 + }, "considered_access_paths": [ { "access_type": "scan", - "resulting_rows": 3, - "cost": 2.605126953, + "rows": 3, + "rows_after_scan": 3, + "rows_after_filter": 3, + "cost": 1.902563477, + "index_only": false, "chosen": true } ], "chosen_access_method": { "type": "scan", "records": 3, - "cost": 2.605126953, + "cost": 1.902563477, "uses_join_buffering": false } }, "rows_for_plan": 3, - "cost_for_plan": 3.205126953, + "cost_for_plan": 1.902563477, "semijoin_strategy_choice": [], "rest_of_plan": [ { "plan_prefix": ["t_outer_1"], "table": "t_inner_1", "best_access_path": { + "plan_details": { + "record_count": 3 + }, "considered_access_paths": [ { - "access_type": "scan", - "resulting_rows": 3, - "cost": 4.405126953, + "access_type": "scan_with_join_cache", + "rows": 3, + "rows_after_scan": 3, + "rows_after_filter": 3, + "cost": 4.152563477, + "index_only": false, "chosen": true } ], "chosen_access_method": { "type": "scan", "records": 3, - "cost": 4.405126953, + "cost": 4.152563477, "uses_join_buffering": true } }, "rows_for_plan": 9, - "cost_for_plan": 9.410253906, + "cost_for_plan": 6.055126953, "semijoin_strategy_choice": [], "rest_of_plan": [ { "plan_prefix": ["t_outer_1", "t_inner_1"], "table": "t_inner_2", "best_access_path": { + "plan_details": { + "record_count": 9 + }, "considered_access_paths": [ { - "access_type": "scan", - "resulting_rows": 9, - "cost": 20.01538086, + "access_type": "scan_with_join_cache", + "rows": 9, + "rows_after_scan": 9, + "rows_after_filter": 9, + "cost": 28.00769043, + "index_only": false, "chosen": true } ], "chosen_access_method": { "type": "scan", "records": 9, - "cost": 20.01538086, + "cost": 28.00769043, "uses_join_buffering": true } }, "rows_for_plan": 81, - "cost_for_plan": 45.62563477, + "cost_for_plan": 34.06281738, "semijoin_strategy_choice": [ { "strategy": "FirstMatch", "records": 3, - "read_time": 81.35893555 + "cost": 40.97946777 }, { "strategy": "SJ-Materialization", "records": 3, - "cost": 16.52563477 + "cost": 16.76281738 }, { "strategy": "DuplicateWeedout", "records": 3, - "read_time": 58.22563477 + "dups_cost": 34.06281738, + "write_cost": 1.45, + "full_lookup_cost": 12.15, + "total_cost": 47.66281738 }, { "chosen_strategy": "SJ-Materialization" @@ -6989,23 +7510,29 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "plan_prefix": ["t_outer_1", "t_inner_1", "t_inner_2"], "table": "t_outer_2", "best_access_path": { + "plan_details": { + "record_count": 3 + }, "considered_access_paths": [ { - "access_type": "scan", - "resulting_rows": 9, - "cost": 9.215380859, + "access_type": "scan_with_join_cache", + "rows": 9, + "rows_after_scan": 9, + "rows_after_filter": 9, + "cost": 13.15769043, + "index_only": false, "chosen": true } ], "chosen_access_method": { "type": "scan", "records": 9, - "cost": 9.215380859, + "cost": 13.15769043, "uses_join_buffering": true } }, "rows_for_plan": 27, - "cost_for_plan": 31.14101563, + "cost_for_plan": 29.92050781, "semijoin_strategy_choice": [], "rest_of_plan": [ { @@ -7017,23 +7544,29 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { ], "table": "t_inner_4", "best_access_path": { + "plan_details": { + "record_count": 27 + }, "considered_access_paths": [ { - "access_type": "scan", - "resulting_rows": 3, - "cost": 18.80512695, + "access_type": "scan_with_join_cache", + "rows": 3, + "rows_after_scan": 3, + "rows_after_filter": 3, + "cost": 34.30256348, + "index_only": false, "chosen": true } ], "chosen_access_method": { "type": "scan", "records": 3, - "cost": 18.80512695, + "cost": 34.30256348, "uses_join_buffering": true } }, "rows_for_plan": 81, - "cost_for_plan": 66.14614258, + "cost_for_plan": 64.22307129, "semijoin_strategy_choice": [], "rest_of_plan": [ { @@ -7046,38 +7579,47 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { ], "table": "t_inner_3", "best_access_path": { + "plan_details": { + "record_count": 81 + }, "considered_access_paths": [ { - "access_type": "scan", - "resulting_rows": 9, - "cost": 149.6153809, + "access_type": "scan_with_join_cache", + "rows": 9, + "rows_after_scan": 9, + "rows_after_filter": 9, + "cost": 331.7576904, + "index_only": false, "chosen": true } ], "chosen_access_method": { "type": "scan", "records": 9, - "cost": 149.6153809, + "cost": 331.7576904, "uses_join_buffering": true } }, "rows_for_plan": 729, - "cost_for_plan": 361.5615234, + "cost_for_plan": 395.9807617, "semijoin_strategy_choice": [ { "strategy": "FirstMatch", "records": 27, - "read_time": 734.525293 + "cost": 381.6126465 }, { "strategy": "SJ-Materialization", "records": 27, - "cost": 45.66152344 + "cost": 45.98076172 }, { "strategy": "DuplicateWeedout", "records": 27, - "read_time": 474.9615234 + "dups_cost": 395.9807617, + "write_cost": 5.05, + "full_lookup_cost": 109.35, + "total_cost": 510.3807617 }, { "chosen_strategy": "SJ-Materialization" @@ -7096,23 +7638,29 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { ], "table": "t_inner_3", "best_access_path": { + "plan_details": { + "record_count": 27 + }, "considered_access_paths": [ { - "access_type": "scan", - "resulting_rows": 9, - "cost": 52.41538086, + "access_type": "scan_with_join_cache", + "rows": 9, + "rows_after_scan": 9, + "rows_after_filter": 9, + "cost": 100.9076904, + "index_only": false, "chosen": true } ], "chosen_access_method": { "type": "scan", "records": 9, - "cost": 52.41538086, + "cost": 100.9076904, "uses_join_buffering": true } }, "rows_for_plan": 243, - "cost_for_plan": 132.1563965, + "cost_for_plan": 130.8281982, "semijoin_strategy_choice": [], "pruned_by_cost": true } @@ -7122,23 +7670,29 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "plan_prefix": ["t_outer_1", "t_inner_1", "t_inner_2"], "table": "t_inner_4", "best_access_path": { + "plan_details": { + "record_count": 3 + }, "considered_access_paths": [ { - "access_type": "scan", - "resulting_rows": 3, - "cost": 4.405126953, + "access_type": "scan_with_join_cache", + "rows": 3, + "rows_after_scan": 3, + "rows_after_filter": 3, + "cost": 5.052563477, + "index_only": false, "chosen": true } ], "chosen_access_method": { "type": "scan", "records": 3, - "cost": 4.405126953, + "cost": 5.052563477, "uses_join_buffering": true } }, "rows_for_plan": 9, - "cost_for_plan": 22.73076172, + "cost_for_plan": 21.81538086, "semijoin_strategy_choice": [], "rest_of_plan": [ { @@ -7150,23 +7704,29 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { ], "table": "t_outer_2", "best_access_path": { + "plan_details": { + "record_count": 9 + }, "considered_access_paths": [ { - "access_type": "scan", - "resulting_rows": 9, - "cost": 20.01538086, + "access_type": "scan_with_join_cache", + "rows": 9, + "rows_after_scan": 9, + "rows_after_filter": 9, + "cost": 36.10769043, + "index_only": false, "chosen": true } ], "chosen_access_method": { "type": "scan", "records": 9, - "cost": 20.01538086, + "cost": 36.10769043, "uses_join_buffering": true } }, "rows_for_plan": 81, - "cost_for_plan": 58.94614258, + "cost_for_plan": 57.92307129, "semijoin_strategy_choice": [], "pruned_by_cost": true }, @@ -7179,23 +7739,29 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { ], "table": "t_inner_3", "best_access_path": { + "plan_details": { + "record_count": 9 + }, "considered_access_paths": [ { - "access_type": "scan", - "resulting_rows": 9, - "cost": 20.01538086, + "access_type": "scan_with_join_cache", + "rows": 9, + "rows_after_scan": 9, + "rows_after_filter": 9, + "cost": 36.10769043, + "index_only": false, "chosen": true } ], "chosen_access_method": { "type": "scan", "records": 9, - "cost": 20.01538086, + "cost": 36.10769043, "uses_join_buffering": true } }, "rows_for_plan": 81, - "cost_for_plan": 58.94614258, + "cost_for_plan": 57.92307129, "semijoin_strategy_choice": [], "pruned_by_cost": true } @@ -7205,23 +7771,29 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "plan_prefix": ["t_outer_1", "t_inner_1", "t_inner_2"], "table": "t_inner_3", "best_access_path": { + "plan_details": { + "record_count": 3 + }, "considered_access_paths": [ { - "access_type": "scan", - "resulting_rows": 9, - "cost": 9.215380859, + "access_type": "scan_with_join_cache", + "rows": 9, + "rows_after_scan": 9, + "rows_after_filter": 9, + "cost": 13.15769043, + "index_only": false, "chosen": true } ], "chosen_access_method": { "type": "scan", "records": 9, - "cost": 9.215380859, + "cost": 13.15769043, "uses_join_buffering": true } }, "rows_for_plan": 27, - "cost_for_plan": 31.14101563, + "cost_for_plan": 29.92050781, "semijoin_strategy_choice": [], "pruned_by_heuristic": true } @@ -7231,23 +7803,29 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "plan_prefix": ["t_outer_1", "t_inner_1"], "table": "t_outer_2", "best_access_path": { + "plan_details": { + "record_count": 9 + }, "considered_access_paths": [ { - "access_type": "scan", - "resulting_rows": 9, - "cost": 20.01538086, + "access_type": "scan_with_join_cache", + "rows": 9, + "rows_after_scan": 9, + "rows_after_filter": 9, + "cost": 28.00769043, + "index_only": false, "chosen": true } ], "chosen_access_method": { "type": "scan", "records": 9, - "cost": 20.01538086, + "cost": 28.00769043, "uses_join_buffering": true } }, "rows_for_plan": 81, - "cost_for_plan": 45.62563477, + "cost_for_plan": 34.06281738, "semijoin_strategy_choice": [], "pruned_by_heuristic": true }, @@ -7255,47 +7833,150 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "plan_prefix": ["t_outer_1", "t_inner_1"], "table": "t_inner_4", "best_access_path": { + "plan_details": { + "record_count": 9 + }, "considered_access_paths": [ { - "access_type": "scan", - "resulting_rows": 3, - "cost": 8.005126953, + "access_type": "scan_with_join_cache", + "rows": 3, + "rows_after_scan": 3, + "rows_after_filter": 3, + "cost": 10.00256348, + "index_only": false, "chosen": true } ], "chosen_access_method": { "type": "scan", "records": 3, - "cost": 8.005126953, + "cost": 10.00256348, "uses_join_buffering": true } }, "rows_for_plan": 27, - "cost_for_plan": 22.81538086, + "cost_for_plan": 16.05769043, "semijoin_strategy_choice": [], - "pruned_by_heuristic": true + "rest_of_plan": [ + { + "plan_prefix": ["t_outer_1", "t_inner_1", "t_inner_4"], + "table": "t_outer_2", + "best_access_path": { + "plan_details": { + "record_count": 27 + }, + "considered_access_paths": [ + { + "access_type": "scan_with_join_cache", + "rows": 9, + "rows_after_scan": 9, + "rows_after_filter": 9, + "cost": 88.75769043, + "index_only": false, + "chosen": true + } + ], + "chosen_access_method": { + "type": "scan", + "records": 9, + "cost": 88.75769043, + "uses_join_buffering": true + } + }, + "rows_for_plan": 243, + "cost_for_plan": 104.8153809, + "semijoin_strategy_choice": [], + "pruned_by_cost": true + }, + { + "plan_prefix": ["t_outer_1", "t_inner_1", "t_inner_4"], + "table": "t_inner_2", + "best_access_path": { + "plan_details": { + "record_count": 27 + }, + "considered_access_paths": [ + { + "access_type": "scan_with_join_cache", + "rows": 9, + "rows_after_scan": 9, + "rows_after_filter": 9, + "cost": 88.75769043, + "index_only": false, + "chosen": true + } + ], + "chosen_access_method": { + "type": "scan", + "records": 9, + "cost": 88.75769043, + "uses_join_buffering": true + } + }, + "rows_for_plan": 243, + "cost_for_plan": 104.8153809, + "semijoin_strategy_choice": [], + "pruned_by_cost": true + }, + { + "plan_prefix": ["t_outer_1", "t_inner_1", "t_inner_4"], + "table": "t_inner_3", + "best_access_path": { + "plan_details": { + "record_count": 27 + }, + "considered_access_paths": [ + { + "access_type": "scan_with_join_cache", + "rows": 9, + "rows_after_scan": 9, + "rows_after_filter": 9, + "cost": 88.75769043, + "index_only": false, + "chosen": true + } + ], + "chosen_access_method": { + "type": "scan", + "records": 9, + "cost": 88.75769043, + "uses_join_buffering": true + } + }, + "rows_for_plan": 243, + "cost_for_plan": 104.8153809, + "semijoin_strategy_choice": [], + "pruned_by_cost": true + } + ] }, { "plan_prefix": ["t_outer_1", "t_inner_1"], "table": "t_inner_3", "best_access_path": { + "plan_details": { + "record_count": 9 + }, "considered_access_paths": [ { - "access_type": "scan", - "resulting_rows": 9, - "cost": 20.01538086, + "access_type": "scan_with_join_cache", + "rows": 9, + "rows_after_scan": 9, + "rows_after_filter": 9, + "cost": 28.00769043, + "index_only": false, "chosen": true } ], "chosen_access_method": { "type": "scan", "records": 9, - "cost": 20.01538086, + "cost": 28.00769043, "uses_join_buffering": true } }, "rows_for_plan": 81, - "cost_for_plan": 45.62563477, + "cost_for_plan": 34.06281738, "semijoin_strategy_choice": [], "pruned_by_heuristic": true } @@ -7305,23 +7986,29 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "plan_prefix": ["t_outer_1"], "table": "t_inner_2", "best_access_path": { + "plan_details": { + "record_count": 3 + }, "considered_access_paths": [ { - "access_type": "scan", - "resulting_rows": 9, - "cost": 9.215380859, + "access_type": "scan_with_join_cache", + "rows": 9, + "rows_after_scan": 9, + "rows_after_filter": 9, + "cost": 10.45769043, + "index_only": false, "chosen": true } ], "chosen_access_method": { "type": "scan", "records": 9, - "cost": 9.215380859, + "cost": 10.45769043, "uses_join_buffering": true } }, "rows_for_plan": 27, - "cost_for_plan": 17.82050781, + "cost_for_plan": 12.36025391, "semijoin_strategy_choice": [], "pruned_by_heuristic": true }, @@ -7329,23 +8016,29 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "plan_prefix": ["t_outer_1"], "table": "t_outer_2", "best_access_path": { + "plan_details": { + "record_count": 3 + }, "considered_access_paths": [ { - "access_type": "scan", - "resulting_rows": 9, - "cost": 9.215380859, + "access_type": "scan_with_join_cache", + "rows": 9, + "rows_after_scan": 9, + "rows_after_filter": 9, + "cost": 10.45769043, + "index_only": false, "chosen": true } ], "chosen_access_method": { "type": "scan", "records": 9, - "cost": 9.215380859, + "cost": 10.45769043, "uses_join_buffering": true } }, "rows_for_plan": 27, - "cost_for_plan": 17.82050781, + "cost_for_plan": 12.36025391, "semijoin_strategy_choice": [], "pruned_by_heuristic": true }, @@ -7353,23 +8046,29 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "plan_prefix": ["t_outer_1"], "table": "t_inner_4", "best_access_path": { + "plan_details": { + "record_count": 3 + }, "considered_access_paths": [ { - "access_type": "scan", - "resulting_rows": 3, - "cost": 4.405126953, + "access_type": "scan_with_join_cache", + "rows": 3, + "rows_after_scan": 3, + "rows_after_filter": 3, + "cost": 4.152563477, + "index_only": false, "chosen": true } ], "chosen_access_method": { "type": "scan", "records": 3, - "cost": 4.405126953, + "cost": 4.152563477, "uses_join_buffering": true } }, "rows_for_plan": 9, - "cost_for_plan": 9.410253906, + "cost_for_plan": 6.055126953, "semijoin_strategy_choice": [], "pruned_by_heuristic": true }, @@ -7377,23 +8076,29 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "plan_prefix": ["t_outer_1"], "table": "t_inner_3", "best_access_path": { + "plan_details": { + "record_count": 3 + }, "considered_access_paths": [ { - "access_type": "scan", - "resulting_rows": 9, - "cost": 9.215380859, + "access_type": "scan_with_join_cache", + "rows": 9, + "rows_after_scan": 9, + "rows_after_filter": 9, + "cost": 10.45769043, + "index_only": false, "chosen": true } ], "chosen_access_method": { "type": "scan", "records": 9, - "cost": 9.215380859, + "cost": 10.45769043, "uses_join_buffering": true } }, "rows_for_plan": 27, - "cost_for_plan": 17.82050781, + "cost_for_plan": 12.36025391, "semijoin_strategy_choice": [], "pruned_by_heuristic": true } @@ -7403,23 +8108,29 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "plan_prefix": [], "table": "t_inner_1", "best_access_path": { + "plan_details": { + "record_count": 1 + }, "considered_access_paths": [ { "access_type": "scan", - "resulting_rows": 3, - "cost": 2.605126953, + "rows": 3, + "rows_after_scan": 3, + "rows_after_filter": 3, + "cost": 1.902563477, + "index_only": false, "chosen": true } ], "chosen_access_method": { "type": "scan", "records": 3, - "cost": 2.605126953, + "cost": 1.902563477, "uses_join_buffering": false } }, "rows_for_plan": 3, - "cost_for_plan": 3.205126953, + "cost_for_plan": 1.902563477, "semijoin_strategy_choice": [], "pruned_by_heuristic": true }, @@ -7427,23 +8138,29 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "plan_prefix": [], "table": "t_inner_2", "best_access_path": { + "plan_details": { + "record_count": 1 + }, "considered_access_paths": [ { "access_type": "scan", - "resulting_rows": 9, - "cost": 3.815380859, + "rows": 9, + "rows_after_scan": 9, + "rows_after_filter": 9, + "cost": 3.70769043, + "index_only": false, "chosen": true } ], "chosen_access_method": { "type": "scan", "records": 9, - "cost": 3.815380859, + "cost": 3.70769043, "uses_join_buffering": false } }, "rows_for_plan": 9, - "cost_for_plan": 5.615380859, + "cost_for_plan": 3.70769043, "semijoin_strategy_choice": [], "pruned_by_heuristic": true }, @@ -7451,23 +8168,29 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "plan_prefix": [], "table": "t_outer_2", "best_access_path": { + "plan_details": { + "record_count": 1 + }, "considered_access_paths": [ { "access_type": "scan", - "resulting_rows": 9, - "cost": 3.815380859, + "rows": 9, + "rows_after_scan": 9, + "rows_after_filter": 9, + "cost": 3.70769043, + "index_only": false, "chosen": true } ], "chosen_access_method": { "type": "scan", "records": 9, - "cost": 3.815380859, + "cost": 3.70769043, "uses_join_buffering": false } }, "rows_for_plan": 9, - "cost_for_plan": 5.615380859, + "cost_for_plan": 3.70769043, "semijoin_strategy_choice": [], "pruned_by_heuristic": true }, @@ -7475,23 +8198,29 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "plan_prefix": [], "table": "t_inner_4", "best_access_path": { + "plan_details": { + "record_count": 1 + }, "considered_access_paths": [ { "access_type": "scan", - "resulting_rows": 3, - "cost": 2.605126953, + "rows": 3, + "rows_after_scan": 3, + "rows_after_filter": 3, + "cost": 1.902563477, + "index_only": false, "chosen": true } ], "chosen_access_method": { "type": "scan", "records": 3, - "cost": 2.605126953, + "cost": 1.902563477, "uses_join_buffering": false } }, "rows_for_plan": 3, - "cost_for_plan": 3.205126953, + "cost_for_plan": 1.902563477, "semijoin_strategy_choice": [], "pruned_by_heuristic": true }, @@ -7499,23 +8228,29 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "plan_prefix": [], "table": "t_inner_3", "best_access_path": { + "plan_details": { + "record_count": 1 + }, "considered_access_paths": [ { "access_type": "scan", - "resulting_rows": 9, - "cost": 3.815380859, + "rows": 9, + "rows_after_scan": 9, + "rows_after_filter": 9, + "cost": 3.70769043, + "index_only": false, "chosen": true } ], "chosen_access_method": { "type": "scan", "records": 9, - "cost": 3.815380859, + "cost": 3.70769043, "uses_join_buffering": false } }, "rows_for_plan": 9, - "cost_for_plan": 5.615380859, + "cost_for_plan": 3.70769043, "semijoin_strategy_choice": [], "pruned_by_heuristic": true } @@ -7555,7 +8290,8 @@ t_outer_2.a in (select t_inner_3.a from t2 t_inner_3, t1 t_inner_4) { "<subquery3>" ], "best_access_method": { - "cost": 45.66052344 + "rows": 27, + "cost": 45.98076172 } }, { @@ -7663,7 +8399,7 @@ JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) "using_mrr": false, "index_only": true, "rows": 1, - "cost": 0.345829876, + "cost": 0.745829876, "chosen": true } ], @@ -7697,7 +8433,7 @@ JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) "using_mrr": false, "index_only": true, "rows": 107, - "cost": 21.63379668, + "cost": 24.68379668, "chosen": true } ], @@ -7734,7 +8470,7 @@ JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) "using_mrr": false, "index_only": false, "rows": 1000, - "cost": 1203.877243, + "cost": 756.2522431, "chosen": true } ], @@ -7779,7 +8515,7 @@ JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) "using_mrr": false, "index_only": false, "rows": 4, - "cost": 4.948710032, + "cost": 3.523710032, "chosen": true } ], @@ -7818,7 +8554,7 @@ JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) "using_mrr": false, "index_only": false, "rows": 1, - "cost": 1.346171589, + "cost": 1.271171589, "chosen": true } ], @@ -7852,7 +8588,7 @@ JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) "using_mrr": false, "index_only": false, "rows": 1, - "cost": 1.346171589, + "cost": 1.271171589, "chosen": true } ], @@ -7894,7 +8630,7 @@ JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) "using_mrr": false, "index_only": false, "rows": 1, - "cost": 1.345927508, + "cost": 1.270927508, "chosen": true } ], @@ -7929,7 +8665,7 @@ JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) "using_mrr": false, "index_only": false, "rows": 1, - "cost": 1.345878692, + "cost": 1.270878692, "chosen": true } ], @@ -7964,7 +8700,7 @@ JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) "using_mrr": false, "index_only": false, "rows": 1, - "cost": 1.345927508, + "cost": 1.270927508, "chosen": true } ], @@ -8002,7 +8738,7 @@ JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) "using_mrr": false, "index_only": false, "rows": 1, - "cost": 1.345878692, + "cost": 1.270878692, "chosen": true } ], @@ -8043,7 +8779,7 @@ JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) "using_mrr": false, "index_only": false, "rows": 1, - "cost": 1.394255553, + "cost": 1.319255553, "chosen": true } ], @@ -8063,7 +8799,7 @@ INSERT INTO t1 VALUES (2, 'ab\n'); set optimizer_trace=1; EXPLAIN SELECT * FROM t1 WHERE b='ab\n'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref i_b i_b 13 const 2 Using index condition +1 SIMPLE t1 ALL i_b NULL NULL NULL 2 Using where select JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) from INFORMATION_SCHEMA.OPTIMIZER_TRACE; JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) [ @@ -8082,8 +8818,9 @@ JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) "using_mrr": false, "index_only": false, "rows": 2, - "cost": 2.546855016, - "chosen": true + "cost": 2.021855016, + "chosen": false, + "cause": "cost" } ], "analyzing_roworder_intersect": @@ -8138,7 +8875,7 @@ JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) "using_mrr": false, "index_only": false, "rows": 1000, - "cost": 1203.877243, + "cost": 756.2522431, "chosen": true } ], @@ -8197,13 +8934,20 @@ JSON_DETAILED(JSON_EXTRACT(trace, '$**.considered_execution_plans')) "table": "A", "best_access_path": { + "plan_details": + { + "record_count": 1 + }, "considered_access_paths": [ { "access_type": "scan", - "resulting_rows": 5.9375, - "cost": 4.017089844, + "rows": 10, + "rows_after_scan": 5.9375, + "rows_after_filter": 5.9375, + "cost": 4.008544922, + "index_only": false, "chosen": true } ], @@ -8211,12 +8955,12 @@ JSON_DETAILED(JSON_EXTRACT(trace, '$**.considered_execution_plans')) { "type": "scan", "records": 5.9375, - "cost": 4.017089844, + "cost": 4.008544922, "uses_join_buffering": false } }, "rows_for_plan": 5.9375, - "cost_for_plan": 5.204589844, + "cost_for_plan": 4.008544922, "rest_of_plan": [ @@ -8228,13 +8972,20 @@ JSON_DETAILED(JSON_EXTRACT(trace, '$**.considered_execution_plans')) "table": "B", "best_access_path": { + "plan_details": + { + "record_count": 5.9375 + }, "considered_access_paths": [ { "access_type": "scan", - "resulting_rows": 804.6875, - "cost": 2167.987671, + "rows": 1000, + "rows_after_scan": 804.6875, + "rows_after_filter": 804.6875, + "cost": 1793.710632, + "index_only": false, "chosen": true } ], @@ -8242,12 +8993,12 @@ JSON_DETAILED(JSON_EXTRACT(trace, '$**.considered_execution_plans')) { "type": "scan", "records": 804.6875, - "cost": 2167.987671, + "cost": 1793.710632, "uses_join_buffering": false } }, "rows_for_plan": 4777.832031, - "cost_for_plan": 3128.758667, + "cost_for_plan": 1797.719177, "estimated_join_cardinality": 4777.832031 } ] @@ -8260,13 +9011,20 @@ JSON_DETAILED(JSON_EXTRACT(trace, '$**.considered_execution_plans')) "table": "B", "best_access_path": { + "plan_details": + { + "record_count": 1 + }, "considered_access_paths": [ { "access_type": "scan", - "resulting_rows": 804.6875, - "cost": 204.1972656, + "rows": 1000, + "rows_after_scan": 804.6875, + "rows_after_filter": 804.6875, + "cost": 302.0986328, + "index_only": false, "chosen": true } ], @@ -8274,12 +9032,12 @@ JSON_DETAILED(JSON_EXTRACT(trace, '$**.considered_execution_plans')) { "type": "scan", "records": 804.6875, - "cost": 204.1972656, + "cost": 302.0986328, "uses_join_buffering": false } }, "rows_for_plan": 804.6875, - "cost_for_plan": 365.1347656, + "cost_for_plan": 302.0986328, "pruned_by_heuristic": true } ] @@ -8303,13 +9061,20 @@ JSON_DETAILED(JSON_EXTRACT(trace, '$**.considered_execution_plans')) "table": "A", "best_access_path": { + "plan_details": + { + "record_count": 1 + }, "considered_access_paths": [ { "access_type": "scan", - "resulting_rows": 10, - "cost": 4.017089844, + "rows": 10, + "rows_after_scan": 10, + "rows_after_filter": 10, + "cost": 4.008544922, + "index_only": false, "chosen": true } ], @@ -8317,12 +9082,12 @@ JSON_DETAILED(JSON_EXTRACT(trace, '$**.considered_execution_plans')) { "type": "scan", "records": 10, - "cost": 4.017089844, + "cost": 4.008544922, "uses_join_buffering": false } }, "rows_for_plan": 10, - "cost_for_plan": 6.017089844, + "cost_for_plan": 4.008544922, "rest_of_plan": [ @@ -8334,6 +9099,10 @@ JSON_DETAILED(JSON_EXTRACT(trace, '$**.considered_execution_plans')) "table": "B", "best_access_path": { + "plan_details": + { + "record_count": 10 + }, "considered_access_paths": [ @@ -8343,30 +9112,26 @@ JSON_DETAILED(JSON_EXTRACT(trace, '$**.considered_execution_plans')) "used_range_estimates": false, "cause": "not available", "rows": 1, - "found_matching_rows_cost": 2.200585794, - "startup_cost": 0, - "rows": 1, - "cost": 22.00585794, + "cost": 12.50585794, "chosen": true }, { - "access_type": "scan", - "resulting_rows": 603.515625, - "cost": 1411.228516, - "chosen": false + "type": "scan", + "chosen": false, + "cause": "cost" } ], "chosen_access_method": { "type": "ref", "records": 1, - "cost": 22.00585794, + "cost": 12.50585794, "uses_join_buffering": false } }, "rows_for_plan": 10, - "cost_for_plan": 30.02294779, + "cost_for_plan": 16.51440287, "selectivity": 0.8046875, "remaining_rows_for_plan": 8.046875, "estimated_join_cardinality": 8.046875 @@ -8381,13 +9146,20 @@ JSON_DETAILED(JSON_EXTRACT(trace, '$**.considered_execution_plans')) "table": "B", "best_access_path": { + "plan_details": + { + "record_count": 1 + }, "considered_access_paths": [ { "access_type": "scan", - "resulting_rows": 804.6875, - "cost": 204.1972656, + "rows": 1000, + "rows_after_scan": 804.6875, + "rows_after_filter": 804.6875, + "cost": 302.0986328, + "index_only": false, "chosen": true } ], @@ -8395,12 +9167,12 @@ JSON_DETAILED(JSON_EXTRACT(trace, '$**.considered_execution_plans')) { "type": "scan", "records": 804.6875, - "cost": 204.1972656, + "cost": 302.0986328, "uses_join_buffering": false } }, "rows_for_plan": 804.6875, - "cost_for_plan": 365.1347656, + "cost_for_plan": 302.0986328, "pruned_by_cost": true } ] @@ -8434,7 +9206,7 @@ JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) "using_mrr": false, "index_only": false, "rows": 1, - "cost": 1.357887479, + "cost": 1.282887479, "chosen": true } ], @@ -8460,9 +9232,9 @@ insert into t3 values (1),(2),(3),(4),(5),(6),(7),(8),(9),(10); explain select * from t3 where (a,a) in (select t1.a, t2.a from t1, t2 where t1.b=t2.b); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL PRIMARY NULL NULL NULL 5 -1 PRIMARY t2 eq_ref PRIMARY PRIMARY 4 test.t1.a 1 Using where -1 PRIMARY t3 ALL NULL NULL NULL NULL 10 Using where; Using join buffer (flat, BNL join) +1 PRIMARY t3 ALL NULL NULL NULL NULL 10 Using where +1 PRIMARY t2 ALL PRIMARY NULL NULL NULL 5 Using where; Using join buffer (flat, BNL join) +1 PRIMARY t1 eq_ref PRIMARY PRIMARY 4 test.t3.a 1 Using where select JSON_DETAILED(JSON_EXTRACT(trace, '$**.semijoin_table_pullout')) from INFORMATION_SCHEMA.OPTIMIZER_TRACE; JSON_DETAILED(JSON_EXTRACT(trace, '$**.semijoin_table_pullout')) [ @@ -8500,7 +9272,7 @@ JSON_DETAILED(JSON_EXTRACT(trace, '$**.range_scan_alternatives')) "using_mrr": false, "index_only": true, "rows": 1, - "cost": 0.345829876, + "cost": 0.745829876, "chosen": true } ] @@ -8531,13 +9303,20 @@ JSON_DETAILED(JSON_EXTRACT(trace, '$**.considered_execution_plans')) "table": "t1", "best_access_path": { + "plan_details": + { + "record_count": 1 + }, "considered_access_paths": [ { "access_type": "scan", - "resulting_rows": 10, - "cost": 4.021972656, + "rows": 10, + "rows_after_scan": 10, + "rows_after_filter": 10, + "cost": 4.010986328, + "index_only": false, "chosen": true } ], @@ -8545,12 +9324,12 @@ JSON_DETAILED(JSON_EXTRACT(trace, '$**.considered_execution_plans')) { "type": "scan", "records": 10, - "cost": 4.021972656, + "cost": 4.010986328, "uses_join_buffering": false } }, "rows_for_plan": 10, - "cost_for_plan": 6.021972656, + "cost_for_plan": 4.010986328, "rest_of_plan": [ @@ -8562,6 +9341,10 @@ JSON_DETAILED(JSON_EXTRACT(trace, '$**.considered_execution_plans')) "table": "t2", "best_access_path": { + "plan_details": + { + "record_count": 10 + }, "considered_access_paths": [ @@ -8571,17 +9354,17 @@ JSON_DETAILED(JSON_EXTRACT(trace, '$**.considered_execution_plans')) "used_range_estimates": false, "cause": "not available", "rows": 1, - "found_matching_rows_cost": 2.200585794, - "startup_cost": 0, - "rows": 1, - "cost": 22.00585794, + "cost": 12.50585794, "chosen": true }, { - "access_type": "scan", - "resulting_rows": 75, - "cost": 172.2197266, + "access_type": "scan_with_join_cache", + "rows": 100, + "rows_after_scan": 75, + "rows_after_filter": 75, + "cost": 218.6098633, + "index_only": false, "chosen": false } ], @@ -8589,12 +9372,12 @@ JSON_DETAILED(JSON_EXTRACT(trace, '$**.considered_execution_plans')) { "type": "ref", "records": 1, - "cost": 22.00585794, + "cost": 12.50585794, "uses_join_buffering": false } }, "rows_for_plan": 10, - "cost_for_plan": 30.0278306, + "cost_for_plan": 16.51684427, "cost_for_sorting": 10, "estimated_join_cardinality": 10 } @@ -8608,13 +9391,20 @@ JSON_DETAILED(JSON_EXTRACT(trace, '$**.considered_execution_plans')) "table": "t2", "best_access_path": { + "plan_details": + { + "record_count": 1 + }, "considered_access_paths": [ { "access_type": "scan", - "resulting_rows": 100, - "cost": 22.21972656, + "rows": 100, + "rows_after_scan": 100, + "rows_after_filter": 100, + "cost": 31.10986328, + "index_only": false, "chosen": true, "use_tmp_table": true } @@ -8623,12 +9413,12 @@ JSON_DETAILED(JSON_EXTRACT(trace, '$**.considered_execution_plans')) { "type": "scan", "records": 100, - "cost": 22.21972656, + "cost": 31.10986328, "uses_join_buffering": false } }, "rows_for_plan": 100, - "cost_for_plan": 42.21972656, + "cost_for_plan": 31.10986328, "pruned_by_cost": true } ] @@ -8744,7 +9534,7 @@ JSON_DETAILED(JSON_EXTRACT(trace, '$**.range_scan_alternatives')) "using_mrr": false, "index_only": false, "rows": 0, - "cost": 0.145, + "cost": 0.52, "chosen": true } ] @@ -8837,7 +9627,8 @@ select count(*) from seq_1_to_10000000 { "table": "seq_1_to_10000000", "table_scan": { "rows": 10000000, - "cost": 10000000 + "read_cost": 5000000, + "read_and_compare_cost": 7250000 } } ] @@ -8848,23 +9639,29 @@ select count(*) from seq_1_to_10000000 { "plan_prefix": [], "table": "seq_1_to_10000000", "best_access_path": { + "plan_details": { + "record_count": 1 + }, "considered_access_paths": [ { "access_type": "scan", - "resulting_rows": 10000000, - "cost": 12000000, + "rows": 10000000, + "rows_after_scan": 10000000, + "rows_after_filter": 10000000, + "cost": 7250000, + "index_only": true, "chosen": true } ], "chosen_access_method": { "type": "scan", "records": 10000000, - "cost": 12000000, + "cost": 7250000, "uses_join_buffering": false } }, "rows_for_plan": 10000000, - "cost_for_plan": 14000000, + "cost_for_plan": 7250000, "estimated_join_cardinality": 10000000 } ] @@ -8872,7 +9669,8 @@ select count(*) from seq_1_to_10000000 { { "best_join_order": ["seq_1_to_10000000"], "best_access_method": { - "cost": 14000000 + "rows": 10000000, + "cost": 7250000 } }, { @@ -8937,9 +9735,8 @@ set @tmp=@@in_predicate_conversion_threshold; set in_predicate_conversion_threshold=3; explain select * from t0 where a in (1,2,3,4,5,6); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t0 ALL NULL NULL NULL NULL 10 -1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 -2 MATERIALIZED <derived3> ALL NULL NULL NULL NULL 6 +1 PRIMARY t0 ALL NULL NULL NULL NULL 10 Using where +1 PRIMARY <derived3> ref key0 key0 4 test.t0.a 2 FirstMatch(t0) 3 DERIVED NULL NULL NULL NULL NULL NULL NULL No tables used select json_detailed(json_extract(trace, '$**.in_to_subquery_conversion')) from information_schema.optimizer_trace; @@ -9041,9 +9838,9 @@ create table t3 (a int, b int, c int); insert into t3 values (0,0,0),(1,1,1),(2,2,2),(3,3,3),(4,4,4); explain select * from t2,t1,t3 where t2.b= t1.b and t1.a=t3.a; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 ALL NULL NULL NULL NULL 2 -1 SIMPLE t1 index PRIMARY PRIMARY 12 NULL 5 Using where; Using index; Using join buffer (flat, BNL join) -1 SIMPLE t3 ALL NULL NULL NULL NULL 5 Using where; Using join buffer (incremental, BNL join) +1 SIMPLE t2 ALL NULL NULL NULL NULL 2 Using where +1 SIMPLE t3 ALL NULL NULL NULL NULL 5 Using where; Using join buffer (flat, BNL join) +1 SIMPLE t1 ref PRIMARY PRIMARY 8 test.t3.a,test.t2.b 1 Using index set @trace=(select trace from information_schema.optimizer_trace); set @path= (select json_search(@trace, 'one', 'no predicate for first keypart')); set @sub_path= substr(@path, 2, locate('.best_access_path', @path)-2); @@ -9253,6 +10050,10 @@ json_detailed(json_extract(trace, '$**.choose_best_splitting')) "table": "t2", "best_access_path": { + "plan_details": + { + "record_count": 1 + }, "considered_access_paths": [ @@ -9262,10 +10063,7 @@ json_detailed(json_extract(trace, '$**.choose_best_splitting')) "used_range_estimates": false, "cause": "not available", "rows": 1.8367, - "found_matching_rows_cost": 2.367925794, - "startup_cost": 0, - "rows": 1.8367, - "cost": 2.367925794, + "cost": 1.417925794, "chosen": true }, @@ -9279,12 +10077,12 @@ json_detailed(json_extract(trace, '$**.choose_best_splitting')) { "type": "ref", "records": 1.8367, - "cost": 2.367925794, + "cost": 1.417925794, "uses_join_buffering": false } }, "rows_for_plan": 1.8367, - "cost_for_plan": 2.735265794, + "cost_for_plan": 1.417925794, "cost_for_sorting": 1.8367, "estimated_join_cardinality": 1.8367 } @@ -9297,8 +10095,8 @@ json_detailed(json_extract(trace, '$**.choose_best_splitting')) "table": "t2", "key": "idx_a", "record_count": 4, - "cost": 2.856285919, - "unsplit_cost": 43.72361682 + "cost": 3.651150919, + "unsplit_cost": 51.1794762 } } ] @@ -9311,8 +10109,8 @@ json_detailed(json_extract(trace, '$**.lateral_derived')) [ { - "startup_cost": 11.42514368, - "splitting_cost": 2.856285919, + "startup_cost": 14.60460368, + "splitting_cost": 3.651150919, "records": 1 } ] diff --git a/mysql-test/main/opt_trace_index_merge.result b/mysql-test/main/opt_trace_index_merge.result index ee9ad1be2ba..a729ca9ea71 100644 --- a/mysql-test/main/opt_trace_index_merge.result +++ b/mysql-test/main/opt_trace_index_merge.result @@ -73,7 +73,7 @@ explain select * from t1 where a=1 or b=1 { "range_analysis": { "table_scan": { "rows": 1000, - "cost": 231.5878906 + "cost": 264.7939453 }, "potential_range_indexes": [ { @@ -111,12 +111,12 @@ explain select * from t1 where a=1 or b=1 { "using_mrr": false, "index_only": true, "rows": 1, - "cost": 0.345585794, + "cost": 0.745585794, "chosen": true } ], "index_to_merge": "a", - "cumulated_cost": 0.345585794 + "cumulated_cost": 0.745585794 }, { "range_scan_alternatives": [ @@ -127,15 +127,15 @@ explain select * from t1 where a=1 or b=1 { "using_mrr": false, "index_only": true, "rows": 1, - "cost": 0.345585794, + "cost": 0.745585794, "chosen": true } ], "index_to_merge": "b", - "cumulated_cost": 0.691171589 + "cumulated_cost": 1.491171589 } ], - "cost_of_reading_ranges": 0.691171589, + "cost_of_reading_ranges": 1.491171589, "use_roworder_union": true, "cause": "always cheaper than non roworder retrieval", "analyzing_roworder_scans": [ @@ -158,7 +158,7 @@ explain select * from t1 where a=1 or b=1 { } } ], - "index_roworder_union_cost": 2.484903732, + "index_roworder_union_cost": 2.595171589, "members": 2, "chosen": true } @@ -187,7 +187,7 @@ explain select * from t1 where a=1 or b=1 { ] }, "rows_for_plan": 2, - "cost_for_plan": 2.484903732, + "cost_for_plan": 2.595171589, "chosen": true } } @@ -209,23 +209,28 @@ explain select * from t1 where a=1 or b=1 { "plan_prefix": [], "table": "t1", "best_access_path": { + "plan_details": { + "record_count": 1 + }, "considered_access_paths": [ { "access_type": "index_merge", - "resulting_rows": 2, - "cost": 2.484903732, + "rows": 2, + "rows_after_scan": 2, + "rows_after_filter": 2, + "cost": 2.595171589, "chosen": true } ], "chosen_access_method": { "type": "index_merge", "records": 2, - "cost": 2.484903732, + "cost": 2.595171589, "uses_join_buffering": false } }, "rows_for_plan": 2, - "cost_for_plan": 2.884903732, + "cost_for_plan": 2.595171589, "estimated_join_cardinality": 2 } ] @@ -233,7 +238,8 @@ explain select * from t1 where a=1 or b=1 { { "best_join_order": ["t1"], "best_access_method": { - "cost": 2.883903732 + "rows": 2, + "cost": 2.595171589 } }, { @@ -315,7 +321,7 @@ set optimizer_trace='enabled=on'; # 3-way ROR-intersection explain select key1,key2,key3 from t1 where key1=100 and key2=100 and key3=100; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 index_merge key1,key2,key3 key1,key2,key3 5,5,5 NULL 2 Using intersect(key1,key2,key3); Using where; Using index +1 SIMPLE t1 index_merge key1,key2,key3 key1,key2 5,5 NULL 77 Using intersect(key1,key2); Using where select JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) from INFORMATION_SCHEMA.OPTIMIZER_TRACE; JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) [ @@ -334,7 +340,7 @@ JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) "using_mrr": false, "index_only": false, "rows": 2243, - "cost": 2700.058937, + "cost": 1695.083937, "chosen": true }, @@ -348,7 +354,7 @@ JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) "using_mrr": false, "index_only": false, "rows": 2243, - "cost": 2700.058937, + "cost": 1695.083937, "chosen": false, "cause": "cost" }, @@ -363,7 +369,7 @@ JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) "using_mrr": false, "index_only": false, "rows": 2243, - "cost": 2700.058937, + "cost": 1695.083937, "chosen": false, "cause": "cost" } @@ -375,10 +381,10 @@ JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) { "index": "key1", - "index_scan_cost": 10.31393703, - "cumulated_index_scan_cost": 10.31393703, - "disk_sweep_cost": 1923.144061, - "cumulative_total_cost": 1933.457998, + "index_scan_cost": 61.88893703, + "cumulated_index_scan_cost": 61.88893703, + "disk_sweep_cost": 1682.25, + "cumulative_total_cost": 1744.138937, "usable": true, "matching_rows_now": 2243, "intersect_covering_with_this_index": false, @@ -387,10 +393,10 @@ JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) { "index": "key2", - "index_scan_cost": 10.31393703, - "cumulated_index_scan_cost": 20.62787405, - "disk_sweep_cost": 84.51771758, - "cumulative_total_cost": 105.1455916, + "index_scan_cost": 61.88893703, + "cumulated_index_scan_cost": 123.7778741, + "disk_sweep_cost": 57.75, + "cumulative_total_cost": 181.5278741, "usable": true, "matching_rows_now": 77.6360508, "intersect_covering_with_this_index": false, @@ -399,14 +405,15 @@ JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) { "index": "key3", - "index_scan_cost": 10.31393703, - "cumulated_index_scan_cost": 30.94181108, + "index_scan_cost": 61.88893703, + "cumulated_index_scan_cost": 185.6668111, "disk_sweep_cost": 0, - "cumulative_total_cost": 30.94181108, + "cumulative_total_cost": 185.6668111, "usable": true, "matching_rows_now": 2.687185191, "intersect_covering_with_this_index": true, - "chosen": true + "chosen": false, + "cause": "does not reduce cost" } ], "clustered_pk": @@ -414,9 +421,9 @@ JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) "clustered_pk_added_to_intersect": false, "cause": "no clustered pk index" }, - "rows": 2, - "cost": 30.94181108, - "covering": true, + "rows": 77, + "cost": 197.0550842, + "covering": false, "chosen": true }, "analyzing_index_merge_union": @@ -432,9 +439,9 @@ JSON_DETAILED(JSON_EXTRACT(trace, '$**.chosen_range_access_summary')) "range_access_plan": { "type": "index_roworder_intersect", - "rows": 2, - "cost": 30.94181108, - "covering": true, + "rows": 77, + "cost": 197.0550842, + "covering": false, "clustered_pk_scan": false, "intersect_of": [ @@ -457,21 +464,11 @@ JSON_DETAILED(JSON_EXTRACT(trace, '$**.chosen_range_access_summary')) [ "(100) <= (key2) <= (100)" ] - }, - - { - "type": "range_scan", - "index": "key3", - "rows": 2243, - "ranges": - [ - "(100) <= (key3) <= (100)" - ] } ] }, - "rows_for_plan": 2, - "cost_for_plan": 30.94181108, + "rows_for_plan": 77, + "cost_for_plan": 197.0550842, "chosen": true } ] @@ -512,7 +509,7 @@ JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) "using_mrr": false, "index_only": true, "rows": 2243, - "cost": 457.058937, + "cost": 517.508937, "chosen": true }, @@ -526,13 +523,13 @@ JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) "using_mrr": false, "index_only": true, "rows": 2243, - "cost": 457.058937, + "cost": 517.508937, "chosen": false, "cause": "cost" } ], "index_to_merge": "key1", - "cumulated_cost": 457.058937 + "cumulated_cost": 517.508937 }, { @@ -549,7 +546,7 @@ JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) "using_mrr": false, "index_only": true, "rows": 2243, - "cost": 457.058937, + "cost": 517.508937, "chosen": true }, @@ -563,16 +560,16 @@ JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) "using_mrr": false, "index_only": true, "rows": 2243, - "cost": 457.058937, + "cost": 517.508937, "chosen": false, "cause": "cost" } ], "index_to_merge": "key3", - "cumulated_cost": 914.1178741 + "cumulated_cost": 1035.017874 } ], - "cost_of_reading_ranges": 914.1178741, + "cost_of_reading_ranges": 1035.017874, "use_roworder_union": true, "cause": "always cheaper than non roworder retrieval", "analyzing_roworder_scans": @@ -593,10 +590,10 @@ JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) { "index": "key1", - "index_scan_cost": 10.31393703, - "cumulated_index_scan_cost": 10.31393703, - "disk_sweep_cost": 1923.144061, - "cumulative_total_cost": 1933.457998, + "index_scan_cost": 61.88893703, + "cumulated_index_scan_cost": 61.88893703, + "disk_sweep_cost": 1682.25, + "cumulative_total_cost": 1744.138937, "usable": true, "matching_rows_now": 2243, "intersect_covering_with_this_index": false, @@ -605,10 +602,10 @@ JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) { "index": "key2", - "index_scan_cost": 10.31393703, - "cumulated_index_scan_cost": 20.62787405, - "disk_sweep_cost": 84.51771758, - "cumulative_total_cost": 105.1455916, + "index_scan_cost": 61.88893703, + "cumulated_index_scan_cost": 123.7778741, + "disk_sweep_cost": 57.75, + "cumulative_total_cost": 181.5278741, "usable": true, "matching_rows_now": 77.6360508, "intersect_covering_with_this_index": false, @@ -621,7 +618,7 @@ JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) "cause": "no clustered pk index" }, "rows": 77, - "cost": 105.1455916, + "cost": 197.0550842, "covering": false, "chosen": true } @@ -642,10 +639,10 @@ JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) { "index": "key3", - "index_scan_cost": 10.31393703, - "cumulated_index_scan_cost": 10.31393703, - "disk_sweep_cost": 1923.144061, - "cumulative_total_cost": 1933.457998, + "index_scan_cost": 61.88893703, + "cumulated_index_scan_cost": 61.88893703, + "disk_sweep_cost": 1682.25, + "cumulative_total_cost": 1744.138937, "usable": true, "matching_rows_now": 2243, "intersect_covering_with_this_index": false, @@ -654,10 +651,10 @@ JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) { "index": "key4", - "index_scan_cost": 10.31393703, - "cumulated_index_scan_cost": 20.62787405, - "disk_sweep_cost": 84.51771758, - "cumulative_total_cost": 105.1455916, + "index_scan_cost": 61.88893703, + "cumulated_index_scan_cost": 123.7778741, + "disk_sweep_cost": 57.75, + "cumulative_total_cost": 181.5278741, "usable": true, "matching_rows_now": 77.6360508, "intersect_covering_with_this_index": false, @@ -670,13 +667,13 @@ JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) "cause": "no clustered pk index" }, "rows": 77, - "cost": 105.1455916, + "cost": 197.0550842, "covering": false, "chosen": true } } ], - "index_roworder_union_cost": 194.9771115, + "index_roworder_union_cost": 332.5637481, "members": 2, "chosen": true } @@ -697,7 +694,7 @@ JSON_DETAILED(JSON_EXTRACT(trace, '$**.chosen_range_access_summary')) { "type": "index_roworder_intersect", "rows": 77, - "cost": 105.1455916, + "cost": 197.0550842, "covering": false, "clustered_pk_scan": false, "intersect_of": @@ -728,7 +725,7 @@ JSON_DETAILED(JSON_EXTRACT(trace, '$**.chosen_range_access_summary')) { "type": "index_roworder_intersect", "rows": 77, - "cost": 105.1455916, + "cost": 197.0550842, "covering": false, "clustered_pk_scan": false, "intersect_of": @@ -758,7 +755,7 @@ JSON_DETAILED(JSON_EXTRACT(trace, '$**.chosen_range_access_summary')) ] }, "rows_for_plan": 154, - "cost_for_plan": 194.9771115, + "cost_for_plan": 332.5637481, "chosen": true } ] diff --git a/mysql-test/main/opt_trace_index_merge_innodb.result b/mysql-test/main/opt_trace_index_merge_innodb.result index d3081bd6b9d..1569f3763b4 100644 --- a/mysql-test/main/opt_trace_index_merge_innodb.result +++ b/mysql-test/main/opt_trace_index_merge_innodb.result @@ -88,7 +88,7 @@ explain select * from t1 where pk1 != 0 and key1 = 1 { "range_analysis": { "table_scan": { "rows": 1000, - "cost": 206 + "cost": 253 }, "potential_range_indexes": [ { @@ -117,7 +117,7 @@ explain select * from t1 where pk1 != 0 and key1 = 1 { "using_mrr": false, "index_only": false, "rows": 1000, - "cost": 204.27, + "cost": 252.02, "chosen": true }, { @@ -127,7 +127,7 @@ explain select * from t1 where pk1 != 0 and key1 = 1 { "using_mrr": false, "index_only": false, "rows": 1, - "cost": 1.345146475, + "cost": 1.270146475, "chosen": true } ], @@ -135,10 +135,10 @@ explain select * from t1 where pk1 != 0 and key1 = 1 { "intersecting_indexes": [ { "index": "key1", - "index_scan_cost": 1.000146475, - "cumulated_index_scan_cost": 1.000146475, - "disk_sweep_cost": 1.004153686, - "cumulative_total_cost": 2.004300162, + "index_scan_cost": 0.525146475, + "cumulated_index_scan_cost": 0.525146475, + "disk_sweep_cost": 0.752076843, + "cumulative_total_cost": 1.277223319, "usable": true, "matching_rows_now": 1, "intersect_covering_with_this_index": false, @@ -166,7 +166,7 @@ explain select * from t1 where pk1 != 0 and key1 = 1 { "ranges": ["(1) <= (key1) <= (1)"] }, "rows_for_plan": 1, - "cost_for_plan": 1.345146475, + "cost_for_plan": 1.270146475, "chosen": true } } @@ -176,7 +176,7 @@ explain select * from t1 where pk1 != 0 and key1 = 1 { "rowid_filters": [ { "key": "key1", - "build_cost": 0.130146475, + "build_cost": 0.526146475, "rows": 1 } ] @@ -203,16 +203,16 @@ explain select * from t1 where pk1 != 0 and key1 = 1 { "plan_prefix": [], "table": "t1", "best_access_path": { + "plan_details": { + "record_count": 1 + }, "considered_access_paths": [ { "access_type": "ref", "index": "key1", "used_range_estimates": true, "rows": 1, - "found_matching_rows_cost": 1.325146475, - "startup_cost": 0, - "rows": 1, - "cost": 1.325146475, + "cost": 1.250146475, "chosen": true }, { @@ -224,12 +224,12 @@ explain select * from t1 where pk1 != 0 and key1 = 1 { "chosen_access_method": { "type": "ref", "records": 1, - "cost": 1.325146475, + "cost": 1.250146475, "uses_join_buffering": false } }, "rows_for_plan": 1, - "cost_for_plan": 1.525146475, + "cost_for_plan": 1.250146475, "estimated_join_cardinality": 1 } ] @@ -237,7 +237,8 @@ explain select * from t1 where pk1 != 0 and key1 = 1 { { "best_join_order": ["t1"], "best_access_method": { - "cost": 1.524146475 + "rows": 1, + "cost": 1.250146475 } }, { diff --git a/mysql-test/main/opt_trace_security.result b/mysql-test/main/opt_trace_security.result index d9e5fbee5ef..9caf2309261 100644 --- a/mysql-test/main/opt_trace_security.result +++ b/mysql-test/main/opt_trace_security.result @@ -80,7 +80,8 @@ select * from db1.t1 { "table": "t1", "table_scan": { "rows": 3, - "cost": 2.005126953 + "read_cost": 1.152563477, + "read_and_compare_cost": 1.902563477 } } ] @@ -91,23 +92,29 @@ select * from db1.t1 { "plan_prefix": [], "table": "t1", "best_access_path": { + "plan_details": { + "record_count": 1 + }, "considered_access_paths": [ { "access_type": "scan", - "resulting_rows": 3, - "cost": 2.605126953, + "rows": 3, + "rows_after_scan": 3, + "rows_after_filter": 3, + "cost": 1.902563477, + "index_only": false, "chosen": true } ], "chosen_access_method": { "type": "scan", "records": 3, - "cost": 2.605126953, + "cost": 1.902563477, "uses_join_buffering": false } }, "rows_for_plan": 3, - "cost_for_plan": 3.205126953, + "cost_for_plan": 1.902563477, "estimated_join_cardinality": 3 } ] @@ -115,7 +122,8 @@ select * from db1.t1 { { "best_join_order": ["t1"], "best_access_method": { - "cost": 3.204126953 + "rows": 3, + "cost": 1.902563477 } }, { @@ -205,7 +213,8 @@ select * from db1.v1 { "table": "t1", "table_scan": { "rows": 3, - "cost": 2.005126953 + "read_cost": 1.152563477, + "read_and_compare_cost": 1.902563477 } } ] @@ -216,23 +225,29 @@ select * from db1.v1 { "plan_prefix": [], "table": "t1", "best_access_path": { + "plan_details": { + "record_count": 1 + }, "considered_access_paths": [ { "access_type": "scan", - "resulting_rows": 3, - "cost": 2.605126953, + "rows": 3, + "rows_after_scan": 3, + "rows_after_filter": 3, + "cost": 1.902563477, + "index_only": false, "chosen": true } ], "chosen_access_method": { "type": "scan", "records": 3, - "cost": 2.605126953, + "cost": 1.902563477, "uses_join_buffering": false } }, "rows_for_plan": 3, - "cost_for_plan": 3.205126953, + "cost_for_plan": 1.902563477, "estimated_join_cardinality": 3 } ] @@ -240,7 +255,8 @@ select * from db1.v1 { { "best_join_order": ["t1"], "best_access_method": { - "cost": 3.204126953 + "rows": 3, + "cost": 1.902563477 } }, { diff --git a/mysql-test/main/opt_trace_selectivity.result b/mysql-test/main/opt_trace_selectivity.result index 8d1f50ff48d..dc850c7ca1d 100644 --- a/mysql-test/main/opt_trace_selectivity.result +++ b/mysql-test/main/opt_trace_selectivity.result @@ -42,6 +42,10 @@ JSON_DETAILED(JSON_EXTRACT(trace, '$**.considered_execution_plans')) "table": "t1", "best_access_path": { + "plan_details": + { + "record_count": 1 + }, "considered_access_paths": [ @@ -50,10 +54,7 @@ JSON_DETAILED(JSON_EXTRACT(trace, '$**.considered_execution_plans')) "index": "a", "used_range_estimates": true, "rows": 104, - "found_matching_rows_cost": 124.96562, - "startup_cost": 0, - "rows": 104, - "cost": 124.96562, + "cost": 78.54062004, "chosen": true }, @@ -62,10 +63,7 @@ JSON_DETAILED(JSON_EXTRACT(trace, '$**.considered_execution_plans')) "index": "b", "used_range_estimates": true, "rows": 340, - "found_matching_rows_cost": 408.2577963, - "startup_cost": 0, - "rows": 340, - "cost": 408.2577963, + "cost": 255.6327963, "chosen": false, "cause": "cost" }, @@ -75,18 +73,17 @@ JSON_DETAILED(JSON_EXTRACT(trace, '$**.considered_execution_plans')) "index": "c", "used_range_estimates": true, "rows": 632, - "found_matching_rows_cost": 758.7718449, - "startup_cost": 0, - "rows": 632, - "cost": 758.7718449, + "cost": 475.2468449, "chosen": false, "cause": "cost" }, { "access_type": "index_merge", - "resulting_rows": 7, - "cost": 2.173416331, + "rows": 7, + "rows_after_scan": 7, + "rows_after_filter": 7, + "cost": 13.79559815, "chosen": true } ], @@ -94,12 +91,12 @@ JSON_DETAILED(JSON_EXTRACT(trace, '$**.considered_execution_plans')) { "type": "index_merge", "records": 7, - "cost": 2.173416331, + "cost": 13.79559815, "uses_join_buffering": false } }, "rows_for_plan": 7, - "cost_for_plan": 3.573416331, + "cost_for_plan": 13.79559815, "estimated_join_cardinality": 7 } ] @@ -141,6 +138,10 @@ JSON_DETAILED(JSON_EXTRACT(trace, '$**.considered_execution_plans')) "table": "t1", "best_access_path": { + "plan_details": + { + "record_count": 1 + }, "considered_access_paths": [ @@ -149,10 +150,7 @@ JSON_DETAILED(JSON_EXTRACT(trace, '$**.considered_execution_plans')) "index": "a", "used_range_estimates": true, "rows": 6, - "found_matching_rows_cost": 7.327343464, - "startup_cost": 0, - "rows": 6, - "cost": 7.327343464, + "cost": 5.002343464, "chosen": true }, @@ -161,10 +159,7 @@ JSON_DETAILED(JSON_EXTRACT(trace, '$**.considered_execution_plans')) "index": "b", "used_range_estimates": true, "rows": 232, - "found_matching_rows_cost": 278.6156139, - "startup_cost": 0, - "rows": 232, - "cost": 278.6156139, + "cost": 174.5906139, "chosen": false, "cause": "cost" }, @@ -174,32 +169,30 @@ JSON_DETAILED(JSON_EXTRACT(trace, '$**.considered_execution_plans')) "index": "c", "used_range_estimates": true, "rows": 293, - "found_matching_rows_cost": 351.8394392, - "startup_cost": 0, - "rows": 293, - "cost": 351.8394392, + "cost": 220.3644392, "chosen": false, "cause": "cost" }, { - "access_type": "index_merge", - "resulting_rows": 1, - "cost": 2.092957403, - "chosen": true + "type": "scan", + "chosen": false, + "cause": "cost" } ], "chosen_access_method": { - "type": "index_merge", - "records": 1, - "cost": 2.092957403, + "type": "ref", + "records": 6, + "cost": 5.002343464, "uses_join_buffering": false } }, - "rows_for_plan": 1, - "cost_for_plan": 2.292957403, - "estimated_join_cardinality": 1 + "rows_for_plan": 6, + "cost_for_plan": 5.002343464, + "selectivity": 0.1, + "remaining_rows_for_plan": 0.6, + "estimated_join_cardinality": 0.6 } ] ] diff --git a/mysql-test/main/opt_trace_selectivity.test b/mysql-test/main/opt_trace_selectivity.test index 4d59d4974cd..3ebf4d97ed9 100644 --- a/mysql-test/main/opt_trace_selectivity.test +++ b/mysql-test/main/opt_trace_selectivity.test @@ -19,7 +19,9 @@ select count(*) from t1 where c=5 and b=5; set optimizer_trace="enabled=on"; select count(*) from t1 where a=2 and b=5 and c=10; + select JSON_DETAILED(JSON_EXTRACT(trace, '$**.considered_execution_plans')) from INFORMATION_SCHEMA.OPTIMIZER_TRACE; + select JSON_DETAILED(JSON_EXTRACT(trace, '$**.selectivity_for_indexes')) from INFORMATION_SCHEMA.OPTIMIZER_TRACE; select count(*) from t1 where a=2 and b=5 and c=5; diff --git a/mysql-test/main/opt_trace_ucs2.result b/mysql-test/main/opt_trace_ucs2.result index 5de1fc5c3e9..c4b36902bce 100644 --- a/mysql-test/main/opt_trace_ucs2.result +++ b/mysql-test/main/opt_trace_ucs2.result @@ -38,7 +38,7 @@ JSON_DETAILED(JSON_EXTRACT(trace, '$**.analyzing_range_alternatives')) "using_mrr": false, "index_only": false, "rows": 2, - "cost": 2.547733708, + "cost": 2.022733708, "chosen": true } ], diff --git a/mysql-test/main/opt_tvc.result b/mysql-test/main/opt_tvc.result index a68e70e8a25..60782fe5db8 100644 --- a/mysql-test/main/opt_tvc.result +++ b/mysql-test/main/opt_tvc.result @@ -444,7 +444,7 @@ where b in (3,5) group by b ) as dr_table; id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY <derived2> ALL NULL NULL NULL NULL 12 100.00 +1 PRIMARY <derived2> ALL NULL NULL NULL NULL 9 100.00 2 DERIVED t1 ALL NULL NULL NULL NULL 6 100.00 Using temporary; Using filesort 2 DERIVED <subquery3> eq_ref distinct_key distinct_key 4 func 1 100.00 3 MATERIALIZED <derived4> ALL NULL NULL NULL NULL 2 100.00 @@ -464,7 +464,7 @@ as tvc_0 group by b ) as dr_table; id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY <derived2> ALL NULL NULL NULL NULL 12 100.00 +1 PRIMARY <derived2> ALL NULL NULL NULL NULL 9 100.00 2 DERIVED t1 ALL NULL NULL NULL NULL 6 100.00 Using temporary; Using filesort 2 DERIVED <subquery3> eq_ref distinct_key distinct_key 4 func 1 100.00 3 MATERIALIZED <derived4> ALL NULL NULL NULL NULL 2 100.00 @@ -526,7 +526,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra Warnings: Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` semi join ((values (1,2),(3,4)) `tvc_0`) where 1 set @@in_predicate_conversion_threshold= 2; -# trasformation works for the one IN predicate and doesn't work for the other +# transformation works for the one IN predicate and doesn't work for the other set @@in_predicate_conversion_threshold= 5; select * from t2 where (a,b) in ((1,2),(8,9)) and @@ -539,11 +539,10 @@ where (a,b) in ((1,2),(8,9)) and (a,c) in ((1,3),(8,0),(5,1)); id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t2 ALL NULL NULL NULL NULL 6 100.00 Using where -1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 8 func,func 1 100.00 -2 MATERIALIZED <derived3> ALL NULL NULL NULL NULL 3 100.00 +1 PRIMARY <derived3> ref key0 key0 8 test.t2.a,test.t2.c 2 100.00 FirstMatch(t2) 3 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 /* select#1 */ select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c` from `test`.`t2` semi join ((values (1,3),(8,0),(5,1)) `tvc_0`) where (`test`.`t2`.`a`,`test`.`t2`.`b`) in (<cache>((1,2)),<cache>((8,9))) +Note 1003 /* select#1 */ select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c` from `test`.`t2` semi join ((values (1,3),(8,0),(5,1)) `tvc_0`) where `tvc_0`.`_col_1` = `test`.`t2`.`a` and `tvc_0`.`_col_2` = `test`.`t2`.`c` and (`test`.`t2`.`a`,`test`.`t2`.`b`) in (<cache>((1,2)),<cache>((8,9))) set @@in_predicate_conversion_threshold= 2; # # mdev-14281: conversion of NOT IN predicate into subquery predicate @@ -568,18 +567,18 @@ explain extended select * from t1 where (a,b) not in ((1,2),(8,9), (5,1)); id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00 Using where -2 MATERIALIZED <derived3> ALL NULL NULL NULL NULL 3 100.00 +2 DEPENDENT SUBQUERY <derived3> index_subquery key0 key0 8 func,func 2 100.00 Using where; Full scan on NULL key 3 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where !<expr_cache><`test`.`t1`.`a`,`test`.`t1`.`b`>(<in_optimizer>((`test`.`t1`.`a`,`test`.`t1`.`b`),(`test`.`t1`.`a`,`test`.`t1`.`b`) in ( <materialize> (/* select#2 */ select `tvc_0`.`_col_1`,`tvc_0`.`_col_2` from (values (1,2),(8,9),(5,1)) `tvc_0` ), <primary_index_lookup>(`test`.`t1`.`a` in <temporary table> on distinct_key where `test`.`t1`.`a` = `<subquery2>`.`_col_1` and `test`.`t1`.`b` = `<subquery2>`.`_col_2`)))) +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where !<expr_cache><`test`.`t1`.`a`,`test`.`t1`.`b`>(<in_optimizer>((`test`.`t1`.`a`,`test`.`t1`.`b`),<exists>(<index_lookup>(<cache>(`test`.`t1`.`a`) in (temporary) on key0 where trigcond(<cache>(`test`.`t1`.`a`) = `tvc_0`.`_col_1`) and trigcond(<cache>(`test`.`t1`.`b`) = `tvc_0`.`_col_2`))))) explain extended select * from t1 where (a,b) not in (select * from (values (1,2),(8,9), (5,1)) as tvc_0); id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00 Using where -2 MATERIALIZED <derived3> ALL NULL NULL NULL NULL 3 100.00 +2 DEPENDENT SUBQUERY <derived3> index_subquery key0 key0 8 func,func 2 100.00 Using where; Full scan on NULL key 3 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where !<expr_cache><`test`.`t1`.`a`,`test`.`t1`.`b`>(<in_optimizer>((`test`.`t1`.`a`,`test`.`t1`.`b`),(`test`.`t1`.`a`,`test`.`t1`.`b`) in ( <materialize> (/* select#2 */ select `tvc_0`.`1`,`tvc_0`.`2` from (values (1,2),(8,9),(5,1)) `tvc_0` ), <primary_index_lookup>(`test`.`t1`.`a` in <temporary table> on distinct_key where `test`.`t1`.`a` = `<subquery2>`.`1` and `test`.`t1`.`b` = `<subquery2>`.`2`)))) +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where !<expr_cache><`test`.`t1`.`a`,`test`.`t1`.`b`>(<in_optimizer>((`test`.`t1`.`a`,`test`.`t1`.`b`),<exists>(<index_lookup>(<cache>(`test`.`t1`.`a`) in (temporary) on key0 where trigcond(<cache>(`test`.`t1`.`a`) = `tvc_0`.`1`) and trigcond(<cache>(`test`.`t1`.`b`) = `tvc_0`.`2`))))) select * from t1 where b < 7 and (a,b) not in ((1,2),(8,9), (5,1)); a b @@ -590,10 +589,10 @@ explain extended select * from t1 where b < 7 and (a,b) not in ((1,2),(8,9), (5,1)); id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 6 100.00 Using where -2 MATERIALIZED <derived3> ALL NULL NULL NULL NULL 3 100.00 +2 DEPENDENT SUBQUERY <derived3> index_subquery key0 key0 8 func,func 2 100.00 Using where; Full scan on NULL key 3 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where `test`.`t1`.`b` < 7 and !<expr_cache><`test`.`t1`.`a`,`test`.`t1`.`b`>(<in_optimizer>((`test`.`t1`.`a`,`test`.`t1`.`b`),(`test`.`t1`.`a`,`test`.`t1`.`b`) in ( <materialize> (/* select#2 */ select `tvc_0`.`_col_1`,`tvc_0`.`_col_2` from (values (1,2),(8,9),(5,1)) `tvc_0` ), <primary_index_lookup>(`test`.`t1`.`a` in <temporary table> on distinct_key where `test`.`t1`.`a` = `<subquery2>`.`_col_1` and `test`.`t1`.`b` = `<subquery2>`.`_col_2`)))) +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where `test`.`t1`.`b` < 7 and !<expr_cache><`test`.`t1`.`a`,`test`.`t1`.`b`>(<in_optimizer>((`test`.`t1`.`a`,`test`.`t1`.`b`),<exists>(<index_lookup>(<cache>(`test`.`t1`.`a`) in (temporary) on key0 where trigcond(<cache>(`test`.`t1`.`a`) = `tvc_0`.`_col_1`) and trigcond(<cache>(`test`.`t1`.`b`) = `tvc_0`.`_col_2`))))) select * from t2 where (a,c) not in ((1,2),(8,9), (5,1)); a b c @@ -606,10 +605,10 @@ explain extended select * from t2 where (a,c) not in ((1,2),(8,9), (5,1)); id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t2 ALL NULL NULL NULL NULL 6 100.00 Using where -2 MATERIALIZED <derived3> ALL NULL NULL NULL NULL 3 100.00 +2 DEPENDENT SUBQUERY <derived3> index_subquery key0 key0 8 func,func 2 100.00 Using where; Full scan on NULL key 3 DERIVED NULL NULL NULL NULL NULL NULL NULL NULL No tables used Warnings: -Note 1003 /* select#1 */ select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c` from `test`.`t2` where !<expr_cache><`test`.`t2`.`a`,`test`.`t2`.`c`>(<in_optimizer>((`test`.`t2`.`a`,`test`.`t2`.`c`),(`test`.`t2`.`a`,`test`.`t2`.`c`) in ( <materialize> (/* select#2 */ select `tvc_0`.`_col_1`,`tvc_0`.`_col_2` from (values (1,2),(8,9),(5,1)) `tvc_0` ), <primary_index_lookup>(`test`.`t2`.`a` in <temporary table> on distinct_key where `test`.`t2`.`a` = `<subquery2>`.`_col_1` and `test`.`t2`.`c` = `<subquery2>`.`_col_2`)))) +Note 1003 /* select#1 */ select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b`,`test`.`t2`.`c` AS `c` from `test`.`t2` where !<expr_cache><`test`.`t2`.`a`,`test`.`t2`.`c`>(<in_optimizer>((`test`.`t2`.`a`,`test`.`t2`.`c`),<exists>(<index_lookup>(<cache>(`test`.`t2`.`a`) in (temporary) on key0 where trigcond(<cache>(`test`.`t2`.`a`) = `tvc_0`.`_col_1`) and trigcond(<cache>(`test`.`t2`.`c`) = `tvc_0`.`_col_2`))))) drop table t1, t2, t3; set @@in_predicate_conversion_threshold= default; # diff --git a/mysql-test/main/opt_tvc.test b/mysql-test/main/opt_tvc.test index e4e8c6d7919..e07a7be67c7 100644 --- a/mysql-test/main/opt_tvc.test +++ b/mysql-test/main/opt_tvc.test @@ -276,7 +276,7 @@ eval $query; eval explain extended $query; set @@in_predicate_conversion_threshold= 2; ---echo # trasformation works for the one IN predicate and doesn't work for the other +--echo # transformation works for the one IN predicate and doesn't work for the other set @@in_predicate_conversion_threshold= 5; diff --git a/mysql-test/main/order_by.result b/mysql-test/main/order_by.result index 153cccf822e..70f21cacc98 100644 --- a/mysql-test/main/order_by.result +++ b/mysql-test/main/order_by.result @@ -1193,7 +1193,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 index k2 k3 5 NULL 111 Using where EXPLAIN SELECT id,c3 FROM t2 WHERE c2=11 ORDER BY c3 LIMIT 4000; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 index k2 k3 5 NULL 22318 Using where +1 SIMPLE t2 ref k2 k2 5 const 7341 Using where; Using filesort EXPLAIN SELECT id,c3 FROM t2 WHERE c2 BETWEEN 10 AND 12 ORDER BY c3 LIMIT 20; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 index k2 k3 5 NULL 73 Using where @@ -1222,6 +1222,10 @@ id c3 176 14 186 14 196 14 +ALTER TABLE t2 DROP INDEX k3, ADD INDEX k3 (c3,c2); +EXPLAIN SELECT c3 FROM t2 WHERE c2=11 ORDER BY c3 LIMIT 4000; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 index k2 k3 10 NULL 22318 Using where; Using index DROP TABLE t1,t2; CREATE TABLE t1 ( a INT, @@ -1552,11 +1556,17 @@ INSERT INTO t1 VALUES (1, 10), (2, NULL); EXPLAIN SELECT 1 AS col FROM t1 WHERE a=2 AND (c=10 OR c IS NULL) ORDER BY c; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref_or_null a_c,a a_c 10 const,const 2 Using where; Using index; Using filesort +1 SIMPLE t1 range a_c,a a_c 10 NULL 2 Using where; Using index # Must return 1 row SELECT 1 AS col FROM t1 WHERE a=2 AND (c=10 OR c IS NULL) ORDER BY c; col 1 +# With more rows "range" changes to "ref_or_null" +INSERT INTO t1 select seq,seq from seq_1_to_10; +EXPLAIN +SELECT 1 AS col FROM t1 WHERE a=2 AND (c=10 OR c IS NULL) ORDER BY c; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref_or_null a_c,a a_c 10 const,const 2 Using where; Using index; Using filesort # Must use ref-or-null on the a_c index EXPLAIN SELECT 1 AS col FROM t1 WHERE a=2 AND (c=10 OR c IS NULL) ORDER BY c DESC; @@ -3408,10 +3418,9 @@ ANALYZE "r_loops": 1, "r_total_time_ms": "REPLACED", "r_limit": 5, - "r_used_priority_queue": false, - "r_output_rows": 100, - "r_buffer_size": "REPLACED", - "r_sort_mode": "sort_key,packed_addon_fields", + "r_used_priority_queue": true, + "r_output_rows": 6, + "r_sort_mode": "sort_key,rowid", "table": { "table_name": "t1", "access_type": "ALL", @@ -3447,7 +3456,7 @@ CREATE TABLE t2 SELECT * FROM t1; EXPLAIN SELECT (SELECT 1 FROM t1 WHERE t1.a=t2.b ORDER BY t1.b LIMIT 1) AS c FROM t2; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t2 ALL NULL NULL NULL NULL 2 -2 DEPENDENT SUBQUERY t1 index PRIMARY b 5 NULL 1 Using where +2 DEPENDENT SUBQUERY t1 eq_ref PRIMARY PRIMARY 4 test.t2.b 1 Using where SELECT (SELECT 1 FROM t1 WHERE t1.a=t2.b ORDER BY t1.b LIMIT 1) AS c FROM t2; c 1 @@ -3495,11 +3504,10 @@ WHERE books.library_id = 8663 AND books.scheduled_for_removal=0 ) ORDER BY wings.id; id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 2 100.00 Using filesort -1 PRIMARY wings eq_ref PRIMARY PRIMARY 4 test.books.wings_id 1 100.00 -2 MATERIALIZED books ref library_idx library_idx 4 const 2 100.00 Using where +1 PRIMARY wings ALL PRIMARY NULL NULL NULL 2 100.00 Using temporary; Using filesort +1 PRIMARY books ALL library_idx NULL NULL NULL 2 100.00 Using where; FirstMatch(wings); Using join buffer (flat, BNL join) Warnings: -Note 1003 select `test`.`wings`.`id` AS `wing_id`,`test`.`wings`.`department_id` AS `department_id` from `test`.`wings` semi join (`test`.`books`) where `test`.`books`.`library_id` = 8663 and `test`.`books`.`scheduled_for_removal` = 0 and `test`.`wings`.`id` = `test`.`books`.`wings_id` order by `test`.`wings`.`id` +Note 1003 select `test`.`wings`.`id` AS `wing_id`,`test`.`wings`.`department_id` AS `department_id` from `test`.`wings` semi join (`test`.`books`) where `test`.`books`.`library_id` = 8663 and `test`.`books`.`scheduled_for_removal` = 0 and `test`.`books`.`wings_id` = `test`.`wings`.`id` order by `test`.`wings`.`id` set optimizer_switch= @save_optimizer_switch; DROP TABLE books, wings; # diff --git a/mysql-test/main/order_by.test b/mysql-test/main/order_by.test index 9ad0af1d21f..70cf10df446 100644 --- a/mysql-test/main/order_by.test +++ b/mysql-test/main/order_by.test @@ -3,6 +3,7 @@ # call mtr.add_suppression("Sort aborted.*"); +--source include/have_sequence.inc --disable_warnings drop table if exists t1,t2,t3; @@ -804,6 +805,10 @@ EXPLAIN SELECT id,c3 FROM t2 WHERE c2 BETWEEN 20 AND 30 ORDER BY c3 LIMIT 4000; SELECT id,c3 FROM t2 WHERE c2=11 ORDER BY c3 LIMIT 20; +# Show that order by optimization takes into account index only scans +ALTER TABLE t2 DROP INDEX k3, ADD INDEX k3 (c3,c2); +EXPLAIN SELECT c3 FROM t2 WHERE c2=11 ORDER BY c3 LIMIT 4000; + DROP TABLE t1,t2; # @@ -913,6 +918,11 @@ SELECT 1 AS col FROM t1 WHERE a=2 AND (c=10 OR c IS NULL) ORDER BY c; --echo # Must return 1 row SELECT 1 AS col FROM t1 WHERE a=2 AND (c=10 OR c IS NULL) ORDER BY c; +--echo # With more rows "range" changes to "ref_or_null" +INSERT INTO t1 select seq,seq from seq_1_to_10; +EXPLAIN +SELECT 1 AS col FROM t1 WHERE a=2 AND (c=10 OR c IS NULL) ORDER BY c; + # part 2 of the problem : DESC test cases --echo # Must use ref-or-null on the a_c index --replace_column 1 x 2 x 3 x 6 x 7 x 8 x 9 x 10 x diff --git a/mysql-test/main/order_by_innodb.result b/mysql-test/main/order_by_innodb.result index 14b9b861a14..d157297bb5f 100644 --- a/mysql-test/main/order_by_innodb.result +++ b/mysql-test/main/order_by_innodb.result @@ -61,17 +61,29 @@ KEY a_c (a,c), KEY a_b (a,b) ) ENGINE=InnoDB; insert into t1 select A.a , B.a, C.a from t0 A, t0 B, t0 C; +select count(*) from t1; +count(*) +1000 +select count(*) from t1 where a=1; +count(*) +200 +select count(*) from t1 where a=1 and c=2; +count(*) +20 # should use ref access explain select a,b,c from t1 where a=1 and c=2 order by b; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ref a_c,a_b a_c 10 const,const 20 Using where; Using filesort -# both should use range access -explain select a,b,c from t1 where a=1 and c=2 order by b limit 1000; +# all should use range access +explain select a,b,c from t1 where a=1 and c=2 order by b limit 10; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ref a_c,a_b a_c 10 const,const 20 Using where; Using filesort +explain select a,b,c from t1 where a=1 and c=2 order by b limit 300; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range a_c,a_b a_b 5 NULL 200 Using where -explain select a,b,c from t1 where a=1 and c=2 order by b limit 2000; +1 SIMPLE t1 ref a_c,a_b a_c 10 const,const 20 Using where; Using filesort +explain select a,b,c from t1 where a=1 and c=2 order by b limit 1000; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range a_c,a_b a_b 5 NULL 200 Using where +1 SIMPLE t1 ref a_c,a_b a_c 10 const,const 20 Using where; Using filesort drop table t1,t0; # Start of 10.2 tests # diff --git a/mysql-test/main/order_by_innodb.test b/mysql-test/main/order_by_innodb.test index 97c043b8dbc..b4ea2de8b05 100644 --- a/mysql-test/main/order_by_innodb.test +++ b/mysql-test/main/order_by_innodb.test @@ -77,13 +77,17 @@ KEY a_c (a,c), KEY a_b (a,b) ) ENGINE=InnoDB; insert into t1 select A.a , B.a, C.a from t0 A, t0 B, t0 C; +select count(*) from t1; +select count(*) from t1 where a=1; +select count(*) from t1 where a=1 and c=2; --echo # should use ref access explain select a,b,c from t1 where a=1 and c=2 order by b; ---echo # both should use range access +--echo # all should use range access +explain select a,b,c from t1 where a=1 and c=2 order by b limit 10; +explain select a,b,c from t1 where a=1 and c=2 order by b limit 300; explain select a,b,c from t1 where a=1 and c=2 order by b limit 1000; -explain select a,b,c from t1 where a=1 and c=2 order by b limit 2000; drop table t1,t0; --echo # Start of 10.2 tests diff --git a/mysql-test/main/order_by_sortkey.result b/mysql-test/main/order_by_sortkey.result index c1d9609eb47..853823f5f61 100644 --- a/mysql-test/main/order_by_sortkey.result +++ b/mysql-test/main/order_by_sortkey.result @@ -40,6 +40,9 @@ INSERT INTO tmp SELECT f1,f2 FROM t1; INSERT INTO t1(f1,f2) SELECT * FROM tmp; INSERT INTO tmp SELECT f1,f2 FROM t1; INSERT INTO t1(f1,f2) SELECT * FROM tmp; +select count(*) from t1; +count(*) +87700 set sort_buffer_size= 32768; FLUSH STATUS; SHOW SESSION STATUS LIKE 'Sort%'; @@ -49,6 +52,9 @@ Sort_priority_queue_sorts 0 Sort_range 0 Sort_rows 0 Sort_scan 0 +explain SELECT * FROM t1 ORDER BY f2 LIMIT 100; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL NULL NULL NULL NULL 87700 Using filesort SELECT * FROM t1 ORDER BY f2 LIMIT 100; f0 f1 f2 1 0 0 @@ -158,4 +164,9 @@ Sort_priority_queue_sorts 1 Sort_range 0 Sort_rows 100 Sort_scan 1 +SHOW STATUS LIKE 'Handler_read_rnd%'; +Variable_name Value +Handler_read_rnd 100 +Handler_read_rnd_deleted 0 +Handler_read_rnd_next 87701 DROP TABLE t1, tmp; diff --git a/mysql-test/main/order_by_sortkey.test b/mysql-test/main/order_by_sortkey.test index 43de028496e..d3f8ba396d8 100644 --- a/mysql-test/main/order_by_sortkey.test +++ b/mysql-test/main/order_by_sortkey.test @@ -50,6 +50,7 @@ INSERT INTO tmp SELECT f1,f2 FROM t1; INSERT INTO t1(f1,f2) SELECT * FROM tmp; INSERT INTO tmp SELECT f1,f2 FROM t1; INSERT INTO t1(f1,f2) SELECT * FROM tmp; +select count(*) from t1; # Test when only sortkeys fits to memory set sort_buffer_size= 32768; @@ -57,8 +58,12 @@ set sort_buffer_size= 32768; FLUSH STATUS; SHOW SESSION STATUS LIKE 'Sort%'; +explain SELECT * FROM t1 ORDER BY f2 LIMIT 100; SELECT * FROM t1 ORDER BY f2 LIMIT 100; +# Check that Sort_priority_queue_sorts is used SHOW SESSION STATUS LIKE 'Sort%'; +# Check that we did scan the whole table and did LIMIT lookups +SHOW STATUS LIKE 'Handler_read_rnd%'; DROP TABLE t1, tmp; diff --git a/mysql-test/main/partition_pruning.result b/mysql-test/main/partition_pruning.result index 519bf590b9b..cabcc2eada5 100644 --- a/mysql-test/main/partition_pruning.result +++ b/mysql-test/main/partition_pruning.result @@ -15,13 +15,13 @@ PARTITION max VALUES LESS THAN MAXVALUE); INSERT INTO t1 VALUES (-1),(0),(1),(2),(3),(4),(5),(6),(7),(8); EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a <= 1; id select_type table partitions type possible_keys key key_len ref rows Extra -# # # # # # # # # 3 # +# # # # range # # # # 3 # EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a < 7; id select_type table partitions type possible_keys key key_len ref rows Extra -# # # # # # # # # 8 # +# # # # range # # # # 8 # EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a <= 1; id select_type table partitions type possible_keys key key_len ref rows Extra -# # # # # # # # # 3 # +# # # # range # # # # 3 # DROP TABLE t1; # # Bug#49742: Partition Pruning not working correctly for RANGE @@ -2888,12 +2888,12 @@ id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t2 p0,p1,p2,p3,p4 ALL b NULL NULL NULL 910 Using where explain extended select * from t2 where b in (2,4,6); id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t2 ALL b NULL NULL NULL 910 25.38 Using where +1 SIMPLE t2 range b b 5 NULL 231 100.00 Using where Warnings: Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t2` where `test`.`t2`.`b` in (2,4,6) explain partitions select * from t2 where b in (2,4,6); id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE t2 p0,p1,p2,p3,p4 ALL b NULL NULL NULL 910 Using where +1 SIMPLE t2 p0,p1,p2,p3,p4 range b b 5 NULL 231 Using where explain extended select * from t2 where b in (7,8,9); id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 ALL b NULL NULL NULL 910 36.81 Using where @@ -2912,12 +2912,12 @@ id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t2 p0,p1,p2,p3,p4 ALL b NULL NULL NULL 910 Using where explain extended select * from t2 where b > 5 and b < 8; id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t2 ALL b NULL NULL NULL 910 22.20 Using where +1 SIMPLE t2 range b b 5 NULL 202 100.00 Using where Warnings: Note 1003 select `test`.`t2`.`a` AS `a`,`test`.`t2`.`b` AS `b` from `test`.`t2` where `test`.`t2`.`b` > 5 and `test`.`t2`.`b` < 8 explain partitions select * from t2 where b > 5 and b < 8; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE t2 p0,p1,p2,p3,p4 ALL b NULL NULL NULL 910 Using where +1 SIMPLE t2 p0,p1,p2,p3,p4 range b b 5 NULL 202 Using where explain extended select * from t2 where b > 5 and b < 7; id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t2 range b b 5 NULL 77 100.00 Using where @@ -2946,10 +2946,10 @@ flush status; update t2 set a = 111 where b in (5,6); show status like 'Handler_read_rnd_next'; Variable_name Value -Handler_read_rnd_next 915 +Handler_read_rnd_next 0 show status like 'Handler_read_key'; Variable_name Value -Handler_read_key 0 +Handler_read_key 10 flush status; update t2 set a = 222 where b = 7; show status like 'Handler_read_rnd_next'; @@ -3378,7 +3378,7 @@ id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 p1 const PRIMARY PRIMARY 8 const,const 1 EXPLAIN PARTITIONS SELECT * FROM t1 WHERE c1 = 1 AND c2 >= 1; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE t1 p1,p2 range PRIMARY PRIMARY 8 NULL 3 Using where +1 SIMPLE t1 p1,p2 ref PRIMARY PRIMARY 4 const 1 Using where EXPLAIN PARTITIONS SELECT * FROM t1 WHERE c1 = 1 AND c2 > 1; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 p1,p2 range PRIMARY PRIMARY 8 NULL 2 Using where @@ -3387,7 +3387,7 @@ id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 p1 range PRIMARY PRIMARY 8 NULL 2 Using where EXPLAIN PARTITIONS SELECT * FROM t1 WHERE c1 = 1 AND c2 <= 3; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE t1 p1,p2 range PRIMARY PRIMARY 8 NULL 3 Using where +1 SIMPLE t1 p1,p2 ref PRIMARY PRIMARY 4 const 1 Using where EXPLAIN PARTITIONS SELECT * FROM t1 WHERE c1 = 2 AND c2 <= 3; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 p1,p2 range PRIMARY PRIMARY 8 NULL 2 Using where @@ -3405,7 +3405,7 @@ id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 p1,p2 range PRIMARY PRIMARY 8 NULL 2 Using where EXPLAIN PARTITIONS SELECT * FROM t1 WHERE c1 = 2 AND c2 <= 4; id select_type table partitions type possible_keys key key_len ref rows Extra -1 SIMPLE t1 p1,p2 range PRIMARY PRIMARY 8 NULL 3 Using where +1 SIMPLE t1 p1,p2 ref PRIMARY PRIMARY 4 const 1 Using where EXPLAIN PARTITIONS SELECT * FROM t1 WHERE c1 = 2 AND c2 = 4; id select_type table partitions type possible_keys key key_len ref rows Extra 1 SIMPLE t1 p2 const PRIMARY PRIMARY 8 const,const 1 @@ -3465,8 +3465,8 @@ select * from t1 where company_id = 1000 and dept_id in (select dept_id from t2 where COMPANY_ID = 1000); id select_type table partitions type possible_keys key key_len ref rows Extra -1 PRIMARY t2 p_1000 ref PRIMARY PRIMARY 8 const 3 Using index -1 PRIMARY t1 p_1000 ALL PRIMARY NULL NULL NULL 6 Using where; Using join buffer (flat, BNL join) +1 PRIMARY t1 p_1000 ref PRIMARY PRIMARY 8 const 6 Using where +1 PRIMARY t2 p_1000 eq_ref PRIMARY PRIMARY 16 const,test.t1.dept_id 1 Using index drop table t1,t2; # # MDEV-9505: Valgrind failure in SEL_ARG::store_min,find_used_partitions,... diff --git a/mysql-test/main/partition_pruning.test b/mysql-test/main/partition_pruning.test index d59f52be313..78924d27550 100644 --- a/mysql-test/main/partition_pruning.test +++ b/mysql-test/main/partition_pruning.test @@ -25,11 +25,11 @@ PARTITION max VALUES LESS THAN MAXVALUE); INSERT INTO t1 VALUES (-1),(0),(1),(2),(3),(4),(5),(6),(7),(8); ---replace_column 1 # 2 # 3 # 4 # 5 # 6 # 7 # 8 # 9 # 11 # +--replace_column 1 # 2 # 3 # 4 # 6 # 7 # 8 # 9 # 11 # EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a <= 1; ---replace_column 1 # 2 # 3 # 4 # 5 # 6 # 7 # 8 # 9 # 11 # +--replace_column 1 # 2 # 3 # 4 # 6 # 7 # 8 # 9 # 11 # EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a < 7; ---replace_column 1 # 2 # 3 # 4 # 5 # 6 # 7 # 8 # 9 # 11 # +--replace_column 1 # 2 # 3 # 4 # 6 # 7 # 8 # 9 # 11 # EXPLAIN PARTITIONS SELECT * FROM t1 WHERE a <= 1; DROP TABLE t1; diff --git a/mysql-test/main/partition_range.result b/mysql-test/main/partition_range.result index 320a15fa5b5..2c6b735560c 100644 --- a/mysql-test/main/partition_range.result +++ b/mysql-test/main/partition_range.result @@ -9,11 +9,11 @@ COUNT(*) 3 EXPLAIN SELECT a, MAX(b) FROM t1 WHERE a IN (10000, 1000000, 3000) GROUP BY a; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range a a 5 NULL 4 Using where; Using index +1 SIMPLE t1 range a a 5 NULL 3 Using where; Using index for group-by alter table t1 partition by hash(a) partitions 1; EXPLAIN SELECT a, MAX(b) FROM t1 WHERE a IN (10000, 1000000, 3000) GROUP BY a; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range a a 5 NULL 4 Using where; Using index +1 SIMPLE t1 range a a 5 NULL 3 Using where; Using index for group-by alter table t1 remove partitioning; insert into t1 (a,b) select seq,seq from seq_4001_to_4100; insert into t1 (a,b) select seq,seq from seq_10001_to_10100; diff --git a/mysql-test/main/ps_1general.result b/mysql-test/main/ps_1general.result index 05a40f54a52..3ccd4a69e2d 100644 --- a/mysql-test/main/ps_1general.result +++ b/mysql-test/main/ps_1general.result @@ -451,7 +451,7 @@ def Extra 253 255 14 N 1 39 8 id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 4 Using filesort SET @arg00=1 ; -prepare stmt1 from ' explain select a from t1 where a > ? order by b '; +prepare stmt1 from ' explain select a from t1 force index (primary) where a > ? order by b '; execute stmt1 using @arg00; Catalog Database Table Table_alias Column Column_alias Type Length Max length Is_null Flags Decimals Charsetnr def id 8 3 1 Y 32928 0 63 diff --git a/mysql-test/main/ps_1general.test b/mysql-test/main/ps_1general.test index b0f408e3bcf..580fabf525d 100644 --- a/mysql-test/main/ps_1general.test +++ b/mysql-test/main/ps_1general.test @@ -437,8 +437,10 @@ prepare stmt3 from ' unlock tables ' ; ## Load/Unload table contents --let $datafile = $MYSQLTEST_VARDIR/tmp/data.txt +--disable_warnings --error 0,1 --remove_file $datafile +--enable_warnings --replace_result $MYSQLTEST_VARDIR <MYSQLTEST_VARDIR> eval prepare stmt1 from ' load data infile ''$datafile'' @@ -494,7 +496,7 @@ prepare stmt1 from ' explain select a from t1 order by b '; execute stmt1; --disable_metadata SET @arg00=1 ; -prepare stmt1 from ' explain select a from t1 where a > ? order by b '; +prepare stmt1 from ' explain select a from t1 force index (primary) where a > ? order by b '; --enable_metadata --replace_result 4096 4_OR_8_K 8192 4_OR_8_K execute stmt1 using @arg00; diff --git a/mysql-test/main/range.result b/mysql-test/main/range.result index e9a73cf0215..77058712fd5 100644 --- a/mysql-test/main/range.result +++ b/mysql-test/main/range.result @@ -252,7 +252,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ref x x 5 const 1 Using index explain select count(*) from t1 where x in (1,2,3,4); id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range x x 5 NULL 4 Using where; Using index +1 SIMPLE t1 index x x 5 NULL 9 Using where; Using index drop table t1; CREATE TABLE t1 (key1 int(11) NOT NULL default '0', KEY i1 (key1)); INSERT INTO t1 VALUES (0),(0),(0),(0),(0),(1),(1); @@ -261,12 +261,12 @@ INSERT INTO t2 VALUES (0),(0),(1),(1),(2),(2); explain select * from t1, t2 where (t1.key1 <t2.keya + 1) and t2.keya=3; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 ref j1 j1 4 const 1 Using index -1 SIMPLE t1 range i1 i1 4 NULL 7 Using where; Using index; Using join buffer (flat, BNL join) +1 SIMPLE t1 index i1 i1 4 NULL 7 Using where; Using index; Using join buffer (flat, BNL join) explain select * from t1 force index(i1), t2 force index(j1) where (t1.key1 <t2.keya + 1) and t2.keya=3; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 ref j1 j1 4 const 1 Using index -1 SIMPLE t1 range i1 i1 4 NULL 7 Using where; Using index; Using join buffer (flat, BNL join) +1 SIMPLE t1 index i1 i1 4 NULL 7 Using where; Using index; Using join buffer (flat, BNL join) DROP TABLE t1,t2; CREATE TABLE t1 ( a int(11) default NULL, @@ -281,7 +281,7 @@ INSERT INTO t1 VALUES (33,5),(33,5),(33,5),(33,5),(34,5),(35,5); EXPLAIN SELECT * FROM t1 WHERE a IN(1,2) AND b=5; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range|filter a,b a|b 5|5 NULL 2 (41%) Using index condition; Using where; Using rowid filter +1 SIMPLE t1 ref|filter a,b b|a 5|5 const 15 (5%) Using where; Using rowid filter SELECT * FROM t1 WHERE a IN(1,2) AND b=5; a b DROP TABLE t1; @@ -676,7 +676,7 @@ create table t1(a char(2), key(a(1))); insert into t1 values ('x'), ('xx'); explain select a from t1 where a > 'x'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range a a 2 NULL 2 Using where +1 SIMPLE t1 ALL a NULL NULL NULL 2 Using where select a from t1 where a > 'x'; a xx @@ -1138,7 +1138,7 @@ INSERT INTO t1 VALUES ('A2','2005-12-01 08:00:00',1000); EXPLAIN SELECT * FROM t1 WHERE item='A1' AND started<='2005-12-01 24:00:00'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref PRIMARY PRIMARY 20 const 3 Using index condition +1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 4 Using where SELECT * FROM t1 WHERE item='A1' AND started<='2005-12-01 24:00:00'; item started price Warnings: @@ -1236,14 +1236,13 @@ insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); create table t2 (a int, b int, filler char(100)); insert into t2 select A.a + 10 * (B.a + 10 * C.a), 10, 'filler' from t1 A, t1 B, t1 C where A.a < 5; -insert into t2 select 1000, b, 'filler' from t2; +insert into t2 select 1000, b, 'filler' from t2 limit 250; alter table t2 add index (a,b); -select 'In following EXPLAIN the access method should be ref, #rows~=500 (and not 2)' Z; -Z -In following EXPLAIN the access method should be ref, #rows~=500 (and not 2) +# In following EXPLAIN the access method should be ref, #rows~=250 +# (and not 2) when we are not using rowid-ordered scans explain select * from t2 where a=1000 and b<11; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 ref a a 5 const 503 Using index condition +1 SIMPLE t2 range a a 10 NULL 253 Using index condition drop table t1, t2; CREATE TABLE t1( a INT, b INT, KEY( a, b ) ); CREATE TABLE t2( a INT, b INT, KEY( a, b ) ); @@ -2530,7 +2529,7 @@ insert into t2 values explain select * from t1,t2 where a = d and (a,e) in ((3,3),(7,7),(2,2)); id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 range|filter idx1,idx2 idx1|idx2 5|5 NULL 3 (60%) Using index condition; Using where; Using rowid filter +1 SIMPLE t2 range idx1,idx2 idx1 5 NULL 3 Using index condition; Using where 1 SIMPLE t1 ref idx idx 5 test.t2.d 8 explain format=json select * from t1,t2 where a = d and (a,e) in ((3,3),(7,7),(2,2)); @@ -2545,16 +2544,8 @@ EXPLAIN "key": "idx1", "key_length": "5", "used_key_parts": ["d"], - "rowid_filter": { - "range": { - "key": "idx2", - "used_key_parts": ["e"] - }, - "rows": 12, - "selectivity_pct": 60 - }, "rows": 3, - "filtered": 60, + "filtered": 100, "index_condition": "t2.d is not null", "attached_condition": "(t2.d,t2.e) in (<cache>((3,3)),<cache>((7,7)),<cache>((2,2)))" }, @@ -2610,8 +2601,8 @@ insert into t2 values explain select * from t1,t2 where a = d and (a,e) in ((3,3),(7,7),(8,8)) and length(f) = 1; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 range|filter idx1,idx2 idx1|idx2 5|5 NULL 8 (14%) Using index condition; Using where; Using rowid filter -1 SIMPLE t1 ref idx idx 5 test.t2.d 8 +1 SIMPLE t1 range idx idx 5 NULL 6 Using index condition +1 SIMPLE t2 ref|filter idx1,idx2 idx1|idx2 5|5 test.t1.a 12 (14%) Using where; Using rowid filter explain format=json select * from t1,t2 where a = d and (a,e) in ((3,3),(7,7),(8,8)) and length(f) = 1; EXPLAIN @@ -2619,12 +2610,24 @@ EXPLAIN "query_block": { "select_id": 1, "table": { - "table_name": "t2", + "table_name": "t1", "access_type": "range", + "possible_keys": ["idx"], + "key": "idx", + "key_length": "5", + "used_key_parts": ["a"], + "rows": 6, + "filtered": 100, + "index_condition": "t1.a is not null" + }, + "table": { + "table_name": "t2", + "access_type": "ref", "possible_keys": ["idx1", "idx2"], "key": "idx1", "key_length": "5", "used_key_parts": ["d"], + "ref": ["test.t1.a"], "rowid_filter": { "range": { "key": "idx2", @@ -2633,58 +2636,46 @@ EXPLAIN "rows": 15, "selectivity_pct": 14.42307692 }, - "rows": 8, + "rows": 12, "filtered": 14.42307663, - "index_condition": "t2.d is not null", - "attached_condition": "(t2.d,t2.e) in (<cache>((3,3)),<cache>((7,7)),<cache>((8,8))) and octet_length(t2.f) = 1" - }, - "table": { - "table_name": "t1", - "access_type": "ref", - "possible_keys": ["idx"], - "key": "idx", - "key_length": "5", - "used_key_parts": ["a"], - "ref": ["test.t2.d"], - "rows": 8, - "filtered": 100 + "attached_condition": "(t1.a,t2.e) in (<cache>((3,3)),<cache>((7,7)),<cache>((8,8))) and octet_length(t2.f) = 1" } } } select * from t1,t2 where a = d and (a,e) in ((3,3),(7,7),(8,8)) and length(f) = 1; a b c d e f -3 2 uuuw 3 3 i 3 2 uuua 3 3 i -3 3 zzzz 3 3 i -3 3 zyxw 3 3 i -3 3 zzza 3 3 i -3 3 zyxa 3 3 i -3 2 uuuw 3 3 i 3 2 uuua 3 3 i -3 3 zzzz 3 3 i +3 2 uuuw 3 3 i +3 2 uuuw 3 3 i +3 3 zyxa 3 3 i +3 3 zyxa 3 3 i +3 3 zyxw 3 3 i 3 3 zyxw 3 3 i 3 3 zzza 3 3 i -3 3 zyxa 3 3 i -7 7 xxxyy 7 7 h +3 3 zzza 3 3 i +3 3 zzzz 3 3 i +3 3 zzzz 3 3 i 7 7 xxxya 7 7 h -7 8 xxxxx 7 7 h +7 7 xxxyy 7 7 h 7 8 xxxxa 7 7 h +7 8 xxxxx 7 7 h prepare stmt from "select * from t1,t2 where a = d and (a,e) in ((3,3),(7,7),(8,8)) and length(f) = 1"; execute stmt; a b c d e f 3 2 uuuw 3 3 i -3 2 uuua 3 3 i -3 3 zzzz 3 3 i -3 3 zyxw 3 3 i -3 3 zzza 3 3 i -3 3 zyxa 3 3 i 3 2 uuuw 3 3 i 3 2 uuua 3 3 i +3 2 uuua 3 3 i 3 3 zzzz 3 3 i +3 3 zzzz 3 3 i +3 3 zyxw 3 3 i 3 3 zyxw 3 3 i 3 3 zzza 3 3 i +3 3 zzza 3 3 i +3 3 zyxa 3 3 i 3 3 zyxa 3 3 i 7 7 xxxyy 7 7 h 7 7 xxxya 7 7 h @@ -2693,17 +2684,17 @@ a b c d e f execute stmt; a b c d e f 3 2 uuuw 3 3 i -3 2 uuua 3 3 i -3 3 zzzz 3 3 i -3 3 zyxw 3 3 i -3 3 zzza 3 3 i -3 3 zyxa 3 3 i 3 2 uuuw 3 3 i 3 2 uuua 3 3 i +3 2 uuua 3 3 i +3 3 zzzz 3 3 i 3 3 zzzz 3 3 i 3 3 zyxw 3 3 i +3 3 zyxw 3 3 i +3 3 zzza 3 3 i 3 3 zzza 3 3 i 3 3 zyxa 3 3 i +3 3 zyxa 3 3 i 7 7 xxxyy 7 7 h 7 7 xxxya 7 7 h 7 8 xxxxx 7 7 h @@ -2715,8 +2706,8 @@ insert into t1 select * from t1; explain select * from t1,t2 where a = d and (a,e) in ((4,4),(7,7),(8,8)) and length(f) = 1; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 range|filter idx1,idx2 idx1|idx2 5|5 NULL 7 (7%) Using index condition; Using where; Using rowid filter -1 SIMPLE t1 ref idx idx 5 test.t2.d 11 +1 SIMPLE t1 range idx idx 5 NULL 15 Using index condition +1 SIMPLE t2 ref|filter idx1,idx2 idx1|idx2 5|5 test.t1.a 12 (7%) Using where; Using rowid filter explain format=json select * from t1,t2 where a = d and (a,e) in ((4,4),(7,7),(8,8)) and length(f) = 1; EXPLAIN @@ -2724,12 +2715,24 @@ EXPLAIN "query_block": { "select_id": 1, "table": { - "table_name": "t2", + "table_name": "t1", "access_type": "range", + "possible_keys": ["idx"], + "key": "idx", + "key_length": "5", + "used_key_parts": ["a"], + "rows": 15, + "filtered": 100, + "index_condition": "t1.a is not null" + }, + "table": { + "table_name": "t2", + "access_type": "ref", "possible_keys": ["idx1", "idx2"], "key": "idx1", "key_length": "5", "used_key_parts": ["d"], + "ref": ["test.t1.a"], "rowid_filter": { "range": { "key": "idx2", @@ -2738,35 +2741,23 @@ EXPLAIN "rows": 7, "selectivity_pct": 6.730769231 }, - "rows": 7, - "filtered": 14.28571415, - "index_condition": "t2.d is not null", - "attached_condition": "(t2.d,t2.e) in (<cache>((4,4)),<cache>((7,7)),<cache>((8,8))) and octet_length(t2.f) = 1" - }, - "table": { - "table_name": "t1", - "access_type": "ref", - "possible_keys": ["idx"], - "key": "idx", - "key_length": "5", - "used_key_parts": ["a"], - "ref": ["test.t2.d"], - "rows": 11, - "filtered": 100 + "rows": 12, + "filtered": 6.730769157, + "attached_condition": "(t1.a,t2.e) in (<cache>((4,4)),<cache>((7,7)),<cache>((8,8))) and octet_length(t2.f) = 1" } } } select * from t1,t2 where a = d and (a,e) in ((4,4),(7,7),(8,8)) and length(f) = 1; a b c d e f -7 7 xxxyy 7 7 h 7 7 xxxya 7 7 h -7 7 xxxyy 7 7 h 7 7 xxxya 7 7 h -7 8 xxxxx 7 7 h +7 7 xxxyy 7 7 h +7 7 xxxyy 7 7 h 7 8 xxxxa 7 7 h -7 8 xxxxx 7 7 h 7 8 xxxxa 7 7 h +7 8 xxxxx 7 7 h +7 8 xxxxx 7 7 h alter table t2 drop index idx1, drop index idx2, add index idx3(d,e); # join order: (t2,t1) with ref access of t1 # range access to t2 by 2-component keys for index idx3 @@ -2858,22 +2849,22 @@ EXPLAIN select * from t1,t2 where a = d and (a,e) in ((4,d+1),(7,d+1),(8,d+1)) and length(f) = 1; a b c d e f -4 3 zyx 4 5 a 4 3 zya 4 5 a -4 3 zyx 4 5 a 4 3 zya 4 5 a -4 5 ww 4 5 a +4 3 zyx 4 5 a +4 3 zyx 4 5 a 4 5 wa 4 5 a -4 5 ww 4 5 a 4 5 wa 4 5 a -7 7 xxxyy 7 8 b +4 5 ww 4 5 a +4 5 ww 4 5 a 7 7 xxxya 7 8 b -7 7 xxxyy 7 8 b 7 7 xxxya 7 8 b -7 8 xxxxx 7 8 b +7 7 xxxyy 7 8 b +7 7 xxxyy 7 8 b 7 8 xxxxa 7 8 b -7 8 xxxxx 7 8 b 7 8 xxxxa 7 8 b +7 8 xxxxx 7 8 b +7 8 xxxxx 7 8 b # join order: (t1,t2) with ref access of t2 # no range access explain select * from t1,t2 @@ -2912,14 +2903,14 @@ EXPLAIN select * from t1,t2 where a = d and (a,e) in ((e,d+1),(7,7),(8,8)) and length(f) = 1; a b c d e f -7 8 xxxxx 7 7 h -7 7 xxxyy 7 7 h -7 8 xxxxa 7 7 h 7 7 xxxya 7 7 h -7 8 xxxxx 7 7 h +7 7 xxxya 7 7 h +7 7 xxxyy 7 7 h 7 7 xxxyy 7 7 h 7 8 xxxxa 7 7 h -7 7 xxxya 7 7 h +7 8 xxxxa 7 7 h +7 8 xxxxx 7 7 h +7 8 xxxxx 7 7 h # join order: (t1,t2) with ref access of t2 # range access to t1 by 1-component keys for index idx explain select * from t1,t2 diff --git a/mysql-test/main/range.test b/mysql-test/main/range.test index 6d43ad9090d..0103dc34735 100644 --- a/mysql-test/main/range.test +++ b/mysql-test/main/range.test @@ -1024,7 +1024,7 @@ create table t2 (a int, b int, filler char(100)); insert into t2 select A.a + 10 * (B.a + 10 * C.a), 10, 'filler' from t1 A, t1 B, t1 C where A.a < 5; -insert into t2 select 1000, b, 'filler' from t2; +insert into t2 select 1000, b, 'filler' from t2 limit 250; alter table t2 add index (a,b); # t2 values # ( 1 , 10, 'filler') @@ -1032,13 +1032,14 @@ alter table t2 add index (a,b); # ( 3 , 10, 'filler') # (... , 10, 'filler') # ... -# (1000, 10, 'filler') - 500 times +# (1000, 10, 'filler') - 250 times -# 500 rows, 1 row +# 250 rows, 1 row -select 'In following EXPLAIN the access method should be ref, #rows~=500 (and not 2)' Z; -explain select * from t2 where a=1000 and b<11; +--echo # In following EXPLAIN the access method should be ref, #rows~=250 +--echo # (and not 2) when we are not using rowid-ordered scans +explain select * from t2 where a=1000 and b<11; drop table t1, t2; # @@ -1967,6 +1968,7 @@ select * from t1,t2 where a = d and (a,e) in ((3,3),(7,7),(8,8)) and length(f) = 1; eval explain $q5; eval explain format=json $q5; +--sorted_result eval $q5; eval prepare stmt from "$q5"; execute stmt; @@ -1982,6 +1984,7 @@ select * from t1,t2 where a = d and (a,e) in ((4,4),(7,7),(8,8)) and length(f) = 1; eval explain $q6; eval explain format=json $q6; +--sorted_result eval $q6; alter table t2 drop index idx1, drop index idx2, add index idx3(d,e); @@ -2002,6 +2005,7 @@ select * from t1,t2 where a = d and (a,e) in ((4,d+1),(7,d+1),(8,d+1)) and length(f) = 1; eval explain $q8; eval explain format=json $q8; +--sorted_result eval $q8; --echo # join order: (t1,t2) with ref access of t2 @@ -2011,6 +2015,7 @@ select * from t1,t2 where a = d and (a,e) in ((e,d+1),(7,7),(8,8)) and length(f) = 1; eval explain $q9; eval explain format=json $q9; +--sorted_result eval $q9; --echo # join order: (t1,t2) with ref access of t2 diff --git a/mysql-test/main/range_innodb.result b/mysql-test/main/range_innodb.result index be7e89b9fd2..058a6caee2c 100644 --- a/mysql-test/main/range_innodb.result +++ b/mysql-test/main/range_innodb.result @@ -57,9 +57,9 @@ set optimizer_switch='extended_keys=on'; explain select pk, a, b from t1,t2,t3 where b >= d and pk < c and b = '0'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 ALL NULL NULL NULL NULL 2 -1 SIMPLE t1 ref PRIMARY,idx1,idx2 idx1 5 const 3 Using index condition -1 SIMPLE t3 ALL NULL NULL NULL NULL 3 Using where; Using join buffer (flat, BNL join) +1 SIMPLE t2 ALL NULL NULL NULL NULL # +1 SIMPLE t3 ALL NULL NULL NULL NULL # Using join buffer (flat, BNL join) +1 SIMPLE t1 ALL PRIMARY,idx1,idx2 NULL NULL NULL # Using where; Using join buffer (incremental, BNL join) select pk, a, b from t1,t2,t3 where b >= d and pk < c and b = '0'; pk a b 1 6 0 @@ -87,6 +87,7 @@ drop table t1,t2; # MDEV-14440: Server crash in in handler::ha_external_lock or Assertion `inited==RND' # failed in handler::ha_rnd_end upon SELECT from partitioned table # +call mtr.add_suppression("Got error .* when reading table"); set @optimizer_switch_save= @@optimizer_switch; set optimizer_switch='index_merge_sort_intersection=off'; create table t0 (a int)engine=innodb; diff --git a/mysql-test/main/range_innodb.test b/mysql-test/main/range_innodb.test index f79104fde85..dabb4afaa5a 100644 --- a/mysql-test/main/range_innodb.test +++ b/mysql-test/main/range_innodb.test @@ -64,6 +64,8 @@ insert into t3 values (3),(-1),(4); set @save_optimizer_switch=@@optimizer_switch; set optimizer_switch='extended_keys=on'; +# InnoDB sometimes returns 4 other times 5 records for t1 +--replace_column 9 # explain select pk, a, b from t1,t2,t3 where b >= d and pk < c and b = '0'; select pk, a, b from t1,t2,t3 where b >= d and pk < c and b = '0'; @@ -95,6 +97,8 @@ drop table t1,t2; --echo # failed in handler::ha_rnd_end upon SELECT from partitioned table --echo # +call mtr.add_suppression("Got error .* when reading table"); + set @optimizer_switch_save= @@optimizer_switch; set optimizer_switch='index_merge_sort_intersection=off'; create table t0 (a int)engine=innodb; diff --git a/mysql-test/main/range_mrr_icp.result b/mysql-test/main/range_mrr_icp.result index 1a76f41ead7..1a31835eb9d 100644 --- a/mysql-test/main/range_mrr_icp.result +++ b/mysql-test/main/range_mrr_icp.result @@ -255,7 +255,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ref x x 5 const 1 Using index explain select count(*) from t1 where x in (1,2,3,4); id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range x x 5 NULL 4 Using where; Using index +1 SIMPLE t1 index x x 5 NULL 9 Using where; Using index drop table t1; CREATE TABLE t1 (key1 int(11) NOT NULL default '0', KEY i1 (key1)); INSERT INTO t1 VALUES (0),(0),(0),(0),(0),(1),(1); @@ -264,12 +264,12 @@ INSERT INTO t2 VALUES (0),(0),(1),(1),(2),(2); explain select * from t1, t2 where (t1.key1 <t2.keya + 1) and t2.keya=3; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 ref j1 j1 4 const 1 Using index -1 SIMPLE t1 range i1 i1 4 NULL 7 Using where; Using index; Using join buffer (flat, BNL join) +1 SIMPLE t1 index i1 i1 4 NULL 7 Using where; Using index; Using join buffer (flat, BNL join) explain select * from t1 force index(i1), t2 force index(j1) where (t1.key1 <t2.keya + 1) and t2.keya=3; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 ref j1 j1 4 const 1 Using index -1 SIMPLE t1 range i1 i1 4 NULL 7 Using where; Using index; Using join buffer (flat, BNL join) +1 SIMPLE t1 index i1 i1 4 NULL 7 Using where; Using index; Using join buffer (flat, BNL join) DROP TABLE t1,t2; CREATE TABLE t1 ( a int(11) default NULL, @@ -679,7 +679,7 @@ create table t1(a char(2), key(a(1))); insert into t1 values ('x'), ('xx'); explain select a from t1 where a > 'x'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range a a 2 NULL 2 Using where +1 SIMPLE t1 ALL a NULL NULL NULL 2 Using where select a from t1 where a > 'x'; a xx @@ -1141,7 +1141,7 @@ INSERT INTO t1 VALUES ('A2','2005-12-01 08:00:00',1000); EXPLAIN SELECT * FROM t1 WHERE item='A1' AND started<='2005-12-01 24:00:00'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref PRIMARY PRIMARY 20 const 3 Using index condition +1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 4 Using where SELECT * FROM t1 WHERE item='A1' AND started<='2005-12-01 24:00:00'; item started price Warnings: @@ -1239,14 +1239,13 @@ insert into t1 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9); create table t2 (a int, b int, filler char(100)); insert into t2 select A.a + 10 * (B.a + 10 * C.a), 10, 'filler' from t1 A, t1 B, t1 C where A.a < 5; -insert into t2 select 1000, b, 'filler' from t2; +insert into t2 select 1000, b, 'filler' from t2 limit 250; alter table t2 add index (a,b); -select 'In following EXPLAIN the access method should be ref, #rows~=500 (and not 2)' Z; -Z -In following EXPLAIN the access method should be ref, #rows~=500 (and not 2) +# In following EXPLAIN the access method should be ref, #rows~=250 +# (and not 2) when we are not using rowid-ordered scans explain select * from t2 where a=1000 and b<11; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 ref a a 5 const 503 Using index condition +1 SIMPLE t2 range a a 10 NULL 253 Using index condition; Rowid-ordered scan drop table t1, t2; CREATE TABLE t1( a INT, b INT, KEY( a, b ) ); CREATE TABLE t2( a INT, b INT, KEY( a, b ) ); @@ -2552,7 +2551,7 @@ EXPLAIN "key_length": "5", "used_key_parts": ["d"], "rows": 3, - "filtered": 60, + "filtered": 100, "index_condition": "t2.d is not null", "attached_condition": "(t2.d,t2.e) in (<cache>((3,3)),<cache>((7,7)),<cache>((2,2)))", "mrr_type": "Rowid-ordered scan" @@ -2625,7 +2624,7 @@ EXPLAIN "key_length": "5", "used_key_parts": ["d"], "rows": 8, - "filtered": 14.42307663, + "filtered": 100, "index_condition": "t2.d is not null", "attached_condition": "(t2.d,t2.e) in (<cache>((3,3)),<cache>((7,7)),<cache>((8,8))) and octet_length(t2.f) = 1", "mrr_type": "Rowid-ordered scan" @@ -2646,22 +2645,22 @@ EXPLAIN select * from t1,t2 where a = d and (a,e) in ((3,3),(7,7),(8,8)) and length(f) = 1; a b c d e f -3 2 uuuw 3 3 i 3 2 uuua 3 3 i -3 3 zzzz 3 3 i +3 2 uuua 3 3 i +3 2 uuuw 3 3 i +3 2 uuuw 3 3 i +3 3 zyxa 3 3 i +3 3 zyxa 3 3 i +3 3 zyxw 3 3 i 3 3 zyxw 3 3 i 3 3 zzza 3 3 i -3 3 zyxa 3 3 i -7 7 xxxyy 7 7 h +3 3 zzza 3 3 i +3 3 zzzz 3 3 i +3 3 zzzz 3 3 i 7 7 xxxya 7 7 h -7 8 xxxxx 7 7 h +7 7 xxxyy 7 7 h 7 8 xxxxa 7 7 h -3 2 uuuw 3 3 i -3 2 uuua 3 3 i -3 3 zzzz 3 3 i -3 3 zyxw 3 3 i -3 3 zzza 3 3 i -3 3 zyxa 3 3 i +7 8 xxxxx 7 7 h prepare stmt from "select * from t1,t2 where a = d and (a,e) in ((3,3),(7,7),(8,8)) and length(f) = 1"; execute stmt; @@ -2723,7 +2722,7 @@ EXPLAIN "key_length": "5", "used_key_parts": ["d"], "rows": 7, - "filtered": 14.28571415, + "filtered": 100, "index_condition": "t2.d is not null", "attached_condition": "(t2.d,t2.e) in (<cache>((4,4)),<cache>((7,7)),<cache>((8,8))) and octet_length(t2.f) = 1", "mrr_type": "Rowid-ordered scan" @@ -2744,14 +2743,14 @@ EXPLAIN select * from t1,t2 where a = d and (a,e) in ((4,4),(7,7),(8,8)) and length(f) = 1; a b c d e f -7 7 xxxyy 7 7 h 7 7 xxxya 7 7 h -7 7 xxxyy 7 7 h 7 7 xxxya 7 7 h -7 8 xxxxx 7 7 h +7 7 xxxyy 7 7 h +7 7 xxxyy 7 7 h 7 8 xxxxa 7 7 h -7 8 xxxxx 7 7 h 7 8 xxxxa 7 7 h +7 8 xxxxx 7 7 h +7 8 xxxxx 7 7 h alter table t2 drop index idx1, drop index idx2, add index idx3(d,e); # join order: (t2,t1) with ref access of t1 # range access to t2 by 2-component keys for index idx3 @@ -2845,22 +2844,22 @@ EXPLAIN select * from t1,t2 where a = d and (a,e) in ((4,d+1),(7,d+1),(8,d+1)) and length(f) = 1; a b c d e f -4 5 ww 4 5 a -7 8 xxxxx 7 8 b +4 3 zya 4 5 a +4 3 zya 4 5 a +4 3 zyx 4 5 a 4 3 zyx 4 5 a -7 7 xxxyy 7 8 b 4 5 wa 4 5 a -7 8 xxxxa 7 8 b -4 3 zya 4 5 a -7 7 xxxya 7 8 b +4 5 wa 4 5 a 4 5 ww 4 5 a -7 8 xxxxx 7 8 b -4 3 zyx 4 5 a +4 5 ww 4 5 a +7 7 xxxya 7 8 b +7 7 xxxya 7 8 b +7 7 xxxyy 7 8 b 7 7 xxxyy 7 8 b -4 5 wa 4 5 a 7 8 xxxxa 7 8 b -4 3 zya 4 5 a -7 7 xxxya 7 8 b +7 8 xxxxa 7 8 b +7 8 xxxxx 7 8 b +7 8 xxxxx 7 8 b # join order: (t1,t2) with ref access of t2 # no range access explain select * from t1,t2 @@ -2899,14 +2898,14 @@ EXPLAIN select * from t1,t2 where a = d and (a,e) in ((e,d+1),(7,7),(8,8)) and length(f) = 1; a b c d e f -7 8 xxxxx 7 7 h -7 7 xxxyy 7 7 h -7 8 xxxxa 7 7 h 7 7 xxxya 7 7 h -7 8 xxxxx 7 7 h +7 7 xxxya 7 7 h +7 7 xxxyy 7 7 h 7 7 xxxyy 7 7 h 7 8 xxxxa 7 7 h -7 7 xxxya 7 7 h +7 8 xxxxa 7 7 h +7 8 xxxxx 7 7 h +7 8 xxxxx 7 7 h # join order: (t1,t2) with ref access of t2 # range access to t1 by 1-component keys for index idx explain select * from t1,t2 diff --git a/mysql-test/main/range_notembedded.result b/mysql-test/main/range_notembedded.result index eeab230e72f..9810b965a1e 100644 --- a/mysql-test/main/range_notembedded.result +++ b/mysql-test/main/range_notembedded.result @@ -13,7 +13,7 @@ set @tmp_21958=@@optimizer_trace; set optimizer_trace=1; explain select * from t2 where key1 in (1,2,3) and pk not in (1,2,3); id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 range PRIMARY,key1 key1 5 NULL 3 Using index condition +1 SIMPLE t2 ALL PRIMARY,key1 NULL NULL NULL 5 Using where # This should show only ranges in form "(1) <= (key1) <= (1)" # ranges over "pk" should not be constructed. select json_detailed(JSON_EXTRACT(trace, '$**.ranges')) @@ -25,12 +25,6 @@ json_detailed(JSON_EXTRACT(trace, '$**.ranges')) "(1) <= (key1) <= (1)", "(2) <= (key1) <= (2)", "(3) <= (key1) <= (3)" - ], - - [ - "(1) <= (key1) <= (1)", - "(2) <= (key1) <= (2)", - "(3) <= (key1) <= (3)" ] ] set optimizer_trace=@tmp_21958; @@ -235,9 +229,10 @@ user_id int(10) unsigned NOT NULL DEFAULT 0, PRIMARY KEY (notification_type_id,item_id,item_parent_id,user_id) ); insert into t1 values (1,1,1,1), (2,2,2,2), (3,3,3,3); +insert into t1 select seq,seq,seq,seq from seq_10_to_30; # Run crashing query id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range PRIMARY PRIMARY 2 NULL 3 Using where +1 SIMPLE t1 range PRIMARY PRIMARY 2 NULL 5 Using where drop table t1; # # MDEV-25069: Assertion `root->weight >= ...' failed in SEL_ARG::tree_delete #2 diff --git a/mysql-test/main/range_notembedded.test b/mysql-test/main/range_notembedded.test index 4e77d6a4810..e541018f6af 100644 --- a/mysql-test/main/range_notembedded.test +++ b/mysql-test/main/range_notembedded.test @@ -122,6 +122,7 @@ CREATE TABLE t1 ( PRIMARY KEY (notification_type_id,item_id,item_parent_id,user_id) ); insert into t1 values (1,1,1,1), (2,2,2,2), (3,3,3,3); +insert into t1 select seq,seq,seq,seq from seq_10_to_30; let $consts=`select group_concat(concat("'",seq,"'")) from seq_1_to_4642`; diff --git a/mysql-test/main/range_vs_index_merge.result b/mysql-test/main/range_vs_index_merge.result index 7108fd89a7d..3babbc989b3 100644 --- a/mysql-test/main/range_vs_index_merge.result +++ b/mysql-test/main/range_vs_index_merge.result @@ -333,7 +333,7 @@ id select_type table type possible_keys key key_len ref rows Extra EXPLAIN SELECT * FROM City WHERE (ID < 600) OR (ID BETWEEN 900 AND 1500); id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City ALL PRIMARY NULL NULL NULL 4079 Using where +1 SIMPLE City range PRIMARY PRIMARY 4 NULL 1200 Using index condition EXPLAIN SELECT * FROM City WHERE Country > 'A' AND Country < 'ARG'; id select_type table type possible_keys key key_len ref rows Extra @@ -1077,7 +1077,7 @@ EXPLAIN SELECT Name, Country, Population FROM City WHERE (Name='Samara' AND Country='RUS') OR (Name='Seattle' AND Country='USA'); id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City index_merge Country,CountryPopulation,CountryName,CityName CountryName,CityName 38,35 NULL 28 Using sort_union(CountryName,CityName); Using where +1 SIMPLE City range Country,CountryPopulation,CountryName,CityName CountryName 38 NULL 28 Using index condition SELECT Name, Country, Population FROM City WHERE (Name='Manila' AND Country='PHL') OR (Name='Addis Abeba' AND Country='ETH') OR @@ -1810,7 +1810,7 @@ EXPLAIN SELECT * FROM t1 WHERE a BETWEEN 4 AND 5 AND b IN (255,4) OR a IN (2,14,25) OR (a<2 or a>2); id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range PRIMARY,idx PRIMARY 0 NULL 2 Using index condition; Using where +1 SIMPLE t1 ALL PRIMARY,idx NULL NULL NULL 2 Using where SELECT * FROM t1 WHERE a BETWEEN 4 AND 5 AND b IN (255,4) OR a IN (2,14,25) OR (a<2 or a>2); a b diff --git a/mysql-test/main/range_vs_index_merge.test b/mysql-test/main/range_vs_index_merge.test index 670762bcb2f..a8e86e44b9e 100644 --- a/mysql-test/main/range_vs_index_merge.test +++ b/mysql-test/main/range_vs_index_merge.test @@ -658,7 +658,7 @@ let $cond = (Name='Lugansk' AND Country='UKR') OR (Name='Caracas' AND Country='VEN') OR (Name='Samara' AND Country='RUS') OR -(Name='Seattle' AND Country='USA'); +(Name='Seattle' AND Country='USA'); eval EXPLAIN SELECT Name, Country, Population FROM City WHERE diff --git a/mysql-test/main/range_vs_index_merge_innodb.result b/mysql-test/main/range_vs_index_merge_innodb.result index 79a670aedb2..de345f66161 100644 --- a/mysql-test/main/range_vs_index_merge_innodb.result +++ b/mysql-test/main/range_vs_index_merge_innodb.result @@ -365,7 +365,7 @@ WHERE ((ID < 800) AND (Name LIKE 'Ha%' OR (Country > 'A' AND Country < 'ARG'))) OR ((ID BETWEEN 900 AND 1500) AND (Name LIKE 'Pa%' OR (Population > 103000 AND Population < 105000))); id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City index_merge PRIMARY,Population,Country,Name Name,Country,PRIMARY 39,3,4 NULL 683 Using sort_union(Name,Country,PRIMARY); Using where +1 SIMPLE City index_merge PRIMARY,Population,Country,Name Name,Country,Population 39,3,4 NULL 212 Using sort_union(Name,Country,Population); Using where EXPLAIN SELECT * FROM City WHERE ((ID < 200) AND (Name LIKE 'Ha%' OR (Country > 'A' AND Country < 'ARG'))) @@ -620,7 +620,7 @@ WHERE ((Population > 101000 AND Population < 102000) AND ((ID BETWEEN 3400 AND 3800) AND (Country < 'AGO' OR Name LIKE 'Pa%')); id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE City index_merge PRIMARY,Population,Country,Name Population,PRIMARY 4,4 NULL 440 Using sort_union(Population,PRIMARY); Using where +1 SIMPLE City index_merge PRIMARY,Population,Country,Name Country,Name,Population 3,39,4 NULL 115 Using sort_union(Country,Name,Population); Using where EXPLAIN SELECT * FROM City WHERE ((Population > 101000 AND Population < 110000) AND @@ -1804,7 +1804,7 @@ SELECT * FROM t1 WHERE t1.a>300 AND t1.c!=0 AND t1.b>=350 AND t1.b<=400 AND (t1.c=0 OR t1.a=500); id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range PRIMARY,idx idx 5 NULL 2 Using where; Using index +1 SIMPLE t1 range PRIMARY,idx PRIMARY 4 NULL 1 Using where SELECT * FROM t1 WHERE t1.a>300 AND t1.c!=0 AND t1.b>=350 AND t1.b<=400 AND (t1.c=0 OR t1.a=500); diff --git a/mysql-test/main/rowid_filter.result b/mysql-test/main/rowid_filter.result index 774fbd87ed9..cba4087148f 100644 --- a/mysql-test/main/rowid_filter.result +++ b/mysql-test/main/rowid_filter.result @@ -228,7 +228,7 @@ EXPLAIN "key_length": "4", "used_key_parts": ["l_shipDATE"], "rows": 509, - "filtered": 11.69025803, + "filtered": 100, "index_condition": "lineitem.l_shipDATE between '1997-01-01' and '1997-06-30'", "attached_condition": "lineitem.l_quantity > 45" } @@ -238,7 +238,7 @@ set statement optimizer_switch='rowid_filter=off' for ANALYZE SELECT l_orderkey, WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND l_quantity > 45; id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra -1 SIMPLE lineitem range i_l_shipdate,i_l_quantity i_l_shipdate 4 NULL 509 510.00 11.69 11.76 Using index condition; Using where +1 SIMPLE lineitem range i_l_shipdate,i_l_quantity i_l_shipdate 4 NULL 509 510.00 100.00 11.76 Using index condition; Using where set statement optimizer_switch='rowid_filter=off' for ANALYZE FORMAT=JSON SELECT l_orderkey, l_linenumber, l_shipdate, l_quantity FROM lineitem WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND l_quantity > 45; @@ -260,7 +260,7 @@ ANALYZE "r_rows": 510, "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", - "filtered": 11.69025803, + "filtered": 100, "r_filtered": 11.76470588, "index_condition": "lineitem.l_shipDATE between '1997-01-01' and '1997-06-30'", "attached_condition": "lineitem.l_quantity > 45" @@ -336,8 +336,8 @@ FROM orders JOIN lineitem ON o_orderkey=l_orderkey WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-01-31' AND o_totalprice between 200000 and 230000; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE lineitem range PRIMARY,i_l_shipdate,i_l_orderkey,i_l_orderkey_quantity i_l_shipdate 4 NULL 98 Using index condition -1 SIMPLE orders eq_ref|filter PRIMARY,i_o_totalprice PRIMARY|i_o_totalprice 4|9 dbt3_s001.lineitem.l_orderkey 1 (5%) Using where; Using rowid filter +1 SIMPLE orders range PRIMARY,i_o_totalprice i_o_totalprice 9 NULL 69 Using index condition +1 SIMPLE lineitem ref|filter PRIMARY,i_l_shipdate,i_l_orderkey,i_l_orderkey_quantity i_l_orderkey|i_l_shipdate 4|4 dbt3_s001.orders.o_orderkey 4 (2%) Using where; Using rowid filter set statement optimizer_switch='rowid_filter=on' for EXPLAIN FORMAT=JSON SELECT o_orderkey, l_linenumber, l_shipdate, o_totalprice FROM orders JOIN lineitem ON o_orderkey=l_orderkey WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-01-31' AND @@ -347,40 +347,40 @@ EXPLAIN "query_block": { "select_id": 1, "table": { - "table_name": "lineitem", + "table_name": "orders", "access_type": "range", + "possible_keys": ["PRIMARY", "i_o_totalprice"], + "key": "i_o_totalprice", + "key_length": "9", + "used_key_parts": ["o_totalprice"], + "rows": 69, + "filtered": 100, + "index_condition": "orders.o_totalprice between 200000 and 230000" + }, + "table": { + "table_name": "lineitem", + "access_type": "ref", "possible_keys": [ "PRIMARY", "i_l_shipdate", "i_l_orderkey", "i_l_orderkey_quantity" ], - "key": "i_l_shipdate", - "key_length": "4", - "used_key_parts": ["l_shipDATE"], - "rows": 98, - "filtered": 100, - "index_condition": "lineitem.l_shipDATE between '1997-01-01' and '1997-01-31'" - }, - "table": { - "table_name": "orders", - "access_type": "eq_ref", - "possible_keys": ["PRIMARY", "i_o_totalprice"], - "key": "PRIMARY", + "key": "i_l_orderkey", "key_length": "4", - "used_key_parts": ["o_orderkey"], - "ref": ["dbt3_s001.lineitem.l_orderkey"], + "used_key_parts": ["l_orderkey"], + "ref": ["dbt3_s001.orders.o_orderkey"], "rowid_filter": { "range": { - "key": "i_o_totalprice", - "used_key_parts": ["o_totalprice"] + "key": "i_l_shipdate", + "used_key_parts": ["l_shipDATE"] }, - "rows": 69, - "selectivity_pct": 4.6 + "rows": 98, + "selectivity_pct": 1.631973356 }, - "rows": 1, - "filtered": 4.599999905, - "attached_condition": "orders.o_totalprice between 200000 and 230000" + "rows": 4, + "filtered": 1.631973386, + "attached_condition": "lineitem.l_shipDATE between '1997-01-01' and '1997-01-31'" } } } @@ -389,8 +389,8 @@ FROM orders JOIN lineitem ON o_orderkey=l_orderkey WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-01-31' AND o_totalprice between 200000 and 230000; id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra -1 SIMPLE lineitem range PRIMARY,i_l_shipdate,i_l_orderkey,i_l_orderkey_quantity i_l_shipdate 4 NULL 98 98.00 100.00 100.00 Using index condition -1 SIMPLE orders eq_ref|filter PRIMARY,i_o_totalprice PRIMARY|i_o_totalprice 4|9 dbt3_s001.lineitem.l_orderkey 1 (5%) 0.11 (10%) 4.60 100.00 Using where; Using rowid filter +1 SIMPLE orders range PRIMARY,i_o_totalprice i_o_totalprice 9 NULL 69 71.00 100.00 100.00 Using index condition +1 SIMPLE lineitem ref|filter PRIMARY,i_l_shipdate,i_l_orderkey,i_l_orderkey_quantity i_l_orderkey|i_l_shipdate 4|4 dbt3_s001.orders.o_orderkey 4 (2%) 0.15 (2%) 1.63 100.00 Using where; Using rowid filter set statement optimizer_switch='rowid_filter=on' for ANALYZE FORMAT=JSON SELECT o_orderkey, l_linenumber, l_shipdate, o_totalprice FROM orders JOIN lineitem ON o_orderkey=l_orderkey WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-01-31' AND @@ -402,54 +402,54 @@ ANALYZE "r_loops": 1, "r_total_time_ms": "REPLACED", "table": { - "table_name": "lineitem", + "table_name": "orders", "access_type": "range", - "possible_keys": [ - "PRIMARY", - "i_l_shipdate", - "i_l_orderkey", - "i_l_orderkey_quantity" - ], - "key": "i_l_shipdate", - "key_length": "4", - "used_key_parts": ["l_shipDATE"], + "possible_keys": ["PRIMARY", "i_o_totalprice"], + "key": "i_o_totalprice", + "key_length": "9", + "used_key_parts": ["o_totalprice"], "r_loops": 1, - "rows": 98, - "r_rows": 98, + "rows": 69, + "r_rows": 71, "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 100, "r_filtered": 100, - "index_condition": "lineitem.l_shipDATE between '1997-01-01' and '1997-01-31'" + "index_condition": "orders.o_totalprice between 200000 and 230000" }, "table": { - "table_name": "orders", - "access_type": "eq_ref", - "possible_keys": ["PRIMARY", "i_o_totalprice"], - "key": "PRIMARY", + "table_name": "lineitem", + "access_type": "ref", + "possible_keys": [ + "PRIMARY", + "i_l_shipdate", + "i_l_orderkey", + "i_l_orderkey_quantity" + ], + "key": "i_l_orderkey", "key_length": "4", - "used_key_parts": ["o_orderkey"], - "ref": ["dbt3_s001.lineitem.l_orderkey"], + "used_key_parts": ["l_orderkey"], + "ref": ["dbt3_s001.orders.o_orderkey"], "rowid_filter": { "range": { - "key": "i_o_totalprice", - "used_key_parts": ["o_totalprice"] + "key": "i_l_shipdate", + "used_key_parts": ["l_shipDATE"] }, - "rows": 69, - "selectivity_pct": 4.6, - "r_rows": 71, - "r_selectivity_pct": 10.41666667, + "rows": 98, + "selectivity_pct": 1.631973356, + "r_rows": 98, + "r_selectivity_pct": 2.31092437, "r_buffer_size": "REPLACED", "r_filling_time_ms": "REPLACED" }, - "r_loops": 98, - "rows": 1, - "r_rows": 0.112244898, + "r_loops": 71, + "rows": 4, + "r_rows": 0.154929577, "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", - "filtered": 4.599999905, + "filtered": 1.631973386, "r_filtered": 100, - "attached_condition": "orders.o_totalprice between 200000 and 230000" + "attached_condition": "lineitem.l_shipDATE between '1997-01-01' and '1997-01-31'" } } } @@ -593,8 +593,8 @@ WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND l_quantity > 45 AND o_totalprice between 180000 and 230000; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE lineitem range|filter PRIMARY,i_l_shipdate,i_l_orderkey,i_l_orderkey_quantity,i_l_quantity i_l_shipdate|i_l_quantity 4|9 NULL 509 (12%) Using index condition; Using where; Using rowid filter -1 SIMPLE orders eq_ref|filter PRIMARY,i_o_totalprice PRIMARY|i_o_totalprice 4|9 dbt3_s001.lineitem.l_orderkey 1 (9%) Using where; Using rowid filter +1 SIMPLE orders range PRIMARY,i_o_totalprice i_o_totalprice 9 NULL 139 Using index condition +1 SIMPLE lineitem ref|filter PRIMARY,i_l_shipdate,i_l_orderkey,i_l_orderkey_quantity,i_l_quantity i_l_orderkey|i_l_shipdate 4|4 dbt3_s001.orders.o_orderkey 4 (8%) Using where; Using rowid filter set statement optimizer_switch='rowid_filter=on' for EXPLAIN FORMAT=JSON SELECT o_orderkey, l_linenumber, l_shipdate, l_quantity, o_totalprice FROM orders JOIN lineitem ON o_orderkey=l_orderkey WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND @@ -605,8 +605,19 @@ EXPLAIN "query_block": { "select_id": 1, "table": { - "table_name": "lineitem", + "table_name": "orders", "access_type": "range", + "possible_keys": ["PRIMARY", "i_o_totalprice"], + "key": "i_o_totalprice", + "key_length": "9", + "used_key_parts": ["o_totalprice"], + "rows": 139, + "filtered": 100, + "index_condition": "orders.o_totalprice between 180000 and 230000" + }, + "table": { + "table_name": "lineitem", + "access_type": "ref", "possible_keys": [ "PRIMARY", "i_l_shipdate", @@ -614,41 +625,21 @@ EXPLAIN "i_l_orderkey_quantity", "i_l_quantity" ], - "key": "i_l_shipdate", - "key_length": "4", - "used_key_parts": ["l_shipDATE"], - "rowid_filter": { - "range": { - "key": "i_l_quantity", - "used_key_parts": ["l_quantity"] - }, - "rows": 702, - "selectivity_pct": 11.69025812 - }, - "rows": 509, - "filtered": 11.69025803, - "index_condition": "lineitem.l_shipDATE between '1997-01-01' and '1997-06-30'", - "attached_condition": "lineitem.l_quantity > 45" - }, - "table": { - "table_name": "orders", - "access_type": "eq_ref", - "possible_keys": ["PRIMARY", "i_o_totalprice"], - "key": "PRIMARY", + "key": "i_l_orderkey", "key_length": "4", - "used_key_parts": ["o_orderkey"], - "ref": ["dbt3_s001.lineitem.l_orderkey"], + "used_key_parts": ["l_orderkey"], + "ref": ["dbt3_s001.orders.o_orderkey"], "rowid_filter": { "range": { - "key": "i_o_totalprice", - "used_key_parts": ["o_totalprice"] + "key": "i_l_shipdate", + "used_key_parts": ["l_shipDATE"] }, - "rows": 139, - "selectivity_pct": 9.266666667 + "rows": 509, + "selectivity_pct": 8.476269775 }, - "rows": 1, - "filtered": 9.266666412, - "attached_condition": "orders.o_totalprice between 180000 and 230000" + "rows": 4, + "filtered": 0.990897834, + "attached_condition": "lineitem.l_shipDATE between '1997-01-01' and '1997-06-30' and lineitem.l_quantity > 45" } } } @@ -658,8 +649,8 @@ WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND l_quantity > 45 AND o_totalprice between 180000 and 230000; id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra -1 SIMPLE lineitem range|filter PRIMARY,i_l_shipdate,i_l_orderkey,i_l_orderkey_quantity,i_l_quantity i_l_shipdate|i_l_quantity 4|9 NULL 509 (12%) 60.00 (11%) 11.69 100.00 Using index condition; Using where; Using rowid filter -1 SIMPLE orders eq_ref|filter PRIMARY,i_o_totalprice PRIMARY|i_o_totalprice 4|9 dbt3_s001.lineitem.l_orderkey 1 (9%) 0.27 (25%) 9.27 100.00 Using where; Using rowid filter +1 SIMPLE orders range PRIMARY,i_o_totalprice i_o_totalprice 9 NULL 139 144.00 100.00 100.00 Using index condition +1 SIMPLE lineitem ref|filter PRIMARY,i_l_shipdate,i_l_orderkey,i_l_orderkey_quantity,i_l_quantity i_l_orderkey|i_l_shipdate 4|4 dbt3_s001.orders.o_orderkey 4 (8%) 0.54 (8%) 0.99 20.51 Using where; Using rowid filter set statement optimizer_switch='rowid_filter=on' for ANALYZE FORMAT=JSON SELECT o_orderkey, l_linenumber, l_shipdate, l_quantity, o_totalprice FROM orders JOIN lineitem ON o_orderkey=l_orderkey WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND @@ -672,8 +663,24 @@ ANALYZE "r_loops": 1, "r_total_time_ms": "REPLACED", "table": { - "table_name": "lineitem", + "table_name": "orders", "access_type": "range", + "possible_keys": ["PRIMARY", "i_o_totalprice"], + "key": "i_o_totalprice", + "key_length": "9", + "used_key_parts": ["o_totalprice"], + "r_loops": 1, + "rows": 139, + "r_rows": 144, + "r_table_time_ms": "REPLACED", + "r_other_time_ms": "REPLACED", + "filtered": 100, + "r_filtered": 100, + "index_condition": "orders.o_totalprice between 180000 and 230000" + }, + "table": { + "table_name": "lineitem", + "access_type": "ref", "possible_keys": [ "PRIMARY", "i_l_shipdate", @@ -681,59 +688,30 @@ ANALYZE "i_l_orderkey_quantity", "i_l_quantity" ], - "key": "i_l_shipdate", - "key_length": "4", - "used_key_parts": ["l_shipDATE"], - "rowid_filter": { - "range": { - "key": "i_l_quantity", - "used_key_parts": ["l_quantity"] - }, - "rows": 702, - "selectivity_pct": 11.69025812, - "r_rows": 605, - "r_selectivity_pct": 11.76470588, - "r_buffer_size": "REPLACED", - "r_filling_time_ms": "REPLACED" - }, - "r_loops": 1, - "rows": 509, - "r_rows": 60, - "r_table_time_ms": "REPLACED", - "r_other_time_ms": "REPLACED", - "filtered": 11.69025803, - "r_filtered": 100, - "index_condition": "lineitem.l_shipDATE between '1997-01-01' and '1997-06-30'", - "attached_condition": "lineitem.l_quantity > 45" - }, - "table": { - "table_name": "orders", - "access_type": "eq_ref", - "possible_keys": ["PRIMARY", "i_o_totalprice"], - "key": "PRIMARY", + "key": "i_l_orderkey", "key_length": "4", - "used_key_parts": ["o_orderkey"], - "ref": ["dbt3_s001.lineitem.l_orderkey"], + "used_key_parts": ["l_orderkey"], + "ref": ["dbt3_s001.orders.o_orderkey"], "rowid_filter": { "range": { - "key": "i_o_totalprice", - "used_key_parts": ["o_totalprice"] + "key": "i_l_shipdate", + "used_key_parts": ["l_shipDATE"] }, - "rows": 139, - "selectivity_pct": 9.266666667, - "r_rows": 144, - "r_selectivity_pct": 25.42372881, + "rows": 509, + "selectivity_pct": 8.476269775, + "r_rows": 510, + "r_selectivity_pct": 8.176100629, "r_buffer_size": "REPLACED", "r_filling_time_ms": "REPLACED" }, - "r_loops": 60, - "rows": 1, - "r_rows": 0.266666667, + "r_loops": 144, + "rows": 4, + "r_rows": 0.541666667, "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", - "filtered": 9.266666412, - "r_filtered": 100, - "attached_condition": "orders.o_totalprice between 180000 and 230000" + "filtered": 0.990897834, + "r_filtered": 20.51282051, + "attached_condition": "lineitem.l_shipDATE between '1997-01-01' and '1997-06-30' and lineitem.l_quantity > 45" } } } @@ -765,8 +743,8 @@ WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND l_quantity > 45 AND o_totalprice between 180000 and 230000; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE lineitem range PRIMARY,i_l_shipdate,i_l_orderkey,i_l_orderkey_quantity,i_l_quantity i_l_shipdate 4 NULL 509 Using index condition; Using where -1 SIMPLE orders eq_ref PRIMARY,i_o_totalprice PRIMARY 4 dbt3_s001.lineitem.l_orderkey 1 Using where +1 SIMPLE orders range PRIMARY,i_o_totalprice i_o_totalprice 9 NULL 139 Using index condition +1 SIMPLE lineitem ref PRIMARY,i_l_shipdate,i_l_orderkey,i_l_orderkey_quantity,i_l_quantity i_l_orderkey 4 dbt3_s001.orders.o_orderkey 4 Using where set statement optimizer_switch='rowid_filter=off' for EXPLAIN FORMAT=JSON SELECT o_orderkey, l_linenumber, l_shipdate, l_quantity, o_totalprice FROM orders JOIN lineitem ON o_orderkey=l_orderkey WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND @@ -777,8 +755,19 @@ EXPLAIN "query_block": { "select_id": 1, "table": { - "table_name": "lineitem", + "table_name": "orders", "access_type": "range", + "possible_keys": ["PRIMARY", "i_o_totalprice"], + "key": "i_o_totalprice", + "key_length": "9", + "used_key_parts": ["o_totalprice"], + "rows": 139, + "filtered": 100, + "index_condition": "orders.o_totalprice between 180000 and 230000" + }, + "table": { + "table_name": "lineitem", + "access_type": "ref", "possible_keys": [ "PRIMARY", "i_l_shipdate", @@ -786,25 +775,13 @@ EXPLAIN "i_l_orderkey_quantity", "i_l_quantity" ], - "key": "i_l_shipdate", - "key_length": "4", - "used_key_parts": ["l_shipDATE"], - "rows": 509, - "filtered": 11.69025803, - "index_condition": "lineitem.l_shipDATE between '1997-01-01' and '1997-06-30'", - "attached_condition": "lineitem.l_quantity > 45" - }, - "table": { - "table_name": "orders", - "access_type": "eq_ref", - "possible_keys": ["PRIMARY", "i_o_totalprice"], - "key": "PRIMARY", + "key": "i_l_orderkey", "key_length": "4", - "used_key_parts": ["o_orderkey"], - "ref": ["dbt3_s001.lineitem.l_orderkey"], - "rows": 1, - "filtered": 9.266666412, - "attached_condition": "orders.o_totalprice between 180000 and 230000" + "used_key_parts": ["l_orderkey"], + "ref": ["dbt3_s001.orders.o_orderkey"], + "rows": 4, + "filtered": 0.990897834, + "attached_condition": "lineitem.l_shipDATE between '1997-01-01' and '1997-06-30' and lineitem.l_quantity > 45" } } } @@ -814,8 +791,8 @@ WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND l_quantity > 45 AND o_totalprice between 180000 and 230000; id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra -1 SIMPLE lineitem range PRIMARY,i_l_shipdate,i_l_orderkey,i_l_orderkey_quantity,i_l_quantity i_l_shipdate 4 NULL 509 510.00 11.69 11.76 Using index condition; Using where -1 SIMPLE orders eq_ref PRIMARY,i_o_totalprice PRIMARY 4 dbt3_s001.lineitem.l_orderkey 1 1.00 9.27 26.67 Using where +1 SIMPLE orders range PRIMARY,i_o_totalprice i_o_totalprice 9 NULL 139 144.00 100.00 100.00 Using index condition +1 SIMPLE lineitem ref PRIMARY,i_l_shipdate,i_l_orderkey,i_l_orderkey_quantity,i_l_quantity i_l_orderkey 4 dbt3_s001.orders.o_orderkey 4 6.62 0.99 1.68 Using where set statement optimizer_switch='rowid_filter=off' for ANALYZE FORMAT=JSON SELECT o_orderkey, l_linenumber, l_shipdate, l_quantity, o_totalprice FROM orders JOIN lineitem ON o_orderkey=l_orderkey WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND @@ -828,8 +805,24 @@ ANALYZE "r_loops": 1, "r_total_time_ms": "REPLACED", "table": { - "table_name": "lineitem", + "table_name": "orders", "access_type": "range", + "possible_keys": ["PRIMARY", "i_o_totalprice"], + "key": "i_o_totalprice", + "key_length": "9", + "used_key_parts": ["o_totalprice"], + "r_loops": 1, + "rows": 139, + "r_rows": 144, + "r_table_time_ms": "REPLACED", + "r_other_time_ms": "REPLACED", + "filtered": 100, + "r_filtered": 100, + "index_condition": "orders.o_totalprice between 180000 and 230000" + }, + "table": { + "table_name": "lineitem", + "access_type": "ref", "possible_keys": [ "PRIMARY", "i_l_shipdate", @@ -837,35 +830,18 @@ ANALYZE "i_l_orderkey_quantity", "i_l_quantity" ], - "key": "i_l_shipdate", - "key_length": "4", - "used_key_parts": ["l_shipDATE"], - "r_loops": 1, - "rows": 509, - "r_rows": 510, - "r_table_time_ms": "REPLACED", - "r_other_time_ms": "REPLACED", - "filtered": 11.69025803, - "r_filtered": 11.76470588, - "index_condition": "lineitem.l_shipDATE between '1997-01-01' and '1997-06-30'", - "attached_condition": "lineitem.l_quantity > 45" - }, - "table": { - "table_name": "orders", - "access_type": "eq_ref", - "possible_keys": ["PRIMARY", "i_o_totalprice"], - "key": "PRIMARY", + "key": "i_l_orderkey", "key_length": "4", - "used_key_parts": ["o_orderkey"], - "ref": ["dbt3_s001.lineitem.l_orderkey"], - "r_loops": 60, - "rows": 1, - "r_rows": 1, + "used_key_parts": ["l_orderkey"], + "ref": ["dbt3_s001.orders.o_orderkey"], + "r_loops": 144, + "rows": 4, + "r_rows": 6.625, "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", - "filtered": 9.266666412, - "r_filtered": 26.66666667, - "attached_condition": "orders.o_totalprice between 180000 and 230000" + "filtered": 0.990897834, + "r_filtered": 1.677148847, + "attached_condition": "lineitem.l_shipDATE between '1997-01-01' and '1997-06-30' and lineitem.l_quantity > 45" } } } @@ -891,13 +867,21 @@ o_orderkey l_linenumber l_shipdate l_quantity o_totalprice 5829 5 1997-01-31 49 183734.56 5895 2 1997-04-27 47 201419.83 5895 3 1997-03-15 49 201419.83 +set statement optimizer_switch='rowid_filter=on' for EXPLAIN SELECT STRAIGHT_JOIN o_orderkey, l_linenumber, l_shipdate, l_quantity, o_totalprice +FROM lineitem JOIN orders ON o_orderkey=l_orderkey +WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND +l_quantity > 45 AND +o_totalprice between 180000 and 230000; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE lineitem range|filter PRIMARY,i_l_shipdate,i_l_orderkey,i_l_orderkey_quantity,i_l_quantity i_l_shipdate|i_l_quantity 4|9 NULL 509 (12%) Using index condition; Using where; Using rowid filter +1 SIMPLE orders eq_ref|filter PRIMARY,i_o_totalprice PRIMARY|i_o_totalprice 4|9 dbt3_s001.lineitem.l_orderkey 1 (9%) Using where; Using rowid filter set statement optimizer_switch='rowid_filter=on' for EXPLAIN SELECT o_orderkey, l_linenumber, l_shipdate, o_totalprice FROM orders JOIN lineitem ON o_orderkey=l_orderkey WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND o_totalprice between 200000 and 230000; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE orders range PRIMARY,i_o_totalprice i_o_totalprice 9 NULL 69 Using index condition -1 SIMPLE lineitem ref PRIMARY,i_l_shipdate,i_l_orderkey,i_l_orderkey_quantity i_l_orderkey 4 dbt3_s001.orders.o_orderkey 4 Using where +1 SIMPLE lineitem ref|filter PRIMARY,i_l_shipdate,i_l_orderkey,i_l_orderkey_quantity i_l_orderkey|i_l_shipdate 4|4 dbt3_s001.orders.o_orderkey 4 (8%) Using where; Using rowid filter set statement optimizer_switch='rowid_filter=on' for EXPLAIN FORMAT=JSON SELECT o_orderkey, l_linenumber, l_shipdate, o_totalprice FROM orders JOIN lineitem ON o_orderkey=l_orderkey WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND @@ -930,6 +914,14 @@ EXPLAIN "key_length": "4", "used_key_parts": ["l_orderkey"], "ref": ["dbt3_s001.orders.o_orderkey"], + "rowid_filter": { + "range": { + "key": "i_l_shipdate", + "used_key_parts": ["l_shipDATE"] + }, + "rows": 509, + "selectivity_pct": 8.476269775 + }, "rows": 4, "filtered": 8.476269722, "attached_condition": "lineitem.l_shipDATE between '1997-01-01' and '1997-06-30'" @@ -942,7 +934,7 @@ WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND o_totalprice between 200000 and 230000; id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra 1 SIMPLE orders range PRIMARY,i_o_totalprice i_o_totalprice 9 NULL 69 71.00 100.00 100.00 Using index condition -1 SIMPLE lineitem ref PRIMARY,i_l_shipdate,i_l_orderkey,i_l_orderkey_quantity i_l_orderkey 4 dbt3_s001.orders.o_orderkey 4 6.70 8.48 7.77 Using where +1 SIMPLE lineitem ref|filter PRIMARY,i_l_shipdate,i_l_orderkey,i_l_orderkey_quantity i_l_orderkey|i_l_shipdate 4|4 dbt3_s001.orders.o_orderkey 4 (8%) 0.52 (7%) 8.48 100.00 Using where; Using rowid filter set statement optimizer_switch='rowid_filter=on' for ANALYZE FORMAT=JSON SELECT o_orderkey, l_linenumber, l_shipdate, o_totalprice FROM orders JOIN lineitem ON o_orderkey=l_orderkey WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND @@ -982,13 +974,25 @@ ANALYZE "key_length": "4", "used_key_parts": ["l_orderkey"], "ref": ["dbt3_s001.orders.o_orderkey"], + "rowid_filter": { + "range": { + "key": "i_l_shipdate", + "used_key_parts": ["l_shipDATE"] + }, + "rows": 509, + "selectivity_pct": 8.476269775, + "r_rows": 510, + "r_selectivity_pct": 7.773109244, + "r_buffer_size": "REPLACED", + "r_filling_time_ms": "REPLACED" + }, "r_loops": 71, "rows": 4, - "r_rows": 6.704225352, + "r_rows": 0.521126761, "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 8.476269722, - "r_filtered": 7.773109244, + "r_filtered": 100, "attached_condition": "lineitem.l_shipDATE between '1997-01-01' and '1997-06-30'" } } @@ -1219,7 +1223,7 @@ EXPLAIN "key_length": "4", "used_key_parts": ["l_receiptDATE"], "rows": 18, - "filtered": 5.555555344, + "filtered": 100, "index_condition": "lineitem.l_receiptDATE between '1996-10-05' and '1996-10-10'", "attached_condition": "lineitem.l_shipDATE between '1996-10-01' and '1996-10-10'" }, @@ -1244,7 +1248,7 @@ l_shipdate BETWEEN '1996-10-01' AND '1996-10-10' AND l_receiptdate BETWEEN '1996-10-05' AND '1996-10-10' AND o_totalprice BETWEEN 200000 AND 250000; id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra -1 SIMPLE lineitem range PRIMARY,i_l_shipdate,i_l_receiptdate,i_l_orderkey,i_l_orderkey_quantity i_l_receiptdate 4 NULL 18 18.00 5.56 38.89 Using index condition; Using where +1 SIMPLE lineitem range PRIMARY,i_l_shipdate,i_l_receiptdate,i_l_orderkey,i_l_orderkey_quantity i_l_receiptdate 4 NULL 18 18.00 100.00 38.89 Using index condition; Using where 1 SIMPLE orders eq_ref PRIMARY,i_o_totalprice PRIMARY 4 dbt3_s001.lineitem.l_orderkey 1 1.00 7.47 14.29 Using where set statement optimizer_switch='rowid_filter=on' for ANALYZE FORMAT=JSON SELECT l_shipdate, l_receiptdate, o_totalprice FROM orders, lineitem @@ -1276,7 +1280,7 @@ ANALYZE "r_rows": 18, "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", - "filtered": 5.555555344, + "filtered": 100, "r_filtered": 38.88888889, "index_condition": "lineitem.l_receiptDATE between '1996-10-05' and '1996-10-10'", "attached_condition": "lineitem.l_shipDATE between '1996-10-01' and '1996-10-10'" @@ -1341,7 +1345,7 @@ EXPLAIN "key_length": "4", "used_key_parts": ["l_receiptDATE"], "rows": 18, - "filtered": 5.555555344, + "filtered": 100, "index_condition": "lineitem.l_receiptDATE between '1996-10-05' and '1996-10-10'", "attached_condition": "lineitem.l_shipDATE between '1996-10-01' and '1996-10-10'" }, @@ -1366,7 +1370,7 @@ l_shipdate BETWEEN '1996-10-01' AND '1996-10-10' AND l_receiptdate BETWEEN '1996-10-05' AND '1996-10-10' AND o_totalprice BETWEEN 200000 AND 250000; id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra -1 SIMPLE lineitem range PRIMARY,i_l_shipdate,i_l_receiptdate,i_l_orderkey,i_l_orderkey_quantity i_l_receiptdate 4 NULL 18 18.00 5.56 38.89 Using index condition; Using where +1 SIMPLE lineitem range PRIMARY,i_l_shipdate,i_l_receiptdate,i_l_orderkey,i_l_orderkey_quantity i_l_receiptdate 4 NULL 18 18.00 100.00 38.89 Using index condition; Using where 1 SIMPLE orders eq_ref PRIMARY,i_o_totalprice PRIMARY 4 dbt3_s001.lineitem.l_orderkey 1 1.00 7.47 14.29 Using where set statement optimizer_switch='rowid_filter=off' for ANALYZE FORMAT=JSON SELECT l_shipdate, l_receiptdate, o_totalprice FROM orders, lineitem @@ -1398,7 +1402,7 @@ ANALYZE "r_rows": 18, "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", - "filtered": 5.555555344, + "filtered": 100, "r_filtered": 38.88888889, "index_condition": "lineitem.l_receiptDATE between '1996-10-05' and '1996-10-10'", "attached_condition": "lineitem.l_shipDATE between '1996-10-01' and '1996-10-10'" @@ -1445,7 +1449,7 @@ o_totalprice BETWEEN 200000 AND 220000 AND l_shipdate BETWEEN '1996-10-01' AND '1996-12-01'; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE orders range PRIMARY,i_o_totalprice,i_o_totaldiscount i_o_totaldiscount 9 NULL 39 Using index condition; Using where -1 SIMPLE lineitem ref PRIMARY,i_l_shipdate,i_l_orderkey,i_l_orderkey_quantity i_l_orderkey 4 dbt3_s001.orders.o_orderkey 4 Using where +1 SIMPLE lineitem ref|filter PRIMARY,i_l_shipdate,i_l_orderkey,i_l_orderkey_quantity i_l_orderkey|i_l_shipdate 4|4 dbt3_s001.orders.o_orderkey 4 (3%) Using where; Using rowid filter set statement optimizer_switch='rowid_filter=on' for EXPLAIN FORMAT=JSON SELECT o_totaldiscount, o_totalprice, l_shipdate FROM orders, lineitem WHERE o_orderkey=l_orderkey AND @@ -1464,7 +1468,7 @@ EXPLAIN "key_length": "9", "used_key_parts": ["o_totaldiscount"], "rows": 39, - "filtered": 3.200000048, + "filtered": 100, "index_condition": "orders.o_totaldiscount between 18000 and 20000", "attached_condition": "orders.o_totalprice between 200000 and 220000" }, @@ -1481,6 +1485,14 @@ EXPLAIN "key_length": "4", "used_key_parts": ["l_orderkey"], "ref": ["dbt3_s001.orders.o_orderkey"], + "rowid_filter": { + "range": { + "key": "i_l_shipdate", + "used_key_parts": ["l_shipDATE"] + }, + "rows": 183, + "selectivity_pct": 3.04746045 + }, "rows": 4, "filtered": 3.047460556, "attached_condition": "lineitem.l_shipDATE between '1996-10-01' and '1996-12-01'" @@ -1494,8 +1506,8 @@ o_totaldiscount BETWEEN 18000 AND 20000 AND o_totalprice BETWEEN 200000 AND 220000 AND l_shipdate BETWEEN '1996-10-01' AND '1996-12-01'; id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra -1 SIMPLE orders range PRIMARY,i_o_totalprice,i_o_totaldiscount i_o_totaldiscount 9 NULL 39 41.00 3.20 2.44 Using index condition; Using where -1 SIMPLE lineitem ref PRIMARY,i_l_shipdate,i_l_orderkey,i_l_orderkey_quantity i_l_orderkey 4 dbt3_s001.orders.o_orderkey 4 6.00 3.05 66.67 Using where +1 SIMPLE orders range PRIMARY,i_o_totalprice,i_o_totaldiscount i_o_totaldiscount 9 NULL 39 41.00 100.00 2.44 Using index condition; Using where +1 SIMPLE lineitem ref|filter PRIMARY,i_l_shipdate,i_l_orderkey,i_l_orderkey_quantity i_l_orderkey|i_l_shipdate 4|4 dbt3_s001.orders.o_orderkey 4 (3%) 4.00 (66%) 3.05 100.00 Using where; Using rowid filter set statement optimizer_switch='rowid_filter=on' for ANALYZE FORMAT=JSON SELECT o_totaldiscount, o_totalprice, l_shipdate FROM orders, lineitem WHERE o_orderkey=l_orderkey AND @@ -1520,7 +1532,7 @@ ANALYZE "r_rows": 41, "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", - "filtered": 3.200000048, + "filtered": 100, "r_filtered": 2.43902439, "index_condition": "orders.o_totaldiscount between 18000 and 20000", "attached_condition": "orders.o_totalprice between 200000 and 220000" @@ -1538,13 +1550,25 @@ ANALYZE "key_length": "4", "used_key_parts": ["l_orderkey"], "ref": ["dbt3_s001.orders.o_orderkey"], + "rowid_filter": { + "range": { + "key": "i_l_shipdate", + "used_key_parts": ["l_shipDATE"] + }, + "rows": 183, + "selectivity_pct": 3.04746045, + "r_rows": 183, + "r_selectivity_pct": 66.66666667, + "r_buffer_size": "REPLACED", + "r_filling_time_ms": "REPLACED" + }, "r_loops": 1, "rows": 4, - "r_rows": 6, + "r_rows": 4, "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 3.047460556, - "r_filtered": 66.66666667, + "r_filtered": 100, "attached_condition": "lineitem.l_shipDATE between '1996-10-01' and '1996-12-01'" } } @@ -1587,7 +1611,7 @@ EXPLAIN "key_length": "9", "used_key_parts": ["o_totaldiscount"], "rows": 39, - "filtered": 3.200000048, + "filtered": 100, "index_condition": "orders.o_totaldiscount between 18000 and 20000", "attached_condition": "orders.o_totalprice between 200000 and 220000" }, @@ -1617,7 +1641,7 @@ o_totaldiscount BETWEEN 18000 AND 20000 AND o_totalprice BETWEEN 200000 AND 220000 AND l_shipdate BETWEEN '1996-10-01' AND '1996-12-01'; id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra -1 SIMPLE orders range PRIMARY,i_o_totalprice,i_o_totaldiscount i_o_totaldiscount 9 NULL 39 41.00 3.20 2.44 Using index condition; Using where +1 SIMPLE orders range PRIMARY,i_o_totalprice,i_o_totaldiscount i_o_totaldiscount 9 NULL 39 41.00 100.00 2.44 Using index condition; Using where 1 SIMPLE lineitem ref PRIMARY,i_l_shipdate,i_l_orderkey,i_l_orderkey_quantity i_l_orderkey 4 dbt3_s001.orders.o_orderkey 4 6.00 3.05 66.67 Using where set statement optimizer_switch='rowid_filter=off' for ANALYZE FORMAT=JSON SELECT o_totaldiscount, o_totalprice, l_shipdate FROM orders, lineitem @@ -1643,7 +1667,7 @@ ANALYZE "r_rows": 41, "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", - "filtered": 3.200000048, + "filtered": 100, "r_filtered": 2.43902439, "index_condition": "orders.o_totaldiscount between 18000 and 20000", "attached_condition": "orders.o_totalprice between 200000 and 220000" @@ -1694,7 +1718,7 @@ o_totalprice BETWEEN 200000 AND 220000 AND l_shipdate BETWEEN '1996-10-01' AND '1996-12-01'; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE orders range PRIMARY,i_o_orderdate,i_o_totalprice,i_o_totaldiscount i_o_totaldiscount 9 NULL 39 Using index condition; Using where -1 SIMPLE lineitem ref PRIMARY,i_l_shipdate,i_l_orderkey,i_l_orderkey_quantity i_l_orderkey 4 dbt3_s001.orders.o_orderkey 4 Using where +1 SIMPLE lineitem ref|filter PRIMARY,i_l_shipdate,i_l_orderkey,i_l_orderkey_quantity i_l_orderkey|i_l_shipdate 4|4 dbt3_s001.orders.o_orderkey 4 (3%) Using where; Using rowid filter set statement optimizer_switch='rowid_filter=on' for EXPLAIN FORMAT=JSON SELECT o_totaldiscount, o_totalprice, l_shipdate FROM v1, lineitem WHERE o_orderkey=l_orderkey AND @@ -1735,6 +1759,14 @@ EXPLAIN "key_length": "4", "used_key_parts": ["l_orderkey"], "ref": ["dbt3_s001.orders.o_orderkey"], + "rowid_filter": { + "range": { + "key": "i_l_shipdate", + "used_key_parts": ["l_shipDATE"] + }, + "rows": 183, + "selectivity_pct": 3.04746045 + }, "rows": 4, "filtered": "REPLACED", "attached_condition": "lineitem.l_shipDATE between '1996-10-01' and '1996-12-01'" @@ -1749,7 +1781,7 @@ o_totalprice BETWEEN 200000 AND 220000 AND l_shipdate BETWEEN '1996-10-01' AND '1996-12-01'; id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra 1 SIMPLE orders range PRIMARY,i_o_orderdate,i_o_totalprice,i_o_totaldiscount i_o_totaldiscount 9 NULL 39 41.00 # 2.44 Using index condition; Using where -1 SIMPLE lineitem ref PRIMARY,i_l_shipdate,i_l_orderkey,i_l_orderkey_quantity i_l_orderkey 4 dbt3_s001.orders.o_orderkey 4 6.00 # 66.67 Using where +1 SIMPLE lineitem ref|filter PRIMARY,i_l_shipdate,i_l_orderkey,i_l_orderkey_quantity i_l_orderkey|i_l_shipdate 4|4 dbt3_s001.orders.o_orderkey 4 (3%) 4.00 (66%) # 100.00 Using where; Using rowid filter set statement optimizer_switch='rowid_filter=on' for ANALYZE FORMAT=JSON SELECT o_totaldiscount, o_totalprice, l_shipdate FROM v1, lineitem WHERE o_orderkey=l_orderkey AND @@ -1797,13 +1829,25 @@ ANALYZE "key_length": "4", "used_key_parts": ["l_orderkey"], "ref": ["dbt3_s001.orders.o_orderkey"], + "rowid_filter": { + "range": { + "key": "i_l_shipdate", + "used_key_parts": ["l_shipDATE"] + }, + "rows": 183, + "selectivity_pct": 3.04746045, + "r_rows": 183, + "r_selectivity_pct": 66.66666667, + "r_buffer_size": "REPLACED", + "r_filling_time_ms": "REPLACED" + }, "r_loops": 1, "rows": 4, - "r_rows": 6, + "r_rows": 4, "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": "REPLACED", - "r_filtered": 66.66666667, + "r_filtered": 100, "attached_condition": "lineitem.l_shipDATE between '1996-10-01' and '1996-12-01'" } } @@ -2063,7 +2107,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 INNER JOIN t2 ON ( pk1 <> pk2 AND pk1 = a2 ) WHERE b1 <= ( SELECT MAX(b2) FROM t2 WHERE pk2 <= 1 ); id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t2 ALL NULL NULL NULL NULL 101 100.00 Using where -1 PRIMARY t1 eq_ref PRIMARY,b1 PRIMARY 4 test.t2.a2 1 87.00 Using where +1 PRIMARY t1 eq_ref|filter PRIMARY,b1 PRIMARY|b1 4|4 test.t2.a2 1 (87%) 87.00 Using where; Using rowid filter 2 SUBQUERY t2 range PRIMARY PRIMARY 4 NULL 1 100.00 Using index condition Warnings: Note 1003 /* select#1 */ select `test`.`t1`.`pk1` AS `pk1`,`test`.`t1`.`a1` AS `a1`,`test`.`t1`.`b1` AS `b1`,`test`.`t2`.`pk2` AS `pk2`,`test`.`t2`.`a2` AS `a2`,`test`.`t2`.`b2` AS `b2` from `test`.`t1` join `test`.`t2` where `test`.`t1`.`pk1` = `test`.`t2`.`a2` and `test`.`t1`.`b1` <= (/* select#2 */ select max(`test`.`t2`.`b2`) from `test`.`t2` where `test`.`t2`.`pk2` <= 1) and `test`.`t2`.`a2` <> `test`.`t2`.`pk2` @@ -2088,6 +2132,14 @@ EXPLAIN "key_length": "4", "used_key_parts": ["pk1"], "ref": ["test.t2.a2"], + "rowid_filter": { + "range": { + "key": "b1", + "used_key_parts": ["b1"] + }, + "rows": 87, + "selectivity_pct": 87 + }, "rows": 1, "filtered": 87, "attached_condition": "t1.b1 <= (subquery#2)" @@ -2160,7 +2212,7 @@ INSERT INTO t1 VALUES (0,0),(1,0),(-1,1), (-2,1), (-2,3), (-3,4), (-2,4); explain SELECT * FROM t1 WHERE a > 0 AND b=0; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range|filter a,b a|b 5|5 NULL 1 (29%) Using index condition; Using where; Using rowid filter +1 SIMPLE t1 range a,b a 5 NULL 1 Using index condition; Using where SELECT * FROM t1 WHERE a > 0 AND b=0; a b 1 0 diff --git a/mysql-test/main/rowid_filter.test b/mysql-test/main/rowid_filter.test index 163b71b6153..fbbd9746ef8 100644 --- a/mysql-test/main/rowid_filter.test +++ b/mysql-test/main/rowid_filter.test @@ -115,6 +115,13 @@ eval $without_filter ANALYZE FORMAT=JSON $q3; --sorted_result eval $without_filter $q3; +# Check different optimization +eval $with_filter EXPLAIN SELECT STRAIGHT_JOIN o_orderkey, l_linenumber, l_shipdate, l_quantity, o_totalprice + FROM lineitem JOIN orders ON o_orderkey=l_orderkey + WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND + l_quantity > 45 AND + o_totalprice between 180000 and 230000; + let $q4= SELECT o_orderkey, l_linenumber, l_shipdate, o_totalprice FROM orders JOIN lineitem ON o_orderkey=l_orderkey diff --git a/mysql-test/main/rowid_filter_innodb.result b/mysql-test/main/rowid_filter_innodb.result index 55b6d99464b..d459776d218 100644 --- a/mysql-test/main/rowid_filter_innodb.result +++ b/mysql-test/main/rowid_filter_innodb.result @@ -231,7 +231,7 @@ EXPLAIN "key_length": "4", "used_key_parts": ["l_shipDATE"], "rows": 510, - "filtered": 10.07493782, + "filtered": 100, "index_condition": "lineitem.l_shipDATE between '1997-01-01' and '1997-06-30'", "attached_condition": "lineitem.l_quantity > 45" } @@ -241,7 +241,7 @@ set statement optimizer_switch='rowid_filter=off' for ANALYZE SELECT l_orderkey, WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND l_quantity > 45; id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra -1 SIMPLE lineitem range i_l_shipdate,i_l_quantity i_l_shipdate 4 NULL 510 510.00 10.07 11.76 Using index condition; Using where +1 SIMPLE lineitem range i_l_shipdate,i_l_quantity i_l_shipdate 4 NULL 510 510.00 100.00 11.76 Using index condition; Using where set statement optimizer_switch='rowid_filter=off' for ANALYZE FORMAT=JSON SELECT l_orderkey, l_linenumber, l_shipdate, l_quantity FROM lineitem WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND l_quantity > 45; @@ -263,7 +263,7 @@ ANALYZE "r_rows": 510, "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", - "filtered": 10.07493782, + "filtered": 100, "r_filtered": 11.76470588, "index_condition": "lineitem.l_shipDATE between '1997-01-01' and '1997-06-30'", "attached_condition": "lineitem.l_quantity > 45" @@ -580,8 +580,8 @@ WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND l_quantity > 45 AND o_totalprice between 180000 and 230000; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE lineitem range|filter PRIMARY,i_l_shipdate,i_l_orderkey,i_l_orderkey_quantity,i_l_quantity i_l_shipdate|i_l_quantity 4|9 NULL 510 (10%) Using index condition; Using where; Using rowid filter -1 SIMPLE orders eq_ref PRIMARY,i_o_totalprice PRIMARY 4 dbt3_s001.lineitem.l_orderkey 1 Using where +1 SIMPLE orders range PRIMARY,i_o_totalprice i_o_totalprice 9 NULL 144 Using where; Using index +1 SIMPLE lineitem ref|filter PRIMARY,i_l_shipdate,i_l_orderkey,i_l_orderkey_quantity,i_l_quantity i_l_orderkey|i_l_shipdate 4|4 dbt3_s001.orders.o_orderkey 4 (8%) Using where; Using rowid filter set statement optimizer_switch='rowid_filter=on' for EXPLAIN FORMAT=JSON SELECT o_orderkey, l_linenumber, l_shipdate, l_quantity, o_totalprice FROM orders JOIN lineitem ON o_orderkey=l_orderkey WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND @@ -592,8 +592,20 @@ EXPLAIN "query_block": { "select_id": 1, "table": { - "table_name": "lineitem", + "table_name": "orders", "access_type": "range", + "possible_keys": ["PRIMARY", "i_o_totalprice"], + "key": "i_o_totalprice", + "key_length": "9", + "used_key_parts": ["o_totalprice"], + "rows": 144, + "filtered": 100, + "attached_condition": "orders.o_totalprice between 180000 and 230000", + "using_index": true + }, + "table": { + "table_name": "lineitem", + "access_type": "ref", "possible_keys": [ "PRIMARY", "i_l_shipdate", @@ -601,33 +613,21 @@ EXPLAIN "i_l_orderkey_quantity", "i_l_quantity" ], - "key": "i_l_shipdate", + "key": "i_l_orderkey", "key_length": "4", - "used_key_parts": ["l_shipDATE"], + "used_key_parts": ["l_orderkey"], + "ref": ["dbt3_s001.orders.o_orderkey"], "rowid_filter": { "range": { - "key": "i_l_quantity", - "used_key_parts": ["l_quantity"] + "key": "i_l_shipdate", + "used_key_parts": ["l_shipDATE"] }, - "rows": 605, - "selectivity_pct": 10.07493755 + "rows": 510, + "selectivity_pct": 8.492922565 }, - "rows": 510, - "filtered": 10.07493782, - "index_condition": "lineitem.l_shipDATE between '1997-01-01' and '1997-06-30'", - "attached_condition": "lineitem.l_quantity > 45" - }, - "table": { - "table_name": "orders", - "access_type": "eq_ref", - "possible_keys": ["PRIMARY", "i_o_totalprice"], - "key": "PRIMARY", - "key_length": "4", - "used_key_parts": ["o_orderkey"], - "ref": ["dbt3_s001.lineitem.l_orderkey"], - "rows": 1, - "filtered": 9.600000381, - "attached_condition": "orders.o_totalprice between 180000 and 230000" + "rows": 4, + "filtered": 0.855656624, + "attached_condition": "lineitem.l_shipDATE between '1997-01-01' and '1997-06-30' and lineitem.l_quantity > 45" } } } @@ -637,8 +637,8 @@ WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND l_quantity > 45 AND o_totalprice between 180000 and 230000; id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra -1 SIMPLE lineitem range|filter PRIMARY,i_l_shipdate,i_l_orderkey,i_l_orderkey_quantity,i_l_quantity i_l_shipdate|i_l_quantity 4|9 NULL 510 (10%) 60.00 (11%) 10.07 100.00 Using index condition; Using where; Using rowid filter -1 SIMPLE orders eq_ref PRIMARY,i_o_totalprice PRIMARY 4 dbt3_s001.lineitem.l_orderkey 1 1.00 9.60 26.67 Using where +1 SIMPLE orders range PRIMARY,i_o_totalprice i_o_totalprice 9 NULL 144 144.00 100.00 100.00 Using where; Using index +1 SIMPLE lineitem ref|filter PRIMARY,i_l_shipdate,i_l_orderkey,i_l_orderkey_quantity,i_l_quantity i_l_orderkey|i_l_shipdate 4|4 dbt3_s001.orders.o_orderkey 4 (8%) 0.54 (8%) 0.86 20.51 Using where; Using rowid filter set statement optimizer_switch='rowid_filter=on' for ANALYZE FORMAT=JSON SELECT o_orderkey, l_linenumber, l_shipdate, l_quantity, o_totalprice FROM orders JOIN lineitem ON o_orderkey=l_orderkey WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND @@ -651,8 +651,25 @@ ANALYZE "r_loops": 1, "r_total_time_ms": "REPLACED", "table": { - "table_name": "lineitem", + "table_name": "orders", "access_type": "range", + "possible_keys": ["PRIMARY", "i_o_totalprice"], + "key": "i_o_totalprice", + "key_length": "9", + "used_key_parts": ["o_totalprice"], + "r_loops": 1, + "rows": 144, + "r_rows": 144, + "r_table_time_ms": "REPLACED", + "r_other_time_ms": "REPLACED", + "filtered": 100, + "r_filtered": 100, + "attached_condition": "orders.o_totalprice between 180000 and 230000", + "using_index": true + }, + "table": { + "table_name": "lineitem", + "access_type": "ref", "possible_keys": [ "PRIMARY", "i_l_shipdate", @@ -660,47 +677,30 @@ ANALYZE "i_l_orderkey_quantity", "i_l_quantity" ], - "key": "i_l_shipdate", + "key": "i_l_orderkey", "key_length": "4", - "used_key_parts": ["l_shipDATE"], + "used_key_parts": ["l_orderkey"], + "ref": ["dbt3_s001.orders.o_orderkey"], "rowid_filter": { "range": { - "key": "i_l_quantity", - "used_key_parts": ["l_quantity"] + "key": "i_l_shipdate", + "used_key_parts": ["l_shipDATE"] }, - "rows": 605, - "selectivity_pct": 10.07493755, - "r_rows": 605, - "r_selectivity_pct": 11.76470588, + "rows": 510, + "selectivity_pct": 8.492922565, + "r_rows": 510, + "r_selectivity_pct": 8.176100629, "r_buffer_size": "REPLACED", "r_filling_time_ms": "REPLACED" }, - "r_loops": 1, - "rows": 510, - "r_rows": 60, - "r_table_time_ms": "REPLACED", - "r_other_time_ms": "REPLACED", - "filtered": 10.07493782, - "r_filtered": 100, - "index_condition": "lineitem.l_shipDATE between '1997-01-01' and '1997-06-30'", - "attached_condition": "lineitem.l_quantity > 45" - }, - "table": { - "table_name": "orders", - "access_type": "eq_ref", - "possible_keys": ["PRIMARY", "i_o_totalprice"], - "key": "PRIMARY", - "key_length": "4", - "used_key_parts": ["o_orderkey"], - "ref": ["dbt3_s001.lineitem.l_orderkey"], - "r_loops": 60, - "rows": 1, - "r_rows": 1, + "r_loops": 144, + "rows": 4, + "r_rows": 0.541666667, "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", - "filtered": 9.600000381, - "r_filtered": 26.66666667, - "attached_condition": "orders.o_totalprice between 180000 and 230000" + "filtered": 0.855656624, + "r_filtered": 20.51282051, + "attached_condition": "lineitem.l_shipDATE between '1997-01-01' and '1997-06-30' and lineitem.l_quantity > 45" } } } @@ -858,6 +858,14 @@ o_orderkey l_linenumber l_shipdate l_quantity o_totalprice 5829 5 1997-01-31 49 183734.56 5895 2 1997-04-27 47 201419.83 5895 3 1997-03-15 49 201419.83 +set statement optimizer_switch='rowid_filter=on' for EXPLAIN SELECT STRAIGHT_JOIN o_orderkey, l_linenumber, l_shipdate, l_quantity, o_totalprice +FROM lineitem JOIN orders ON o_orderkey=l_orderkey +WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND +l_quantity > 45 AND +o_totalprice between 180000 and 230000; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE lineitem range|filter PRIMARY,i_l_shipdate,i_l_orderkey,i_l_orderkey_quantity,i_l_quantity i_l_shipdate|i_l_quantity 4|9 NULL 510 (10%) Using index condition; Using where; Using rowid filter +1 SIMPLE orders eq_ref PRIMARY,i_o_totalprice PRIMARY 4 dbt3_s001.lineitem.l_orderkey 1 Using where set statement optimizer_switch='rowid_filter=on' for EXPLAIN SELECT o_orderkey, l_linenumber, l_shipdate, o_totalprice FROM orders JOIN lineitem ON o_orderkey=l_orderkey WHERE l_shipdate BETWEEN '1997-01-01' AND '1997-06-30' AND @@ -1190,7 +1198,7 @@ EXPLAIN "key_length": "4", "used_key_parts": ["l_receiptDATE"], "rows": 18, - "filtered": 5.555555344, + "filtered": 100, "index_condition": "lineitem.l_receiptDATE between '1996-10-05' and '1996-10-10'", "attached_condition": "lineitem.l_shipDATE between '1996-10-01' and '1996-10-10'" }, @@ -1215,7 +1223,7 @@ l_shipdate BETWEEN '1996-10-01' AND '1996-10-10' AND l_receiptdate BETWEEN '1996-10-05' AND '1996-10-10' AND o_totalprice BETWEEN 200000 AND 250000; id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra -1 SIMPLE lineitem range PRIMARY,i_l_shipdate,i_l_receiptdate,i_l_orderkey,i_l_orderkey_quantity i_l_receiptdate 4 NULL 18 18.00 5.56 38.89 Using index condition; Using where +1 SIMPLE lineitem range PRIMARY,i_l_shipdate,i_l_receiptdate,i_l_orderkey,i_l_orderkey_quantity i_l_receiptdate 4 NULL 18 18.00 100.00 38.89 Using index condition; Using where 1 SIMPLE orders eq_ref PRIMARY,i_o_totalprice PRIMARY 4 dbt3_s001.lineitem.l_orderkey 1 1.00 5.67 14.29 Using where set statement optimizer_switch='rowid_filter=on' for ANALYZE FORMAT=JSON SELECT l_shipdate, l_receiptdate, o_totalprice FROM orders, lineitem @@ -1247,7 +1255,7 @@ ANALYZE "r_rows": 18, "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", - "filtered": 5.555555344, + "filtered": 100, "r_filtered": 38.88888889, "index_condition": "lineitem.l_receiptDATE between '1996-10-05' and '1996-10-10'", "attached_condition": "lineitem.l_shipDATE between '1996-10-01' and '1996-10-10'" @@ -1312,7 +1320,7 @@ EXPLAIN "key_length": "4", "used_key_parts": ["l_receiptDATE"], "rows": 18, - "filtered": 5.555555344, + "filtered": 100, "index_condition": "lineitem.l_receiptDATE between '1996-10-05' and '1996-10-10'", "attached_condition": "lineitem.l_shipDATE between '1996-10-01' and '1996-10-10'" }, @@ -1337,7 +1345,7 @@ l_shipdate BETWEEN '1996-10-01' AND '1996-10-10' AND l_receiptdate BETWEEN '1996-10-05' AND '1996-10-10' AND o_totalprice BETWEEN 200000 AND 250000; id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra -1 SIMPLE lineitem range PRIMARY,i_l_shipdate,i_l_receiptdate,i_l_orderkey,i_l_orderkey_quantity i_l_receiptdate 4 NULL 18 18.00 5.56 38.89 Using index condition; Using where +1 SIMPLE lineitem range PRIMARY,i_l_shipdate,i_l_receiptdate,i_l_orderkey,i_l_orderkey_quantity i_l_receiptdate 4 NULL 18 18.00 100.00 38.89 Using index condition; Using where 1 SIMPLE orders eq_ref PRIMARY,i_o_totalprice PRIMARY 4 dbt3_s001.lineitem.l_orderkey 1 1.00 5.67 14.29 Using where set statement optimizer_switch='rowid_filter=off' for ANALYZE FORMAT=JSON SELECT l_shipdate, l_receiptdate, o_totalprice FROM orders, lineitem @@ -1369,7 +1377,7 @@ ANALYZE "r_rows": 18, "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", - "filtered": 5.555555344, + "filtered": 100, "r_filtered": 38.88888889, "index_condition": "lineitem.l_receiptDATE between '1996-10-05' and '1996-10-10'", "attached_condition": "lineitem.l_shipDATE between '1996-10-01' and '1996-10-10'" @@ -1416,7 +1424,7 @@ o_totalprice BETWEEN 200000 AND 220000 AND l_shipdate BETWEEN '1996-10-01' AND '1996-12-01'; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE orders range PRIMARY,i_o_totalprice,i_o_totaldiscount i_o_totaldiscount 9 NULL 41 Using index condition; Using where -1 SIMPLE lineitem ref PRIMARY,i_l_shipdate,i_l_orderkey,i_l_orderkey_quantity PRIMARY 4 dbt3_s001.orders.o_orderkey 4 Using where +1 SIMPLE lineitem ref|filter PRIMARY,i_l_shipdate,i_l_orderkey,i_l_orderkey_quantity i_l_orderkey|i_l_shipdate 4|4 dbt3_s001.orders.o_orderkey 4 (3%) Using where; Using rowid filter set statement optimizer_switch='rowid_filter=on' for EXPLAIN FORMAT=JSON SELECT o_totaldiscount, o_totalprice, l_shipdate FROM orders, lineitem WHERE o_orderkey=l_orderkey AND @@ -1435,7 +1443,7 @@ EXPLAIN "key_length": "9", "used_key_parts": ["o_totaldiscount"], "rows": 41, - "filtered": 3.333333254, + "filtered": 100, "index_condition": "orders.o_totaldiscount between 18000 and 20000", "attached_condition": "orders.o_totalprice between 200000 and 220000" }, @@ -1448,10 +1456,18 @@ EXPLAIN "i_l_orderkey", "i_l_orderkey_quantity" ], - "key": "PRIMARY", + "key": "i_l_orderkey", "key_length": "4", "used_key_parts": ["l_orderkey"], "ref": ["dbt3_s001.orders.o_orderkey"], + "rowid_filter": { + "range": { + "key": "i_l_shipdate", + "used_key_parts": ["l_shipDATE"] + }, + "rows": 183, + "selectivity_pct": 3.04746045 + }, "rows": 4, "filtered": 3.047460556, "attached_condition": "lineitem.l_shipDATE between '1996-10-01' and '1996-12-01'" @@ -1465,8 +1481,8 @@ o_totaldiscount BETWEEN 18000 AND 20000 AND o_totalprice BETWEEN 200000 AND 220000 AND l_shipdate BETWEEN '1996-10-01' AND '1996-12-01'; id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra -1 SIMPLE orders range PRIMARY,i_o_totalprice,i_o_totaldiscount i_o_totaldiscount 9 NULL 41 41.00 3.33 2.44 Using index condition; Using where -1 SIMPLE lineitem ref PRIMARY,i_l_shipdate,i_l_orderkey,i_l_orderkey_quantity PRIMARY 4 dbt3_s001.orders.o_orderkey 4 6.00 3.05 66.67 Using where +1 SIMPLE orders range PRIMARY,i_o_totalprice,i_o_totaldiscount i_o_totaldiscount 9 NULL 41 41.00 100.00 2.44 Using index condition; Using where +1 SIMPLE lineitem ref|filter PRIMARY,i_l_shipdate,i_l_orderkey,i_l_orderkey_quantity i_l_orderkey|i_l_shipdate 4|4 dbt3_s001.orders.o_orderkey 4 (3%) 4.00 (66%) 3.05 100.00 Using where; Using rowid filter set statement optimizer_switch='rowid_filter=on' for ANALYZE FORMAT=JSON SELECT o_totaldiscount, o_totalprice, l_shipdate FROM orders, lineitem WHERE o_orderkey=l_orderkey AND @@ -1491,7 +1507,7 @@ ANALYZE "r_rows": 41, "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", - "filtered": 3.333333254, + "filtered": 100, "r_filtered": 2.43902439, "index_condition": "orders.o_totaldiscount between 18000 and 20000", "attached_condition": "orders.o_totalprice between 200000 and 220000" @@ -1505,17 +1521,29 @@ ANALYZE "i_l_orderkey", "i_l_orderkey_quantity" ], - "key": "PRIMARY", + "key": "i_l_orderkey", "key_length": "4", "used_key_parts": ["l_orderkey"], "ref": ["dbt3_s001.orders.o_orderkey"], + "rowid_filter": { + "range": { + "key": "i_l_shipdate", + "used_key_parts": ["l_shipDATE"] + }, + "rows": 183, + "selectivity_pct": 3.04746045, + "r_rows": 183, + "r_selectivity_pct": 66.66666667, + "r_buffer_size": "REPLACED", + "r_filling_time_ms": "REPLACED" + }, "r_loops": 1, "rows": 4, - "r_rows": 6, + "r_rows": 4, "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 3.047460556, - "r_filtered": 66.66666667, + "r_filtered": 100, "attached_condition": "lineitem.l_shipDATE between '1996-10-01' and '1996-12-01'" } } @@ -1558,7 +1586,7 @@ EXPLAIN "key_length": "9", "used_key_parts": ["o_totaldiscount"], "rows": 41, - "filtered": 3.333333254, + "filtered": 100, "index_condition": "orders.o_totaldiscount between 18000 and 20000", "attached_condition": "orders.o_totalprice between 200000 and 220000" }, @@ -1588,7 +1616,7 @@ o_totaldiscount BETWEEN 18000 AND 20000 AND o_totalprice BETWEEN 200000 AND 220000 AND l_shipdate BETWEEN '1996-10-01' AND '1996-12-01'; id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra -1 SIMPLE orders range PRIMARY,i_o_totalprice,i_o_totaldiscount i_o_totaldiscount 9 NULL 41 41.00 3.33 2.44 Using index condition; Using where +1 SIMPLE orders range PRIMARY,i_o_totalprice,i_o_totaldiscount i_o_totaldiscount 9 NULL 41 41.00 100.00 2.44 Using index condition; Using where 1 SIMPLE lineitem ref PRIMARY,i_l_shipdate,i_l_orderkey,i_l_orderkey_quantity PRIMARY 4 dbt3_s001.orders.o_orderkey 4 6.00 3.05 66.67 Using where set statement optimizer_switch='rowid_filter=off' for ANALYZE FORMAT=JSON SELECT o_totaldiscount, o_totalprice, l_shipdate FROM orders, lineitem @@ -1614,7 +1642,7 @@ ANALYZE "r_rows": 41, "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", - "filtered": 3.333333254, + "filtered": 100, "r_filtered": 2.43902439, "index_condition": "orders.o_totaldiscount between 18000 and 20000", "attached_condition": "orders.o_totalprice between 200000 and 220000" @@ -1665,7 +1693,7 @@ o_totalprice BETWEEN 200000 AND 220000 AND l_shipdate BETWEEN '1996-10-01' AND '1996-12-01'; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE orders range PRIMARY,i_o_orderdate,i_o_totalprice,i_o_totaldiscount i_o_totaldiscount 9 NULL 41 Using index condition; Using where -1 SIMPLE lineitem ref PRIMARY,i_l_shipdate,i_l_orderkey,i_l_orderkey_quantity PRIMARY 4 dbt3_s001.orders.o_orderkey 4 Using where +1 SIMPLE lineitem ref|filter PRIMARY,i_l_shipdate,i_l_orderkey,i_l_orderkey_quantity i_l_orderkey|i_l_shipdate 4|4 dbt3_s001.orders.o_orderkey 4 (3%) Using where; Using rowid filter set statement optimizer_switch='rowid_filter=on' for EXPLAIN FORMAT=JSON SELECT o_totaldiscount, o_totalprice, l_shipdate FROM v1, lineitem WHERE o_orderkey=l_orderkey AND @@ -1702,10 +1730,18 @@ EXPLAIN "i_l_orderkey", "i_l_orderkey_quantity" ], - "key": "PRIMARY", + "key": "i_l_orderkey", "key_length": "4", "used_key_parts": ["l_orderkey"], "ref": ["dbt3_s001.orders.o_orderkey"], + "rowid_filter": { + "range": { + "key": "i_l_shipdate", + "used_key_parts": ["l_shipDATE"] + }, + "rows": 183, + "selectivity_pct": 3.04746045 + }, "rows": 4, "filtered": "REPLACED", "attached_condition": "lineitem.l_shipDATE between '1996-10-01' and '1996-12-01'" @@ -1720,7 +1756,7 @@ o_totalprice BETWEEN 200000 AND 220000 AND l_shipdate BETWEEN '1996-10-01' AND '1996-12-01'; id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra 1 SIMPLE orders range PRIMARY,i_o_orderdate,i_o_totalprice,i_o_totaldiscount i_o_totaldiscount 9 NULL 41 41.00 # 2.44 Using index condition; Using where -1 SIMPLE lineitem ref PRIMARY,i_l_shipdate,i_l_orderkey,i_l_orderkey_quantity PRIMARY 4 dbt3_s001.orders.o_orderkey 4 6.00 # 66.67 Using where +1 SIMPLE lineitem ref|filter PRIMARY,i_l_shipdate,i_l_orderkey,i_l_orderkey_quantity i_l_orderkey|i_l_shipdate 4|4 dbt3_s001.orders.o_orderkey 4 (3%) 4.00 (66%) # 100.00 Using where; Using rowid filter set statement optimizer_switch='rowid_filter=on' for ANALYZE FORMAT=JSON SELECT o_totaldiscount, o_totalprice, l_shipdate FROM v1, lineitem WHERE o_orderkey=l_orderkey AND @@ -1764,17 +1800,29 @@ ANALYZE "i_l_orderkey", "i_l_orderkey_quantity" ], - "key": "PRIMARY", + "key": "i_l_orderkey", "key_length": "4", "used_key_parts": ["l_orderkey"], "ref": ["dbt3_s001.orders.o_orderkey"], + "rowid_filter": { + "range": { + "key": "i_l_shipdate", + "used_key_parts": ["l_shipDATE"] + }, + "rows": 183, + "selectivity_pct": 3.04746045, + "r_rows": 183, + "r_selectivity_pct": 66.66666667, + "r_buffer_size": "REPLACED", + "r_filling_time_ms": "REPLACED" + }, "r_loops": 1, "rows": 4, - "r_rows": 6, + "r_rows": 4, "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": "REPLACED", - "r_filtered": 66.66666667, + "r_filtered": 100, "attached_condition": "lineitem.l_shipDATE between '1996-10-01' and '1996-12-01'" } } @@ -2034,7 +2082,7 @@ EXPLAIN EXTENDED SELECT * FROM t1 INNER JOIN t2 ON ( pk1 <> pk2 AND pk1 = a2 ) WHERE b1 <= ( SELECT MAX(b2) FROM t2 WHERE pk2 <= 1 ); id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t2 ALL NULL NULL NULL NULL 101 100.00 Using where -1 PRIMARY t1 eq_ref PRIMARY,b1 PRIMARY 4 test.t2.a2 1 87.00 Using where +1 PRIMARY t1 eq_ref|filter PRIMARY,b1 PRIMARY|b1 4|4 test.t2.a2 1 (87%) 87.00 Using where; Using rowid filter 2 SUBQUERY t2 range PRIMARY PRIMARY 4 NULL 1 100.00 Using index condition Warnings: Note 1003 /* select#1 */ select `test`.`t1`.`pk1` AS `pk1`,`test`.`t1`.`a1` AS `a1`,`test`.`t1`.`b1` AS `b1`,`test`.`t2`.`pk2` AS `pk2`,`test`.`t2`.`a2` AS `a2`,`test`.`t2`.`b2` AS `b2` from `test`.`t1` join `test`.`t2` where `test`.`t1`.`pk1` = `test`.`t2`.`a2` and `test`.`t1`.`b1` <= (/* select#2 */ select max(`test`.`t2`.`b2`) from `test`.`t2` where `test`.`t2`.`pk2` <= 1) and `test`.`t2`.`a2` <> `test`.`t2`.`pk2` @@ -2059,6 +2107,14 @@ EXPLAIN "key_length": "4", "used_key_parts": ["pk1"], "ref": ["test.t2.a2"], + "rowid_filter": { + "range": { + "key": "b1", + "used_key_parts": ["b1"] + }, + "rows": 87, + "selectivity_pct": 87 + }, "rows": 1, "filtered": 87, "attached_condition": "t1.b1 <= (subquery#2)" @@ -2131,7 +2187,7 @@ INSERT INTO t1 VALUES (0,0),(1,0),(-1,1), (-2,1), (-2,3), (-3,4), (-2,4); explain SELECT * FROM t1 WHERE a > 0 AND b=0; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range|filter a,b a|b 5|5 NULL 1 (29%) Using index condition; Using where; Using rowid filter +1 SIMPLE t1 range a,b a 5 NULL 1 Using index condition; Using where SELECT * FROM t1 WHERE a > 0 AND b=0; a b 1 0 @@ -2174,8 +2230,8 @@ union ( select * from t1 where (f1 is null and f2 is null) and (f2 between 'a' and 'z' or f1 in ('a'))); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ref|filter f1,f2 f1|f1 13|13 const 1 (2%) Using index condition; Using where; Using rowid filter -2 UNION t1 ref|filter f1,f2 f1|f1 13|13 const 1 (2%) Using index condition; Using where; Using rowid filter +1 PRIMARY t1 index_merge f1,f2 f1,f2 13,33 NULL 1 Using intersect(f1,f2); Using where +2 UNION t1 index_merge f1,f2 f1,f2 13,33 NULL 1 Using intersect(f1,f2); Using where NULL UNION RESULT <union1,2> ALL NULL NULL NULL NULL NULL explain format=json ( select * from t1 where (f1 is null and f2 is null) and (f2 between 'a' and 'z' or f1 in ('a'))) @@ -2194,24 +2250,24 @@ EXPLAIN "select_id": 1, "table": { "table_name": "t1", - "access_type": "ref", + "access_type": "index_merge", "possible_keys": ["f1", "f2"], - "key": "f1", - "key_length": "13", - "used_key_parts": ["f1"], - "ref": ["const"], - "rowid_filter": { - "range": { - "key": "f1", - "used_key_parts": ["f1"] - }, - "rows": 1, - "selectivity_pct": 1.587301587 + "key_length": "13,33", + "index_merge": { + "intersect": { + "range": { + "key": "f1", + "used_key_parts": ["f1"] + }, + "range": { + "key": "f2", + "used_key_parts": ["f2"] + } + } }, "rows": 1, - "filtered": 1.587301612, - "index_condition": "t1.f1 is null", - "attached_condition": "t1.f2 is null and (t1.f2 between 'a' and 'z' or t1.f1 = 'a')" + "filtered": 100, + "attached_condition": "t1.f1 is null and t1.f2 is null and (t1.f2 between 'a' and 'z' or t1.f1 = 'a')" } } }, @@ -2221,24 +2277,24 @@ EXPLAIN "operation": "UNION", "table": { "table_name": "t1", - "access_type": "ref", + "access_type": "index_merge", "possible_keys": ["f1", "f2"], - "key": "f1", - "key_length": "13", - "used_key_parts": ["f1"], - "ref": ["const"], - "rowid_filter": { - "range": { - "key": "f1", - "used_key_parts": ["f1"] - }, - "rows": 1, - "selectivity_pct": 1.587301587 + "key_length": "13,33", + "index_merge": { + "intersect": { + "range": { + "key": "f1", + "used_key_parts": ["f1"] + }, + "range": { + "key": "f2", + "used_key_parts": ["f2"] + } + } }, "rows": 1, - "filtered": 1.587301612, - "index_condition": "t1.f1 is null", - "attached_condition": "t1.f2 is null and (t1.f2 between 'a' and 'z' or t1.f1 = 'a')" + "filtered": 100, + "attached_condition": "t1.f1 is null and t1.f2 is null and (t1.f2 between 'a' and 'z' or t1.f1 = 'a')" } } } @@ -2284,7 +2340,7 @@ count(*) 6 explain extended select count(*) from t1 where a in (22,83,11) and b=2; id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 range b,a a 5 NULL 33 5.90 Using index condition; Using where +1 SIMPLE t1 range b,a a 5 NULL 33 100.00 Using index condition; Using where Warnings: Note 1003 select count(0) AS `count(*)` from `test`.`t1` where `test`.`t1`.`b` = 2 and `test`.`t1`.`a` in (22,83,11) select * from t1 where a in (22,83,11) and b=2; @@ -2569,7 +2625,7 @@ WHERE 1 = 1 AND domain = 'www.mailhost.i-dev.fr' AND timestamp >= DATE_ADD(CURRENT_TIMESTAMP, INTERVAL -1 MONTH) ORDER BY timestamp DESC; id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 range|filter ixEventWhoisDomainDomain,ixEventWhoisDomainTimestamp ixEventWhoisDomainTimestamp|ixEventWhoisDomainDomain 4|767 NULL 1 (29%) 100.00 Using where; Using rowid filter +1 SIMPLE t1 range ixEventWhoisDomainDomain,ixEventWhoisDomainTimestamp ixEventWhoisDomainTimestamp 4 NULL 1 100.00 Using where Warnings: Note 1003 select `test`.`t1`.`id` AS `id`,`test`.`t1`.`domain` AS `domain`,`test`.`t1`.`registrant_name` AS `registrant_name`,`test`.`t1`.`registrant_organization` AS `registrant_organization`,`test`.`t1`.`registrant_street1` AS `registrant_street1`,`test`.`t1`.`registrant_street2` AS `registrant_street2`,`test`.`t1`.`registrant_street3` AS `registrant_street3`,`test`.`t1`.`registrant_street4` AS `registrant_street4`,`test`.`t1`.`registrant_street5` AS `registrant_street5`,`test`.`t1`.`registrant_city` AS `registrant_city`,`test`.`t1`.`registrant_postal_code` AS `registrant_postal_code`,`test`.`t1`.`registrant_country` AS `registrant_country`,`test`.`t1`.`registrant_email` AS `registrant_email`,`test`.`t1`.`registrant_telephone` AS `registrant_telephone`,`test`.`t1`.`administrative_name` AS `administrative_name`,`test`.`t1`.`administrative_organization` AS `administrative_organization`,`test`.`t1`.`administrative_street1` AS `administrative_street1`,`test`.`t1`.`administrative_street2` AS `administrative_street2`,`test`.`t1`.`administrative_street3` AS `administrative_street3`,`test`.`t1`.`administrative_street4` AS `administrative_street4`,`test`.`t1`.`administrative_street5` AS `administrative_street5`,`test`.`t1`.`administrative_city` AS `administrative_city`,`test`.`t1`.`administrative_postal_code` AS `administrative_postal_code`,`test`.`t1`.`administrative_country` AS `administrative_country`,`test`.`t1`.`administrative_email` AS `administrative_email`,`test`.`t1`.`administrative_telephone` AS `administrative_telephone`,`test`.`t1`.`technical_name` AS `technical_name`,`test`.`t1`.`technical_organization` AS `technical_organization`,`test`.`t1`.`technical_street1` AS `technical_street1`,`test`.`t1`.`technical_street2` AS `technical_street2`,`test`.`t1`.`technical_street3` AS `technical_street3`,`test`.`t1`.`technical_street4` AS `technical_street4`,`test`.`t1`.`technical_street5` AS `technical_street5`,`test`.`t1`.`technical_city` AS `technical_city`,`test`.`t1`.`technical_postal_code` AS `technical_postal_code`,`test`.`t1`.`technical_country` AS `technical_country`,`test`.`t1`.`technical_email` AS `technical_email`,`test`.`t1`.`technical_telephone` AS `technical_telephone`,`test`.`t1`.`json` AS `json`,`test`.`t1`.`timestamp` AS `timestamp` from `test`.`t1` where `test`.`t1`.`domain` = 'www.mailhost.i-dev.fr' and `test`.`t1`.`timestamp` >= <cache>(current_timestamp() + interval -1 month) order by `test`.`t1`.`timestamp` desc SET optimizer_switch=@save_optimizer_switch; @@ -2616,7 +2672,7 @@ SELECT * FROM t1 WHERE (a BETWEEN 9 AND 10 OR a IS NULL) AND (b BETWEEN 9 AND 10 OR b = 9) ORDER BY pk LIMIT 1; id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 index a,b PRIMARY 4 NULL 75 54.55 Using where +1 SIMPLE t1 index a,b PRIMARY 4 NULL 75 100.00 Using where Warnings: Note 1003 select `test`.`t1`.`pk` AS `pk`,`test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where (`test`.`t1`.`a` between 9 and 10 or `test`.`t1`.`a` is null) and (`test`.`t1`.`b` between 9 and 10 or `test`.`t1`.`b` = 9) order by `test`.`t1`.`pk` limit 1 ANALYZE @@ -2624,7 +2680,7 @@ SELECT * FROM t1 WHERE (a BETWEEN 9 AND 10 OR a IS NULL) AND (b BETWEEN 9 AND 10 OR b = 9) ORDER BY pk LIMIT 1; id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra -1 SIMPLE t1 index a,b PRIMARY 4 NULL 3008 3008.00 1.36 0.00 Using where +1 SIMPLE t1 index a,b PRIMARY 4 NULL 3008 3008.00 6.38 0.00 Using where DROP TABLE t1; SET global innodb_stats_persistent= @stats.save; # @@ -2784,7 +2840,7 @@ fi.fh in (6311439873746261694,-397087483897438286, id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t index_merge PRIMARY,acli_rid,acli_tp acli_tp,acli_rid 2,767 NULL 2 100.00 Using intersect(acli_tp,acli_rid); Using where; Using index 1 SIMPLE a ref PRIMARY,acei_aclid acei_aclid 8 test.t.id 1 100.00 Using where -1 SIMPLE fi ref|filter filt_aceid,filt_fh filt_aceid|filt_fh 8|8 test.a.id 1 (17%) 17.14 Using where; Using rowid filter +1 SIMPLE fi ref filt_aceid,filt_fh filt_aceid 8 test.a.id 1 17.14 Using where Warnings: Note 1003 select `test`.`t`.`id` AS `id`,`test`.`fi`.`id` AS `id`,`test`.`fi`.`aceid` AS `aceid`,`test`.`fi`.`clid` AS `clid`,`test`.`fi`.`fh` AS `fh` from `test`.`acli` `t` join `test`.`acei` `a` join `test`.`filt` `fi` where `test`.`t`.`tp` = 121 and `test`.`a`.`atp` = 1 and `test`.`fi`.`aceid` = `test`.`a`.`id` and `test`.`a`.`aclid` = `test`.`t`.`id` and `test`.`t`.`rid` = 'B5FCC8C7111E4E3CBC21AAF5012F59C2' and `test`.`fi`.`fh` in (6311439873746261694,-397087483897438286,8518228073041491534,-5420422472375069774) set statement optimizer_switch='rowid_filter=on' for select t.id, fi.* @@ -2840,7 +2896,7 @@ fi.fh in (6311439873746261694,-397087483897438286, id select_type table type possible_keys key key_len ref rows filtered Extra 1 SIMPLE t index_merge PRIMARY,acli_rid,acli_tp acli_tp,acli_rid 2,767 NULL 2 100.00 Using intersect(acli_tp,acli_rid); Using where; Using index 1 SIMPLE a ref PRIMARY,acei_aclid acei_aclid 8 test.t.id 1 100.00 Using where; Using join buffer (flat, BKA join); Rowid-ordered scan -1 SIMPLE fi ref|filter filt_aceid,filt_fh filt_aceid|filt_fh 8|8 test.a.id 1 (17%) 17.14 Using where; Using join buffer (incremental, BKA join); Rowid-ordered scan; Using rowid filter +1 SIMPLE fi ref filt_aceid,filt_fh filt_aceid 8 test.a.id 1 17.14 Using where; Using join buffer (incremental, BKA join); Rowid-ordered scan Warnings: Note 1003 select `test`.`t`.`id` AS `id`,`test`.`fi`.`id` AS `id`,`test`.`fi`.`aceid` AS `aceid`,`test`.`fi`.`clid` AS `clid`,`test`.`fi`.`fh` AS `fh` from `test`.`acli` `t` join `test`.`acei` `a` join `test`.`filt` `fi` where `test`.`t`.`tp` = 121 and `test`.`a`.`atp` = 1 and `test`.`fi`.`aceid` = `test`.`a`.`id` and `test`.`a`.`aclid` = `test`.`t`.`id` and `test`.`t`.`rid` = 'B5FCC8C7111E4E3CBC21AAF5012F59C2' and `test`.`fi`.`fh` in (6311439873746261694,-397087483897438286,8518228073041491534,-5420422472375069774) set statement optimizer_switch='rowid_filter=on' for select t.id, fi.* @@ -2930,21 +2986,9 @@ ANALYZE "key_length": "8", "used_key_parts": ["aceid"], "ref": ["test.a.id"], - "rowid_filter": { - "range": { - "key": "filt_fh", - "used_key_parts": ["fh"] - }, - "rows": 6, - "selectivity_pct": 17.14285714, - "r_rows": 5, - "r_selectivity_pct": 40, - "r_buffer_size": "REPLACED", - "r_filling_time_ms": "REPLACED" - }, "r_loops": 1, "rows": 1, - "r_rows": 2, + "r_rows": 5, "r_table_time_ms": "REPLACED", "r_other_time_ms": "REPLACED", "filtered": 17.1428566, @@ -2955,7 +2999,7 @@ ANALYZE "join_type": "BKA", "mrr_type": "Rowid-ordered scan", "attached_condition": "fi.fh in (6311439873746261694,-397087483897438286,8518228073041491534,-5420422472375069774)", - "r_filtered": 100 + "r_filtered": 40 } } } diff --git a/mysql-test/main/select.result b/mysql-test/main/select.result index dad1ce6b012..2104f78c3ac 100644 --- a/mysql-test/main/select.result +++ b/mysql-test/main/select.result @@ -3597,7 +3597,7 @@ CREATE TABLE t1(id int PRIMARY KEY, b int, e int); CREATE TABLE t2(i int, a int, INDEX si(i), INDEX ai(a)); CREATE TABLE t3(a int PRIMARY KEY, c char(4), INDEX ci(c)); INSERT INTO t1 VALUES -(1,10,19), (2,20,22), (4,41,42), (9,93,95), (7, 77,79), +(1,10,19), (2,20,22), (4,41,42), (9,39,95), (7, 77,79), (6,63,67), (5,55,58), (3,38,39), (8,81,89); INSERT INTO t2 VALUES (21,210), (41,410), (82,820), (83,830), (84,840), @@ -3625,6 +3625,14 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 const PRIMARY PRIMARY 4 const 1 1 SIMPLE t2 range si,ai si 5 NULL 4 Using index condition; Using where 1 SIMPLE t3 eq_ref|filter PRIMARY,ci PRIMARY|ci 4|5 test.t2.a 1 (30%) Using where; Using rowid filter +EXPLAIN +SELECT t3.a FROM t1,t2 FORCE INDEX (si),t3 +WHERE t1.id = 9 AND t2.i BETWEEN t1.b AND t1.e AND +t3.a=t2.a AND t3.c IN ('bb','ee'); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 const PRIMARY PRIMARY 4 const 1 +1 SIMPLE t2 range si si 5 NULL 13 Using index condition; Using where +1 SIMPLE t3 eq_ref|filter PRIMARY,ci PRIMARY|ci 4|5 test.t2.a 1 (30%) Using where; Using rowid filter EXPLAIN SELECT t3.a FROM t1,t2 FORCE INDEX (si),t3 WHERE t1.id = 8 AND (t2.i=t1.b OR t2.i=t1.e) AND t3.a=t2.a AND @@ -3717,7 +3725,7 @@ COUNT(*) EXPLAIN SELECT * FROM t1 WHERE ID_better=1 AND ID1_with_null IS NULL AND ID2_with_null=3 ; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref idx1,idx2 idx2 4 const 2 Using where +1 SIMPLE t1 index_merge idx1,idx2 idx2,idx1 4,10 NULL 1 Using intersect(idx2,idx1); Using where; Using index EXPLAIN SELECT * FROM t1 WHERE ID_better=1 AND ID1_with_null=3 AND ID2_with_null=3 IS NULL ; id select_type table type possible_keys key key_len ref rows Extra @@ -3731,7 +3739,7 @@ CREATE UNIQUE INDEX idx1 ON t1(ID1_with_null,ID2_with_null); EXPLAIN SELECT * FROM t1 WHERE ID_better=1 AND ID1_with_null IS NULL AND ID2_with_null=3 ; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref idx1,idx2 idx2 4 const 2 Using where +1 SIMPLE t1 index_merge idx1,idx2 idx2,idx1 4,10 NULL 1 Using intersect(idx2,idx1); Using where; Using index EXPLAIN SELECT * FROM t1 WHERE ID_better=1 AND ID1_with_null=3 AND ID2_with_null IS NULL ; id select_type table type possible_keys key key_len ref rows Extra @@ -3744,7 +3752,7 @@ EXPLAIN SELECT * FROM t1 WHERE ID_better=1 AND ID1_with_null IS NULL AND (ID2_with_null=1 OR ID2_with_null=2); id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref idx1,idx2 idx2 4 const 2 Using where +1 SIMPLE t1 ref|filter idx1,idx2 idx1|idx2 5|4 const 2 (1%) Using index condition; Using where; Using rowid filter DROP TABLE t1; CREATE TABLE t1 (a INT, ts TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, KEY ts(ts)); INSERT INTO t1 VALUES (30,"2006-01-03 23:00:00"), (31,"2006-01-03 23:00:00"); @@ -3765,7 +3773,7 @@ AND t1.ts BETWEEN t2.dt1 AND t2.dt2 AND t1.ts BETWEEN "2006-01-01" AND "2006-12-31"; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 const PRIMARY PRIMARY 4 const 1 -1 SIMPLE t1 range ts ts 4 NULL 2 Using index condition; Using where +1 SIMPLE t1 ALL ts NULL NULL NULL 2 Using where SELECT * FROM t1 LEFT JOIN t2 ON (t1.a=t2.a) WHERE t1.a=30 AND t1.ts BETWEEN t2.dt1 AND t2.dt2 AND t1.ts BETWEEN "2006-01-01" AND "2006-12-31"; @@ -4031,7 +4039,7 @@ EXPLAIN SELECT COUNT(*) FROM t1 f1 INNER JOIN t1 f2 ON ( f1.b=f2.b AND f1.a<f2.a ) WHERE 1 AND f1.b NOT IN (100,2232,3343,51111); id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE f1 range inx inx 5 NULL 7 Using where; Using index +1 SIMPLE f1 index inx inx 10 NULL 7 Using where; Using index 1 SIMPLE f2 ref inx inx 5 test.f1.b 1 Using where; Using index DROP TABLE t1; CREATE TABLE t1 (c1 INT, c2 INT); diff --git a/mysql-test/main/select.test b/mysql-test/main/select.test index b9891280c45..9d64d0b595c 100644 --- a/mysql-test/main/select.test +++ b/mysql-test/main/select.test @@ -1530,7 +1530,6 @@ INSERT INTO t4 (companynr, companyname) VALUES (68,'company 10'); INSERT INTO t4 (companynr, companyname) VALUES (50,'company 11'); INSERT INTO t4 (companynr, companyname) VALUES (00,'Unknown'); --enable_query_log - # # Test of stright join to force a full join. # @@ -3121,7 +3120,7 @@ CREATE TABLE t2(i int, a int, INDEX si(i), INDEX ai(a)); CREATE TABLE t3(a int PRIMARY KEY, c char(4), INDEX ci(c)); INSERT INTO t1 VALUES - (1,10,19), (2,20,22), (4,41,42), (9,93,95), (7, 77,79), + (1,10,19), (2,20,22), (4,41,42), (9,39,95), (7, 77,79), (6,63,67), (5,55,58), (3,38,39), (8,81,89); INSERT INTO t2 VALUES (21,210), (41,410), (82,820), (83,830), (84,840), @@ -3143,6 +3142,11 @@ SELECT t3.a FROM t1,t2,t3 WHERE t1.id = 8 AND t2.i BETWEEN t1.b AND t1.e AND t3.a=t2.a AND t3.c IN ('bb','ee') ; +EXPLAIN +SELECT t3.a FROM t1,t2 FORCE INDEX (si),t3 + WHERE t1.id = 9 AND t2.i BETWEEN t1.b AND t1.e AND + t3.a=t2.a AND t3.c IN ('bb','ee'); + EXPLAIN SELECT t3.a FROM t1,t2 FORCE INDEX (si),t3 WHERE t1.id = 8 AND (t2.i=t1.b OR t2.i=t1.e) AND t3.a=t2.a AND diff --git a/mysql-test/main/select_jcl6.result b/mysql-test/main/select_jcl6.result index 51d652fa245..b93ba17e174 100644 --- a/mysql-test/main/select_jcl6.result +++ b/mysql-test/main/select_jcl6.result @@ -1391,16 +1391,16 @@ id select_type table type possible_keys key key_len ref rows Extra delete from t2 where fld1=999999; explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where -1 SIMPLE t4 eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1 Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan +1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 Using where +1 SIMPLE t2 hash_ALL NULL #hash#$hj 1 test.t4.companynr 1199 Using where; Using join buffer (flat, BNLH join) explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 or t2.companynr < 0; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where -1 SIMPLE t4 eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1 Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan +1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 Using where +1 SIMPLE t2 hash_ALL NULL #hash#$hj 1 test.t4.companynr 1199 Using where; Using join buffer (flat, BNLH join) explain select t2.companynr,companyname from t4 left join t2 using (companynr) where t2.companynr > 0 and t4.companynr > 0; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t2 ALL NULL NULL NULL NULL 1199 Using where -1 SIMPLE t4 eq_ref PRIMARY PRIMARY 1 test.t2.companynr 1 Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan +1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 Using where +1 SIMPLE t2 hash_ALL NULL #hash#$hj 1 test.t4.companynr 1199 Using where; Using join buffer (flat, BNLH join) explain select companynr,companyname from t4 left join t2 using (companynr) where companynr > 0; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t4 ALL PRIMARY NULL NULL NULL 12 Using where @@ -3608,7 +3608,7 @@ CREATE TABLE t1(id int PRIMARY KEY, b int, e int); CREATE TABLE t2(i int, a int, INDEX si(i), INDEX ai(a)); CREATE TABLE t3(a int PRIMARY KEY, c char(4), INDEX ci(c)); INSERT INTO t1 VALUES -(1,10,19), (2,20,22), (4,41,42), (9,93,95), (7, 77,79), +(1,10,19), (2,20,22), (4,41,42), (9,39,95), (7, 77,79), (6,63,67), (5,55,58), (3,38,39), (8,81,89); INSERT INTO t2 VALUES (21,210), (41,410), (82,820), (83,830), (84,840), @@ -3636,6 +3636,14 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 const PRIMARY PRIMARY 4 const 1 1 SIMPLE t2 range si,ai si 5 NULL 4 Using index condition; Using where; Rowid-ordered scan 1 SIMPLE t3 eq_ref|filter PRIMARY,ci PRIMARY|ci 4|5 test.t2.a 1 (30%) Using where; Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan; Using rowid filter +EXPLAIN +SELECT t3.a FROM t1,t2 FORCE INDEX (si),t3 +WHERE t1.id = 9 AND t2.i BETWEEN t1.b AND t1.e AND +t3.a=t2.a AND t3.c IN ('bb','ee'); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 const PRIMARY PRIMARY 4 const 1 +1 SIMPLE t3 range PRIMARY,ci ci 5 NULL 6 Using index condition; Rowid-ordered scan +1 SIMPLE t2 hash_range si #hash#$hj:si 5:5 test.t3.a 13 Using where; Rowid-ordered scan; Using join buffer (flat, BNLH join) EXPLAIN SELECT t3.a FROM t1,t2 FORCE INDEX (si),t3 WHERE t1.id = 8 AND (t2.i=t1.b OR t2.i=t1.e) AND t3.a=t2.a AND @@ -3728,7 +3736,7 @@ COUNT(*) EXPLAIN SELECT * FROM t1 WHERE ID_better=1 AND ID1_with_null IS NULL AND ID2_with_null=3 ; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref idx1,idx2 idx2 4 const 2 Using where +1 SIMPLE t1 index_merge idx1,idx2 idx2,idx1 4,10 NULL 1 Using intersect(idx2,idx1); Using where; Using index EXPLAIN SELECT * FROM t1 WHERE ID_better=1 AND ID1_with_null=3 AND ID2_with_null=3 IS NULL ; id select_type table type possible_keys key key_len ref rows Extra @@ -3742,7 +3750,7 @@ CREATE UNIQUE INDEX idx1 ON t1(ID1_with_null,ID2_with_null); EXPLAIN SELECT * FROM t1 WHERE ID_better=1 AND ID1_with_null IS NULL AND ID2_with_null=3 ; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref idx1,idx2 idx2 4 const 2 Using where +1 SIMPLE t1 index_merge idx1,idx2 idx2,idx1 4,10 NULL 1 Using intersect(idx2,idx1); Using where; Using index EXPLAIN SELECT * FROM t1 WHERE ID_better=1 AND ID1_with_null=3 AND ID2_with_null IS NULL ; id select_type table type possible_keys key key_len ref rows Extra @@ -3755,7 +3763,7 @@ EXPLAIN SELECT * FROM t1 WHERE ID_better=1 AND ID1_with_null IS NULL AND (ID2_with_null=1 OR ID2_with_null=2); id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref idx1,idx2 idx2 4 const 2 Using where +1 SIMPLE t1 ref|filter idx1,idx2 idx1|idx2 5|4 const 2 (1%) Using index condition; Using where; Using rowid filter DROP TABLE t1; CREATE TABLE t1 (a INT, ts TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, KEY ts(ts)); INSERT INTO t1 VALUES (30,"2006-01-03 23:00:00"), (31,"2006-01-03 23:00:00"); @@ -3776,7 +3784,7 @@ AND t1.ts BETWEEN t2.dt1 AND t2.dt2 AND t1.ts BETWEEN "2006-01-01" AND "2006-12-31"; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 const PRIMARY PRIMARY 4 const 1 -1 SIMPLE t1 range ts ts 4 NULL 2 Using index condition; Using where; Rowid-ordered scan +1 SIMPLE t1 ALL ts NULL NULL NULL 2 Using where SELECT * FROM t1 LEFT JOIN t2 ON (t1.a=t2.a) WHERE t1.a=30 AND t1.ts BETWEEN t2.dt1 AND t2.dt2 AND t1.ts BETWEEN "2006-01-01" AND "2006-12-31"; @@ -4042,7 +4050,7 @@ EXPLAIN SELECT COUNT(*) FROM t1 f1 INNER JOIN t1 f2 ON ( f1.b=f2.b AND f1.a<f2.a ) WHERE 1 AND f1.b NOT IN (100,2232,3343,51111); id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE f1 range inx inx 5 NULL 7 Using where; Using index +1 SIMPLE f1 index inx inx 10 NULL 7 Using where; Using index 1 SIMPLE f2 ref inx inx 5 test.f1.b 1 Using where; Using index DROP TABLE t1; CREATE TABLE t1 (c1 INT, c2 INT); diff --git a/mysql-test/main/select_pkeycache.result b/mysql-test/main/select_pkeycache.result index dad1ce6b012..2104f78c3ac 100644 --- a/mysql-test/main/select_pkeycache.result +++ b/mysql-test/main/select_pkeycache.result @@ -3597,7 +3597,7 @@ CREATE TABLE t1(id int PRIMARY KEY, b int, e int); CREATE TABLE t2(i int, a int, INDEX si(i), INDEX ai(a)); CREATE TABLE t3(a int PRIMARY KEY, c char(4), INDEX ci(c)); INSERT INTO t1 VALUES -(1,10,19), (2,20,22), (4,41,42), (9,93,95), (7, 77,79), +(1,10,19), (2,20,22), (4,41,42), (9,39,95), (7, 77,79), (6,63,67), (5,55,58), (3,38,39), (8,81,89); INSERT INTO t2 VALUES (21,210), (41,410), (82,820), (83,830), (84,840), @@ -3625,6 +3625,14 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 const PRIMARY PRIMARY 4 const 1 1 SIMPLE t2 range si,ai si 5 NULL 4 Using index condition; Using where 1 SIMPLE t3 eq_ref|filter PRIMARY,ci PRIMARY|ci 4|5 test.t2.a 1 (30%) Using where; Using rowid filter +EXPLAIN +SELECT t3.a FROM t1,t2 FORCE INDEX (si),t3 +WHERE t1.id = 9 AND t2.i BETWEEN t1.b AND t1.e AND +t3.a=t2.a AND t3.c IN ('bb','ee'); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 const PRIMARY PRIMARY 4 const 1 +1 SIMPLE t2 range si si 5 NULL 13 Using index condition; Using where +1 SIMPLE t3 eq_ref|filter PRIMARY,ci PRIMARY|ci 4|5 test.t2.a 1 (30%) Using where; Using rowid filter EXPLAIN SELECT t3.a FROM t1,t2 FORCE INDEX (si),t3 WHERE t1.id = 8 AND (t2.i=t1.b OR t2.i=t1.e) AND t3.a=t2.a AND @@ -3717,7 +3725,7 @@ COUNT(*) EXPLAIN SELECT * FROM t1 WHERE ID_better=1 AND ID1_with_null IS NULL AND ID2_with_null=3 ; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref idx1,idx2 idx2 4 const 2 Using where +1 SIMPLE t1 index_merge idx1,idx2 idx2,idx1 4,10 NULL 1 Using intersect(idx2,idx1); Using where; Using index EXPLAIN SELECT * FROM t1 WHERE ID_better=1 AND ID1_with_null=3 AND ID2_with_null=3 IS NULL ; id select_type table type possible_keys key key_len ref rows Extra @@ -3731,7 +3739,7 @@ CREATE UNIQUE INDEX idx1 ON t1(ID1_with_null,ID2_with_null); EXPLAIN SELECT * FROM t1 WHERE ID_better=1 AND ID1_with_null IS NULL AND ID2_with_null=3 ; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref idx1,idx2 idx2 4 const 2 Using where +1 SIMPLE t1 index_merge idx1,idx2 idx2,idx1 4,10 NULL 1 Using intersect(idx2,idx1); Using where; Using index EXPLAIN SELECT * FROM t1 WHERE ID_better=1 AND ID1_with_null=3 AND ID2_with_null IS NULL ; id select_type table type possible_keys key key_len ref rows Extra @@ -3744,7 +3752,7 @@ EXPLAIN SELECT * FROM t1 WHERE ID_better=1 AND ID1_with_null IS NULL AND (ID2_with_null=1 OR ID2_with_null=2); id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref idx1,idx2 idx2 4 const 2 Using where +1 SIMPLE t1 ref|filter idx1,idx2 idx1|idx2 5|4 const 2 (1%) Using index condition; Using where; Using rowid filter DROP TABLE t1; CREATE TABLE t1 (a INT, ts TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, KEY ts(ts)); INSERT INTO t1 VALUES (30,"2006-01-03 23:00:00"), (31,"2006-01-03 23:00:00"); @@ -3765,7 +3773,7 @@ AND t1.ts BETWEEN t2.dt1 AND t2.dt2 AND t1.ts BETWEEN "2006-01-01" AND "2006-12-31"; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 const PRIMARY PRIMARY 4 const 1 -1 SIMPLE t1 range ts ts 4 NULL 2 Using index condition; Using where +1 SIMPLE t1 ALL ts NULL NULL NULL 2 Using where SELECT * FROM t1 LEFT JOIN t2 ON (t1.a=t2.a) WHERE t1.a=30 AND t1.ts BETWEEN t2.dt1 AND t2.dt2 AND t1.ts BETWEEN "2006-01-01" AND "2006-12-31"; @@ -4031,7 +4039,7 @@ EXPLAIN SELECT COUNT(*) FROM t1 f1 INNER JOIN t1 f2 ON ( f1.b=f2.b AND f1.a<f2.a ) WHERE 1 AND f1.b NOT IN (100,2232,3343,51111); id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE f1 range inx inx 5 NULL 7 Using where; Using index +1 SIMPLE f1 index inx inx 10 NULL 7 Using where; Using index 1 SIMPLE f2 ref inx inx 5 test.f1.b 1 Using where; Using index DROP TABLE t1; CREATE TABLE t1 (c1 INT, c2 INT); diff --git a/mysql-test/main/select_safe.result b/mysql-test/main/select_safe.result index 649e2dc484e..90ed1a4e785 100644 --- a/mysql-test/main/select_safe.result +++ b/mysql-test/main/select_safe.result @@ -74,8 +74,8 @@ id select_type table type possible_keys key key_len ref rows Extra set MAX_SEEKS_FOR_KEY=1; explain select STRAIGHT_JOIN * from t1,t1 as t2 where t1.b=t2.b; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ALL b NULL NULL NULL 11 -1 SIMPLE t2 ALL b NULL NULL NULL 11 Using where; Using join buffer (flat, BNL join) +1 SIMPLE t1 ALL b NULL NULL NULL 11 Using where +1 SIMPLE t2 ref b b 21 test.t1.b 5 SET MAX_SEEKS_FOR_KEY=DEFAULT; drop table t1; create table t1 (a int); diff --git a/mysql-test/main/selectivity.result b/mysql-test/main/selectivity.result index 9931ca7ddce..6bd3d871edd 100644 --- a/mysql-test/main/selectivity.result +++ b/mysql-test/main/selectivity.result @@ -541,8 +541,8 @@ limit 10; id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY nation ALL PRIMARY NULL NULL NULL 25 4.00 Using where; Using temporary; Using filesort 1 PRIMARY supplier ref PRIMARY,i_s_nationkey i_s_nationkey 5 dbt3_s001.nation.n_nationkey 1 100.00 -1 PRIMARY part ALL PRIMARY NULL NULL NULL 200 4.17 Using where; Start temporary; Using join buffer (flat, BNL join) -1 PRIMARY partsupp eq_ref PRIMARY,i_ps_partkey,i_ps_suppkey PRIMARY 8 dbt3_s001.part.p_partkey,dbt3_s001.supplier.s_suppkey 1 100.00 Using where; End temporary +1 PRIMARY part ALL PRIMARY NULL NULL NULL 200 4.17 Using where +1 PRIMARY partsupp eq_ref PRIMARY,i_ps_partkey,i_ps_suppkey PRIMARY 8 dbt3_s001.part.p_partkey,dbt3_s001.supplier.s_suppkey 1 100.00 Using where; FirstMatch(supplier) 4 DEPENDENT SUBQUERY lineitem ref i_l_shipdate,i_l_suppkey_partkey,i_l_partkey,i_l_suppkey i_l_suppkey_partkey 10 dbt3_s001.partsupp.ps_partkey,dbt3_s001.partsupp.ps_suppkey 8 15.14 Using where Warnings: Note 1276 Field or reference 'dbt3_s001.partsupp.ps_partkey' of SELECT #4 was resolved in SELECT #2 @@ -1661,7 +1661,7 @@ Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` # gives selectivity data explain extended select * from t1 where a in (17,51,5) and b=2; id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 range|filter b,a a|b 5|5 NULL 29 (6%) 5.80 Using index condition; Using where; Using rowid filter +1 SIMPLE t1 ref|filter b,a b|a 5|5 const 58 (3%) 2.90 Using where; Using rowid filter Warnings: Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where `test`.`t1`.`b` = 2 and `test`.`t1`.`a` in (17,51,5) drop table t1; @@ -1790,7 +1790,7 @@ set optimizer_use_condition_selectivity=2; explain extended select t1.b,t2.a,t3.a,t3.b from t1,t2,t3 where t1.c = t2.a AND t1.d = t3.a and t1.a = 50 and t1.b <= 100; id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 range a a 10 NULL 9 9.00 Using index condition; Using where +1 SIMPLE t1 range a a 10 NULL 9 100.00 Using index condition; Using where 1 SIMPLE t3 eq_ref PRIMARY PRIMARY 4 test.t1.d 1 100.00 1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t1.c 1 100.00 Using index Warnings: diff --git a/mysql-test/main/selectivity_innodb.result b/mysql-test/main/selectivity_innodb.result index 3bd03dfc289..d31c0c3cacd 100644 --- a/mysql-test/main/selectivity_innodb.result +++ b/mysql-test/main/selectivity_innodb.result @@ -82,13 +82,13 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY partsupp ref PRIMARY,i_ps_partkey,i_ps_suppkey PRIMARY 4 dbt3_s001.part.p_partkey 3 100.00 Using where 1 PRIMARY supplier eq_ref PRIMARY,i_s_nationkey PRIMARY 4 dbt3_s001.partsupp.ps_suppkey 1 100.00 Using where 1 PRIMARY nation eq_ref PRIMARY,i_n_regionkey PRIMARY 4 dbt3_s001.supplier.s_nationkey 1 100.00 Using where -2 DEPENDENT SUBQUERY region ALL PRIMARY NULL NULL NULL 5 20.00 Using where 2 DEPENDENT SUBQUERY partsupp ref PRIMARY,i_ps_partkey,i_ps_suppkey PRIMARY 4 dbt3_s001.part.p_partkey 3 100.00 2 DEPENDENT SUBQUERY supplier eq_ref PRIMARY,i_s_nationkey PRIMARY 4 dbt3_s001.partsupp.ps_suppkey 1 100.00 Using where 2 DEPENDENT SUBQUERY nation eq_ref PRIMARY,i_n_regionkey PRIMARY 4 dbt3_s001.supplier.s_nationkey 1 100.00 Using where +2 DEPENDENT SUBQUERY region eq_ref PRIMARY PRIMARY 4 dbt3_s001.nation.n_regionkey 1 20.00 Using where Warnings: Note 1276 Field or reference 'dbt3_s001.part.p_partkey' of SELECT #2 was resolved in SELECT #1 -Note 1003 /* select#1 */ select `dbt3_s001`.`supplier`.`s_acctbal` AS `s_acctbal`,`dbt3_s001`.`supplier`.`s_name` AS `s_name`,`dbt3_s001`.`nation`.`n_name` AS `n_name`,`dbt3_s001`.`part`.`p_partkey` AS `p_partkey`,`dbt3_s001`.`part`.`p_mfgr` AS `p_mfgr`,`dbt3_s001`.`supplier`.`s_address` AS `s_address`,`dbt3_s001`.`supplier`.`s_phone` AS `s_phone`,`dbt3_s001`.`supplier`.`s_comment` AS `s_comment` from `dbt3_s001`.`part` join `dbt3_s001`.`supplier` join `dbt3_s001`.`partsupp` join `dbt3_s001`.`nation` join `dbt3_s001`.`region` where `dbt3_s001`.`partsupp`.`ps_partkey` = `dbt3_s001`.`part`.`p_partkey` and `dbt3_s001`.`supplier`.`s_suppkey` = `dbt3_s001`.`partsupp`.`ps_suppkey` and `dbt3_s001`.`part`.`p_size` = 9 and `dbt3_s001`.`nation`.`n_nationkey` = `dbt3_s001`.`supplier`.`s_nationkey` and `dbt3_s001`.`nation`.`n_regionkey` = `dbt3_s001`.`region`.`r_regionkey` and `dbt3_s001`.`region`.`r_name` = 'ASIA' and `dbt3_s001`.`part`.`p_type` like '%TIN' and `dbt3_s001`.`partsupp`.`ps_supplycost` = <expr_cache><`dbt3_s001`.`part`.`p_partkey`>((/* select#2 */ select min(`dbt3_s001`.`partsupp`.`ps_supplycost`) from `dbt3_s001`.`partsupp` join `dbt3_s001`.`supplier` join `dbt3_s001`.`nation` join `dbt3_s001`.`region` where `dbt3_s001`.`supplier`.`s_suppkey` = `dbt3_s001`.`partsupp`.`ps_suppkey` and `dbt3_s001`.`nation`.`n_nationkey` = `dbt3_s001`.`supplier`.`s_nationkey` and `dbt3_s001`.`nation`.`n_regionkey` = `dbt3_s001`.`region`.`r_regionkey` and `dbt3_s001`.`region`.`r_name` = 'ASIA' and `dbt3_s001`.`part`.`p_partkey` = `dbt3_s001`.`partsupp`.`ps_partkey`)) order by `dbt3_s001`.`supplier`.`s_acctbal` desc,`dbt3_s001`.`nation`.`n_name`,`dbt3_s001`.`supplier`.`s_name`,`dbt3_s001`.`part`.`p_partkey` +Note 1003 /* select#1 */ select `dbt3_s001`.`supplier`.`s_acctbal` AS `s_acctbal`,`dbt3_s001`.`supplier`.`s_name` AS `s_name`,`dbt3_s001`.`nation`.`n_name` AS `n_name`,`dbt3_s001`.`part`.`p_partkey` AS `p_partkey`,`dbt3_s001`.`part`.`p_mfgr` AS `p_mfgr`,`dbt3_s001`.`supplier`.`s_address` AS `s_address`,`dbt3_s001`.`supplier`.`s_phone` AS `s_phone`,`dbt3_s001`.`supplier`.`s_comment` AS `s_comment` from `dbt3_s001`.`part` join `dbt3_s001`.`supplier` join `dbt3_s001`.`partsupp` join `dbt3_s001`.`nation` join `dbt3_s001`.`region` where `dbt3_s001`.`partsupp`.`ps_partkey` = `dbt3_s001`.`part`.`p_partkey` and `dbt3_s001`.`supplier`.`s_suppkey` = `dbt3_s001`.`partsupp`.`ps_suppkey` and `dbt3_s001`.`part`.`p_size` = 9 and `dbt3_s001`.`nation`.`n_nationkey` = `dbt3_s001`.`supplier`.`s_nationkey` and `dbt3_s001`.`nation`.`n_regionkey` = `dbt3_s001`.`region`.`r_regionkey` and `dbt3_s001`.`region`.`r_name` = 'ASIA' and `dbt3_s001`.`part`.`p_type` like '%TIN' and `dbt3_s001`.`partsupp`.`ps_supplycost` = <expr_cache><`dbt3_s001`.`part`.`p_partkey`>((/* select#2 */ select min(`dbt3_s001`.`partsupp`.`ps_supplycost`) from `dbt3_s001`.`partsupp` join `dbt3_s001`.`supplier` join `dbt3_s001`.`nation` join `dbt3_s001`.`region` where `dbt3_s001`.`supplier`.`s_suppkey` = `dbt3_s001`.`partsupp`.`ps_suppkey` and `dbt3_s001`.`nation`.`n_nationkey` = `dbt3_s001`.`supplier`.`s_nationkey` and `dbt3_s001`.`region`.`r_regionkey` = `dbt3_s001`.`nation`.`n_regionkey` and `dbt3_s001`.`region`.`r_name` = 'ASIA' and `dbt3_s001`.`part`.`p_partkey` = `dbt3_s001`.`partsupp`.`ps_partkey`)) order by `dbt3_s001`.`supplier`.`s_acctbal` desc,`dbt3_s001`.`nation`.`n_name`,`dbt3_s001`.`supplier`.`s_name`,`dbt3_s001`.`part`.`p_partkey` set optimizer_use_condition_selectivity=4; explain extended select @@ -123,13 +123,13 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY partsupp ref PRIMARY,i_ps_partkey,i_ps_suppkey PRIMARY 4 dbt3_s001.part.p_partkey 3 100.00 Using where 1 PRIMARY supplier eq_ref PRIMARY,i_s_nationkey PRIMARY 4 dbt3_s001.partsupp.ps_suppkey 1 100.00 Using where 1 PRIMARY nation eq_ref PRIMARY,i_n_regionkey PRIMARY 4 dbt3_s001.supplier.s_nationkey 1 100.00 Using where -2 DEPENDENT SUBQUERY region ALL PRIMARY NULL NULL NULL 5 20.00 Using where 2 DEPENDENT SUBQUERY partsupp ref PRIMARY,i_ps_partkey,i_ps_suppkey PRIMARY 4 dbt3_s001.part.p_partkey 3 100.00 2 DEPENDENT SUBQUERY supplier eq_ref PRIMARY,i_s_nationkey PRIMARY 4 dbt3_s001.partsupp.ps_suppkey 1 100.00 Using where 2 DEPENDENT SUBQUERY nation eq_ref PRIMARY,i_n_regionkey PRIMARY 4 dbt3_s001.supplier.s_nationkey 1 100.00 Using where +2 DEPENDENT SUBQUERY region eq_ref PRIMARY PRIMARY 4 dbt3_s001.nation.n_regionkey 1 20.00 Using where Warnings: Note 1276 Field or reference 'dbt3_s001.part.p_partkey' of SELECT #2 was resolved in SELECT #1 -Note 1003 /* select#1 */ select `dbt3_s001`.`supplier`.`s_acctbal` AS `s_acctbal`,`dbt3_s001`.`supplier`.`s_name` AS `s_name`,`dbt3_s001`.`nation`.`n_name` AS `n_name`,`dbt3_s001`.`part`.`p_partkey` AS `p_partkey`,`dbt3_s001`.`part`.`p_mfgr` AS `p_mfgr`,`dbt3_s001`.`supplier`.`s_address` AS `s_address`,`dbt3_s001`.`supplier`.`s_phone` AS `s_phone`,`dbt3_s001`.`supplier`.`s_comment` AS `s_comment` from `dbt3_s001`.`part` join `dbt3_s001`.`supplier` join `dbt3_s001`.`partsupp` join `dbt3_s001`.`nation` join `dbt3_s001`.`region` where `dbt3_s001`.`partsupp`.`ps_partkey` = `dbt3_s001`.`part`.`p_partkey` and `dbt3_s001`.`supplier`.`s_suppkey` = `dbt3_s001`.`partsupp`.`ps_suppkey` and `dbt3_s001`.`part`.`p_size` = 9 and `dbt3_s001`.`nation`.`n_nationkey` = `dbt3_s001`.`supplier`.`s_nationkey` and `dbt3_s001`.`nation`.`n_regionkey` = `dbt3_s001`.`region`.`r_regionkey` and `dbt3_s001`.`region`.`r_name` = 'ASIA' and `dbt3_s001`.`part`.`p_type` like '%TIN' and `dbt3_s001`.`partsupp`.`ps_supplycost` = <expr_cache><`dbt3_s001`.`part`.`p_partkey`>((/* select#2 */ select min(`dbt3_s001`.`partsupp`.`ps_supplycost`) from `dbt3_s001`.`partsupp` join `dbt3_s001`.`supplier` join `dbt3_s001`.`nation` join `dbt3_s001`.`region` where `dbt3_s001`.`supplier`.`s_suppkey` = `dbt3_s001`.`partsupp`.`ps_suppkey` and `dbt3_s001`.`nation`.`n_nationkey` = `dbt3_s001`.`supplier`.`s_nationkey` and `dbt3_s001`.`nation`.`n_regionkey` = `dbt3_s001`.`region`.`r_regionkey` and `dbt3_s001`.`region`.`r_name` = 'ASIA' and `dbt3_s001`.`part`.`p_partkey` = `dbt3_s001`.`partsupp`.`ps_partkey`)) order by `dbt3_s001`.`supplier`.`s_acctbal` desc,`dbt3_s001`.`nation`.`n_name`,`dbt3_s001`.`supplier`.`s_name`,`dbt3_s001`.`part`.`p_partkey` +Note 1003 /* select#1 */ select `dbt3_s001`.`supplier`.`s_acctbal` AS `s_acctbal`,`dbt3_s001`.`supplier`.`s_name` AS `s_name`,`dbt3_s001`.`nation`.`n_name` AS `n_name`,`dbt3_s001`.`part`.`p_partkey` AS `p_partkey`,`dbt3_s001`.`part`.`p_mfgr` AS `p_mfgr`,`dbt3_s001`.`supplier`.`s_address` AS `s_address`,`dbt3_s001`.`supplier`.`s_phone` AS `s_phone`,`dbt3_s001`.`supplier`.`s_comment` AS `s_comment` from `dbt3_s001`.`part` join `dbt3_s001`.`supplier` join `dbt3_s001`.`partsupp` join `dbt3_s001`.`nation` join `dbt3_s001`.`region` where `dbt3_s001`.`partsupp`.`ps_partkey` = `dbt3_s001`.`part`.`p_partkey` and `dbt3_s001`.`supplier`.`s_suppkey` = `dbt3_s001`.`partsupp`.`ps_suppkey` and `dbt3_s001`.`part`.`p_size` = 9 and `dbt3_s001`.`nation`.`n_nationkey` = `dbt3_s001`.`supplier`.`s_nationkey` and `dbt3_s001`.`nation`.`n_regionkey` = `dbt3_s001`.`region`.`r_regionkey` and `dbt3_s001`.`region`.`r_name` = 'ASIA' and `dbt3_s001`.`part`.`p_type` like '%TIN' and `dbt3_s001`.`partsupp`.`ps_supplycost` = <expr_cache><`dbt3_s001`.`part`.`p_partkey`>((/* select#2 */ select min(`dbt3_s001`.`partsupp`.`ps_supplycost`) from `dbt3_s001`.`partsupp` join `dbt3_s001`.`supplier` join `dbt3_s001`.`nation` join `dbt3_s001`.`region` where `dbt3_s001`.`supplier`.`s_suppkey` = `dbt3_s001`.`partsupp`.`ps_suppkey` and `dbt3_s001`.`nation`.`n_nationkey` = `dbt3_s001`.`supplier`.`s_nationkey` and `dbt3_s001`.`region`.`r_regionkey` = `dbt3_s001`.`nation`.`n_regionkey` and `dbt3_s001`.`region`.`r_name` = 'ASIA' and `dbt3_s001`.`part`.`p_partkey` = `dbt3_s001`.`partsupp`.`ps_partkey`)) order by `dbt3_s001`.`supplier`.`s_acctbal` desc,`dbt3_s001`.`nation`.`n_name`,`dbt3_s001`.`supplier`.`s_name`,`dbt3_s001`.`part`.`p_partkey` === Q15 === create view revenue0 (supplier_no, total_revenue) as select l_suppkey, sum(l_extendedprice * (1 - l_discount)) @@ -171,7 +171,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY supplier index PRIMARY PRIMARY 4 NULL 10 100.00 1 PRIMARY <derived3> ref key0 key0 5 dbt3_s001.supplier.s_suppkey 10 100.00 Using where 3 DERIVED lineitem range i_l_shipdate,i_l_suppkey i_l_shipdate 4 NULL 229 100.00 Using where; Using temporary; Using filesort -2 SUBQUERY <derived4> ALL NULL NULL NULL NULL 228 100.00 +2 SUBQUERY <derived4> ALL NULL NULL NULL NULL 229 100.00 4 DERIVED lineitem range i_l_shipdate i_l_shipdate 4 NULL 229 100.00 Using where; Using temporary; Using filesort Warnings: Note 1003 /* select#1 */ select `dbt3_s001`.`supplier`.`s_suppkey` AS `s_suppkey`,`dbt3_s001`.`supplier`.`s_name` AS `s_name`,`dbt3_s001`.`supplier`.`s_address` AS `s_address`,`dbt3_s001`.`supplier`.`s_phone` AS `s_phone`,`revenue0`.`total_revenue` AS `total_revenue` from `dbt3_s001`.`supplier` join `dbt3_s001`.`revenue0` where `revenue0`.`supplier_no` = `dbt3_s001`.`supplier`.`s_suppkey` and `revenue0`.`total_revenue` = (/* select#2 */ select max(`revenue0`.`total_revenue`) from `dbt3_s001`.`revenue0`) order by `dbt3_s001`.`supplier`.`s_suppkey` @@ -602,14 +602,13 @@ limit 10; id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY nation ALL PRIMARY NULL NULL NULL 25 4.00 Using where; Using temporary; Using filesort 1 PRIMARY supplier ref PRIMARY,i_s_nationkey i_s_nationkey 5 dbt3_s001.nation.n_nationkey 1 100.00 -1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 100.00 -2 MATERIALIZED part ALL PRIMARY NULL NULL NULL 200 7.03 Using where -2 MATERIALIZED partsupp ref PRIMARY,i_ps_partkey,i_ps_suppkey PRIMARY 4 dbt3_s001.part.p_partkey 3 100.00 Using where +1 PRIMARY part ALL PRIMARY NULL NULL NULL 200 7.03 Using where +1 PRIMARY partsupp eq_ref PRIMARY,i_ps_partkey,i_ps_suppkey PRIMARY 8 dbt3_s001.part.p_partkey,dbt3_s001.supplier.s_suppkey 1 100.00 Using where; FirstMatch(supplier) 4 DEPENDENT SUBQUERY lineitem ref i_l_shipdate,i_l_suppkey_partkey,i_l_partkey,i_l_suppkey i_l_suppkey_partkey 10 dbt3_s001.partsupp.ps_partkey,dbt3_s001.partsupp.ps_suppkey 8 14.40 Using where Warnings: Note 1276 Field or reference 'dbt3_s001.partsupp.ps_partkey' of SELECT #4 was resolved in SELECT #2 Note 1276 Field or reference 'dbt3_s001.partsupp.ps_suppkey' of SELECT #4 was resolved in SELECT #2 -Note 1003 /* select#1 */ select sql_calc_found_rows `dbt3_s001`.`supplier`.`s_name` AS `s_name`,`dbt3_s001`.`supplier`.`s_address` AS `s_address` from `dbt3_s001`.`supplier` semi join (`dbt3_s001`.`part` join `dbt3_s001`.`partsupp`) join `dbt3_s001`.`nation` where `dbt3_s001`.`supplier`.`s_nationkey` = `dbt3_s001`.`nation`.`n_nationkey` and `dbt3_s001`.`nation`.`n_name` = 'UNITED STATES' and `dbt3_s001`.`partsupp`.`ps_partkey` = `dbt3_s001`.`part`.`p_partkey` and `dbt3_s001`.`partsupp`.`ps_availqty` > <expr_cache><`dbt3_s001`.`partsupp`.`ps_partkey`,`dbt3_s001`.`partsupp`.`ps_suppkey`>((/* select#4 */ select 0.5 * sum(`dbt3_s001`.`lineitem`.`l_quantity`) from `dbt3_s001`.`lineitem` where `dbt3_s001`.`lineitem`.`l_partkey` = `dbt3_s001`.`partsupp`.`ps_partkey` and `dbt3_s001`.`lineitem`.`l_suppkey` = `dbt3_s001`.`partsupp`.`ps_suppkey` and `dbt3_s001`.`lineitem`.`l_shipDATE` >= <cache>(cast('1993-01-01' as date)) and `dbt3_s001`.`lineitem`.`l_shipDATE` < <cache>(cast('1993-01-01' as date) + interval '1' year))) and `dbt3_s001`.`part`.`p_name` like 'g%' order by `dbt3_s001`.`supplier`.`s_name` limit 10 +Note 1003 /* select#1 */ select sql_calc_found_rows `dbt3_s001`.`supplier`.`s_name` AS `s_name`,`dbt3_s001`.`supplier`.`s_address` AS `s_address` from `dbt3_s001`.`supplier` semi join (`dbt3_s001`.`part` join `dbt3_s001`.`partsupp`) join `dbt3_s001`.`nation` where `dbt3_s001`.`supplier`.`s_nationkey` = `dbt3_s001`.`nation`.`n_nationkey` and `dbt3_s001`.`nation`.`n_name` = 'UNITED STATES' and `dbt3_s001`.`partsupp`.`ps_partkey` = `dbt3_s001`.`part`.`p_partkey` and `dbt3_s001`.`partsupp`.`ps_suppkey` = `dbt3_s001`.`supplier`.`s_suppkey` and `dbt3_s001`.`partsupp`.`ps_availqty` > <expr_cache><`dbt3_s001`.`partsupp`.`ps_partkey`,`dbt3_s001`.`partsupp`.`ps_suppkey`>((/* select#4 */ select 0.5 * sum(`dbt3_s001`.`lineitem`.`l_quantity`) from `dbt3_s001`.`lineitem` where `dbt3_s001`.`lineitem`.`l_partkey` = `dbt3_s001`.`partsupp`.`ps_partkey` and `dbt3_s001`.`lineitem`.`l_suppkey` = `dbt3_s001`.`partsupp`.`ps_suppkey` and `dbt3_s001`.`lineitem`.`l_shipDATE` >= <cache>(cast('1993-01-01' as date)) and `dbt3_s001`.`lineitem`.`l_shipDATE` < <cache>(cast('1993-01-01' as date) + interval '1' year))) and `dbt3_s001`.`part`.`p_name` like 'g%' order by `dbt3_s001`.`supplier`.`s_name` limit 10 select sql_calc_found_rows s_name, s_address from supplier, nation @@ -658,14 +657,13 @@ limit 10; id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY nation ALL PRIMARY NULL NULL NULL 25 4.00 Using where; Using temporary; Using filesort 1 PRIMARY supplier ref PRIMARY,i_s_nationkey i_s_nationkey 5 dbt3_s001.nation.n_nationkey 1 100.00 -1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 100.00 -2 MATERIALIZED part ALL PRIMARY NULL NULL NULL 200 7.81 Using where -2 MATERIALIZED partsupp ref PRIMARY,i_ps_partkey,i_ps_suppkey PRIMARY 4 dbt3_s001.part.p_partkey 3 100.00 Using where +1 PRIMARY part ALL PRIMARY NULL NULL NULL 200 7.81 Using where +1 PRIMARY partsupp eq_ref PRIMARY,i_ps_partkey,i_ps_suppkey PRIMARY 8 dbt3_s001.part.p_partkey,dbt3_s001.supplier.s_suppkey 1 100.00 Using where; FirstMatch(supplier) 4 DEPENDENT SUBQUERY lineitem ref i_l_shipdate,i_l_suppkey_partkey,i_l_partkey,i_l_suppkey i_l_suppkey_partkey 10 dbt3_s001.partsupp.ps_partkey,dbt3_s001.partsupp.ps_suppkey 8 14.40 Using where Warnings: Note 1276 Field or reference 'dbt3_s001.partsupp.ps_partkey' of SELECT #4 was resolved in SELECT #2 Note 1276 Field or reference 'dbt3_s001.partsupp.ps_suppkey' of SELECT #4 was resolved in SELECT #2 -Note 1003 /* select#1 */ select sql_calc_found_rows `dbt3_s001`.`supplier`.`s_name` AS `s_name`,`dbt3_s001`.`supplier`.`s_address` AS `s_address` from `dbt3_s001`.`supplier` semi join (`dbt3_s001`.`part` join `dbt3_s001`.`partsupp`) join `dbt3_s001`.`nation` where `dbt3_s001`.`supplier`.`s_nationkey` = `dbt3_s001`.`nation`.`n_nationkey` and `dbt3_s001`.`nation`.`n_name` = 'UNITED STATES' and `dbt3_s001`.`partsupp`.`ps_partkey` = `dbt3_s001`.`part`.`p_partkey` and `dbt3_s001`.`partsupp`.`ps_availqty` > <expr_cache><`dbt3_s001`.`partsupp`.`ps_partkey`,`dbt3_s001`.`partsupp`.`ps_suppkey`>((/* select#4 */ select 0.5 * sum(`dbt3_s001`.`lineitem`.`l_quantity`) from `dbt3_s001`.`lineitem` where `dbt3_s001`.`lineitem`.`l_partkey` = `dbt3_s001`.`partsupp`.`ps_partkey` and `dbt3_s001`.`lineitem`.`l_suppkey` = `dbt3_s001`.`partsupp`.`ps_suppkey` and `dbt3_s001`.`lineitem`.`l_shipDATE` >= <cache>(cast('1993-01-01' as date)) and `dbt3_s001`.`lineitem`.`l_shipDATE` < <cache>(cast('1993-01-01' as date) + interval '1' year))) and `dbt3_s001`.`part`.`p_name` like 'g%' order by `dbt3_s001`.`supplier`.`s_name` limit 10 +Note 1003 /* select#1 */ select sql_calc_found_rows `dbt3_s001`.`supplier`.`s_name` AS `s_name`,`dbt3_s001`.`supplier`.`s_address` AS `s_address` from `dbt3_s001`.`supplier` semi join (`dbt3_s001`.`part` join `dbt3_s001`.`partsupp`) join `dbt3_s001`.`nation` where `dbt3_s001`.`supplier`.`s_nationkey` = `dbt3_s001`.`nation`.`n_nationkey` and `dbt3_s001`.`nation`.`n_name` = 'UNITED STATES' and `dbt3_s001`.`partsupp`.`ps_partkey` = `dbt3_s001`.`part`.`p_partkey` and `dbt3_s001`.`partsupp`.`ps_suppkey` = `dbt3_s001`.`supplier`.`s_suppkey` and `dbt3_s001`.`partsupp`.`ps_availqty` > <expr_cache><`dbt3_s001`.`partsupp`.`ps_partkey`,`dbt3_s001`.`partsupp`.`ps_suppkey`>((/* select#4 */ select 0.5 * sum(`dbt3_s001`.`lineitem`.`l_quantity`) from `dbt3_s001`.`lineitem` where `dbt3_s001`.`lineitem`.`l_partkey` = `dbt3_s001`.`partsupp`.`ps_partkey` and `dbt3_s001`.`lineitem`.`l_suppkey` = `dbt3_s001`.`partsupp`.`ps_suppkey` and `dbt3_s001`.`lineitem`.`l_shipDATE` >= <cache>(cast('1993-01-01' as date)) and `dbt3_s001`.`lineitem`.`l_shipDATE` < <cache>(cast('1993-01-01' as date) + interval '1' year))) and `dbt3_s001`.`part`.`p_name` like 'g%' order by `dbt3_s001`.`supplier`.`s_name` limit 10 select sql_calc_found_rows s_name, s_address from supplier, nation @@ -714,14 +712,13 @@ limit 10; id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY nation ALL PRIMARY NULL NULL NULL 25 4.00 Using where; Using temporary; Using filesort 1 PRIMARY supplier ref PRIMARY,i_s_nationkey i_s_nationkey 5 dbt3_s001.nation.n_nationkey 1 100.00 -1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 100.00 -2 MATERIALIZED part ALL PRIMARY NULL NULL NULL 200 7.81 Using where -2 MATERIALIZED partsupp ref PRIMARY,i_ps_partkey,i_ps_suppkey PRIMARY 4 dbt3_s001.part.p_partkey 3 100.00 Using where +1 PRIMARY part ALL PRIMARY NULL NULL NULL 200 7.81 Using where +1 PRIMARY partsupp eq_ref PRIMARY,i_ps_partkey,i_ps_suppkey PRIMARY 8 dbt3_s001.part.p_partkey,dbt3_s001.supplier.s_suppkey 1 100.00 Using where; FirstMatch(supplier) 4 DEPENDENT SUBQUERY lineitem ref i_l_shipdate,i_l_suppkey_partkey,i_l_partkey,i_l_suppkey i_l_suppkey_partkey 10 dbt3_s001.partsupp.ps_partkey,dbt3_s001.partsupp.ps_suppkey 8 14.40 Using where Warnings: Note 1276 Field or reference 'dbt3_s001.partsupp.ps_partkey' of SELECT #4 was resolved in SELECT #2 Note 1276 Field or reference 'dbt3_s001.partsupp.ps_suppkey' of SELECT #4 was resolved in SELECT #2 -Note 1003 /* select#1 */ select sql_calc_found_rows `dbt3_s001`.`supplier`.`s_name` AS `s_name`,`dbt3_s001`.`supplier`.`s_address` AS `s_address` from `dbt3_s001`.`supplier` semi join (`dbt3_s001`.`part` join `dbt3_s001`.`partsupp`) join `dbt3_s001`.`nation` where `dbt3_s001`.`supplier`.`s_nationkey` = `dbt3_s001`.`nation`.`n_nationkey` and `dbt3_s001`.`nation`.`n_name` = 'UNITED STATES' and `dbt3_s001`.`partsupp`.`ps_partkey` = `dbt3_s001`.`part`.`p_partkey` and `dbt3_s001`.`partsupp`.`ps_availqty` > <expr_cache><`dbt3_s001`.`partsupp`.`ps_partkey`,`dbt3_s001`.`partsupp`.`ps_suppkey`>((/* select#4 */ select 0.5 * sum(`dbt3_s001`.`lineitem`.`l_quantity`) from `dbt3_s001`.`lineitem` where `dbt3_s001`.`lineitem`.`l_partkey` = `dbt3_s001`.`partsupp`.`ps_partkey` and `dbt3_s001`.`lineitem`.`l_suppkey` = `dbt3_s001`.`partsupp`.`ps_suppkey` and `dbt3_s001`.`lineitem`.`l_shipDATE` >= <cache>(cast('1993-01-01' as date)) and `dbt3_s001`.`lineitem`.`l_shipDATE` < <cache>(cast('1993-01-01' as date) + interval '1' year))) and `dbt3_s001`.`part`.`p_name` like 'g%' order by `dbt3_s001`.`supplier`.`s_name` limit 10 +Note 1003 /* select#1 */ select sql_calc_found_rows `dbt3_s001`.`supplier`.`s_name` AS `s_name`,`dbt3_s001`.`supplier`.`s_address` AS `s_address` from `dbt3_s001`.`supplier` semi join (`dbt3_s001`.`part` join `dbt3_s001`.`partsupp`) join `dbt3_s001`.`nation` where `dbt3_s001`.`supplier`.`s_nationkey` = `dbt3_s001`.`nation`.`n_nationkey` and `dbt3_s001`.`nation`.`n_name` = 'UNITED STATES' and `dbt3_s001`.`partsupp`.`ps_partkey` = `dbt3_s001`.`part`.`p_partkey` and `dbt3_s001`.`partsupp`.`ps_suppkey` = `dbt3_s001`.`supplier`.`s_suppkey` and `dbt3_s001`.`partsupp`.`ps_availqty` > <expr_cache><`dbt3_s001`.`partsupp`.`ps_partkey`,`dbt3_s001`.`partsupp`.`ps_suppkey`>((/* select#4 */ select 0.5 * sum(`dbt3_s001`.`lineitem`.`l_quantity`) from `dbt3_s001`.`lineitem` where `dbt3_s001`.`lineitem`.`l_partkey` = `dbt3_s001`.`partsupp`.`ps_partkey` and `dbt3_s001`.`lineitem`.`l_suppkey` = `dbt3_s001`.`partsupp`.`ps_suppkey` and `dbt3_s001`.`lineitem`.`l_shipDATE` >= <cache>(cast('1993-01-01' as date)) and `dbt3_s001`.`lineitem`.`l_shipDATE` < <cache>(cast('1993-01-01' as date) + interval '1' year))) and `dbt3_s001`.`part`.`p_name` like 'g%' order by `dbt3_s001`.`supplier`.`s_name` limit 10 select sql_calc_found_rows s_name, s_address from supplier, nation @@ -808,10 +805,9 @@ explain extended select * from t1 where a in ( select b from t2 ) AND ( a > 3 ); id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 1 100.00 Using where -1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 100.00 -2 MATERIALIZED t2 ALL NULL NULL NULL NULL 2 100.00 +1 PRIMARY t2 ALL NULL NULL NULL NULL 2 100.00 Using where; FirstMatch(t1); Using join buffer (flat, BNL join) Warnings: -Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` semi join (`test`.`t2`) where `test`.`t1`.`a` > 3 +Note 1003 select `test`.`t1`.`a` AS `a` from `test`.`t1` semi join (`test`.`t2`) where `test`.`t2`.`b` = `test`.`t1`.`a` and `test`.`t1`.`a` > 3 select * from t1 where a in ( select b from t2 ) AND ( a > 3 ); a drop table t1,t2; @@ -1673,7 +1669,7 @@ Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` # gives selectivity data explain extended select * from t1 where a in (17,51,5) and b=2; id select_type table type possible_keys key key_len ref rows filtered Extra -1 SIMPLE t1 range|filter b,a a|b 5|5 NULL 29 (6%) 5.90 Using index condition; Using where; Using rowid filter +1 SIMPLE t1 ref|filter b,a b|a 5|5 const 59 (3%) 2.90 Using where; Using rowid filter Warnings: Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t1` where `test`.`t1`.`b` = 2 and `test`.`t1`.`a` in (17,51,5) drop table t1; diff --git a/mysql-test/main/selectivity_no_engine.result b/mysql-test/main/selectivity_no_engine.result index 3811b12a1be..d8c2b83df2e 100644 --- a/mysql-test/main/selectivity_no_engine.result +++ b/mysql-test/main/selectivity_no_engine.result @@ -237,7 +237,7 @@ explain select * from t1,t2 where t1.id = t2.t1_id and t2.f2='qux' and t2.f1='baz'; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t2 ref f1 f1 325 const,const 2 Using index condition; Using where -1 SIMPLE t1 eq_ref PRIMARY PRIMARY 122 test.t2.t1_id 1 +1 SIMPLE t1 ALL PRIMARY NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join) select * from t1,t2 where t1.id = t2.t1_id and t2.f2='qux' and t2.f1='baz'; id dt t1_id f1 f2 foo 2011-04-12 05:18:08 foo baz qux diff --git a/mysql-test/main/show_explain.result b/mysql-test/main/show_explain.result index 317a12ef311..8fd4c828bdc 100644 --- a/mysql-test/main/show_explain.result +++ b/mysql-test/main/show_explain.result @@ -28,7 +28,7 @@ select count(*) from t1 where a < 100000; connection default; show explain for $thr2; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range a a 5 NULL 999 Using where; Using index +1 SIMPLE t1 index a a 5 NULL 1000 Using where; Using index Warnings: Note 1003 select count(*) from t1 where a < 100000 connection con1; @@ -620,8 +620,8 @@ SELECT * FROM t2 WHERE (5, 78) IN (SELECT `a1`, MAX(`a1`) FROM t2 GROUP BY `a1`) connection default; show explain for $thr2; id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t2 ALL NULL NULL NULL NULL 20 1 PRIMARY <subquery2> const distinct_key distinct_key 8 const,const 1 -1 PRIMARY t2 ALL NULL NULL NULL NULL 20 Using join buffer (flat, BNL join) 2 MATERIALIZED t2 index NULL a1 4 NULL 20 Using index Warnings: Note 1003 SELECT * FROM t2 WHERE (5, 78) IN (SELECT `a1`, MAX(`a1`) FROM t2 GROUP BY `a1`) diff --git a/mysql-test/main/single_delete_update.result b/mysql-test/main/single_delete_update.result index 1f0299ac0fc..6a17895ef8a 100644 --- a/mysql-test/main/single_delete_update.result +++ b/mysql-test/main/single_delete_update.result @@ -151,19 +151,19 @@ Variable_name Value Sort_merge_passes 0 Sort_priority_queue_sorts 0 Sort_range 0 -Sort_rows 1 -Sort_scan 1 +Sort_rows 0 +Sort_scan 0 SHOW STATUS LIKE 'Handler_read_%'; Variable_name Value -Handler_read_first 0 +Handler_read_first 1 Handler_read_key 0 Handler_read_last 0 -Handler_read_next 0 +Handler_read_next 16 Handler_read_prev 0 Handler_read_retry 0 -Handler_read_rnd 1 +Handler_read_rnd 0 Handler_read_rnd_deleted 0 -Handler_read_rnd_next 17 +Handler_read_rnd_next 0 ## should be 5 (previous LIMIT) SELECT 1 - COUNT(*) FROM t2 WHERE b = 10; 1 - COUNT(*) @@ -332,6 +332,7 @@ DROP TABLE t2; # CREATE TABLE t2 (i INT, key1 INT, key2 INT, INDEX (key1), INDEX (key2)); INSERT INTO t2 (key1, key2) SELECT i, i FROM t1; +INSERT INTO t2 (key1, key2) SELECT i+100, i+100 FROM t1; FLUSH STATUS; SELECT * FROM t2 WHERE key1 < 13 or key2 < 14 ORDER BY key1; i key1 key2 @@ -754,21 +755,21 @@ UPDATE t2 SET d = 10 WHERE b = 10 ORDER BY a, c LIMIT 5; SHOW SESSION STATUS LIKE 'Sort%'; Variable_name Value Sort_merge_passes 0 -Sort_priority_queue_sorts 1 +Sort_priority_queue_sorts 0 Sort_range 0 -Sort_rows 1 -Sort_scan 1 +Sort_rows 0 +Sort_scan 0 SHOW STATUS LIKE 'Handler_read_%'; Variable_name Value -Handler_read_first 0 +Handler_read_first 1 Handler_read_key 0 Handler_read_last 0 -Handler_read_next 0 +Handler_read_next 16 Handler_read_prev 0 Handler_read_retry 0 Handler_read_rnd 1 Handler_read_rnd_deleted 0 -Handler_read_rnd_next 17 +Handler_read_rnd_next 0 ## should be 5 (previous LIMIT) SELECT COUNT(*) FROM t2 WHERE b = 10 AND d = 10 ORDER BY a, c; COUNT(*) @@ -939,6 +940,7 @@ DROP TABLE t2; # CREATE TABLE t2 (i INT, key1 INT, key2 INT, INDEX (key1), INDEX (key2)); INSERT INTO t2 (key1, key2) SELECT i, i FROM t1; +INSERT INTO t2 (key1, key2) SELECT i+100, i+100 FROM t1; FLUSH STATUS; SELECT * FROM t2 WHERE key1 < 13 or key2 < 14 ORDER BY key1; i key1 key2 diff --git a/mysql-test/main/single_delete_update.test b/mysql-test/main/single_delete_update.test index ec939641ea3..d8a8ff1918b 100644 --- a/mysql-test/main/single_delete_update.test +++ b/mysql-test/main/single_delete_update.test @@ -143,6 +143,7 @@ DROP TABLE t2; CREATE TABLE t2 (i INT, key1 INT, key2 INT, INDEX (key1), INDEX (key2)); INSERT INTO t2 (key1, key2) SELECT i, i FROM t1; +INSERT INTO t2 (key1, key2) SELECT i+100, i+100 FROM t1; FLUSH STATUS; SELECT * FROM t2 WHERE key1 < 13 or key2 < 14 ORDER BY key1; @@ -368,6 +369,7 @@ DROP TABLE t2; CREATE TABLE t2 (i INT, key1 INT, key2 INT, INDEX (key1), INDEX (key2)); INSERT INTO t2 (key1, key2) SELECT i, i FROM t1; +INSERT INTO t2 (key1, key2) SELECT i+100, i+100 FROM t1; FLUSH STATUS; SELECT * FROM t2 WHERE key1 < 13 or key2 < 14 ORDER BY key1; diff --git a/mysql-test/main/stat_tables.result b/mysql-test/main/stat_tables.result index a753aaa2e5d..35659bc0076 100644 --- a/mysql-test/main/stat_tables.result +++ b/mysql-test/main/stat_tables.result @@ -852,6 +852,7 @@ set histogram_size=0; # create table t1 (a int, b int); insert into t1(a,b) values (1,2),(1,3),(1,4),(1,5),(2,6),(2,7),(3,8),(3,9),(3,9),(4,10); +insert into t1 select seq,seq from seq_10_to_100; set use_stat_tables= preferably_for_queries; # # with use_stat_tables= PREFERABLY_FOR_QUERIES @@ -865,7 +866,7 @@ db_name table_name column_name min_value max_value nulls_ratio avg_length avg_fr analyze select * from t1 where a = 1 and b=3; id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 10 10.00 100.00 10.00 Using where +1 SIMPLE t1 ALL NULL NULL NULL NULL 101 101.00 100.00 0.99 Using where # # with use_stat_tables= PREFERABLY_FOR_QUERIES # analyze table t1 will collect statistics if we use PERSISTENT @@ -877,12 +878,12 @@ test.t1 analyze status Engine-independent statistics collected test.t1 analyze status Table is already up to date select * from mysql.column_stats; db_name table_name column_name min_value max_value nulls_ratio avg_length avg_frequency hist_size hist_type histogram -test t1 a 1 4 0.0000 4.0000 2.5000 0 NULL NULL +test t1 a 1 100 0.0000 4.0000 1.0632 0 NULL NULL # filtered shows that we used the data from stat tables analyze select * from t1 where a = 1 and b=3; id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 10 10.00 25.00 10.00 Using where +1 SIMPLE t1 ALL NULL NULL NULL NULL 101 101.00 1.05 0.99 Using where # # with use_stat_tables= PREFERABLY # analyze table t1 will collect statistics @@ -894,13 +895,13 @@ test.t1 analyze status Engine-independent statistics collected test.t1 analyze status Table is already up to date select * from mysql.column_stats; db_name table_name column_name min_value max_value nulls_ratio avg_length avg_frequency hist_size hist_type histogram -test t1 a 1 4 0.0000 4.0000 2.5000 0 NULL NULL -test t1 b 2 10 0.0000 4.0000 1.1111 0 NULL NULL +test t1 a 1 100 0.0000 4.0000 1.0632 0 NULL NULL +test t1 b 2 100 0.0000 4.0000 1.0202 0 NULL NULL # filtered shows that we used the data from stat tables analyze select * from t1 where a=1 and b=3; id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 10 10.00 10.00 10.00 Using where +1 SIMPLE t1 ALL NULL NULL NULL NULL 101 101.00 0.99 0.99 Using where drop table t1; set @@global.histogram_size=@save_histogram_size; # End of 10.4 tests diff --git a/mysql-test/main/stat_tables.test b/mysql-test/main/stat_tables.test index 9955908bd60..48d0e913079 100644 --- a/mysql-test/main/stat_tables.test +++ b/mysql-test/main/stat_tables.test @@ -1,5 +1,6 @@ --source include/have_stat_tables.inc --source include/have_partition.inc +--source include/have_sequence.inc select @@global.use_stat_tables; select @@session.use_stat_tables; @@ -598,6 +599,7 @@ set histogram_size=0; create table t1 (a int, b int); insert into t1(a,b) values (1,2),(1,3),(1,4),(1,5),(2,6),(2,7),(3,8),(3,9),(3,9),(4,10); +insert into t1 select seq,seq from seq_10_to_100; set use_stat_tables= preferably_for_queries; --echo # --echo # with use_stat_tables= PREFERABLY_FOR_QUERIES diff --git a/mysql-test/main/stat_tables_innodb.result b/mysql-test/main/stat_tables_innodb.result index 732300e70e1..f874f6a0ff6 100644 --- a/mysql-test/main/stat_tables_innodb.result +++ b/mysql-test/main/stat_tables_innodb.result @@ -251,7 +251,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE n2 eq_ref PRIMARY PRIMARY 4 dbt3_s001.supplier.s_nationkey 1 1 SIMPLE orders eq_ref PRIMARY,i_o_orderdate,i_o_custkey PRIMARY 4 dbt3_s001.lineitem.l_orderkey 1 Using where 1 SIMPLE customer eq_ref PRIMARY,i_c_nationkey PRIMARY 4 dbt3_s001.orders.o_custkey 1 Using where -1 SIMPLE n1 eq_ref PRIMARY,i_n_regionkey PRIMARY 4 dbt3_s001.customer.c_nationkey 1 Using where +1 SIMPLE n1 eq_ref PRIMARY,i_n_regionkey i_n_regionkey 9 dbt3_s001.region.r_regionkey,dbt3_s001.customer.c_nationkey 1 Using index select o_year, sum(case when nation = 'UNITED STATES' then volume else 0 end) / sum(volume) as mkt_share @@ -884,6 +884,7 @@ set histogram_size=0; # create table t1 (a int, b int); insert into t1(a,b) values (1,2),(1,3),(1,4),(1,5),(2,6),(2,7),(3,8),(3,9),(3,9),(4,10); +insert into t1 select seq,seq from seq_10_to_100; set use_stat_tables= preferably_for_queries; # # with use_stat_tables= PREFERABLY_FOR_QUERIES @@ -897,7 +898,7 @@ db_name table_name column_name min_value max_value nulls_ratio avg_length avg_fr analyze select * from t1 where a = 1 and b=3; id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 10 10.00 100.00 10.00 Using where +1 SIMPLE t1 ALL NULL NULL NULL NULL 101 101.00 100.00 0.99 Using where # # with use_stat_tables= PREFERABLY_FOR_QUERIES # analyze table t1 will collect statistics if we use PERSISTENT @@ -909,12 +910,12 @@ test.t1 analyze status Engine-independent statistics collected test.t1 analyze status OK select * from mysql.column_stats; db_name table_name column_name min_value max_value nulls_ratio avg_length avg_frequency hist_size hist_type histogram -test t1 a 1 4 0.0000 4.0000 2.5000 0 NULL NULL +test t1 a 1 100 0.0000 4.0000 1.0632 0 NULL NULL # filtered shows that we used the data from stat tables analyze select * from t1 where a = 1 and b=3; id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 10 10.00 25.00 10.00 Using where +1 SIMPLE t1 ALL NULL NULL NULL NULL 101 101.00 1.05 0.99 Using where # # with use_stat_tables= PREFERABLY # analyze table t1 will collect statistics @@ -926,13 +927,13 @@ test.t1 analyze status Engine-independent statistics collected test.t1 analyze status OK select * from mysql.column_stats; db_name table_name column_name min_value max_value nulls_ratio avg_length avg_frequency hist_size hist_type histogram -test t1 a 1 4 0.0000 4.0000 2.5000 0 NULL NULL -test t1 b 2 10 0.0000 4.0000 1.1111 0 NULL NULL +test t1 a 1 100 0.0000 4.0000 1.0632 0 NULL NULL +test t1 b 2 100 0.0000 4.0000 1.0202 0 NULL NULL # filtered shows that we used the data from stat tables analyze select * from t1 where a=1 and b=3; id select_type table type possible_keys key key_len ref rows r_rows filtered r_filtered Extra -1 SIMPLE t1 ALL NULL NULL NULL NULL 10 10.00 10.00 10.00 Using where +1 SIMPLE t1 ALL NULL NULL NULL NULL 101 101.00 0.99 0.99 Using where drop table t1; set @@global.histogram_size=@save_histogram_size; # End of 10.4 tests diff --git a/mysql-test/main/status.result b/mysql-test/main/status.result index 7b177b63727..21874b4d2d7 100644 --- a/mysql-test/main/status.result +++ b/mysql-test/main/status.result @@ -71,10 +71,10 @@ a 6 show status like 'last_query_cost'; Variable_name Value -Last_query_cost 22.084449 +Last_query_cost 16.042725 show status like 'last_query_cost'; Variable_name Value -Last_query_cost 22.084449 +Last_query_cost 16.042725 select 1; 1 1 @@ -134,13 +134,13 @@ a 1 SHOW SESSION STATUS LIKE 'Last_query_cost'; Variable_name Value -Last_query_cost 2.802418 +Last_query_cost 1.601709 EXPLAIN SELECT a FROM t1; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 2 SHOW SESSION STATUS LIKE 'Last_query_cost'; Variable_name Value -Last_query_cost 2.802418 +Last_query_cost 1.601709 SELECT a FROM t1 UNION SELECT a FROM t1 ORDER BY a; a 1 @@ -173,7 +173,7 @@ a a 1 1 SHOW SESSION STATUS LIKE 'Last_query_cost'; Variable_name Value -Last_query_cost 6.805836 +Last_query_cost 4.203418 DROP TABLE t1; connect con1,localhost,root,,; show status like 'com_show_status'; diff --git a/mysql-test/main/subselect.result b/mysql-test/main/subselect.result index bda01f7fe5f..1d9c165b150 100644 --- a/mysql-test/main/subselect.result +++ b/mysql-test/main/subselect.result @@ -922,10 +922,10 @@ a t1.a in (select t2.a from t2,t3 where t3.a=t2.a) explain extended SELECT t1.a, t1.a in (select t2.a from t2,t3 where t3.a=t2.a) FROM t1; id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 index NULL PRIMARY 4 NULL 4 100.00 Using index -2 DEPENDENT SUBQUERY t2 ref_or_null a a 5 func 2 100.00 Using where; Using index -2 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (flat, BNL join) +2 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 3 100.00 +2 DEPENDENT SUBQUERY t2 index a a 5 NULL 3 75.00 Using where; Using index; Using join buffer (flat, BNL join) Warnings: -Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,<expr_cache><`test`.`t1`.`a`>(<in_optimizer>(`test`.`t1`.`a`,<exists>(/* select#2 */ select `test`.`t2`.`a` from `test`.`t2` join `test`.`t3` where `test`.`t3`.`a` = `test`.`t2`.`a` and (<cache>(`test`.`t1`.`a`) = `test`.`t2`.`a` or `test`.`t2`.`a` is null) having `test`.`t2`.`a` is null))) AS `t1.a in (select t2.a from t2,t3 where t3.a=t2.a)` from `test`.`t1` +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,<expr_cache><`test`.`t1`.`a`>(<in_optimizer>(`test`.`t1`.`a`,<exists>(/* select#2 */ select `test`.`t2`.`a` from `test`.`t2` join `test`.`t3` where `test`.`t2`.`a` = `test`.`t3`.`a` and (<cache>(`test`.`t1`.`a`) = `test`.`t2`.`a` or `test`.`t2`.`a` is null) having `test`.`t2`.`a` is null))) AS `t1.a in (select t2.a from t2,t3 where t3.a=t2.a)` from `test`.`t1` drop table t1,t2,t3; # check correct NULL Processing for normal IN/ALL/ANY # and 2 ways of max/min optimization @@ -1449,21 +1449,21 @@ a 4 explain extended select * from t2 where t2.a in (select a from t1 where t1.b <> 30); id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t2 index PRIMARY PRIMARY 4 NULL 4 100.00 Using index -1 PRIMARY t1 eq_ref PRIMARY PRIMARY 4 test.t2.a 1 100.00 Using where +1 PRIMARY t1 ALL PRIMARY NULL NULL NULL 4 100.00 Using where +1 PRIMARY t2 eq_ref PRIMARY PRIMARY 4 test.t1.a 1 100.00 Using index Warnings: -Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t1` join `test`.`t2` where `test`.`t1`.`a` = `test`.`t2`.`a` and `test`.`t1`.`b` <> 30 +Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t1` join `test`.`t2` where `test`.`t2`.`a` = `test`.`t1`.`a` and `test`.`t1`.`b` <> 30 select * from t2 where t2.a in (select t1.a from t1,t3 where t1.b=t3.a); a 2 3 explain extended select * from t2 where t2.a in (select t1.a from t1,t3 where t1.b=t3.a); id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t2 index PRIMARY PRIMARY 4 NULL 4 100.00 Using index -1 PRIMARY t1 eq_ref PRIMARY PRIMARY 4 test.t2.a 1 100.00 -1 PRIMARY t3 index PRIMARY PRIMARY 4 NULL 3 75.00 Using where; Using index; Using join buffer (flat, BNL join) +1 PRIMARY t1 ALL PRIMARY NULL NULL NULL 4 100.00 Using where +1 PRIMARY t2 eq_ref PRIMARY PRIMARY 4 test.t1.a 1 100.00 Using index +1 PRIMARY t3 eq_ref PRIMARY PRIMARY 4 test.t1.b 1 100.00 Using index Warnings: -Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t1` join `test`.`t3` join `test`.`t2` where `test`.`t3`.`a` = `test`.`t1`.`b` and `test`.`t1`.`a` = `test`.`t2`.`a` +Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t1` join `test`.`t3` join `test`.`t2` where `test`.`t3`.`a` = `test`.`t1`.`b` and `test`.`t2`.`a` = `test`.`t1`.`a` drop table t1, t2, t3; create table t1 (a int, b int, index a (a,b)); create table t2 (a int, index a (a)); @@ -1503,7 +1503,7 @@ a explain extended select * from t2 where t2.a in (select t1.a from t1,t3 where t1.b=t3.a); id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t2 index a a 5 NULL 4 100.00 Using where; Using index -1 PRIMARY t3 range a a 5 NULL 3 100.00 Using where; Using index +1 PRIMARY t3 index a a 5 NULL 3 100.00 Using where; Using index 1 PRIMARY t1 ref a a 10 test.t2.a,test.t3.a 116 100.00 Using index; FirstMatch(t2) Warnings: Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` semi join (`test`.`t1` join `test`.`t3`) where `test`.`t1`.`b` = `test`.`t3`.`a` and `test`.`t1`.`a` = `test`.`t2`.`a` @@ -1611,21 +1611,21 @@ a3 1 explain extended select s1, s1 NOT IN (SELECT s1 FROM t2) from t1; id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 index NULL s1 6 NULL 3 100.00 Using index -2 SUBQUERY t2 index_subquery s1 s1 6 func 2 100.00 Using index; Full scan on NULL key +2 DEPENDENT SUBQUERY t2 index s1 s1 6 NULL 2 100.00 Using where; Using index Warnings: -Note 1003 /* select#1 */ select `test`.`t1`.`s1` AS `s1`,!<expr_cache><`test`.`t1`.`s1`>(<in_optimizer>(`test`.`t1`.`s1`,<exists>(<index_lookup>(<cache>(`test`.`t1`.`s1`) in t2 on s1 checking NULL having trigcond(`test`.`t2`.`s1` is null))))) AS `s1 NOT IN (SELECT s1 FROM t2)` from `test`.`t1` +Note 1003 /* select#1 */ select `test`.`t1`.`s1` AS `s1`,!<expr_cache><`test`.`t1`.`s1`>(<in_optimizer>(`test`.`t1`.`s1`,<exists>(/* select#2 */ select `test`.`t2`.`s1` from `test`.`t2` where trigcond(<cache>(`test`.`t1`.`s1`) = `test`.`t2`.`s1` or `test`.`t2`.`s1` is null) having trigcond(`test`.`t2`.`s1` is null)))) AS `s1 NOT IN (SELECT s1 FROM t2)` from `test`.`t1` explain extended select s1, s1 = ANY (SELECT s1 FROM t2) from t1; id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 index NULL s1 6 NULL 3 100.00 Using index -2 SUBQUERY t2 index_subquery s1 s1 6 func 2 100.00 Using index; Full scan on NULL key +2 DEPENDENT SUBQUERY t2 index s1 s1 6 NULL 2 100.00 Using where; Using index Warnings: -Note 1003 /* select#1 */ select `test`.`t1`.`s1` AS `s1`,<expr_cache><`test`.`t1`.`s1`>(<in_optimizer>(`test`.`t1`.`s1`,<exists>(<index_lookup>(<cache>(`test`.`t1`.`s1`) in t2 on s1 checking NULL having trigcond(`test`.`t2`.`s1` is null))))) AS `s1 = ANY (SELECT s1 FROM t2)` from `test`.`t1` +Note 1003 /* select#1 */ select `test`.`t1`.`s1` AS `s1`,<expr_cache><`test`.`t1`.`s1`>(<in_optimizer>(`test`.`t1`.`s1`,<exists>(/* select#2 */ select `test`.`t2`.`s1` from `test`.`t2` where trigcond(<cache>(`test`.`t1`.`s1`) = `test`.`t2`.`s1` or `test`.`t2`.`s1` is null) having trigcond(`test`.`t2`.`s1` is null)))) AS `s1 = ANY (SELECT s1 FROM t2)` from `test`.`t1` explain extended select s1, s1 <> ALL (SELECT s1 FROM t2) from t1; id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 index NULL s1 6 NULL 3 100.00 Using index -2 SUBQUERY t2 index_subquery s1 s1 6 func 2 100.00 Using index; Full scan on NULL key +2 DEPENDENT SUBQUERY t2 index s1 s1 6 NULL 2 100.00 Using where; Using index Warnings: -Note 1003 /* select#1 */ select `test`.`t1`.`s1` AS `s1`,!<expr_cache><`test`.`t1`.`s1`>(<in_optimizer>(`test`.`t1`.`s1`,<exists>(<index_lookup>(<cache>(`test`.`t1`.`s1`) in t2 on s1 checking NULL having trigcond(`test`.`t2`.`s1` is null))))) AS `s1 <> ALL (SELECT s1 FROM t2)` from `test`.`t1` +Note 1003 /* select#1 */ select `test`.`t1`.`s1` AS `s1`,!<expr_cache><`test`.`t1`.`s1`>(<in_optimizer>(`test`.`t1`.`s1`,<exists>(/* select#2 */ select `test`.`t2`.`s1` from `test`.`t2` where trigcond(<cache>(`test`.`t1`.`s1`) = `test`.`t2`.`s1` or `test`.`t2`.`s1` is null) having trigcond(`test`.`t2`.`s1` is null)))) AS `s1 <> ALL (SELECT s1 FROM t2)` from `test`.`t1` explain extended select s1, s1 NOT IN (SELECT s1 FROM t2 WHERE s1 < 'a2') from t1; id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 index NULL s1 6 NULL 3 100.00 Using index @@ -2418,16 +2418,18 @@ a 3 DROP TABLE t1; create table t1 (a int, b int); -insert into t1 values (1,2),(3,4); +insert into t1 values (1,2),(3,4),(5,6),(7,8); select * from t1 up where exists (select * from t1 where t1.a=up.a); a b 1 2 3 4 +5 6 +7 8 explain extended select * from t1 up where exists (select * from t1 where t1.a=up.a); id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY up ALL NULL NULL NULL NULL 2 100.00 +1 PRIMARY up ALL NULL NULL NULL NULL 4 100.00 1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 100.00 -2 MATERIALIZED t1 ALL NULL NULL NULL NULL 2 100.00 +2 MATERIALIZED t1 ALL NULL NULL NULL NULL 4 100.00 Warnings: Note 1276 Field or reference 'test.up.a' of SELECT #2 was resolved in SELECT #1 Note 1003 select `test`.`up`.`a` AS `a`,`test`.`up`.`b` AS `b` from `test`.`t1` `up` semi join (`test`.`t1`) where 1 @@ -3100,7 +3102,7 @@ retailerID statusID changed drop table t1; create table t1(a int, primary key (a)); insert into t1 values (10); -create table t2 (a int primary key, b varchar(32), c int, unique key b(c, b)); +create table t2 (a int primary key, b varchar(32), c int, unique key cb(c, b)); insert into t2(a, c, b) values (1,10,'359'), (2,10,'35988'), (3,10,'35989'); insert into t2(a, c, b) values (4,10,'360'), (5,10,'35998'), (6,10,'35999'); analyze table t1; @@ -3113,7 +3115,7 @@ ON r.a = (SELECT t2.a FROM t2 WHERE t2.c = t1.a AND t2.b <= '359899' id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 system PRIMARY NULL NULL NULL 1 1 PRIMARY r const PRIMARY PRIMARY 4 const 1 -2 SUBQUERY t2 range b b 40 NULL 3 Using where +2 SUBQUERY t2 ref cb cb 5 const 1 Using where SELECT sql_no_cache t1.a, r.a, r.b FROM t1 LEFT JOIN t2 r ON r.a = (SELECT t2.a FROM t2 WHERE t2.c = t1.a AND t2.b <= '359899' ORDER BY t2.c DESC, t2.b DESC LIMIT 1) WHERE t1.a = 10; @@ -3125,7 +3127,7 @@ ON r.a = (SELECT t2.a FROM t2 WHERE t2.c = t1.a AND t2.b <= '359899' id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 system PRIMARY NULL NULL NULL 1 1 PRIMARY r const PRIMARY PRIMARY 4 const 1 -2 SUBQUERY t2 range b b 40 NULL 3 Using index condition +2 SUBQUERY t2 ref cb cb 5 const 1 Using index condition; Using where SELECT sql_no_cache t1.a, r.a, r.b FROM t1 LEFT JOIN t2 r ON r.a = (SELECT t2.a FROM t2 WHERE t2.c = t1.a AND t2.b <= '359899' ORDER BY t2.c, t2.b LIMIT 1) WHERE t1.a = 10; @@ -4438,7 +4440,7 @@ out_a MIN(b) DROP TABLE t1; CREATE TABLE t1 (a INT); CREATE TABLE t2 (a INT); -INSERT INTO t1 VALUES (1),(2); +INSERT INTO t1 VALUES (1),(2),(3),(4); INSERT INTO t2 VALUES (1),(2); SELECT 2 FROM t1 WHERE EXISTS ((SELECT 1 FROM t2 WHERE t1.a=t2.a)); 2 @@ -4447,7 +4449,7 @@ SELECT 2 FROM t1 WHERE EXISTS ((SELECT 1 FROM t2 WHERE t1.a=t2.a)); EXPLAIN EXTENDED SELECT 2 FROM t1 WHERE EXISTS ((SELECT 1 FROM t2 WHERE t1.a=t2.a)); id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 +1 PRIMARY t1 ALL NULL NULL NULL NULL 4 100.00 1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 100.00 2 MATERIALIZED t2 ALL NULL NULL NULL NULL 2 100.00 Warnings: @@ -4457,7 +4459,7 @@ EXPLAIN EXTENDED SELECT 2 FROM t1 WHERE EXISTS ((SELECT 1 FROM t2 WHERE t1.a=t2.a) UNION (SELECT 1 FROM t2 WHERE t1.a = t2.a)); id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 Using where +1 PRIMARY t1 ALL NULL NULL NULL NULL 4 100.00 Using where 2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 100.00 Using where 3 DEPENDENT UNION t2 ALL NULL NULL NULL NULL 2 100.00 Using where NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL NULL @@ -4541,15 +4543,15 @@ SET @save_join_cache_level=@@join_cache_level; SET join_cache_level=0; EXPLAIN EXTENDED SELECT 1 FROM t1 WHERE 1 IN (SELECT min(a) FROM t1 GROUP BY a); id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 1 PRIMARY <subquery2> const distinct_key distinct_key 4 const 1 100.00 +1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 2 MATERIALIZED t1 ALL NULL NULL NULL NULL 2 100.00 Using temporary Warnings: Note 1003 /* select#1 */ select 1 AS `1` from <materialize> (/* select#2 */ select min(`test`.`t1`.`a`) from `test`.`t1` group by `test`.`t1`.`a`) join `test`.`t1` where `<subquery2>`.`min(a)` = 1 EXPLAIN EXTENDED SELECT 1 FROM t1 WHERE 1 IN (SELECT min(a) FROM t1 WHERE a > 3 GROUP BY a); id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 1 PRIMARY <subquery2> const distinct_key distinct_key 4 const 1 100.00 +1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 2 MATERIALIZED t1 ALL NULL NULL NULL NULL 2 100.00 Using where; Using temporary Warnings: Note 1003 /* select#1 */ select 1 AS `1` from <materialize> (/* select#2 */ select min(`test`.`t1`.`a`) from `test`.`t1` where `test`.`t1`.`a` > 3 group by `test`.`t1`.`a`) join `test`.`t1` where `<subquery2>`.`min(a)` = 1 @@ -6080,8 +6082,7 @@ WHERE col_varchar_nokey IN (SELECT col_varchar_key FROM it1 WHERE col_int_key IS NULL); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY ot system NULL NULL NULL NULL 1 -1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 -2 MATERIALIZED it1 ref idx_cvk_cik idx_cvk_cik 9 const,const 1 Using where; Using index +1 PRIMARY it1 ref idx_cvk_cik idx_cvk_cik 9 const,const 1 Using where; Using index; FirstMatch(ot) SELECT col_int_nokey FROM ot WHERE col_varchar_nokey IN (SELECT col_varchar_key FROM it1 WHERE col_int_key IS NULL); @@ -6093,8 +6094,7 @@ WHERE (col_varchar_nokey, 'x') IN (SELECT col_varchar_key, col_varchar_key2 FROM it2); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY ot system NULL NULL NULL NULL 1 -1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 8 func,func 1 -2 MATERIALIZED it2 ref idx_cvk_cvk2_cik,idx_cvk_cik idx_cvk_cvk2_cik 8 const,const 1 Using where; Using index +1 PRIMARY it2 ref idx_cvk_cvk2_cik,idx_cvk_cik idx_cvk_cvk2_cik 8 const,const 1 Using where; Using index; FirstMatch(ot) SELECT col_int_nokey FROM ot WHERE (col_varchar_nokey, 'x') IN (SELECT col_varchar_key, col_varchar_key2 FROM it2); diff --git a/mysql-test/main/subselect.test b/mysql-test/main/subselect.test index 19c30bd6dc8..2093b4ff2d7 100644 --- a/mysql-test/main/subselect.test +++ b/mysql-test/main/subselect.test @@ -7,6 +7,7 @@ # as possible. # # Initialise +--source include/have_sequence.inc --disable_warnings drop table if exists t1,t2,t3,t4,t5,t6,t7,t8,t11,t12; drop view if exists v2; @@ -999,6 +1000,7 @@ create table t1 (s1 char(5), index s1(s1)); create table t2 (s1 char(5), index s1(s1)); insert into t1 values ('a1'),('a2'),('a3'); insert into t2 values ('a1'),('a2'); + select s1, s1 NOT IN (SELECT s1 FROM t2) from t1; select s1, s1 = ANY (SELECT s1 FROM t2) from t1; select s1, s1 <> ALL (SELECT s1 FROM t2) from t1; @@ -1423,7 +1425,7 @@ DROP TABLE t1; # SELECT(EXISTS * ...)optimisation # create table t1 (a int, b int); -insert into t1 values (1,2),(3,4); +insert into t1 values (1,2),(3,4),(5,6),(7,8); select * from t1 up where exists (select * from t1 where t1.a=up.a); explain extended select * from t1 up where exists (select * from t1 where t1.a=up.a); drop table t1; @@ -2033,7 +2035,7 @@ drop table t1; create table t1(a int, primary key (a)); insert into t1 values (10); -create table t2 (a int primary key, b varchar(32), c int, unique key b(c, b)); +create table t2 (a int primary key, b varchar(32), c int, unique key cb(c, b)); insert into t2(a, c, b) values (1,10,'359'), (2,10,'35988'), (3,10,'35989'); insert into t2(a, c, b) values (4,10,'360'), (5,10,'35998'), (6,10,'35999'); analyze table t1; @@ -3326,7 +3328,7 @@ DROP TABLE t1; CREATE TABLE t1 (a INT); CREATE TABLE t2 (a INT); -INSERT INTO t1 VALUES (1),(2); +INSERT INTO t1 VALUES (1),(2),(3),(4); INSERT INTO t2 VALUES (1),(2); SELECT 2 FROM t1 WHERE EXISTS ((SELECT 1 FROM t2 WHERE t1.a=t2.a)); diff --git a/mysql-test/main/subselect2.result b/mysql-test/main/subselect2.result index 34e6e857d14..9685d4f87e4 100644 --- a/mysql-test/main/subselect2.result +++ b/mysql-test/main/subselect2.result @@ -132,7 +132,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t3 eq_ref PRIMARY,FFOLDERID_IDX,CMFLDRPARNT_IDX PRIMARY 34 test.t3.PARENTID 1 Using where 1 PRIMARY t3 eq_ref PRIMARY,FFOLDERID_IDX,CMFLDRPARNT_IDX PRIMARY 34 test.t3.PARENTID 1 Using where 1 PRIMARY t3 eq_ref PRIMARY,FFOLDERID_IDX,CMFLDRPARNT_IDX PRIMARY 34 test.t3.PARENTID 1 Using where -1 PRIMARY t3 ref|filter PRIMARY,FFOLDERID_IDX,CMFLDRPARNT_IDX FFOLDERID_IDX|CMFLDRPARNT_IDX 34|35 test.t3.PARENTID 1 (29%) Using where; Using rowid filter +1 PRIMARY t3 eq_ref PRIMARY,FFOLDERID_IDX,CMFLDRPARNT_IDX PRIMARY 34 test.t3.PARENTID 1 Using where drop table t1, t2, t3, t4; CREATE TABLE t1 (a int(10) , PRIMARY KEY (a)) Engine=InnoDB; INSERT INTO t1 VALUES (1),(2); @@ -163,7 +163,7 @@ SELECT * FROM t2,t3 WHERE (2,9) IN (SELECT DISTINCT a,pk FROM t1) OR a = b; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t2 index a a 5 NULL 2 Using where; Using index 1 PRIMARY t3 ref b b 5 test.t2.a 2 Using index -2 SUBQUERY t1 const PRIMARY,a PRIMARY 4 const 1 Using where +2 SUBQUERY t1 const PRIMARY,a a 9 const,const 1 Using where; Using index SELECT * FROM t2,t3 WHERE (2,9) IN (SELECT DISTINCT a,pk FROM t1) OR a = b; pk a b 0 4 4 @@ -172,7 +172,7 @@ SELECT * FROM t2,t3 WHERE (2,9) IN (SELECT DISTINCT a,pk FROM v1) OR a = b; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t2 index a a 5 NULL 2 Using where; Using index 1 PRIMARY t3 ref b b 5 test.t2.a 2 Using index -2 SUBQUERY t1 const PRIMARY,a PRIMARY 4 const 1 Using where +2 SUBQUERY t1 const PRIMARY,a a 9 const,const 1 Using where; Using index SELECT * FROM t2,t3 WHERE (2,9) IN (SELECT DISTINCT a,pk FROM v1) OR a = b; pk a b 0 4 4 @@ -287,7 +287,7 @@ ORDER BY mirror_date ASC ) AS calculated_result; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY <derived2> ALL NULL NULL NULL NULL 3 -2 DERIVED t1 range date date 6 NULL 3 Using index condition; Using where; Rowid-ordered scan; Using filesort +2 DERIVED t1 ALL date NULL NULL NULL 3 Using where; Using filesort SELECT * FROM ( SELECT node_uid, date, mirror_date, @result := 0 AS result FROM t1 @@ -310,7 +310,7 @@ ORDER BY mirror_date ASC ) AS calculated_result; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY <derived2> ALL NULL NULL NULL NULL 3 -2 DERIVED t1 range date date 6 NULL 3 Using index condition; Using where; Using filesort +2 DERIVED t1 ALL date NULL NULL NULL 3 Using where; Using filesort SELECT * FROM ( SELECT node_uid, date, mirror_date, @result := 0 AS result FROM t1 diff --git a/mysql-test/main/subselect3.result b/mysql-test/main/subselect3.result index 299faadeff7..b30ab0a1b18 100644 --- a/mysql-test/main/subselect3.result +++ b/mysql-test/main/subselect3.result @@ -96,10 +96,10 @@ explain extended select oref, a, a in (select a from t1 where oref=t2.oref) Z from t2; id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t2 ALL NULL NULL NULL NULL 4 100.00 -2 DEPENDENT SUBQUERY t1 ALL a NULL NULL NULL 8 100.00 Using where +2 DEPENDENT SUBQUERY t1 index_subquery a a 5 func 3 100.00 Using where; Full scan on NULL key Warnings: Note 1276 Field or reference 'test.t2.oref' of SELECT #2 was resolved in SELECT #1 -Note 1003 /* select#1 */ select `test`.`t2`.`oref` AS `oref`,`test`.`t2`.`a` AS `a`,<expr_cache><`test`.`t2`.`a`,`test`.`t2`.`oref`>(<in_optimizer>(`test`.`t2`.`a`,<exists>(/* select#2 */ select `test`.`t1`.`a` from `test`.`t1` where `test`.`t1`.`oref` = `test`.`t2`.`oref` and trigcond(<cache>(`test`.`t2`.`a`) = `test`.`t1`.`a` or `test`.`t1`.`a` is null) having trigcond(`test`.`t1`.`a` is null)))) AS `Z` from `test`.`t2` +Note 1003 /* select#1 */ select `test`.`t2`.`oref` AS `oref`,`test`.`t2`.`a` AS `a`,<expr_cache><`test`.`t2`.`a`,`test`.`t2`.`oref`>(<in_optimizer>(`test`.`t2`.`a`,<exists>(<index_lookup>(<cache>(`test`.`t2`.`a`) in t1 on a checking NULL where `test`.`t1`.`oref` = `test`.`t2`.`oref` having trigcond(`test`.`t1`.`a` is null))))) AS `Z` from `test`.`t2` flush status; select oref, a from t2 where a in (select a from t1 where oref=t2.oref); oref a @@ -1339,9 +1339,9 @@ insert into t2 select * from t2; explain select * from t1 where (a,b,c) in (select X.a, Y.a, Z.a from t2 X, t2 Y, t2 Z where X.b=33); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 3 -1 PRIMARY X ALL NULL NULL NULL NULL 6 Using where; Start temporary; Using join buffer (flat, BNL join) -1 PRIMARY Y ALL NULL NULL NULL NULL 6 Using where; Using join buffer (flat, BNL join) -1 PRIMARY Z ALL NULL NULL NULL NULL 6 Using where; End temporary; Using join buffer (flat, BNL join) +1 PRIMARY X ALL NULL NULL NULL NULL 6 Using where +1 PRIMARY Y ALL NULL NULL NULL NULL 6 Using where +1 PRIMARY Z ALL NULL NULL NULL NULL 6 Using where; FirstMatch(t1) drop table t0,t1,t2; set @@optimizer_switch=@save_optimizer_switch; diff --git a/mysql-test/main/subselect3_jcl6.result b/mysql-test/main/subselect3_jcl6.result index 65002329588..071f5bfebf8 100644 --- a/mysql-test/main/subselect3_jcl6.result +++ b/mysql-test/main/subselect3_jcl6.result @@ -99,10 +99,10 @@ explain extended select oref, a, a in (select a from t1 where oref=t2.oref) Z from t2; id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t2 ALL NULL NULL NULL NULL 4 100.00 -2 DEPENDENT SUBQUERY t1 ALL a NULL NULL NULL 8 100.00 Using where +2 DEPENDENT SUBQUERY t1 index_subquery a a 5 func 3 100.00 Using where; Full scan on NULL key Warnings: Note 1276 Field or reference 'test.t2.oref' of SELECT #2 was resolved in SELECT #1 -Note 1003 /* select#1 */ select `test`.`t2`.`oref` AS `oref`,`test`.`t2`.`a` AS `a`,<expr_cache><`test`.`t2`.`a`,`test`.`t2`.`oref`>(<in_optimizer>(`test`.`t2`.`a`,<exists>(/* select#2 */ select `test`.`t1`.`a` from `test`.`t1` where `test`.`t1`.`oref` = `test`.`t2`.`oref` and trigcond(<cache>(`test`.`t2`.`a`) = `test`.`t1`.`a` or `test`.`t1`.`a` is null) having trigcond(`test`.`t1`.`a` is null)))) AS `Z` from `test`.`t2` +Note 1003 /* select#1 */ select `test`.`t2`.`oref` AS `oref`,`test`.`t2`.`a` AS `a`,<expr_cache><`test`.`t2`.`a`,`test`.`t2`.`oref`>(<in_optimizer>(`test`.`t2`.`a`,<exists>(<index_lookup>(<cache>(`test`.`t2`.`a`) in t1 on a checking NULL where `test`.`t1`.`oref` = `test`.`t2`.`oref` having trigcond(`test`.`t1`.`a` is null))))) AS `Z` from `test`.`t2` flush status; select oref, a from t2 where a in (select a from t1 where oref=t2.oref); oref a @@ -622,8 +622,8 @@ aa 1 1 bb NULL NULL select oref, a from t2 where a in (select ie from t1 where oref=t2.oref); oref a -aa 1 cc 5 +aa 1 select oref, a from t2 where a not in (select ie from t1 where oref=t2.oref); oref a ee NULL diff --git a/mysql-test/main/subselect4.result b/mysql-test/main/subselect4.result index e2199ab9578..7b2baa16bb5 100644 --- a/mysql-test/main/subselect4.result +++ b/mysql-test/main/subselect4.result @@ -714,8 +714,7 @@ WHERE ( t1.f10 ) IN ( SELECT f11 FROM t2 GROUP BY f11 )); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables 2 SUBQUERY t1 ALL NULL NULL NULL NULL 2 -2 SUBQUERY <subquery3> eq_ref distinct_key distinct_key 4 func 1 -3 MATERIALIZED t2 ALL NULL NULL NULL NULL 2 +2 SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; FirstMatch(t1); Using join buffer (flat, BNL join) SELECT * FROM t1 WHERE f3 = ( SELECT t1.f3 FROM t1 @@ -729,8 +728,7 @@ WHERE ( f10, f10 ) IN ( SELECT f11, f11 FROM t2 GROUP BY f11 )); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables 2 SUBQUERY t1 ALL NULL NULL NULL NULL 2 -2 SUBQUERY <subquery3> eq_ref distinct_key distinct_key 8 func,func 1 -3 MATERIALIZED t2 ALL NULL NULL NULL NULL 2 +2 SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where; FirstMatch(t1); Using join buffer (flat, BNL join) SELECT * FROM t1 WHERE f3 = ( SELECT f3 FROM t1 @@ -1369,7 +1367,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 system NULL NULL NULL NULL 1 2 SUBQUERY t2 ALL NULL NULL NULL NULL 2 Using where 3 SUBQUERY SQ1_t1 index NULL f4 5 NULL 2 Using index; Using temporary -3 SUBQUERY SQ1_t3 range f4 f4 5 NULL 2 Using where; Using index; Using join buffer (flat, BNL join) +3 SUBQUERY SQ1_t3 index f4 f4 5 NULL 2 Using where; Using index; Using join buffer (flat, BNL join) SELECT * FROM t1 WHERE (SELECT f2 FROM t2 WHERE f4 <= ALL @@ -1389,8 +1387,8 @@ INSERT INTO t2 VALUES (1), (2); EXPLAIN SELECT i FROM t1 WHERE (1) NOT IN (SELECT i FROM t2); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 system NULL NULL NULL NULL 1 -2 SUBQUERY t2 index_subquery k k 5 const 2 Using index +1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE +2 SUBQUERY t2 index k k 5 NULL 2 Using where; Using index DROP TABLE t2; DROP TABLE t1; # @@ -1786,7 +1784,7 @@ SELECT * FROM t1 WHERE ( 6 ) NOT IN ( SELECT t2.f3 FROM t2 JOIN t3 ON t3.f10 = t id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE 2 SUBQUERY t3 system NULL NULL NULL NULL 1 -2 SUBQUERY t2 ref_or_null f10 f10 10 const,const 2 Using where; Using index +2 SUBQUERY t2 index f10 f10 10 NULL 2 Using where; Using index SELECT * FROM t1 WHERE ( 6 ) NOT IN ( SELECT t2.f3 FROM t2 JOIN t3 ON t3.f10 = t2.f10); f4 drop table t1,t2,t3; diff --git a/mysql-test/main/subselect_exists2in.result b/mysql-test/main/subselect_exists2in.result index a473f48e0f6..c01c28fc258 100644 --- a/mysql-test/main/subselect_exists2in.result +++ b/mysql-test/main/subselect_exists2in.result @@ -902,9 +902,8 @@ WHERE EXISTS ( SELECT * FROM t1 AS sq2 WHERE sq1.`pk` IN ( SELECT f1 FROM t1 ) AND sq2.f1 = sq1.f1 ); id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 Using where -3 DEPENDENT SUBQUERY sq2 ALL NULL NULL NULL NULL 2 100.00 Using where -3 DEPENDENT SUBQUERY <subquery4> eq_ref distinct_key distinct_key 4 func 1 100.00 -4 MATERIALIZED t1 ALL NULL NULL NULL NULL 2 100.00 +3 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 2 100.00 Using where; FirstMatch +3 DEPENDENT SUBQUERY sq2 ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (flat, BNL join) Warnings: Note 1276 Field or reference 'sq1.pk' of SELECT #3 was resolved in SELECT #1 Note 1276 Field or reference 'sq1.f1' of SELECT #3 was resolved in SELECT #1 @@ -922,9 +921,8 @@ WHERE EXISTS ( SELECT * FROM t1 AS sq2 WHERE sq1.`pk` IN ( SELECT f1 FROM t1 ) AND sq2.f1 = sq1.f1 ); id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 Using where -3 DEPENDENT SUBQUERY sq2 ALL NULL NULL NULL NULL 2 100.00 Using where -3 DEPENDENT SUBQUERY <subquery4> eq_ref distinct_key distinct_key 4 func 1 100.00 -4 MATERIALIZED t1 ALL NULL NULL NULL NULL 2 100.00 +3 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 2 100.00 Using where; FirstMatch +3 DEPENDENT SUBQUERY sq2 ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (flat, BNL join) Warnings: Note 1276 Field or reference 'sq1.pk' of SELECT #3 was resolved in SELECT #1 Note 1276 Field or reference 'sq1.f1' of SELECT #3 was resolved in SELECT #1 diff --git a/mysql-test/main/subselect_exists2in_costmat.result b/mysql-test/main/subselect_exists2in_costmat.result index 1c9574aafd3..5630f8f275a 100644 --- a/mysql-test/main/subselect_exists2in_costmat.result +++ b/mysql-test/main/subselect_exists2in_costmat.result @@ -64,8 +64,8 @@ Code = Country) OR Name LIKE 'L%') AND surfacearea > 1000000; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY Country ALL Name,SurfaceArea NULL NULL NULL 239 Using where -2 MATERIALIZED City ALL Population,Country NULL NULL NULL 4079 Using where +1 PRIMARY Country range Name,SurfaceArea SurfaceArea 4 NULL 71 Using index condition; Using where; Rowid-ordered scan +2 DEPENDENT SUBQUERY City index_subquery Population,Country Country 3 func 17 Using where SELECT Name FROM Country WHERE (EXISTS (select 1 from City where City.Population > 100000 and Code = Country) OR diff --git a/mysql-test/main/subselect_exists2in_costmat.test b/mysql-test/main/subselect_exists2in_costmat.test index 371f0936d1a..dd3890496f5 100644 --- a/mysql-test/main/subselect_exists2in_costmat.test +++ b/mysql-test/main/subselect_exists2in_costmat.test @@ -67,6 +67,7 @@ set @@optimizer_switch = 'exists_to_in=on,in_to_exists=on,semijoin=on,materializ -- echo Q1.1m: -- echo MATERIALIZATION: there are too many rows in the outer query -- echo to be looked up in the inner table. + EXPLAIN SELECT Name FROM Country WHERE (EXISTS (select 1 from City where City.Population > 100000 and diff --git a/mysql-test/main/subselect_extra.result b/mysql-test/main/subselect_extra.result index c654fdfca13..057d05e0038 100644 --- a/mysql-test/main/subselect_extra.result +++ b/mysql-test/main/subselect_extra.result @@ -451,8 +451,8 @@ WHERE t3.b IN (SELECT v1.b FROM v1, t2 WHERE t2.c = v1.c AND t2.c = v1.b AND v1.b = t3.c); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t2 system NULL NULL NULL NULL 1 -1 PRIMARY <derived3> ref key1 key1 8 const,const 0 Start temporary -1 PRIMARY t3 ALL NULL NULL NULL NULL 2 Using where; End temporary; Using join buffer (flat, BNL join) +1 PRIMARY t3 ALL NULL NULL NULL NULL 2 Using where +1 PRIMARY <derived3> ref key1 key1 8 const,const 0 FirstMatch(t3) 3 DERIVED t1 ALL NULL NULL NULL NULL 3 Using where SELECT * FROM t3 WHERE t3.b IN (SELECT v1.b FROM v1, t2 diff --git a/mysql-test/main/subselect_innodb.result b/mysql-test/main/subselect_innodb.result index 7239d64d81e..0d75ad32f45 100644 --- a/mysql-test/main/subselect_innodb.result +++ b/mysql-test/main/subselect_innodb.result @@ -312,7 +312,7 @@ EXPLAIN SELECT 1 FROM t1 WHERE NOT EXISTS (SELECT 1 FROM t2 WHERE d = (SELECT d FROM t2 WHERE a >= 1) ORDER BY d); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 1 Using where -2 DEPENDENT SUBQUERY t2 unique_subquery PRIMARY,d PRIMARY 1 func 1 Using where +2 DEPENDENT SUBQUERY t2 unique_subquery PRIMARY,d d 2 func 1 Using index; Using where 3 DEPENDENT SUBQUERY t2 index NULL d 2 NULL 1 Using index DROP TABLE t2; CREATE TABLE t2 (b INT, c INT, UNIQUE KEY (b), UNIQUE KEY (b, c )) ENGINE=INNODB; @@ -608,11 +608,10 @@ INNER JOIN ON ( 1 IN ( SELECT f4 FROM t4 ) ) ) ON ( f1 >= f2 ); id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 -1 PRIMARY <subquery3> eq_ref distinct_key distinct_key 4 func 1 100.00 -1 PRIMARY t2 ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (flat, BNL join) +1 PRIMARY t4 ALL NULL NULL NULL NULL 2 100.00 Using where; FirstMatch +1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 Using join buffer (flat, BNL join) +1 PRIMARY t2 ALL NULL NULL NULL NULL 2 100.00 Using where; Using join buffer (incremental, BNL join) 1 PRIMARY t3 ALL NULL NULL NULL NULL 2 100.00 Using join buffer (incremental, BNL join) -3 MATERIALIZED t4 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: Note 1003 select `test`.`t1`.`f1` AS `f1`,`test`.`t2`.`f2` AS `f2`,`test`.`t3`.`f3` AS `f3` from `test`.`t1` join `test`.`t2` semi join (`test`.`t4`) join `test`.`t3` where `test`.`t4`.`f4` = 1 and `test`.`t1`.`f1` >= `test`.`t2`.`f2` DROP TABLE t1,t2,t3,t4; diff --git a/mysql-test/main/subselect_mat.result b/mysql-test/main/subselect_mat.result index 3d014730c6a..29dcc706444 100644 --- a/mysql-test/main/subselect_mat.result +++ b/mysql-test/main/subselect_mat.result @@ -105,7 +105,7 @@ explain extended select * from t1i where a1 in (select b1 from t2i where b1 > '0'); id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1i index NULL _it1_idx # NULL 3 100.00 Using where; -2 MATERIALIZED t2i range it2i1,it2i3 it2i1 # NULL 5 100.00 Using where; +2 MATERIALIZED t2i index it2i1,it2i3 it2i1 # NULL 5 100.00 Using where; Warnings: Note 1003 /* select#1 */ select `test`.`t1i`.`a1` AS `a1`,`test`.`t1i`.`a2` AS `a2` from `test`.`t1i` where <expr_cache><`test`.`t1i`.`a1`>(<in_optimizer>(`test`.`t1i`.`a1`,`test`.`t1i`.`a1` in ( <materialize> (/* select#2 */ select `test`.`t2i`.`b1` from `test`.`t2i` where `test`.`t2i`.`b1` > '0' ), <primary_index_lookup>(`test`.`t1i`.`a1` in <temporary table> on distinct_key where `test`.`t1i`.`a1` = `<subquery2>`.`b1`)))) select * from t1i where a1 in (select b1 from t2i where b1 > '0'); @@ -127,7 +127,7 @@ explain extended select * from t1i where (a1, a2) in (select b1, b2 from t2i where b1 > '0'); id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1i index NULL _it1_idx # NULL 3 100.00 Using where; -2 MATERIALIZED t2i range it2i1,it2i3 it2i3 # NULL 5 100.00 Using where; +2 MATERIALIZED t2i index it2i1,it2i3 it2i3 # NULL 5 100.00 Using where; Warnings: Note 1003 /* select#1 */ select `test`.`t1i`.`a1` AS `a1`,`test`.`t1i`.`a2` AS `a2` from `test`.`t1i` where <expr_cache><`test`.`t1i`.`a1`,`test`.`t1i`.`a2`>(<in_optimizer>((`test`.`t1i`.`a1`,`test`.`t1i`.`a2`),(`test`.`t1i`.`a1`,`test`.`t1i`.`a2`) in ( <materialize> (/* select#2 */ select `test`.`t2i`.`b1`,`test`.`t2i`.`b2` from `test`.`t2i` where `test`.`t2i`.`b1` > '0' ), <primary_index_lookup>(`test`.`t1i`.`a1` in <temporary table> on distinct_key where `test`.`t1i`.`a1` = `<subquery2>`.`b1` and `test`.`t1i`.`a2` = `<subquery2>`.`b2`)))) select * from t1i where (a1, a2) in (select b1, b2 from t2i where b1 > '0'); @@ -340,7 +340,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1i index NULL # # # 3 100.00 # 3 MATERIALIZED t3i index NULL # # # 4 100.00 # 4 MATERIALIZED t2i index it2i2 # # # 5 100.00 # -2 MATERIALIZED t2i range it2i1,it2i3 # # # 5 100.00 # +2 MATERIALIZED t2i index it2i1,it2i3 # # # 5 100.00 # Warnings: Note 1003 /* select#1 */ select `test`.`t1i`.`a1` AS `a1`,`test`.`t1i`.`a2` AS `a2` from `test`.`t1i` where <expr_cache><`test`.`t1i`.`a1`,`test`.`t1i`.`a2`>(<in_optimizer>((`test`.`t1i`.`a1`,`test`.`t1i`.`a2`),(`test`.`t1i`.`a1`,`test`.`t1i`.`a2`) in ( <materialize> (/* select#2 */ select `test`.`t2i`.`b1`,`test`.`t2i`.`b2` from `test`.`t2i` where `test`.`t2i`.`b1` > '0' ), <primary_index_lookup>(`test`.`t1i`.`a1` in <temporary table> on distinct_key where `test`.`t1i`.`a1` = `<subquery2>`.`b1` and `test`.`t1i`.`a2` = `<subquery2>`.`b2`)))) and <expr_cache><`test`.`t1i`.`a1`,`test`.`t1i`.`a2`>(<in_optimizer>((`test`.`t1i`.`a1`,`test`.`t1i`.`a2`),(`test`.`t1i`.`a1`,`test`.`t1i`.`a2`) in ( <materialize> (/* select#3 */ select `test`.`t3i`.`c1`,`test`.`t3i`.`c2` from `test`.`t3i` where <expr_cache><`test`.`t3i`.`c1`,`test`.`t3i`.`c2`>(<in_optimizer>((`test`.`t3i`.`c1`,`test`.`t3i`.`c2`),(`test`.`t3i`.`c1`,`test`.`t3i`.`c2`) in ( <materialize> (/* select#4 */ select `test`.`t2i`.`b1`,`test`.`t2i`.`b2` from `test`.`t2i` where `test`.`t2i`.`b2` > '0' ), <primary_index_lookup>(`test`.`t3i`.`c1` in <temporary table> on distinct_key where `test`.`t3i`.`c1` = `<subquery4>`.`b1` and `test`.`t3i`.`c2` = `<subquery4>`.`b2`)))) ), <primary_index_lookup>(`test`.`t1i`.`a1` in <temporary table> on distinct_key where `test`.`t1i`.`a1` = `<subquery3>`.`c1` and `test`.`t1i`.`a2` = `<subquery3>`.`c2`)))) select * from t1i @@ -423,7 +423,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 7 UNION t1i index NULL # # # 3 100.00 # 9 MATERIALIZED t3i index NULL # # # 4 100.00 # 10 MATERIALIZED t2i index it2i2 # # # 5 100.00 # -8 MATERIALIZED t2i range it2i1,it2i3 # # # 5 100.00 # +8 MATERIALIZED t2i index it2i1,it2i3 # # # 5 100.00 # NULL UNION RESULT <union1,7> ALL NULL # # # NULL NULL # Warnings: Note 1003 (/* select#1 */ select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from `test`.`t1` where <expr_cache><`test`.`t1`.`a1`,`test`.`t1`.`a2`>(<in_optimizer>((`test`.`t1`.`a1`,`test`.`t1`.`a2`),(`test`.`t1`.`a1`,`test`.`t1`.`a2`) in ( <materialize> (/* select#2 */ select `test`.`t2`.`b1`,`test`.`t2`.`b2` from `test`.`t2` where <expr_cache><`test`.`t2`.`b2`>(<in_optimizer>(`test`.`t2`.`b2`,`test`.`t2`.`b2` in ( <materialize> (/* select#3 */ select `test`.`t3`.`c2` from `test`.`t3` where `test`.`t3`.`c2` like '%02' ), <primary_index_lookup>(`test`.`t2`.`b2` in <temporary table> on distinct_key where `test`.`t2`.`b2` = `<subquery3>`.`c2`)))) or <expr_cache><`test`.`t2`.`b2`>(<in_optimizer>(`test`.`t2`.`b2`,`test`.`t2`.`b2` in ( <materialize> (/* select#4 */ select `test`.`t3`.`c2` from `test`.`t3` where `test`.`t3`.`c2` like '%03' ), <primary_index_lookup>(`test`.`t2`.`b2` in <temporary table> on distinct_key where `test`.`t2`.`b2` = `<subquery4>`.`c2`)))) ), <primary_index_lookup>(`test`.`t1`.`a1` in <temporary table> on distinct_key where `test`.`t1`.`a1` = `<subquery2>`.`b1` and `test`.`t1`.`a2` = `<subquery2>`.`b2`)))) and <expr_cache><`test`.`t1`.`a1`,`test`.`t1`.`a2`>(<in_optimizer>((`test`.`t1`.`a1`,`test`.`t1`.`a2`),(`test`.`t1`.`a1`,`test`.`t1`.`a2`) in ( <materialize> (/* select#5 */ select `test`.`t3`.`c1`,`test`.`t3`.`c2` from `test`.`t3` where <expr_cache><`test`.`t3`.`c1`,`test`.`t3`.`c2`>(<in_optimizer>((`test`.`t3`.`c1`,`test`.`t3`.`c2`),(`test`.`t3`.`c1`,`test`.`t3`.`c2`) in ( <materialize> (/* select#6 */ select `test`.`t2i`.`b1`,`test`.`t2i`.`b2` from `test`.`t2i` where `test`.`t2i`.`b2` > '0' ), <primary_index_lookup>(`test`.`t3`.`c1` in <temporary table> on distinct_key where `test`.`t3`.`c1` = `<subquery6>`.`b1` and `test`.`t3`.`c2` = `<subquery6>`.`b2`)))) ), <primary_index_lookup>(`test`.`t1`.`a1` in <temporary table> on distinct_key where `test`.`t1`.`a1` = `<subquery5>`.`c1` and `test`.`t1`.`a2` = `<subquery5>`.`c2`))))) union (/* select#7 */ select `test`.`t1i`.`a1` AS `a1`,`test`.`t1i`.`a2` AS `a2` from `test`.`t1i` where <expr_cache><`test`.`t1i`.`a1`,`test`.`t1i`.`a2`>(<in_optimizer>((`test`.`t1i`.`a1`,`test`.`t1i`.`a2`),(`test`.`t1i`.`a1`,`test`.`t1i`.`a2`) in ( <materialize> (/* select#8 */ select `test`.`t2i`.`b1`,`test`.`t2i`.`b2` from `test`.`t2i` where `test`.`t2i`.`b1` > '0' ), <primary_index_lookup>(`test`.`t1i`.`a1` in <temporary table> on distinct_key where `test`.`t1i`.`a1` = `<subquery8>`.`b1` and `test`.`t1i`.`a2` = `<subquery8>`.`b2`)))) and <expr_cache><`test`.`t1i`.`a1`,`test`.`t1i`.`a2`>(<in_optimizer>((`test`.`t1i`.`a1`,`test`.`t1i`.`a2`),(`test`.`t1i`.`a1`,`test`.`t1i`.`a2`) in ( <materialize> (/* select#9 */ select `test`.`t3i`.`c1`,`test`.`t3i`.`c2` from `test`.`t3i` where <expr_cache><`test`.`t3i`.`c1`,`test`.`t3i`.`c2`>(<in_optimizer>((`test`.`t3i`.`c1`,`test`.`t3i`.`c2`),(`test`.`t3i`.`c1`,`test`.`t3i`.`c2`) in ( <materialize> (/* select#10 */ select `test`.`t2i`.`b1`,`test`.`t2i`.`b2` from `test`.`t2i` where `test`.`t2i`.`b2` > '0' ), <primary_index_lookup>(`test`.`t3i`.`c1` in <temporary table> on distinct_key where `test`.`t3i`.`c1` = `<subquery10>`.`b1` and `test`.`t3i`.`c2` = `<subquery10>`.`b2`)))) ), <primary_index_lookup>(`test`.`t1i`.`a1` in <temporary table> on distinct_key where `test`.`t1i`.`a1` = `<subquery9>`.`c1` and `test`.`t1i`.`a2` = `<subquery9>`.`c2`))))) @@ -1534,8 +1534,7 @@ SET @@optimizer_switch='semijoin=on,materialization=on'; EXPLAIN SELECT pk FROM t1 WHERE (a) IN (SELECT a FROM t2 WHERE pk > 0); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 2 -1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 -2 MATERIALIZED t2 range PRIMARY PRIMARY 4 NULL 2 Using index condition; Using where; Rowid-ordered scan +1 PRIMARY t2 ALL PRIMARY NULL NULL NULL 2 Using where; FirstMatch(t1); Using join buffer (flat, BNL join) SELECT pk FROM t1 WHERE (a) IN (SELECT a FROM t2 WHERE pk > 0); pk 2 @@ -1889,8 +1888,8 @@ WHERE alias4.c = alias3.b ); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables -3 MATERIALIZED alias3 ALL NULL NULL NULL NULL 2 Using where -3 MATERIALIZED alias4 ref c c 11 test.alias3.b 2 Using where; Using index +3 MATERIALIZED alias3 ALL NULL NULL NULL NULL 2 +3 MATERIALIZED alias4 index c c 11 NULL 2 Using where; Using index; Using join buffer (flat, BNL join) DROP TABLE t1,t2; # # BUG#928048: Query containing IN subquery with OR in the where clause returns a wrong result @@ -1953,11 +1952,11 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE a IN (SELECT MAX(c) FROM t2) AND b=7 AND (a IS NULL OR a=b); id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY <subquery2> const distinct_key distinct_key 4 const 1 100.00 -1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (flat, BNL join) +1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00 Using where +1 PRIMARY <subquery2> const distinct_key distinct_key 4 const 1 100.00 Using where 2 MATERIALIZED t2 ALL NULL NULL NULL NULL 3 100.00 Warnings: -Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from <materialize> (/* select#2 */ select max(`test`.`t2`.`c`) from `test`.`t2` having `MAX(c)` is null or `MAX(c)` = 7) join `test`.`t1` where `test`.`t1`.`b` = 7 and `test`.`t1`.`a` = `<subquery2>`.`MAX(c)` and (<cache>(/*always not null*/ 1 is null) or `<subquery2>`.`MAX(c)` = 7) +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from <materialize> (/* select#2 */ select max(`test`.`t2`.`c`) from `test`.`t2` having `MAX(c)` is null or `MAX(c)` = 7) join `test`.`t1` where `test`.`t1`.`b` = 7 and `<subquery2>`.`MAX(c)` = `test`.`t1`.`a` and (`test`.`t1`.`a` is null or `test`.`t1`.`a` = 7) SELECT * FROM t1 WHERE a IN (SELECT MAX(c) FROM t2) AND b=7 AND (a IS NULL OR a=b); a b @@ -1966,8 +1965,8 @@ EXPLAIN SELECT * FROM t1 WHERE a IN (SELECT MAX(c) FROM t2 WHERE c < 4) AND b=7 AND (a IS NULL OR a=b); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY <subquery2> const distinct_key distinct_key 4 const 1 -1 PRIMARY t1 ALL NULL NULL NULL NULL 3 Using where; Using join buffer (flat, BNL join) +1 PRIMARY t1 ALL NULL NULL NULL NULL 3 Using where +1 PRIMARY <subquery2> const distinct_key distinct_key 4 const 1 Using where 2 MATERIALIZED t2 ALL NULL NULL NULL NULL 3 Using where SELECT * FROM t1 WHERE a IN (SELECT MAX(c) FROM t2 WHERE c < 4) AND b=7 AND (a IS NULL OR a=b); @@ -2241,9 +2240,8 @@ WHERE EXISTS ( SELECT * FROM t1 AS sq2 WHERE sq1.`pk` IN ( SELECT f1 FROM t1 ) AND sq2.f1 = sq1.f1 ); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY sq1 ALL NULL NULL NULL NULL 2 Using where -2 DEPENDENT SUBQUERY sq2 ALL NULL NULL NULL NULL 2 Using where -2 DEPENDENT SUBQUERY <subquery3> eq_ref distinct_key distinct_key 4 func 1 -3 MATERIALIZED t1 ALL NULL NULL NULL NULL 2 +2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 2 Using where; FirstMatch +2 DEPENDENT SUBQUERY sq2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join) # this checks the result set above set optimizer_switch= 'materialization=off,semijoin=off'; SELECT sq1.f2 FROM t1 AS sq1 @@ -2275,10 +2273,9 @@ WHERE EXISTS ( SELECT * FROM t2, t3 WHERE i3 = i2 AND f1 IN ( SELECT f3 FROM t3 ) ); id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 Using where -2 DEPENDENT SUBQUERY t2 index i2 i2 5 NULL 3 100.00 Using where; Using index -2 DEPENDENT SUBQUERY <subquery3> eq_ref distinct_key distinct_key 4 func 1 100.00 +2 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 8 100.00 Using where; FirstMatch +2 DEPENDENT SUBQUERY t2 index i2 i2 5 NULL 3 100.00 Using where; Using index; Using join buffer (flat, BNL join) 2 DEPENDENT SUBQUERY t3 ref i3 i3 5 test.t2.i2 2 100.00 Using index -3 MATERIALIZED t3 ALL NULL NULL NULL NULL 8 100.00 Warnings: Note 1276 Field or reference 'test.t1.f1' of SELECT #2 was resolved in SELECT #1 Note 1003 /* select#1 */ select `test`.`t1`.`f1` AS `f1` from `test`.`t1` where <expr_cache><`test`.`t1`.`f1`>(exists(/* select#2 */ select 1 from `test`.`t2` semi join (`test`.`t3`) join `test`.`t3` where `test`.`t3`.`i3` = `test`.`t2`.`i2` and `test`.`t1`.`f1` = `test`.`t3`.`f3` limit 1)) @@ -2314,9 +2311,8 @@ SELECT pk, f1, ( SELECT COUNT(*) FROM t2 WHERE t1.pk IN ( SELECT f2 FROM t2 ) ) AS sq FROM t1; id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 5 100.00 -2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 5 100.00 -2 DEPENDENT SUBQUERY <subquery3> eq_ref distinct_key distinct_key 4 func 1 100.00 -3 MATERIALIZED t2 ALL NULL NULL NULL NULL 5 100.00 +2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 5 100.00 Using where; FirstMatch +2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 5 100.00 Using join buffer (flat, BNL join) Warnings: Note 1276 Field or reference 'test.t1.pk' of SELECT #2 was resolved in SELECT #1 Note 1003 /* select#1 */ select `test`.`t1`.`pk` AS `pk`,`test`.`t1`.`f1` AS `f1`,<expr_cache><`test`.`t1`.`pk`>((/* select#2 */ select count(0) from `test`.`t2` semi join (`test`.`t2`) where `test`.`t1`.`pk` = `test`.`t2`.`f2`)) AS `sq` from `test`.`t1` @@ -2399,11 +2395,10 @@ WHERE t2.ugroup = t3_i.sys_id AND t3_i.type LIKE '59e22fb137032000158bbfc8bcbe5d52' AND t2.user = '86826bf03710200044e0bfc8bcbe5d79'); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 2 +1 PRIMARY t2 ref idx3,idx4 idx4 35 const 2 Using index condition; Using where; Start temporary 1 PRIMARY t1 ref idx1,idx2 idx1 35 test.t2.ugroup 2 Using where +1 PRIMARY t3_i eq_ref PRIMARY PRIMARY 32 test.t2.ugroup 1 Using index condition; Using where; End temporary 1 PRIMARY t3 eq_ref PRIMARY PRIMARY 32 test.t1.assignment_group 1 Using where; Using index -2 MATERIALIZED t2 ref idx3,idx4 idx4 35 const 2 Using index condition; Using where -2 MATERIALIZED t3_i eq_ref PRIMARY PRIMARY 32 test.t2.ugroup 1 Using index condition; Using where SELECT t1.assignment_group FROM t1, t3 WHERE t1.assignment_group = t3.sys_id AND @@ -2435,8 +2430,7 @@ explain SELECT 1 FROM t1 where t1.id IN (SELECT t2.i1 FROM t2 WHERE t2.i1 = t2.i2); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 9 -1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 -2 MATERIALIZED t2 ALL NULL NULL NULL NULL 3 Using where +1 PRIMARY t2 ALL NULL NULL NULL NULL 3 Using where; FirstMatch(t1); Using join buffer (flat, BNL join) SELECT 1 FROM t1 where t1.id IN (SELECT t2.i1 FROM t2 WHERE t2.i1 = t2.i2); 1 1 @@ -2447,8 +2441,8 @@ alter table t1 add key(id); explain SELECT 1 FROM t1 where t1.id IN (SELECT t2.i1 FROM t2 WHERE t2.i1 = t2.i2); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 3 -1 PRIMARY t1 ref id id 4 test.t2.i1 2 Using index +1 PRIMARY t1 index id id 4 NULL 9 Using index +1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 2 MATERIALIZED t2 ALL NULL NULL NULL NULL 3 Using where SELECT 1 FROM t1 where t1.id IN (SELECT t2.i1 FROM t2 WHERE t2.i1 = t2.i2); 1 @@ -2504,8 +2498,8 @@ INSERT INTO t2 VALUES (11,11),(12,12),(13,13); CREATE VIEW v1 AS SELECT t2.i1 FROM t2 where t2.i1 = t2.i2; explain SELECT 1 FROM t1 where t1.id IN (SELECT v1.i1 from v1); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 3 -1 PRIMARY t1 ref id id 4 test.t2.i1 2 Using index +1 PRIMARY t1 index id id 4 NULL 9 Using index +1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 2 MATERIALIZED t2 ALL NULL NULL NULL NULL 3 Using where SELECT 1 FROM t1 where t1.id IN (SELECT v1.i1 from v1); 1 @@ -2802,6 +2796,7 @@ PRIMARY KEY (pk) INSERT INTO t1 VALUES (1,'o','ffff','ffff','ffoo'),(2,'f','ffff','ffff','ffff'); CREATE TABLE t2 LIKE t1; INSERT INTO t2 VALUES (1,'i','iiii','iiii','iiii'),(2,'f','ffff','ffff','ffff'); +insert into t2 select -seq,"","","","" from seq_1_to_10; SET @@optimizer_switch='default,semijoin=on,materialization=on'; EXPLAIN SELECT pk FROM t1 WHERE (a) IN (SELECT a FROM t2 WHERE pk > 0); id select_type table type possible_keys key key_len ref rows Extra diff --git a/mysql-test/main/subselect_mat.test b/mysql-test/main/subselect_mat.test index fc43d19ae11..be295f8925d 100644 --- a/mysql-test/main/subselect_mat.test +++ b/mysql-test/main/subselect_mat.test @@ -2,7 +2,7 @@ # Hash semi-join regression tests # (WL#1110: Subquery optimization: materialization) # - +--source include/have_sequence.inc # force the use of materialization set @subselect_mat_test_optimizer_switch_value='materialization=on,in_to_exists=off,semijoin=off'; @@ -111,6 +111,7 @@ INSERT INTO t1 VALUES (1,'o','ffff','ffff','ffoo'),(2,'f','ffff','ffff','ffff'); CREATE TABLE t2 LIKE t1; INSERT INTO t2 VALUES (1,'i','iiii','iiii','iiii'),(2,'f','ffff','ffff','ffff'); +insert into t2 select -seq,"","","","" from seq_1_to_10; SET @@optimizer_switch='default,semijoin=on,materialization=on'; EXPLAIN SELECT pk FROM t1 WHERE (a) IN (SELECT a FROM t2 WHERE pk > 0); diff --git a/mysql-test/main/subselect_mat_cost.result b/mysql-test/main/subselect_mat_cost.result index 66d48b549c4..be0f0a6fcfd 100644 --- a/mysql-test/main/subselect_mat_cost.result +++ b/mysql-test/main/subselect_mat_cost.result @@ -59,15 +59,15 @@ set @@optimizer_switch = 'in_to_exists=on,semijoin=on,materialization=on,partial Q1.1m: MATERIALIZATION: there are too many rows in the outer query to be looked up in the inner table. -EXPLAIN +set statement optimizer_cache_hit_ratio=20 for EXPLAIN SELECT Name FROM Country WHERE (Code IN (select Country from City where City.Population > 100000) OR Name LIKE 'L%') AND surfacearea > 1000000; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY Country ALL Name,SurfaceArea NULL NULL NULL 239 Using where -2 MATERIALIZED City ALL Population,Country NULL NULL NULL 4079 Using where -SELECT Name FROM Country +3 DEPENDENT SUBQUERY City index_subquery Population,Country Country 3 func 17 Using where +set statement optimizer_cache_hit_ratio=20 for SELECT Name FROM Country WHERE (Code IN (select Country from City where City.Population > 100000) OR Name LIKE 'L%') AND surfacearea > 1000000; @@ -133,9 +133,9 @@ Country.SurfaceArea < 3000 AND Country.SurfaceArea > 10 AND (select Language from CountryLanguage where Percentage > 50) OR City.name LIKE '%Island%'); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY Country ALL PRIMARY,SurfaceArea NULL NULL NULL 239 Using where +1 PRIMARY Country range PRIMARY,SurfaceArea SurfaceArea 4 NULL 47 Using index condition; Rowid-ordered scan 1 PRIMARY City ref Country Country 3 world.Country.Code 17 Using where -2 MATERIALIZED CountryLanguage ALL Percentage,Language NULL NULL NULL 984 Using where +2 MATERIALIZED CountryLanguage range Percentage,Language Percentage 4 NULL 197 Using index condition; Rowid-ordered scan SELECT * FROM Country, City WHERE City.Country = Country.Code AND @@ -158,7 +158,7 @@ Country.SurfaceArea < 3000 AND Country.SurfaceArea > 10 AND (select Language from CountryLanguage where Percentage > 50) OR Country.name LIKE '%Island%'); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY Country ALL PRIMARY,SurfaceArea NULL NULL NULL 239 Using where +1 PRIMARY Country range PRIMARY,SurfaceArea SurfaceArea 4 NULL 47 Using index condition; Using where; Rowid-ordered scan 1 PRIMARY City ref Country Country 3 world.Country.Code 17 2 DEPENDENT SUBQUERY CountryLanguage index_subquery Percentage,Language Language 30 func 2 Using where SELECT * @@ -203,7 +203,7 @@ OR (Country.Code, City.Name) IN (select Country, Language from CountryLanguage)); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY Country ALL PRIMARY,SurfaceArea NULL NULL NULL 239 Using where +1 PRIMARY Country range PRIMARY,SurfaceArea SurfaceArea 4 NULL 73 Using index condition; Rowid-ordered scan 1 PRIMARY City ref Country Country 3 world.Country.Code 17 Using where 3 MATERIALIZED CountryLanguage index PRIMARY,Language PRIMARY 33 NULL 984 Using index 2 DEPENDENT SUBQUERY CountryLanguage unique_subquery PRIMARY,Percentage,Language PRIMARY 33 func,func 1 Using where diff --git a/mysql-test/main/subselect_mat_cost.test b/mysql-test/main/subselect_mat_cost.test index 8fe38849735..12263e75cfc 100644 --- a/mysql-test/main/subselect_mat_cost.test +++ b/mysql-test/main/subselect_mat_cost.test @@ -73,13 +73,13 @@ set @@optimizer_switch = 'in_to_exists=on,semijoin=on,materialization=on,partial -- echo Q1.1m: -- echo MATERIALIZATION: there are too many rows in the outer query -- echo to be looked up in the inner table. -EXPLAIN +set statement optimizer_cache_hit_ratio=20 for EXPLAIN SELECT Name FROM Country WHERE (Code IN (select Country from City where City.Population > 100000) OR Name LIKE 'L%') AND surfacearea > 1000000; -SELECT Name FROM Country +set statement optimizer_cache_hit_ratio=20 for SELECT Name FROM Country WHERE (Code IN (select Country from City where City.Population > 100000) OR Name LIKE 'L%') AND surfacearea > 1000000; @@ -210,7 +210,6 @@ WHERE Code NOT IN (SELECT Country FROM CountryLanguage WHERE Language = 'English -- echo MATERIALIZATION because the outer query filters less rows than Q5-a, -- echo so there are more lookups. - set statement optimizer_switch='rowid_filter=off' for EXPLAIN SELECT Country.Name @@ -369,6 +368,7 @@ drop index CountryCapital on Country; # TODO: the cost estimates for subqueries in the HAVING clause need to be changed # to take into account that the subquery predicate is executed #times ~ to the # number of groups, not number of rows + EXPLAIN SELECT City.Name, City.Population FROM City JOIN Country ON City.Country = Country.Code diff --git a/mysql-test/main/subselect_mat_cost_bugs.result b/mysql-test/main/subselect_mat_cost_bugs.result index 26deb2d326a..f94fcf60c5e 100644 --- a/mysql-test/main/subselect_mat_cost_bugs.result +++ b/mysql-test/main/subselect_mat_cost_bugs.result @@ -197,7 +197,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY <derived2> ALL NULL NULL NULL NULL 2 Using where; Using filesort 1 PRIMARY alias1 eq_ref PRIMARY PRIMARY 4 alias2.f3 1 Using index 3 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 -3 DEPENDENT SUBQUERY t1 range PRIMARY PRIMARY 4 NULL 2 Using where; Using index; Using join buffer (flat, BNL join) +3 DEPENDENT SUBQUERY t1 index PRIMARY PRIMARY 4 NULL 2 Using where; Using index; Using join buffer (flat, BNL join) 2 DERIVED t2 ALL NULL NULL NULL NULL 2 SELECT alias2.f2 AS field1 FROM t1 AS alias1 JOIN ( SELECT * FROM t2 ) AS alias2 ON alias2.f3 = alias1.f1 @@ -363,8 +363,8 @@ WHERE t4.a >= t3.b AND a = SOME (SELECT b FROM t5)); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t3 ALL NULL NULL NULL NULL 2 Using where -2 DEPENDENT SUBQUERY t5 index c c 10 NULL 2 Using where; Using index; Start temporary -2 DEPENDENT SUBQUERY t4 eq_ref PRIMARY PRIMARY 4 test.t5.b 1 Using index condition; Using where; End temporary +2 DEPENDENT SUBQUERY t4 ALL PRIMARY NULL NULL NULL 2 Using where +2 DEPENDENT SUBQUERY t5 index c c 10 NULL 2 Using where; Using index; Start temporary; End temporary; Using join buffer (flat, BNL join) SELECT * FROM t3 WHERE t3.b > ALL ( diff --git a/mysql-test/main/subselect_no_exists_to_in.result b/mysql-test/main/subselect_no_exists_to_in.result index a568a2d25a1..81c508b7921 100644 --- a/mysql-test/main/subselect_no_exists_to_in.result +++ b/mysql-test/main/subselect_no_exists_to_in.result @@ -926,10 +926,10 @@ a t1.a in (select t2.a from t2,t3 where t3.a=t2.a) explain extended SELECT t1.a, t1.a in (select t2.a from t2,t3 where t3.a=t2.a) FROM t1; id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 index NULL PRIMARY 4 NULL 4 100.00 Using index -2 DEPENDENT SUBQUERY t2 ref_or_null a a 5 func 2 100.00 Using where; Using index -2 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (flat, BNL join) +2 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 3 100.00 +2 DEPENDENT SUBQUERY t2 index a a 5 NULL 3 75.00 Using where; Using index; Using join buffer (flat, BNL join) Warnings: -Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,<expr_cache><`test`.`t1`.`a`>(<in_optimizer>(`test`.`t1`.`a`,<exists>(/* select#2 */ select `test`.`t2`.`a` from `test`.`t2` join `test`.`t3` where `test`.`t3`.`a` = `test`.`t2`.`a` and (<cache>(`test`.`t1`.`a`) = `test`.`t2`.`a` or `test`.`t2`.`a` is null) having `test`.`t2`.`a` is null))) AS `t1.a in (select t2.a from t2,t3 where t3.a=t2.a)` from `test`.`t1` +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,<expr_cache><`test`.`t1`.`a`>(<in_optimizer>(`test`.`t1`.`a`,<exists>(/* select#2 */ select `test`.`t2`.`a` from `test`.`t2` join `test`.`t3` where `test`.`t2`.`a` = `test`.`t3`.`a` and (<cache>(`test`.`t1`.`a`) = `test`.`t2`.`a` or `test`.`t2`.`a` is null) having `test`.`t2`.`a` is null))) AS `t1.a in (select t2.a from t2,t3 where t3.a=t2.a)` from `test`.`t1` drop table t1,t2,t3; # check correct NULL Processing for normal IN/ALL/ANY # and 2 ways of max/min optimization @@ -1453,21 +1453,21 @@ a 4 explain extended select * from t2 where t2.a in (select a from t1 where t1.b <> 30); id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t2 index PRIMARY PRIMARY 4 NULL 4 100.00 Using index -1 PRIMARY t1 eq_ref PRIMARY PRIMARY 4 test.t2.a 1 100.00 Using where +1 PRIMARY t1 ALL PRIMARY NULL NULL NULL 4 100.00 Using where +1 PRIMARY t2 eq_ref PRIMARY PRIMARY 4 test.t1.a 1 100.00 Using index Warnings: -Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t1` join `test`.`t2` where `test`.`t1`.`a` = `test`.`t2`.`a` and `test`.`t1`.`b` <> 30 +Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t1` join `test`.`t2` where `test`.`t2`.`a` = `test`.`t1`.`a` and `test`.`t1`.`b` <> 30 select * from t2 where t2.a in (select t1.a from t1,t3 where t1.b=t3.a); a 2 3 explain extended select * from t2 where t2.a in (select t1.a from t1,t3 where t1.b=t3.a); id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t2 index PRIMARY PRIMARY 4 NULL 4 100.00 Using index -1 PRIMARY t1 eq_ref PRIMARY PRIMARY 4 test.t2.a 1 100.00 -1 PRIMARY t3 index PRIMARY PRIMARY 4 NULL 3 75.00 Using where; Using index; Using join buffer (flat, BNL join) +1 PRIMARY t1 ALL PRIMARY NULL NULL NULL 4 100.00 Using where +1 PRIMARY t2 eq_ref PRIMARY PRIMARY 4 test.t1.a 1 100.00 Using index +1 PRIMARY t3 eq_ref PRIMARY PRIMARY 4 test.t1.b 1 100.00 Using index Warnings: -Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t1` join `test`.`t3` join `test`.`t2` where `test`.`t3`.`a` = `test`.`t1`.`b` and `test`.`t1`.`a` = `test`.`t2`.`a` +Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t1` join `test`.`t3` join `test`.`t2` where `test`.`t3`.`a` = `test`.`t1`.`b` and `test`.`t2`.`a` = `test`.`t1`.`a` drop table t1, t2, t3; create table t1 (a int, b int, index a (a,b)); create table t2 (a int, index a (a)); @@ -1507,7 +1507,7 @@ a explain extended select * from t2 where t2.a in (select t1.a from t1,t3 where t1.b=t3.a); id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t2 index a a 5 NULL 4 100.00 Using where; Using index -1 PRIMARY t3 range a a 5 NULL 3 100.00 Using where; Using index +1 PRIMARY t3 index a a 5 NULL 3 100.00 Using where; Using index 1 PRIMARY t1 ref a a 10 test.t2.a,test.t3.a 116 100.00 Using index; FirstMatch(t2) Warnings: Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` semi join (`test`.`t1` join `test`.`t3`) where `test`.`t1`.`b` = `test`.`t3`.`a` and `test`.`t1`.`a` = `test`.`t2`.`a` @@ -1615,21 +1615,21 @@ a3 1 explain extended select s1, s1 NOT IN (SELECT s1 FROM t2) from t1; id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 index NULL s1 6 NULL 3 100.00 Using index -2 SUBQUERY t2 index_subquery s1 s1 6 func 2 100.00 Using index; Full scan on NULL key +2 DEPENDENT SUBQUERY t2 index s1 s1 6 NULL 2 100.00 Using where; Using index Warnings: -Note 1003 /* select#1 */ select `test`.`t1`.`s1` AS `s1`,!<expr_cache><`test`.`t1`.`s1`>(<in_optimizer>(`test`.`t1`.`s1`,<exists>(<index_lookup>(<cache>(`test`.`t1`.`s1`) in t2 on s1 checking NULL having trigcond(`test`.`t2`.`s1` is null))))) AS `s1 NOT IN (SELECT s1 FROM t2)` from `test`.`t1` +Note 1003 /* select#1 */ select `test`.`t1`.`s1` AS `s1`,!<expr_cache><`test`.`t1`.`s1`>(<in_optimizer>(`test`.`t1`.`s1`,<exists>(/* select#2 */ select `test`.`t2`.`s1` from `test`.`t2` where trigcond(<cache>(`test`.`t1`.`s1`) = `test`.`t2`.`s1` or `test`.`t2`.`s1` is null) having trigcond(`test`.`t2`.`s1` is null)))) AS `s1 NOT IN (SELECT s1 FROM t2)` from `test`.`t1` explain extended select s1, s1 = ANY (SELECT s1 FROM t2) from t1; id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 index NULL s1 6 NULL 3 100.00 Using index -2 SUBQUERY t2 index_subquery s1 s1 6 func 2 100.00 Using index; Full scan on NULL key +2 DEPENDENT SUBQUERY t2 index s1 s1 6 NULL 2 100.00 Using where; Using index Warnings: -Note 1003 /* select#1 */ select `test`.`t1`.`s1` AS `s1`,<expr_cache><`test`.`t1`.`s1`>(<in_optimizer>(`test`.`t1`.`s1`,<exists>(<index_lookup>(<cache>(`test`.`t1`.`s1`) in t2 on s1 checking NULL having trigcond(`test`.`t2`.`s1` is null))))) AS `s1 = ANY (SELECT s1 FROM t2)` from `test`.`t1` +Note 1003 /* select#1 */ select `test`.`t1`.`s1` AS `s1`,<expr_cache><`test`.`t1`.`s1`>(<in_optimizer>(`test`.`t1`.`s1`,<exists>(/* select#2 */ select `test`.`t2`.`s1` from `test`.`t2` where trigcond(<cache>(`test`.`t1`.`s1`) = `test`.`t2`.`s1` or `test`.`t2`.`s1` is null) having trigcond(`test`.`t2`.`s1` is null)))) AS `s1 = ANY (SELECT s1 FROM t2)` from `test`.`t1` explain extended select s1, s1 <> ALL (SELECT s1 FROM t2) from t1; id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 index NULL s1 6 NULL 3 100.00 Using index -2 SUBQUERY t2 index_subquery s1 s1 6 func 2 100.00 Using index; Full scan on NULL key +2 DEPENDENT SUBQUERY t2 index s1 s1 6 NULL 2 100.00 Using where; Using index Warnings: -Note 1003 /* select#1 */ select `test`.`t1`.`s1` AS `s1`,!<expr_cache><`test`.`t1`.`s1`>(<in_optimizer>(`test`.`t1`.`s1`,<exists>(<index_lookup>(<cache>(`test`.`t1`.`s1`) in t2 on s1 checking NULL having trigcond(`test`.`t2`.`s1` is null))))) AS `s1 <> ALL (SELECT s1 FROM t2)` from `test`.`t1` +Note 1003 /* select#1 */ select `test`.`t1`.`s1` AS `s1`,!<expr_cache><`test`.`t1`.`s1`>(<in_optimizer>(`test`.`t1`.`s1`,<exists>(/* select#2 */ select `test`.`t2`.`s1` from `test`.`t2` where trigcond(<cache>(`test`.`t1`.`s1`) = `test`.`t2`.`s1` or `test`.`t2`.`s1` is null) having trigcond(`test`.`t2`.`s1` is null)))) AS `s1 <> ALL (SELECT s1 FROM t2)` from `test`.`t1` explain extended select s1, s1 NOT IN (SELECT s1 FROM t2 WHERE s1 < 'a2') from t1; id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 index NULL s1 6 NULL 3 100.00 Using index @@ -2422,15 +2422,17 @@ a 3 DROP TABLE t1; create table t1 (a int, b int); -insert into t1 values (1,2),(3,4); +insert into t1 values (1,2),(3,4),(5,6),(7,8); select * from t1 up where exists (select * from t1 where t1.a=up.a); a b 1 2 3 4 +5 6 +7 8 explain extended select * from t1 up where exists (select * from t1 where t1.a=up.a); id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY up ALL NULL NULL NULL NULL 2 100.00 Using where -2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 2 100.00 Using where +1 PRIMARY up ALL NULL NULL NULL NULL 4 100.00 Using where +2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 4 100.00 Using where Warnings: Note 1276 Field or reference 'test.up.a' of SELECT #2 was resolved in SELECT #1 Note 1003 /* select#1 */ select `test`.`up`.`a` AS `a`,`test`.`up`.`b` AS `b` from `test`.`t1` `up` where <expr_cache><`test`.`up`.`a`>(exists(/* select#2 */ select 1 from `test`.`t1` where `test`.`t1`.`a` = `test`.`up`.`a` limit 1)) @@ -3103,7 +3105,7 @@ retailerID statusID changed drop table t1; create table t1(a int, primary key (a)); insert into t1 values (10); -create table t2 (a int primary key, b varchar(32), c int, unique key b(c, b)); +create table t2 (a int primary key, b varchar(32), c int, unique key cb(c, b)); insert into t2(a, c, b) values (1,10,'359'), (2,10,'35988'), (3,10,'35989'); insert into t2(a, c, b) values (4,10,'360'), (5,10,'35998'), (6,10,'35999'); analyze table t1; @@ -3116,7 +3118,7 @@ ON r.a = (SELECT t2.a FROM t2 WHERE t2.c = t1.a AND t2.b <= '359899' id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 system PRIMARY NULL NULL NULL 1 1 PRIMARY r const PRIMARY PRIMARY 4 const 1 -2 SUBQUERY t2 range b b 40 NULL 3 Using where +2 SUBQUERY t2 ref cb cb 5 const 1 Using where SELECT sql_no_cache t1.a, r.a, r.b FROM t1 LEFT JOIN t2 r ON r.a = (SELECT t2.a FROM t2 WHERE t2.c = t1.a AND t2.b <= '359899' ORDER BY t2.c DESC, t2.b DESC LIMIT 1) WHERE t1.a = 10; @@ -3128,7 +3130,7 @@ ON r.a = (SELECT t2.a FROM t2 WHERE t2.c = t1.a AND t2.b <= '359899' id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 system PRIMARY NULL NULL NULL 1 1 PRIMARY r const PRIMARY PRIMARY 4 const 1 -2 SUBQUERY t2 range b b 40 NULL 3 Using index condition +2 SUBQUERY t2 ref cb cb 5 const 1 Using index condition; Using where SELECT sql_no_cache t1.a, r.a, r.b FROM t1 LEFT JOIN t2 r ON r.a = (SELECT t2.a FROM t2 WHERE t2.c = t1.a AND t2.b <= '359899' ORDER BY t2.c, t2.b LIMIT 1) WHERE t1.a = 10; @@ -4441,7 +4443,7 @@ out_a MIN(b) DROP TABLE t1; CREATE TABLE t1 (a INT); CREATE TABLE t2 (a INT); -INSERT INTO t1 VALUES (1),(2); +INSERT INTO t1 VALUES (1),(2),(3),(4); INSERT INTO t2 VALUES (1),(2); SELECT 2 FROM t1 WHERE EXISTS ((SELECT 1 FROM t2 WHERE t1.a=t2.a)); 2 @@ -4450,7 +4452,7 @@ SELECT 2 FROM t1 WHERE EXISTS ((SELECT 1 FROM t2 WHERE t1.a=t2.a)); EXPLAIN EXTENDED SELECT 2 FROM t1 WHERE EXISTS ((SELECT 1 FROM t2 WHERE t1.a=t2.a)); id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 Using where +1 PRIMARY t1 ALL NULL NULL NULL NULL 4 100.00 Using where 2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1 @@ -4459,7 +4461,7 @@ EXPLAIN EXTENDED SELECT 2 FROM t1 WHERE EXISTS ((SELECT 1 FROM t2 WHERE t1.a=t2.a) UNION (SELECT 1 FROM t2 WHERE t1.a = t2.a)); id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 Using where +1 PRIMARY t1 ALL NULL NULL NULL NULL 4 100.00 Using where 2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 100.00 Using where 3 DEPENDENT UNION t2 ALL NULL NULL NULL NULL 2 100.00 Using where NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL NULL @@ -4543,15 +4545,15 @@ SET @save_join_cache_level=@@join_cache_level; SET join_cache_level=0; EXPLAIN EXTENDED SELECT 1 FROM t1 WHERE 1 IN (SELECT min(a) FROM t1 GROUP BY a); id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 1 PRIMARY <subquery2> const distinct_key distinct_key 4 const 1 100.00 +1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 2 MATERIALIZED t1 ALL NULL NULL NULL NULL 2 100.00 Using temporary Warnings: Note 1003 /* select#1 */ select 1 AS `1` from <materialize> (/* select#2 */ select min(`test`.`t1`.`a`) from `test`.`t1` group by `test`.`t1`.`a`) join `test`.`t1` where `<subquery2>`.`min(a)` = 1 EXPLAIN EXTENDED SELECT 1 FROM t1 WHERE 1 IN (SELECT min(a) FROM t1 WHERE a > 3 GROUP BY a); id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 1 PRIMARY <subquery2> const distinct_key distinct_key 4 const 1 100.00 +1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 2 MATERIALIZED t1 ALL NULL NULL NULL NULL 2 100.00 Using where; Using temporary Warnings: Note 1003 /* select#1 */ select 1 AS `1` from <materialize> (/* select#2 */ select min(`test`.`t1`.`a`) from `test`.`t1` where `test`.`t1`.`a` > 3 group by `test`.`t1`.`a`) join `test`.`t1` where `<subquery2>`.`min(a)` = 1 @@ -6080,8 +6082,7 @@ WHERE col_varchar_nokey IN (SELECT col_varchar_key FROM it1 WHERE col_int_key IS NULL); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY ot system NULL NULL NULL NULL 1 -1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 -2 MATERIALIZED it1 ref idx_cvk_cik idx_cvk_cik 9 const,const 1 Using where; Using index +1 PRIMARY it1 ref idx_cvk_cik idx_cvk_cik 9 const,const 1 Using where; Using index; FirstMatch(ot) SELECT col_int_nokey FROM ot WHERE col_varchar_nokey IN (SELECT col_varchar_key FROM it1 WHERE col_int_key IS NULL); @@ -6093,8 +6094,7 @@ WHERE (col_varchar_nokey, 'x') IN (SELECT col_varchar_key, col_varchar_key2 FROM it2); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY ot system NULL NULL NULL NULL 1 -1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 8 func,func 1 -2 MATERIALIZED it2 ref idx_cvk_cvk2_cik,idx_cvk_cik idx_cvk_cvk2_cik 8 const,const 1 Using where; Using index +1 PRIMARY it2 ref idx_cvk_cvk2_cik,idx_cvk_cik idx_cvk_cvk2_cik 8 const,const 1 Using where; Using index; FirstMatch(ot) SELECT col_int_nokey FROM ot WHERE (col_varchar_nokey, 'x') IN (SELECT col_varchar_key, col_varchar_key2 FROM it2); diff --git a/mysql-test/main/subselect_no_mat.result b/mysql-test/main/subselect_no_mat.result index 8ca53e0f64d..367a468b517 100644 --- a/mysql-test/main/subselect_no_mat.result +++ b/mysql-test/main/subselect_no_mat.result @@ -929,10 +929,10 @@ a t1.a in (select t2.a from t2,t3 where t3.a=t2.a) explain extended SELECT t1.a, t1.a in (select t2.a from t2,t3 where t3.a=t2.a) FROM t1; id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 index NULL PRIMARY 4 NULL 4 100.00 Using index -2 DEPENDENT SUBQUERY t2 ref_or_null a a 5 func 2 100.00 Using where; Using index -2 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (flat, BNL join) +2 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 3 100.00 +2 DEPENDENT SUBQUERY t2 index a a 5 NULL 3 75.00 Using where; Using index; Using join buffer (flat, BNL join) Warnings: -Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,<expr_cache><`test`.`t1`.`a`>(<in_optimizer>(`test`.`t1`.`a`,<exists>(/* select#2 */ select `test`.`t2`.`a` from `test`.`t2` join `test`.`t3` where `test`.`t3`.`a` = `test`.`t2`.`a` and (<cache>(`test`.`t1`.`a`) = `test`.`t2`.`a` or `test`.`t2`.`a` is null) having `test`.`t2`.`a` is null))) AS `t1.a in (select t2.a from t2,t3 where t3.a=t2.a)` from `test`.`t1` +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,<expr_cache><`test`.`t1`.`a`>(<in_optimizer>(`test`.`t1`.`a`,<exists>(/* select#2 */ select `test`.`t2`.`a` from `test`.`t2` join `test`.`t3` where `test`.`t2`.`a` = `test`.`t3`.`a` and (<cache>(`test`.`t1`.`a`) = `test`.`t2`.`a` or `test`.`t2`.`a` is null) having `test`.`t2`.`a` is null))) AS `t1.a in (select t2.a from t2,t3 where t3.a=t2.a)` from `test`.`t1` drop table t1,t2,t3; # check correct NULL Processing for normal IN/ALL/ANY # and 2 ways of max/min optimization @@ -1456,21 +1456,21 @@ a 4 explain extended select * from t2 where t2.a in (select a from t1 where t1.b <> 30); id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t2 index PRIMARY PRIMARY 4 NULL 4 100.00 Using index -1 PRIMARY t1 eq_ref PRIMARY PRIMARY 4 test.t2.a 1 100.00 Using where +1 PRIMARY t1 ALL PRIMARY NULL NULL NULL 4 100.00 Using where +1 PRIMARY t2 eq_ref PRIMARY PRIMARY 4 test.t1.a 1 100.00 Using index Warnings: -Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t1` join `test`.`t2` where `test`.`t1`.`a` = `test`.`t2`.`a` and `test`.`t1`.`b` <> 30 +Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t1` join `test`.`t2` where `test`.`t2`.`a` = `test`.`t1`.`a` and `test`.`t1`.`b` <> 30 select * from t2 where t2.a in (select t1.a from t1,t3 where t1.b=t3.a); a 2 3 explain extended select * from t2 where t2.a in (select t1.a from t1,t3 where t1.b=t3.a); id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t2 index PRIMARY PRIMARY 4 NULL 4 100.00 Using index -1 PRIMARY t1 eq_ref PRIMARY PRIMARY 4 test.t2.a 1 100.00 -1 PRIMARY t3 index PRIMARY PRIMARY 4 NULL 3 75.00 Using where; Using index; Using join buffer (flat, BNL join) +1 PRIMARY t1 ALL PRIMARY NULL NULL NULL 4 100.00 Using where +1 PRIMARY t2 eq_ref PRIMARY PRIMARY 4 test.t1.a 1 100.00 Using index +1 PRIMARY t3 eq_ref PRIMARY PRIMARY 4 test.t1.b 1 100.00 Using index Warnings: -Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t1` join `test`.`t3` join `test`.`t2` where `test`.`t3`.`a` = `test`.`t1`.`b` and `test`.`t1`.`a` = `test`.`t2`.`a` +Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t1` join `test`.`t3` join `test`.`t2` where `test`.`t3`.`a` = `test`.`t1`.`b` and `test`.`t2`.`a` = `test`.`t1`.`a` drop table t1, t2, t3; create table t1 (a int, b int, index a (a,b)); create table t2 (a int, index a (a)); @@ -1510,7 +1510,7 @@ a explain extended select * from t2 where t2.a in (select t1.a from t1,t3 where t1.b=t3.a); id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t2 index a a 5 NULL 4 100.00 Using where; Using index -1 PRIMARY t3 range a a 5 NULL 3 100.00 Using where; Using index +1 PRIMARY t3 index a a 5 NULL 3 100.00 Using where; Using index 1 PRIMARY t1 ref a a 10 test.t2.a,test.t3.a 116 100.00 Using index; FirstMatch(t2) Warnings: Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` semi join (`test`.`t1` join `test`.`t3`) where `test`.`t1`.`b` = `test`.`t3`.`a` and `test`.`t1`.`a` = `test`.`t2`.`a` @@ -1618,21 +1618,21 @@ a3 1 explain extended select s1, s1 NOT IN (SELECT s1 FROM t2) from t1; id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 index NULL s1 6 NULL 3 100.00 Using index -2 SUBQUERY t2 index_subquery s1 s1 6 func 2 100.00 Using index; Full scan on NULL key +2 DEPENDENT SUBQUERY t2 index s1 s1 6 NULL 2 100.00 Using where; Using index Warnings: -Note 1003 /* select#1 */ select `test`.`t1`.`s1` AS `s1`,!<expr_cache><`test`.`t1`.`s1`>(<in_optimizer>(`test`.`t1`.`s1`,<exists>(<index_lookup>(<cache>(`test`.`t1`.`s1`) in t2 on s1 checking NULL having trigcond(`test`.`t2`.`s1` is null))))) AS `s1 NOT IN (SELECT s1 FROM t2)` from `test`.`t1` +Note 1003 /* select#1 */ select `test`.`t1`.`s1` AS `s1`,!<expr_cache><`test`.`t1`.`s1`>(<in_optimizer>(`test`.`t1`.`s1`,<exists>(/* select#2 */ select `test`.`t2`.`s1` from `test`.`t2` where trigcond(<cache>(`test`.`t1`.`s1`) = `test`.`t2`.`s1` or `test`.`t2`.`s1` is null) having trigcond(`test`.`t2`.`s1` is null)))) AS `s1 NOT IN (SELECT s1 FROM t2)` from `test`.`t1` explain extended select s1, s1 = ANY (SELECT s1 FROM t2) from t1; id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 index NULL s1 6 NULL 3 100.00 Using index -2 SUBQUERY t2 index_subquery s1 s1 6 func 2 100.00 Using index; Full scan on NULL key +2 DEPENDENT SUBQUERY t2 index s1 s1 6 NULL 2 100.00 Using where; Using index Warnings: -Note 1003 /* select#1 */ select `test`.`t1`.`s1` AS `s1`,<expr_cache><`test`.`t1`.`s1`>(<in_optimizer>(`test`.`t1`.`s1`,<exists>(<index_lookup>(<cache>(`test`.`t1`.`s1`) in t2 on s1 checking NULL having trigcond(`test`.`t2`.`s1` is null))))) AS `s1 = ANY (SELECT s1 FROM t2)` from `test`.`t1` +Note 1003 /* select#1 */ select `test`.`t1`.`s1` AS `s1`,<expr_cache><`test`.`t1`.`s1`>(<in_optimizer>(`test`.`t1`.`s1`,<exists>(/* select#2 */ select `test`.`t2`.`s1` from `test`.`t2` where trigcond(<cache>(`test`.`t1`.`s1`) = `test`.`t2`.`s1` or `test`.`t2`.`s1` is null) having trigcond(`test`.`t2`.`s1` is null)))) AS `s1 = ANY (SELECT s1 FROM t2)` from `test`.`t1` explain extended select s1, s1 <> ALL (SELECT s1 FROM t2) from t1; id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 index NULL s1 6 NULL 3 100.00 Using index -2 SUBQUERY t2 index_subquery s1 s1 6 func 2 100.00 Using index; Full scan on NULL key +2 DEPENDENT SUBQUERY t2 index s1 s1 6 NULL 2 100.00 Using where; Using index Warnings: -Note 1003 /* select#1 */ select `test`.`t1`.`s1` AS `s1`,!<expr_cache><`test`.`t1`.`s1`>(<in_optimizer>(`test`.`t1`.`s1`,<exists>(<index_lookup>(<cache>(`test`.`t1`.`s1`) in t2 on s1 checking NULL having trigcond(`test`.`t2`.`s1` is null))))) AS `s1 <> ALL (SELECT s1 FROM t2)` from `test`.`t1` +Note 1003 /* select#1 */ select `test`.`t1`.`s1` AS `s1`,!<expr_cache><`test`.`t1`.`s1`>(<in_optimizer>(`test`.`t1`.`s1`,<exists>(/* select#2 */ select `test`.`t2`.`s1` from `test`.`t2` where trigcond(<cache>(`test`.`t1`.`s1`) = `test`.`t2`.`s1` or `test`.`t2`.`s1` is null) having trigcond(`test`.`t2`.`s1` is null)))) AS `s1 <> ALL (SELECT s1 FROM t2)` from `test`.`t1` explain extended select s1, s1 NOT IN (SELECT s1 FROM t2 WHERE s1 < 'a2') from t1; id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 index NULL s1 6 NULL 3 100.00 Using index @@ -2425,15 +2425,17 @@ a 3 DROP TABLE t1; create table t1 (a int, b int); -insert into t1 values (1,2),(3,4); +insert into t1 values (1,2),(3,4),(5,6),(7,8); select * from t1 up where exists (select * from t1 where t1.a=up.a); a b 1 2 3 4 +5 6 +7 8 explain extended select * from t1 up where exists (select * from t1 where t1.a=up.a); id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY up ALL NULL NULL NULL NULL 2 100.00 -1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 Using where; FirstMatch(up); Using join buffer (flat, BNL join) +1 PRIMARY up ALL NULL NULL NULL NULL 4 100.00 +1 PRIMARY t1 ALL NULL NULL NULL NULL 4 100.00 Using where; FirstMatch(up); Using join buffer (flat, BNL join) Warnings: Note 1276 Field or reference 'test.up.a' of SELECT #2 was resolved in SELECT #1 Note 1003 select `test`.`up`.`a` AS `a`,`test`.`up`.`b` AS `b` from `test`.`t1` `up` semi join (`test`.`t1`) where `test`.`t1`.`a` = `test`.`up`.`a` @@ -3105,7 +3107,7 @@ retailerID statusID changed drop table t1; create table t1(a int, primary key (a)); insert into t1 values (10); -create table t2 (a int primary key, b varchar(32), c int, unique key b(c, b)); +create table t2 (a int primary key, b varchar(32), c int, unique key cb(c, b)); insert into t2(a, c, b) values (1,10,'359'), (2,10,'35988'), (3,10,'35989'); insert into t2(a, c, b) values (4,10,'360'), (5,10,'35998'), (6,10,'35999'); analyze table t1; @@ -3118,7 +3120,7 @@ ON r.a = (SELECT t2.a FROM t2 WHERE t2.c = t1.a AND t2.b <= '359899' id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 system PRIMARY NULL NULL NULL 1 1 PRIMARY r const PRIMARY PRIMARY 4 const 1 -2 SUBQUERY t2 range b b 40 NULL 3 Using where +2 SUBQUERY t2 ref cb cb 5 const 1 Using where SELECT sql_no_cache t1.a, r.a, r.b FROM t1 LEFT JOIN t2 r ON r.a = (SELECT t2.a FROM t2 WHERE t2.c = t1.a AND t2.b <= '359899' ORDER BY t2.c DESC, t2.b DESC LIMIT 1) WHERE t1.a = 10; @@ -3130,7 +3132,7 @@ ON r.a = (SELECT t2.a FROM t2 WHERE t2.c = t1.a AND t2.b <= '359899' id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 system PRIMARY NULL NULL NULL 1 1 PRIMARY r const PRIMARY PRIMARY 4 const 1 -2 SUBQUERY t2 range b b 40 NULL 3 Using index condition +2 SUBQUERY t2 ref cb cb 5 const 1 Using index condition; Using where SELECT sql_no_cache t1.a, r.a, r.b FROM t1 LEFT JOIN t2 r ON r.a = (SELECT t2.a FROM t2 WHERE t2.c = t1.a AND t2.b <= '359899' ORDER BY t2.c, t2.b LIMIT 1) WHERE t1.a = 10; @@ -4228,8 +4230,8 @@ INSERT INTO t2 VALUES (7), (5), (1), (3); SELECT id, st FROM t1 WHERE st IN ('GA','FL') AND EXISTS(SELECT 1 FROM t2 WHERE t2.id=t1.id); id st -3 FL 1 GA +3 FL 7 FL SELECT id, st FROM t1 WHERE st IN ('GA','FL') AND EXISTS(SELECT 1 FROM t2 WHERE t2.id=t1.id) @@ -4441,7 +4443,7 @@ out_a MIN(b) DROP TABLE t1; CREATE TABLE t1 (a INT); CREATE TABLE t2 (a INT); -INSERT INTO t1 VALUES (1),(2); +INSERT INTO t1 VALUES (1),(2),(3),(4); INSERT INTO t2 VALUES (1),(2); SELECT 2 FROM t1 WHERE EXISTS ((SELECT 1 FROM t2 WHERE t1.a=t2.a)); 2 @@ -4450,7 +4452,7 @@ SELECT 2 FROM t1 WHERE EXISTS ((SELECT 1 FROM t2 WHERE t1.a=t2.a)); EXPLAIN EXTENDED SELECT 2 FROM t1 WHERE EXISTS ((SELECT 1 FROM t2 WHERE t1.a=t2.a)); id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 +1 PRIMARY t1 ALL NULL NULL NULL NULL 4 100.00 1 PRIMARY t2 ALL NULL NULL NULL NULL 2 100.00 Using where; FirstMatch(t1); Using join buffer (flat, BNL join) Warnings: Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1 @@ -4459,7 +4461,7 @@ EXPLAIN EXTENDED SELECT 2 FROM t1 WHERE EXISTS ((SELECT 1 FROM t2 WHERE t1.a=t2.a) UNION (SELECT 1 FROM t2 WHERE t1.a = t2.a)); id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 Using where +1 PRIMARY t1 ALL NULL NULL NULL NULL 4 100.00 Using where 2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 100.00 Using where 3 DEPENDENT UNION t2 ALL NULL NULL NULL NULL 2 100.00 Using where NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL NULL @@ -5687,9 +5689,9 @@ WHERE (ot1.a,ot4.a) IN (SELECT it2.a,it3.a FROM it2,it3); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY ot1 ALL NULL NULL NULL NULL 2 -1 PRIMARY it2 ALL NULL NULL NULL NULL 4 Using where; Start temporary; Using join buffer (flat, BNL join) -1 PRIMARY it3 ALL NULL NULL NULL NULL 6 Using join buffer (flat, BNL join) -1 PRIMARY ot4 ALL NULL NULL NULL NULL 8 Using where; End temporary; Using join buffer (flat, BNL join) +1 PRIMARY ot4 ALL NULL NULL NULL NULL 8 Using join buffer (flat, BNL join) +1 PRIMARY it2 ALL NULL NULL NULL NULL 4 Using where +1 PRIMARY it3 ALL NULL NULL NULL NULL 6 Using where; FirstMatch(ot4) DROP TABLE IF EXISTS ot1, ot4, it2, it3; # # Bug#729039: NULL keys used to evaluate subquery diff --git a/mysql-test/main/subselect_no_opts.result b/mysql-test/main/subselect_no_opts.result index 5c5055da2f5..065db205c5f 100644 --- a/mysql-test/main/subselect_no_opts.result +++ b/mysql-test/main/subselect_no_opts.result @@ -925,10 +925,10 @@ a t1.a in (select t2.a from t2,t3 where t3.a=t2.a) explain extended SELECT t1.a, t1.a in (select t2.a from t2,t3 where t3.a=t2.a) FROM t1; id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 index NULL PRIMARY 4 NULL 4 100.00 Using index -2 DEPENDENT SUBQUERY t2 ref_or_null a a 5 func 2 100.00 Using where; Using index -2 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (flat, BNL join) +2 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 3 100.00 +2 DEPENDENT SUBQUERY t2 index a a 5 NULL 3 75.00 Using where; Using index; Using join buffer (flat, BNL join) Warnings: -Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,<in_optimizer>(`test`.`t1`.`a`,<exists>(/* select#2 */ select `test`.`t2`.`a` from `test`.`t2` join `test`.`t3` where `test`.`t3`.`a` = `test`.`t2`.`a` and (<cache>(`test`.`t1`.`a`) = `test`.`t2`.`a` or `test`.`t2`.`a` is null) having `test`.`t2`.`a` is null)) AS `t1.a in (select t2.a from t2,t3 where t3.a=t2.a)` from `test`.`t1` +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,<in_optimizer>(`test`.`t1`.`a`,<exists>(/* select#2 */ select `test`.`t2`.`a` from `test`.`t2` join `test`.`t3` where `test`.`t2`.`a` = `test`.`t3`.`a` and (<cache>(`test`.`t1`.`a`) = `test`.`t2`.`a` or `test`.`t2`.`a` is null) having `test`.`t2`.`a` is null)) AS `t1.a in (select t2.a from t2,t3 where t3.a=t2.a)` from `test`.`t1` drop table t1,t2,t3; # check correct NULL Processing for normal IN/ALL/ANY # and 2 ways of max/min optimization @@ -1614,21 +1614,21 @@ a3 1 explain extended select s1, s1 NOT IN (SELECT s1 FROM t2) from t1; id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 index NULL s1 6 NULL 3 100.00 Using index -2 SUBQUERY t2 index_subquery s1 s1 6 func 2 100.00 Using index; Full scan on NULL key +2 DEPENDENT SUBQUERY t2 index s1 s1 6 NULL 2 100.00 Using where; Using index Warnings: -Note 1003 /* select#1 */ select `test`.`t1`.`s1` AS `s1`,!(<in_optimizer>(`test`.`t1`.`s1`,<exists>(<index_lookup>(<cache>(`test`.`t1`.`s1`) in t2 on s1 checking NULL having trigcond(`test`.`t2`.`s1` is null))))) AS `s1 NOT IN (SELECT s1 FROM t2)` from `test`.`t1` +Note 1003 /* select#1 */ select `test`.`t1`.`s1` AS `s1`,!(<in_optimizer>(`test`.`t1`.`s1`,<exists>(/* select#2 */ select `test`.`t2`.`s1` from `test`.`t2` where trigcond(<cache>(`test`.`t1`.`s1`) = `test`.`t2`.`s1` or `test`.`t2`.`s1` is null) having trigcond(`test`.`t2`.`s1` is null)))) AS `s1 NOT IN (SELECT s1 FROM t2)` from `test`.`t1` explain extended select s1, s1 = ANY (SELECT s1 FROM t2) from t1; id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 index NULL s1 6 NULL 3 100.00 Using index -2 SUBQUERY t2 index_subquery s1 s1 6 func 2 100.00 Using index; Full scan on NULL key +2 DEPENDENT SUBQUERY t2 index s1 s1 6 NULL 2 100.00 Using where; Using index Warnings: -Note 1003 /* select#1 */ select `test`.`t1`.`s1` AS `s1`,<in_optimizer>(`test`.`t1`.`s1`,<exists>(<index_lookup>(<cache>(`test`.`t1`.`s1`) in t2 on s1 checking NULL having trigcond(`test`.`t2`.`s1` is null)))) AS `s1 = ANY (SELECT s1 FROM t2)` from `test`.`t1` +Note 1003 /* select#1 */ select `test`.`t1`.`s1` AS `s1`,<in_optimizer>(`test`.`t1`.`s1`,<exists>(/* select#2 */ select `test`.`t2`.`s1` from `test`.`t2` where trigcond(<cache>(`test`.`t1`.`s1`) = `test`.`t2`.`s1` or `test`.`t2`.`s1` is null) having trigcond(`test`.`t2`.`s1` is null))) AS `s1 = ANY (SELECT s1 FROM t2)` from `test`.`t1` explain extended select s1, s1 <> ALL (SELECT s1 FROM t2) from t1; id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 index NULL s1 6 NULL 3 100.00 Using index -2 SUBQUERY t2 index_subquery s1 s1 6 func 2 100.00 Using index; Full scan on NULL key +2 DEPENDENT SUBQUERY t2 index s1 s1 6 NULL 2 100.00 Using where; Using index Warnings: -Note 1003 /* select#1 */ select `test`.`t1`.`s1` AS `s1`,!(<in_optimizer>(`test`.`t1`.`s1`,<exists>(<index_lookup>(<cache>(`test`.`t1`.`s1`) in t2 on s1 checking NULL having trigcond(`test`.`t2`.`s1` is null))))) AS `s1 <> ALL (SELECT s1 FROM t2)` from `test`.`t1` +Note 1003 /* select#1 */ select `test`.`t1`.`s1` AS `s1`,!(<in_optimizer>(`test`.`t1`.`s1`,<exists>(/* select#2 */ select `test`.`t2`.`s1` from `test`.`t2` where trigcond(<cache>(`test`.`t1`.`s1`) = `test`.`t2`.`s1` or `test`.`t2`.`s1` is null) having trigcond(`test`.`t2`.`s1` is null)))) AS `s1 <> ALL (SELECT s1 FROM t2)` from `test`.`t1` explain extended select s1, s1 NOT IN (SELECT s1 FROM t2 WHERE s1 < 'a2') from t1; id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 index NULL s1 6 NULL 3 100.00 Using index @@ -2421,15 +2421,17 @@ a 3 DROP TABLE t1; create table t1 (a int, b int); -insert into t1 values (1,2),(3,4); +insert into t1 values (1,2),(3,4),(5,6),(7,8); select * from t1 up where exists (select * from t1 where t1.a=up.a); a b 1 2 3 4 +5 6 +7 8 explain extended select * from t1 up where exists (select * from t1 where t1.a=up.a); id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY up ALL NULL NULL NULL NULL 2 100.00 Using where -2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 2 100.00 Using where +1 PRIMARY up ALL NULL NULL NULL NULL 4 100.00 Using where +2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 4 100.00 Using where Warnings: Note 1276 Field or reference 'test.up.a' of SELECT #2 was resolved in SELECT #1 Note 1003 /* select#1 */ select `test`.`up`.`a` AS `a`,`test`.`up`.`b` AS `b` from `test`.`t1` `up` where <in_optimizer>(`test`.`up`.`a`,<exists>(/* select#2 */ select `test`.`t1`.`a` from `test`.`t1` where <cache>(`test`.`up`.`a`) = `test`.`t1`.`a`)) @@ -3101,7 +3103,7 @@ retailerID statusID changed drop table t1; create table t1(a int, primary key (a)); insert into t1 values (10); -create table t2 (a int primary key, b varchar(32), c int, unique key b(c, b)); +create table t2 (a int primary key, b varchar(32), c int, unique key cb(c, b)); insert into t2(a, c, b) values (1,10,'359'), (2,10,'35988'), (3,10,'35989'); insert into t2(a, c, b) values (4,10,'360'), (5,10,'35998'), (6,10,'35999'); analyze table t1; @@ -3114,7 +3116,7 @@ ON r.a = (SELECT t2.a FROM t2 WHERE t2.c = t1.a AND t2.b <= '359899' id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 system PRIMARY NULL NULL NULL 1 1 PRIMARY r const PRIMARY PRIMARY 4 const 1 -2 SUBQUERY t2 range b b 40 NULL 3 Using where +2 SUBQUERY t2 ref cb cb 5 const 1 Using where SELECT sql_no_cache t1.a, r.a, r.b FROM t1 LEFT JOIN t2 r ON r.a = (SELECT t2.a FROM t2 WHERE t2.c = t1.a AND t2.b <= '359899' ORDER BY t2.c DESC, t2.b DESC LIMIT 1) WHERE t1.a = 10; @@ -3126,7 +3128,7 @@ ON r.a = (SELECT t2.a FROM t2 WHERE t2.c = t1.a AND t2.b <= '359899' id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 system PRIMARY NULL NULL NULL 1 1 PRIMARY r const PRIMARY PRIMARY 4 const 1 -2 SUBQUERY t2 range b b 40 NULL 3 Using index condition +2 SUBQUERY t2 ref cb cb 5 const 1 Using index condition; Using where SELECT sql_no_cache t1.a, r.a, r.b FROM t1 LEFT JOIN t2 r ON r.a = (SELECT t2.a FROM t2 WHERE t2.c = t1.a AND t2.b <= '359899' ORDER BY t2.c, t2.b LIMIT 1) WHERE t1.a = 10; @@ -4437,7 +4439,7 @@ out_a MIN(b) DROP TABLE t1; CREATE TABLE t1 (a INT); CREATE TABLE t2 (a INT); -INSERT INTO t1 VALUES (1),(2); +INSERT INTO t1 VALUES (1),(2),(3),(4); INSERT INTO t2 VALUES (1),(2); SELECT 2 FROM t1 WHERE EXISTS ((SELECT 1 FROM t2 WHERE t1.a=t2.a)); 2 @@ -4446,7 +4448,7 @@ SELECT 2 FROM t1 WHERE EXISTS ((SELECT 1 FROM t2 WHERE t1.a=t2.a)); EXPLAIN EXTENDED SELECT 2 FROM t1 WHERE EXISTS ((SELECT 1 FROM t2 WHERE t1.a=t2.a)); id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 Using where +1 PRIMARY t1 ALL NULL NULL NULL NULL 4 100.00 Using where 2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 100.00 Using where Warnings: Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1 @@ -4455,7 +4457,7 @@ EXPLAIN EXTENDED SELECT 2 FROM t1 WHERE EXISTS ((SELECT 1 FROM t2 WHERE t1.a=t2.a) UNION (SELECT 1 FROM t2 WHERE t1.a = t2.a)); id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 Using where +1 PRIMARY t1 ALL NULL NULL NULL NULL 4 100.00 Using where 2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 100.00 Using where 3 DEPENDENT UNION t2 ALL NULL NULL NULL NULL 2 100.00 Using where NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL NULL diff --git a/mysql-test/main/subselect_no_scache.result b/mysql-test/main/subselect_no_scache.result index e6354f05a7f..ed0bc65584f 100644 --- a/mysql-test/main/subselect_no_scache.result +++ b/mysql-test/main/subselect_no_scache.result @@ -928,10 +928,10 @@ a t1.a in (select t2.a from t2,t3 where t3.a=t2.a) explain extended SELECT t1.a, t1.a in (select t2.a from t2,t3 where t3.a=t2.a) FROM t1; id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 index NULL PRIMARY 4 NULL 4 100.00 Using index -2 DEPENDENT SUBQUERY t2 ref_or_null a a 5 func 2 100.00 Using where; Using index -2 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (flat, BNL join) +2 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 3 100.00 +2 DEPENDENT SUBQUERY t2 index a a 5 NULL 3 75.00 Using where; Using index; Using join buffer (flat, BNL join) Warnings: -Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,<in_optimizer>(`test`.`t1`.`a`,<exists>(/* select#2 */ select `test`.`t2`.`a` from `test`.`t2` join `test`.`t3` where `test`.`t3`.`a` = `test`.`t2`.`a` and (<cache>(`test`.`t1`.`a`) = `test`.`t2`.`a` or `test`.`t2`.`a` is null) having `test`.`t2`.`a` is null)) AS `t1.a in (select t2.a from t2,t3 where t3.a=t2.a)` from `test`.`t1` +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,<in_optimizer>(`test`.`t1`.`a`,<exists>(/* select#2 */ select `test`.`t2`.`a` from `test`.`t2` join `test`.`t3` where `test`.`t2`.`a` = `test`.`t3`.`a` and (<cache>(`test`.`t1`.`a`) = `test`.`t2`.`a` or `test`.`t2`.`a` is null) having `test`.`t2`.`a` is null)) AS `t1.a in (select t2.a from t2,t3 where t3.a=t2.a)` from `test`.`t1` drop table t1,t2,t3; # check correct NULL Processing for normal IN/ALL/ANY # and 2 ways of max/min optimization @@ -1455,21 +1455,21 @@ a 4 explain extended select * from t2 where t2.a in (select a from t1 where t1.b <> 30); id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t2 index PRIMARY PRIMARY 4 NULL 4 100.00 Using index -1 PRIMARY t1 eq_ref PRIMARY PRIMARY 4 test.t2.a 1 100.00 Using where +1 PRIMARY t1 ALL PRIMARY NULL NULL NULL 4 100.00 Using where +1 PRIMARY t2 eq_ref PRIMARY PRIMARY 4 test.t1.a 1 100.00 Using index Warnings: -Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t1` join `test`.`t2` where `test`.`t1`.`a` = `test`.`t2`.`a` and `test`.`t1`.`b` <> 30 +Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t1` join `test`.`t2` where `test`.`t2`.`a` = `test`.`t1`.`a` and `test`.`t1`.`b` <> 30 select * from t2 where t2.a in (select t1.a from t1,t3 where t1.b=t3.a); a 2 3 explain extended select * from t2 where t2.a in (select t1.a from t1,t3 where t1.b=t3.a); id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t2 index PRIMARY PRIMARY 4 NULL 4 100.00 Using index -1 PRIMARY t1 eq_ref PRIMARY PRIMARY 4 test.t2.a 1 100.00 -1 PRIMARY t3 index PRIMARY PRIMARY 4 NULL 3 75.00 Using where; Using index; Using join buffer (flat, BNL join) +1 PRIMARY t1 ALL PRIMARY NULL NULL NULL 4 100.00 Using where +1 PRIMARY t2 eq_ref PRIMARY PRIMARY 4 test.t1.a 1 100.00 Using index +1 PRIMARY t3 eq_ref PRIMARY PRIMARY 4 test.t1.b 1 100.00 Using index Warnings: -Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t1` join `test`.`t3` join `test`.`t2` where `test`.`t3`.`a` = `test`.`t1`.`b` and `test`.`t1`.`a` = `test`.`t2`.`a` +Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t1` join `test`.`t3` join `test`.`t2` where `test`.`t3`.`a` = `test`.`t1`.`b` and `test`.`t2`.`a` = `test`.`t1`.`a` drop table t1, t2, t3; create table t1 (a int, b int, index a (a,b)); create table t2 (a int, index a (a)); @@ -1509,7 +1509,7 @@ a explain extended select * from t2 where t2.a in (select t1.a from t1,t3 where t1.b=t3.a); id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t2 index a a 5 NULL 4 100.00 Using where; Using index -1 PRIMARY t3 range a a 5 NULL 3 100.00 Using where; Using index +1 PRIMARY t3 index a a 5 NULL 3 100.00 Using where; Using index 1 PRIMARY t1 ref a a 10 test.t2.a,test.t3.a 116 100.00 Using index; FirstMatch(t2) Warnings: Note 1003 select `test`.`t2`.`a` AS `a` from `test`.`t2` semi join (`test`.`t1` join `test`.`t3`) where `test`.`t1`.`b` = `test`.`t3`.`a` and `test`.`t1`.`a` = `test`.`t2`.`a` @@ -1617,21 +1617,21 @@ a3 1 explain extended select s1, s1 NOT IN (SELECT s1 FROM t2) from t1; id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 index NULL s1 6 NULL 3 100.00 Using index -2 SUBQUERY t2 index_subquery s1 s1 6 func 2 100.00 Using index; Full scan on NULL key +2 DEPENDENT SUBQUERY t2 index s1 s1 6 NULL 2 100.00 Using where; Using index Warnings: -Note 1003 /* select#1 */ select `test`.`t1`.`s1` AS `s1`,!(<in_optimizer>(`test`.`t1`.`s1`,<exists>(<index_lookup>(<cache>(`test`.`t1`.`s1`) in t2 on s1 checking NULL having trigcond(`test`.`t2`.`s1` is null))))) AS `s1 NOT IN (SELECT s1 FROM t2)` from `test`.`t1` +Note 1003 /* select#1 */ select `test`.`t1`.`s1` AS `s1`,!(<in_optimizer>(`test`.`t1`.`s1`,<exists>(/* select#2 */ select `test`.`t2`.`s1` from `test`.`t2` where trigcond(<cache>(`test`.`t1`.`s1`) = `test`.`t2`.`s1` or `test`.`t2`.`s1` is null) having trigcond(`test`.`t2`.`s1` is null)))) AS `s1 NOT IN (SELECT s1 FROM t2)` from `test`.`t1` explain extended select s1, s1 = ANY (SELECT s1 FROM t2) from t1; id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 index NULL s1 6 NULL 3 100.00 Using index -2 SUBQUERY t2 index_subquery s1 s1 6 func 2 100.00 Using index; Full scan on NULL key +2 DEPENDENT SUBQUERY t2 index s1 s1 6 NULL 2 100.00 Using where; Using index Warnings: -Note 1003 /* select#1 */ select `test`.`t1`.`s1` AS `s1`,<in_optimizer>(`test`.`t1`.`s1`,<exists>(<index_lookup>(<cache>(`test`.`t1`.`s1`) in t2 on s1 checking NULL having trigcond(`test`.`t2`.`s1` is null)))) AS `s1 = ANY (SELECT s1 FROM t2)` from `test`.`t1` +Note 1003 /* select#1 */ select `test`.`t1`.`s1` AS `s1`,<in_optimizer>(`test`.`t1`.`s1`,<exists>(/* select#2 */ select `test`.`t2`.`s1` from `test`.`t2` where trigcond(<cache>(`test`.`t1`.`s1`) = `test`.`t2`.`s1` or `test`.`t2`.`s1` is null) having trigcond(`test`.`t2`.`s1` is null))) AS `s1 = ANY (SELECT s1 FROM t2)` from `test`.`t1` explain extended select s1, s1 <> ALL (SELECT s1 FROM t2) from t1; id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 index NULL s1 6 NULL 3 100.00 Using index -2 SUBQUERY t2 index_subquery s1 s1 6 func 2 100.00 Using index; Full scan on NULL key +2 DEPENDENT SUBQUERY t2 index s1 s1 6 NULL 2 100.00 Using where; Using index Warnings: -Note 1003 /* select#1 */ select `test`.`t1`.`s1` AS `s1`,!(<in_optimizer>(`test`.`t1`.`s1`,<exists>(<index_lookup>(<cache>(`test`.`t1`.`s1`) in t2 on s1 checking NULL having trigcond(`test`.`t2`.`s1` is null))))) AS `s1 <> ALL (SELECT s1 FROM t2)` from `test`.`t1` +Note 1003 /* select#1 */ select `test`.`t1`.`s1` AS `s1`,!(<in_optimizer>(`test`.`t1`.`s1`,<exists>(/* select#2 */ select `test`.`t2`.`s1` from `test`.`t2` where trigcond(<cache>(`test`.`t1`.`s1`) = `test`.`t2`.`s1` or `test`.`t2`.`s1` is null) having trigcond(`test`.`t2`.`s1` is null)))) AS `s1 <> ALL (SELECT s1 FROM t2)` from `test`.`t1` explain extended select s1, s1 NOT IN (SELECT s1 FROM t2 WHERE s1 < 'a2') from t1; id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 index NULL s1 6 NULL 3 100.00 Using index @@ -2424,16 +2424,18 @@ a 3 DROP TABLE t1; create table t1 (a int, b int); -insert into t1 values (1,2),(3,4); +insert into t1 values (1,2),(3,4),(5,6),(7,8); select * from t1 up where exists (select * from t1 where t1.a=up.a); a b 1 2 3 4 +5 6 +7 8 explain extended select * from t1 up where exists (select * from t1 where t1.a=up.a); id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY up ALL NULL NULL NULL NULL 2 100.00 +1 PRIMARY up ALL NULL NULL NULL NULL 4 100.00 1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 100.00 -2 MATERIALIZED t1 ALL NULL NULL NULL NULL 2 100.00 +2 MATERIALIZED t1 ALL NULL NULL NULL NULL 4 100.00 Warnings: Note 1276 Field or reference 'test.up.a' of SELECT #2 was resolved in SELECT #1 Note 1003 select `test`.`up`.`a` AS `a`,`test`.`up`.`b` AS `b` from `test`.`t1` `up` semi join (`test`.`t1`) where 1 @@ -3106,7 +3108,7 @@ retailerID statusID changed drop table t1; create table t1(a int, primary key (a)); insert into t1 values (10); -create table t2 (a int primary key, b varchar(32), c int, unique key b(c, b)); +create table t2 (a int primary key, b varchar(32), c int, unique key cb(c, b)); insert into t2(a, c, b) values (1,10,'359'), (2,10,'35988'), (3,10,'35989'); insert into t2(a, c, b) values (4,10,'360'), (5,10,'35998'), (6,10,'35999'); analyze table t1; @@ -3119,7 +3121,7 @@ ON r.a = (SELECT t2.a FROM t2 WHERE t2.c = t1.a AND t2.b <= '359899' id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 system PRIMARY NULL NULL NULL 1 1 PRIMARY r const PRIMARY PRIMARY 4 const 1 -2 SUBQUERY t2 range b b 40 NULL 3 Using where +2 SUBQUERY t2 ref cb cb 5 const 1 Using where SELECT sql_no_cache t1.a, r.a, r.b FROM t1 LEFT JOIN t2 r ON r.a = (SELECT t2.a FROM t2 WHERE t2.c = t1.a AND t2.b <= '359899' ORDER BY t2.c DESC, t2.b DESC LIMIT 1) WHERE t1.a = 10; @@ -3131,7 +3133,7 @@ ON r.a = (SELECT t2.a FROM t2 WHERE t2.c = t1.a AND t2.b <= '359899' id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 system PRIMARY NULL NULL NULL 1 1 PRIMARY r const PRIMARY PRIMARY 4 const 1 -2 SUBQUERY t2 range b b 40 NULL 3 Using index condition +2 SUBQUERY t2 ref cb cb 5 const 1 Using index condition; Using where SELECT sql_no_cache t1.a, r.a, r.b FROM t1 LEFT JOIN t2 r ON r.a = (SELECT t2.a FROM t2 WHERE t2.c = t1.a AND t2.b <= '359899' ORDER BY t2.c, t2.b LIMIT 1) WHERE t1.a = 10; @@ -4444,7 +4446,7 @@ out_a MIN(b) DROP TABLE t1; CREATE TABLE t1 (a INT); CREATE TABLE t2 (a INT); -INSERT INTO t1 VALUES (1),(2); +INSERT INTO t1 VALUES (1),(2),(3),(4); INSERT INTO t2 VALUES (1),(2); SELECT 2 FROM t1 WHERE EXISTS ((SELECT 1 FROM t2 WHERE t1.a=t2.a)); 2 @@ -4453,7 +4455,7 @@ SELECT 2 FROM t1 WHERE EXISTS ((SELECT 1 FROM t2 WHERE t1.a=t2.a)); EXPLAIN EXTENDED SELECT 2 FROM t1 WHERE EXISTS ((SELECT 1 FROM t2 WHERE t1.a=t2.a)); id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 +1 PRIMARY t1 ALL NULL NULL NULL NULL 4 100.00 1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 100.00 2 MATERIALIZED t2 ALL NULL NULL NULL NULL 2 100.00 Warnings: @@ -4463,7 +4465,7 @@ EXPLAIN EXTENDED SELECT 2 FROM t1 WHERE EXISTS ((SELECT 1 FROM t2 WHERE t1.a=t2.a) UNION (SELECT 1 FROM t2 WHERE t1.a = t2.a)); id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 Using where +1 PRIMARY t1 ALL NULL NULL NULL NULL 4 100.00 Using where 2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 100.00 Using where 3 DEPENDENT UNION t2 ALL NULL NULL NULL NULL 2 100.00 Using where NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL NULL @@ -4547,15 +4549,15 @@ SET @save_join_cache_level=@@join_cache_level; SET join_cache_level=0; EXPLAIN EXTENDED SELECT 1 FROM t1 WHERE 1 IN (SELECT min(a) FROM t1 GROUP BY a); id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 1 PRIMARY <subquery2> const distinct_key distinct_key 4 const 1 100.00 +1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 2 MATERIALIZED t1 ALL NULL NULL NULL NULL 2 100.00 Using temporary Warnings: Note 1003 /* select#1 */ select 1 AS `1` from <materialize> (/* select#2 */ select min(`test`.`t1`.`a`) from `test`.`t1` group by `test`.`t1`.`a`) join `test`.`t1` where `<subquery2>`.`min(a)` = 1 EXPLAIN EXTENDED SELECT 1 FROM t1 WHERE 1 IN (SELECT min(a) FROM t1 WHERE a > 3 GROUP BY a); id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 1 PRIMARY <subquery2> const distinct_key distinct_key 4 const 1 100.00 +1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 2 MATERIALIZED t1 ALL NULL NULL NULL NULL 2 100.00 Using where; Using temporary Warnings: Note 1003 /* select#1 */ select 1 AS `1` from <materialize> (/* select#2 */ select min(`test`.`t1`.`a`) from `test`.`t1` where `test`.`t1`.`a` > 3 group by `test`.`t1`.`a`) join `test`.`t1` where `<subquery2>`.`min(a)` = 1 @@ -6086,8 +6088,7 @@ WHERE col_varchar_nokey IN (SELECT col_varchar_key FROM it1 WHERE col_int_key IS NULL); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY ot system NULL NULL NULL NULL 1 -1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 -2 MATERIALIZED it1 ref idx_cvk_cik idx_cvk_cik 9 const,const 1 Using where; Using index +1 PRIMARY it1 ref idx_cvk_cik idx_cvk_cik 9 const,const 1 Using where; Using index; FirstMatch(ot) SELECT col_int_nokey FROM ot WHERE col_varchar_nokey IN (SELECT col_varchar_key FROM it1 WHERE col_int_key IS NULL); @@ -6099,8 +6100,7 @@ WHERE (col_varchar_nokey, 'x') IN (SELECT col_varchar_key, col_varchar_key2 FROM it2); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY ot system NULL NULL NULL NULL 1 -1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 8 func,func 1 -2 MATERIALIZED it2 ref idx_cvk_cvk2_cik,idx_cvk_cik idx_cvk_cvk2_cik 8 const,const 1 Using where; Using index +1 PRIMARY it2 ref idx_cvk_cvk2_cik,idx_cvk_cik idx_cvk_cvk2_cik 8 const,const 1 Using where; Using index; FirstMatch(ot) SELECT col_int_nokey FROM ot WHERE (col_varchar_nokey, 'x') IN (SELECT col_varchar_key, col_varchar_key2 FROM it2); diff --git a/mysql-test/main/subselect_no_semijoin.result b/mysql-test/main/subselect_no_semijoin.result index d9058965082..32cb9acd477 100644 --- a/mysql-test/main/subselect_no_semijoin.result +++ b/mysql-test/main/subselect_no_semijoin.result @@ -925,8 +925,8 @@ a t1.a in (select t2.a from t2,t3 where t3.a=t2.a) explain extended SELECT t1.a, t1.a in (select t2.a from t2,t3 where t3.a=t2.a) FROM t1; id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 index NULL PRIMARY 4 NULL 4 100.00 Using index -2 MATERIALIZED t3 ALL NULL NULL NULL NULL 3 100.00 -2 MATERIALIZED t2 index a a 5 NULL 3 75.00 Using where; Using index; Using join buffer (flat, BNL join) +2 MATERIALIZED t3 ALL NULL NULL NULL NULL 3 100.00 Using where +2 MATERIALIZED t2 ref a a 5 test.t3.a 2 100.00 Using index Warnings: Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,<expr_cache><`test`.`t1`.`a`>(<in_optimizer>(`test`.`t1`.`a`,`test`.`t1`.`a` in ( <materialize> (/* select#2 */ select `test`.`t2`.`a` from `test`.`t2` join `test`.`t3` where `test`.`t2`.`a` = `test`.`t3`.`a` ), <primary_index_lookup>(`test`.`t1`.`a` in <temporary table> on distinct_key where `test`.`t1`.`a` = `<subquery2>`.`a`)))) AS `t1.a in (select t2.a from t2,t3 where t3.a=t2.a)` from `test`.`t1` drop table t1,t2,t3; @@ -1463,8 +1463,8 @@ a explain extended select * from t2 where t2.a in (select t1.a from t1,t3 where t1.b=t3.a); id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t2 index NULL PRIMARY 4 NULL 4 100.00 Using where; Using index -2 MATERIALIZED t1 ALL PRIMARY NULL NULL NULL 4 100.00 -2 MATERIALIZED t3 index PRIMARY PRIMARY 4 NULL 3 75.00 Using where; Using index; Using join buffer (flat, BNL join) +2 MATERIALIZED t1 ALL PRIMARY NULL NULL NULL 4 100.00 Using where +2 MATERIALIZED t3 eq_ref PRIMARY PRIMARY 4 test.t1.b 1 100.00 Using index Warnings: Note 1003 /* select#1 */ select `test`.`t2`.`a` AS `a` from `test`.`t2` where <expr_cache><`test`.`t2`.`a`>(<in_optimizer>(`test`.`t2`.`a`,`test`.`t2`.`a` in ( <materialize> (/* select#2 */ select `test`.`t1`.`a` from `test`.`t1` join `test`.`t3` where `test`.`t3`.`a` = `test`.`t1`.`b` ), <primary_index_lookup>(`test`.`t2`.`a` in <temporary table> on distinct_key where `test`.`t2`.`a` = `<subquery2>`.`a`)))) drop table t1, t2, t3; @@ -2421,15 +2421,17 @@ a 3 DROP TABLE t1; create table t1 (a int, b int); -insert into t1 values (1,2),(3,4); +insert into t1 values (1,2),(3,4),(5,6),(7,8); select * from t1 up where exists (select * from t1 where t1.a=up.a); a b 1 2 3 4 +5 6 +7 8 explain extended select * from t1 up where exists (select * from t1 where t1.a=up.a); id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY up ALL NULL NULL NULL NULL 2 100.00 Using where -2 MATERIALIZED t1 ALL NULL NULL NULL NULL 2 100.00 +1 PRIMARY up ALL NULL NULL NULL NULL 4 100.00 Using where +2 MATERIALIZED t1 ALL NULL NULL NULL NULL 4 100.00 Warnings: Note 1276 Field or reference 'test.up.a' of SELECT #2 was resolved in SELECT #1 Note 1003 /* select#1 */ select `test`.`up`.`a` AS `a`,`test`.`up`.`b` AS `b` from `test`.`t1` `up` where <expr_cache><`test`.`up`.`a`>(<in_optimizer>(`test`.`up`.`a`,`test`.`up`.`a` in ( <materialize> (/* select#2 */ select `test`.`t1`.`a` from `test`.`t1` where 1 ), <primary_index_lookup>(`test`.`up`.`a` in <temporary table> on distinct_key where `test`.`up`.`a` = `<subquery2>`.`a`)))) @@ -3101,7 +3103,7 @@ retailerID statusID changed drop table t1; create table t1(a int, primary key (a)); insert into t1 values (10); -create table t2 (a int primary key, b varchar(32), c int, unique key b(c, b)); +create table t2 (a int primary key, b varchar(32), c int, unique key cb(c, b)); insert into t2(a, c, b) values (1,10,'359'), (2,10,'35988'), (3,10,'35989'); insert into t2(a, c, b) values (4,10,'360'), (5,10,'35998'), (6,10,'35999'); analyze table t1; @@ -3114,7 +3116,7 @@ ON r.a = (SELECT t2.a FROM t2 WHERE t2.c = t1.a AND t2.b <= '359899' id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 system PRIMARY NULL NULL NULL 1 1 PRIMARY r const PRIMARY PRIMARY 4 const 1 -2 SUBQUERY t2 range b b 40 NULL 3 Using where +2 SUBQUERY t2 ref cb cb 5 const 1 Using where SELECT sql_no_cache t1.a, r.a, r.b FROM t1 LEFT JOIN t2 r ON r.a = (SELECT t2.a FROM t2 WHERE t2.c = t1.a AND t2.b <= '359899' ORDER BY t2.c DESC, t2.b DESC LIMIT 1) WHERE t1.a = 10; @@ -3126,7 +3128,7 @@ ON r.a = (SELECT t2.a FROM t2 WHERE t2.c = t1.a AND t2.b <= '359899' id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 system PRIMARY NULL NULL NULL 1 1 PRIMARY r const PRIMARY PRIMARY 4 const 1 -2 SUBQUERY t2 range b b 40 NULL 3 Using index condition +2 SUBQUERY t2 ref cb cb 5 const 1 Using index condition; Using where SELECT sql_no_cache t1.a, r.a, r.b FROM t1 LEFT JOIN t2 r ON r.a = (SELECT t2.a FROM t2 WHERE t2.c = t1.a AND t2.b <= '359899' ORDER BY t2.c, t2.b LIMIT 1) WHERE t1.a = 10; @@ -4437,7 +4439,7 @@ out_a MIN(b) DROP TABLE t1; CREATE TABLE t1 (a INT); CREATE TABLE t2 (a INT); -INSERT INTO t1 VALUES (1),(2); +INSERT INTO t1 VALUES (1),(2),(3),(4); INSERT INTO t2 VALUES (1),(2); SELECT 2 FROM t1 WHERE EXISTS ((SELECT 1 FROM t2 WHERE t1.a=t2.a)); 2 @@ -4446,7 +4448,7 @@ SELECT 2 FROM t1 WHERE EXISTS ((SELECT 1 FROM t2 WHERE t1.a=t2.a)); EXPLAIN EXTENDED SELECT 2 FROM t1 WHERE EXISTS ((SELECT 1 FROM t2 WHERE t1.a=t2.a)); id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 Using where +1 PRIMARY t1 ALL NULL NULL NULL NULL 4 100.00 Using where 2 MATERIALIZED t2 ALL NULL NULL NULL NULL 2 100.00 Warnings: Note 1276 Field or reference 'test.t1.a' of SELECT #2 was resolved in SELECT #1 @@ -4455,7 +4457,7 @@ EXPLAIN EXTENDED SELECT 2 FROM t1 WHERE EXISTS ((SELECT 1 FROM t2 WHERE t1.a=t2.a) UNION (SELECT 1 FROM t2 WHERE t1.a = t2.a)); id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 Using where +1 PRIMARY t1 ALL NULL NULL NULL NULL 4 100.00 Using where 2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 2 100.00 Using where 3 DEPENDENT UNION t2 ALL NULL NULL NULL NULL 2 100.00 Using where NULL UNION RESULT <union2,3> ALL NULL NULL NULL NULL NULL NULL @@ -5731,8 +5733,8 @@ SET join_cache_level=0; EXPLAIN SELECT * FROM t1 WHERE pk IN (SELECT it.pk FROM t2 JOIN t2 AS it ON 1); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 3 Using where -2 MATERIALIZED t2 index NULL PRIMARY 4 NULL 3 Using index -2 MATERIALIZED it index PRIMARY PRIMARY 4 NULL 3 Using index +2 DEPENDENT SUBQUERY it eq_ref PRIMARY PRIMARY 4 func 1 Using index +2 DEPENDENT SUBQUERY t2 index NULL PRIMARY 4 NULL 3 Using index SELECT * FROM t1 WHERE pk IN (SELECT it.pk FROM t2 JOIN t2 AS it ON 1); pk i 11 0 diff --git a/mysql-test/main/subselect_sj.result b/mysql-test/main/subselect_sj.result index 42605ab9d2c..d130ed4c2a2 100644 --- a/mysql-test/main/subselect_sj.result +++ b/mysql-test/main/subselect_sj.result @@ -160,26 +160,26 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY s47 ALL NULL NULL NULL NULL 3 Using join buffer (flat, BNL join) 1 PRIMARY s48 ALL NULL NULL NULL NULL 3 Using join buffer (flat, BNL join) 1 PRIMARY s49 ALL NULL NULL NULL NULL 3 Using join buffer (flat, BNL join) -2 MATERIALIZED m00 ALL NULL NULL NULL NULL 3 -2 MATERIALIZED m01 ALL NULL NULL NULL NULL 3 Using join buffer (flat, BNL join) -2 MATERIALIZED m02 ALL NULL NULL NULL NULL 3 Using join buffer (flat, BNL join) -2 MATERIALIZED m03 ALL NULL NULL NULL NULL 3 Using join buffer (flat, BNL join) -2 MATERIALIZED m04 ALL NULL NULL NULL NULL 3 Using join buffer (flat, BNL join) -2 MATERIALIZED m05 ALL NULL NULL NULL NULL 3 Using join buffer (flat, BNL join) -2 MATERIALIZED m06 ALL NULL NULL NULL NULL 3 Using join buffer (flat, BNL join) -2 MATERIALIZED m07 ALL NULL NULL NULL NULL 3 Using join buffer (flat, BNL join) -2 MATERIALIZED m08 ALL NULL NULL NULL NULL 3 Using join buffer (flat, BNL join) -2 MATERIALIZED m09 ALL NULL NULL NULL NULL 3 Using join buffer (flat, BNL join) -2 MATERIALIZED m10 ALL NULL NULL NULL NULL 3 Using join buffer (flat, BNL join) -2 MATERIALIZED m11 ALL NULL NULL NULL NULL 3 Using join buffer (flat, BNL join) -2 MATERIALIZED m12 ALL NULL NULL NULL NULL 3 Using join buffer (flat, BNL join) -2 MATERIALIZED m13 ALL NULL NULL NULL NULL 3 Using join buffer (flat, BNL join) -2 MATERIALIZED m14 ALL NULL NULL NULL NULL 3 Using join buffer (flat, BNL join) -2 MATERIALIZED m15 ALL NULL NULL NULL NULL 3 Using join buffer (flat, BNL join) -2 MATERIALIZED m16 ALL NULL NULL NULL NULL 3 Using join buffer (flat, BNL join) -2 MATERIALIZED m17 ALL NULL NULL NULL NULL 3 Using join buffer (flat, BNL join) -2 MATERIALIZED m18 ALL NULL NULL NULL NULL 3 Using join buffer (flat, BNL join) -2 MATERIALIZED m19 ALL NULL NULL NULL NULL 3 Using join buffer (flat, BNL join) +2 DEPENDENT SUBQUERY m00 ALL NULL NULL NULL NULL 3 Using where +2 DEPENDENT SUBQUERY m01 ALL NULL NULL NULL NULL 3 Using join buffer (flat, BNL join) +2 DEPENDENT SUBQUERY m02 ALL NULL NULL NULL NULL 3 Using join buffer (flat, BNL join) +2 DEPENDENT SUBQUERY m03 ALL NULL NULL NULL NULL 3 Using join buffer (flat, BNL join) +2 DEPENDENT SUBQUERY m04 ALL NULL NULL NULL NULL 3 Using join buffer (flat, BNL join) +2 DEPENDENT SUBQUERY m05 ALL NULL NULL NULL NULL 3 Using join buffer (flat, BNL join) +2 DEPENDENT SUBQUERY m06 ALL NULL NULL NULL NULL 3 Using join buffer (flat, BNL join) +2 DEPENDENT SUBQUERY m07 ALL NULL NULL NULL NULL 3 Using join buffer (flat, BNL join) +2 DEPENDENT SUBQUERY m08 ALL NULL NULL NULL NULL 3 Using join buffer (flat, BNL join) +2 DEPENDENT SUBQUERY m09 ALL NULL NULL NULL NULL 3 Using join buffer (flat, BNL join) +2 DEPENDENT SUBQUERY m10 ALL NULL NULL NULL NULL 3 Using join buffer (flat, BNL join) +2 DEPENDENT SUBQUERY m11 ALL NULL NULL NULL NULL 3 Using join buffer (flat, BNL join) +2 DEPENDENT SUBQUERY m12 ALL NULL NULL NULL NULL 3 Using join buffer (flat, BNL join) +2 DEPENDENT SUBQUERY m13 ALL NULL NULL NULL NULL 3 Using join buffer (flat, BNL join) +2 DEPENDENT SUBQUERY m14 ALL NULL NULL NULL NULL 3 Using join buffer (flat, BNL join) +2 DEPENDENT SUBQUERY m15 ALL NULL NULL NULL NULL 3 Using join buffer (flat, BNL join) +2 DEPENDENT SUBQUERY m16 ALL NULL NULL NULL NULL 3 Using join buffer (flat, BNL join) +2 DEPENDENT SUBQUERY m17 ALL NULL NULL NULL NULL 3 Using join buffer (flat, BNL join) +2 DEPENDENT SUBQUERY m18 ALL NULL NULL NULL NULL 3 Using join buffer (flat, BNL join) +2 DEPENDENT SUBQUERY m19 ALL NULL NULL NULL NULL 3 Using join buffer (flat, BNL join) select * from t1 left join t2 on (t2.a= t1.a and t2.a in (select pk from t10)) where t1.a < 5; @@ -205,10 +205,10 @@ a b a b insert into t1 select (A.a + 10 * B.a),1 from t0 A, t0 B; explain extended select * from t1 where a in (select pk from t10 where pk<3); id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t10 range PRIMARY PRIMARY 4 NULL 3 100.00 Using where; Using index -1 PRIMARY t1 ALL NULL NULL NULL NULL 103 100.00 Using where; Using join buffer (flat, BNL join) +1 PRIMARY t1 ALL NULL NULL NULL NULL 103 100.00 Using where +1 PRIMARY t10 eq_ref PRIMARY PRIMARY 4 test.t1.a 1 100.00 Using index Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t10` join `test`.`t1` where `test`.`t1`.`a` = `test`.`t10`.`pk` and `test`.`t10`.`pk` < 3 +Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t10` join `test`.`t1` where `test`.`t10`.`pk` = `test`.`t1`.`a` and `test`.`t1`.`a` < 3 drop table t0, t1, t2; drop table t10, t11, t12; @@ -344,8 +344,8 @@ WHERE PNUM IN (SELECT PNUM FROM PROJ)); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY STAFF ALL NULL NULL NULL NULL 5 -1 PRIMARY PROJ ALL NULL NULL NULL NULL 6 Start temporary -1 PRIMARY WORKS ALL NULL NULL NULL NULL 12 Using where; End temporary +1 PRIMARY PROJ ALL NULL NULL NULL NULL 6 +1 PRIMARY WORKS ALL NULL NULL NULL NULL 12 Using where; FirstMatch(STAFF) SELECT EMPNUM, EMPNAME FROM STAFF WHERE EMPNUM IN @@ -763,16 +763,16 @@ explain extended select a from t1 where a in (select c from t2 where d >= some(select e from t3 where b=e)); id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t2 ALL NULL NULL NULL NULL 6 100.00 Start temporary -1 PRIMARY t1 ALL NULL NULL NULL NULL 7 100.00 Using where; End temporary; Using join buffer (flat, BNL join) +1 PRIMARY t1 ALL NULL NULL NULL NULL 7 100.00 +1 PRIMARY t2 ALL NULL NULL NULL NULL 6 100.00 Using where; FirstMatch(t1) 3 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 4 100.00 Using where Warnings: Note 1276 Field or reference 'test.t1.b' of SELECT #3 was resolved in SELECT #1 -Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` semi join (`test`.`t2`) where `test`.`t1`.`a` = `test`.`t2`.`c` and <nop>(<expr_cache><`test`.`t2`.`d`,`test`.`t1`.`b`>(<in_optimizer>(`test`.`t2`.`d`,<exists>(/* select#3 */ select `test`.`t3`.`e` from `test`.`t3` where `test`.`t1`.`b` = `test`.`t3`.`e` and <cache>(`test`.`t2`.`d`) >= `test`.`t3`.`e`)))) +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` semi join (`test`.`t2`) where `test`.`t2`.`c` = `test`.`t1`.`a` and <nop>(<expr_cache><`test`.`t2`.`d`,`test`.`t1`.`b`>(<in_optimizer>(`test`.`t2`.`d`,<exists>(/* select#3 */ select `test`.`t3`.`e` from `test`.`t3` where `test`.`t1`.`b` = `test`.`t3`.`e` and <cache>(`test`.`t2`.`d`) >= `test`.`t3`.`e`)))) show warnings; Level Code Message Note 1276 Field or reference 'test.t1.b' of SELECT #3 was resolved in SELECT #1 -Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` semi join (`test`.`t2`) where `test`.`t1`.`a` = `test`.`t2`.`c` and <nop>(<expr_cache><`test`.`t2`.`d`,`test`.`t1`.`b`>(<in_optimizer>(`test`.`t2`.`d`,<exists>(/* select#3 */ select `test`.`t3`.`e` from `test`.`t3` where `test`.`t1`.`b` = `test`.`t3`.`e` and <cache>(`test`.`t2`.`d`) >= `test`.`t3`.`e`)))) +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a` from `test`.`t1` semi join (`test`.`t2`) where `test`.`t2`.`c` = `test`.`t1`.`a` and <nop>(<expr_cache><`test`.`t2`.`d`,`test`.`t1`.`b`>(<in_optimizer>(`test`.`t2`.`d`,<exists>(/* select#3 */ select `test`.`t3`.`e` from `test`.`t3` where `test`.`t1`.`b` = `test`.`t3`.`e` and <cache>(`test`.`t2`.`d`) >= `test`.`t3`.`e`)))) select a from t1 where a in (select c from t2 where d >= some(select e from t3 where b=e)); a @@ -802,6 +802,7 @@ PRIMARY KEY (pk) INSERT INTO t1 VALUES (1,'o','ffff','ffff','ffoo','ffff','ffff','ffff','ffff','ffff','ffff',GeomFromText('POLYGON((0 0, 0 2, 2 2, 2 0, 0 0))')), (2,'f','ffff','ffff','ffff', 'ffff','ffff','ffff','ffff','ffff','ffff',GeomFromText('POLYGON((0 0, 0 2, 2 2, 2 0, 0 0))')); CREATE TABLE t2 LIKE t1; INSERT INTO t2 VALUES (1,'i','iiii','iiii','iiii','iiii','ffff','ffff','ffff','ffff','ffff',GeomFromText('POLYGON((0 0, 0 2, 2 2, 2 0, 0 0))')), (2,'f','ffff','ffff','ffff','ffff','ffff','ffff','ffff','ffff','ffff',GeomFromText('POLYGON((0 0, 0 2, 2 2, 2 0, 0 0))')); +insert into t2 (pk) values (-1),(0); EXPLAIN EXTENDED SELECT pk FROM t1 WHERE (a, b) IN (SELECT a, b FROM t2 WHERE pk > 0); id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 @@ -1249,8 +1250,8 @@ INSERT INTO t2 VALUES (1, 0), (1, 1), (2, 0), (2, 1); EXPLAIN SELECT * FROM t1 WHERE (i) IN (SELECT i FROM t2 where j > 0); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 5 -1 PRIMARY t2 index k k 10 NULL 4 Using where; Using index; Start temporary; End temporary +1 PRIMARY t1 ALL NULL NULL NULL NULL 5 Using where +1 PRIMARY t2 ref k k 5 test.t1.i 1 Using where; Using index; Start temporary; End temporary SELECT * FROM t1 WHERE (i) IN (SELECT i FROM t2 where j > 0); i 1 @@ -1610,7 +1611,7 @@ A.t1field IN (SELECT C.t2field FROM t2 C WHERE C.t2field IN (SELECT D.t2field FROM t2 D)); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY A index PRIMARY PRIMARY 4 NULL 3 Using index -1 PRIMARY B index NULL PRIMARY 4 NULL 3 Using index; Start temporary; End temporary +1 PRIMARY B index NULL PRIMARY 4 NULL 3 Using index; FirstMatch(A) 1 PRIMARY C eq_ref PRIMARY PRIMARY 4 test.A.t1field 1 Using index 1 PRIMARY D eq_ref PRIMARY PRIMARY 4 test.A.t1field 1 Using index SELECT * FROM t1 A @@ -1980,7 +1981,7 @@ f1 f3 f4 f2 f4 DROP TABLE t1,t2,t3; # # BUG#803457: Wrong result with semijoin + view + outer join in maria-5.3-subqueries-mwl90 -# (Original testcase) +# (Original, slightly modified testcase) # CREATE TABLE t1 (f1 int, f2 int ); INSERT INTO t1 VALUES (2,0),(4,0),(0,NULL); @@ -1990,24 +1991,23 @@ CREATE TABLE t3 ( f1 int, f3 int ); INSERT INTO t3 VALUES (2,0),(4,0),(0,NULL),(4,0),(8,0); CREATE TABLE t4 ( f2 int, KEY (f2) ); INSERT INTO t4 VALUES (0),(NULL); -CREATE VIEW v4 AS SELECT DISTINCT f2 FROM t4 ; +INSERT INTO t4 VALUES (0),(NULL),(-1),(-2),(-3); # The following must not have outer joins: explain extended -SELECT * FROM t1 NATURAL LEFT JOIN (t2, t3) WHERE t2.f3 IN (SELECT * FROM t4); +SELECT * FROM t1 NATURAL LEFT JOIN (t2, t3) WHERE t2.f3 IN (SELECT * FROM t4 where f2 = 0 or f2 IS NULL); id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t2 ALL NULL NULL NULL NULL 2 100.00 1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 100.00 1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (flat, BNL join) 1 PRIMARY t3 ALL NULL NULL NULL NULL 5 100.00 Using where; Using join buffer (flat, BNL join) -2 MATERIALIZED t4 index f2 f2 5 NULL 2 100.00 Using index +2 MATERIALIZED t4 ref_or_null f2 f2 5 const 4 100.00 Using where; Using index Warnings: -Note 1003 select `test`.`t1`.`f1` AS `f1`,`test`.`t1`.`f2` AS `f2`,`test`.`t2`.`f3` AS `f3`,`test`.`t3`.`f3` AS `f3` from `test`.`t1` semi join (`test`.`t4`) join `test`.`t2` join `test`.`t3` where `test`.`t3`.`f1` = `test`.`t1`.`f1` and `test`.`t1`.`f2` = `test`.`t2`.`f2` -SELECT * FROM t1 NATURAL LEFT JOIN (t2, t3) WHERE t2.f3 IN (SELECT * FROM t4); +Note 1003 select `test`.`t1`.`f1` AS `f1`,`test`.`t1`.`f2` AS `f2`,`test`.`t2`.`f3` AS `f3`,`test`.`t3`.`f3` AS `f3` from `test`.`t1` semi join (`test`.`t4`) join `test`.`t2` join `test`.`t3` where `test`.`t3`.`f1` = `test`.`t1`.`f1` and `test`.`t1`.`f2` = `test`.`t2`.`f2` and (`test`.`t4`.`f2` = 0 or `test`.`t4`.`f2` is null) +SELECT * FROM t1 NATURAL LEFT JOIN (t2, t3) WHERE t2.f3 IN (SELECT * FROM t4 where f2 = 0 or f2 IS NULL); f1 f2 f3 f3 2 0 0 0 4 0 0 0 4 0 0 0 -drop view v4; drop table t1, t2, t3, t4; # # BUG#803303: Wrong result with semijoin=on, outer join in maria-5.3-subqueries-mwl90 @@ -2153,8 +2153,8 @@ INSERT INTO t3 VALUES (6,5),(6,2),(8,0),(9,1),(6,5); explain SELECT * FROM t1, t2 WHERE (t2.a , t1.b) IN (SELECT a, b FROM t3); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 2 -1 PRIMARY t3 ALL b NULL NULL NULL 5 Using where; Start temporary +1 PRIMARY t1 ALL NULL NULL NULL NULL 2 Using where +1 PRIMARY t3 ref b b 5 test.t1.b 2 Start temporary 1 PRIMARY t2 index PRIMARY PRIMARY 4 NULL 2 Using where; Using index; End temporary; Using join buffer (flat, BNL join) SELECT * FROM t1, t2 WHERE (t2.a , t1.b) IN (SELECT a, b FROM t3); b a @@ -2350,8 +2350,8 @@ SELECT * FROM t1 WHERE (a) IN (SELECT a FROM t2 JOIN t3 ON b = a); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 9 1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 -2 MATERIALIZED t3 ALL NULL NULL NULL NULL 13 -2 MATERIALIZED t2 index b b 8 NULL 7 Using where; Using index +2 MATERIALIZED t3 ALL NULL NULL NULL NULL 13 Using where +2 MATERIALIZED t2 ref b b 4 test.t3.a 1 Using index SELECT * FROM t1 WHERE (a) IN (SELECT a FROM t2 JOIN t3 ON b = a); a 19 @@ -2499,10 +2499,9 @@ SELECT * FROM t1, t2 WHERE t1.a = t2.a AND t2.a IN (SELECT b FROM t3 STRAIGHT_JOIN t4); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t3 system NULL NULL NULL NULL 1 -1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 1 -1 PRIMARY t1 ref a a 5 const 1 Using index -1 PRIMARY t2 ref a a 5 func 1 Using index -2 MATERIALIZED t4 ALL NULL NULL NULL NULL 0 +1 PRIMARY t2 ref a a 5 const 1 Using index +1 PRIMARY t4 ALL NULL NULL NULL NULL 0 FirstMatch(t2); Using join buffer (flat, BNL join) +1 PRIMARY t1 ref a a 5 func 1 Using index SELECT * FROM t1, t2 WHERE t1.a = t2.a AND t2.a IN (SELECT b FROM t3 STRAIGHT_JOIN t4); a a @@ -2574,33 +2573,33 @@ SELECT a, b, d FROM t1, t2 WHERE ( b, d ) IN ( SELECT b, d FROM t1, t2 WHERE b = c ); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t2 ALL NULL NULL NULL NULL 7 -1 PRIMARY t1 index b b 5 NULL 10 Using where; Using index; LooseScan -1 PRIMARY t2 ref c c 5 test.t1.b 1 Using where; FirstMatch(t1) +1 PRIMARY t1 index b b 5 NULL 10 Using where; Using index; Start temporary +1 PRIMARY t2 ref c c 5 test.t1.b 1 1 PRIMARY t1 ref b b 5 test.t1.b 2 +1 PRIMARY t2 ALL NULL NULL NULL NULL 7 Using where; End temporary; Using join buffer (flat, BNL join) SELECT a, b, d FROM t1, t2 WHERE ( b, d ) IN ( SELECT b, d FROM t1, t2 WHERE b = c ); a b d -2 1 2 -7 1 2 -8 4 2 1 2 1 -4 2 1 +1 2 1 10 2 1 +10 2 1 +2 1 2 +2 1 2 3 3 3 +3 3 3 +4 2 1 +4 2 1 +5 5 5 +6 3 3 6 3 3 -9 3 3 -2 1 2 +7 1 2 7 1 2 8 4 2 -5 5 5 -3 3 3 -6 3 3 +8 4 2 +9 3 3 9 3 3 -1 2 1 -4 2 1 -10 2 1 DROP TABLE t1, t2; # Another testcase for the above that still uses LooseScan: create table t0(a int primary key); @@ -2768,22 +2767,22 @@ SELECT * FROM t1 AS t1_1, t1 AS t1_2 WHERE (t1_1.a, t1_2.a) IN ( SELECT a, b FROM v1 ); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1_1 ALL NULL NULL NULL NULL 11 Using where -1 PRIMARY t1_2 ALL NULL NULL NULL NULL 11 -1 PRIMARY <derived3> ref key0 key0 5 test.t1_1.a 2 Using where; FirstMatch(t1_2) +1 PRIMARY <derived3> ref key0 key0 5 test.t1_1.a 2 Start temporary +1 PRIMARY t1_2 ALL NULL NULL NULL NULL 11 Using where; End temporary 3 DERIVED t1 ALL NULL NULL NULL NULL 11 SELECT * FROM t1 AS t1_1, t1 AS t1_2 WHERE (t1_1.a, t1_2.a) IN ( SELECT a, b FROM v1 ); a b a b -3 1 9 1 -5 8 4 0 -3 9 9 1 2 4 4 0 2 4 6 8 2 6 4 0 2 6 6 8 +3 1 9 1 +3 9 9 1 5 4 4 0 -7 7 7 7 5 4 4 0 +5 8 4 0 +7 7 7 7 DROP VIEW v1; DROP TABLE t1; set @@join_cache_level= @tmp_jcl_978479; @@ -2927,9 +2926,9 @@ alias2.col_int_key = alias1.col_int_key WHERE alias1.pk = 58 OR alias1.col_varchar_key = 'o' ); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY alias1 index_merge PRIMARY,col_int_key,col_varchar_key PRIMARY,col_varchar_key 4,4 NULL 2 Using sort_union(PRIMARY,col_varchar_key); Using where; Start temporary -1 PRIMARY t2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join) -1 PRIMARY alias2 ALL col_int_key NULL NULL NULL 12 Range checked for each record (index map: 0x2); End temporary +1 PRIMARY t2 ALL NULL NULL NULL NULL 2 +1 PRIMARY alias1 index_merge PRIMARY,col_int_key,col_varchar_key PRIMARY,col_varchar_key 4,4 NULL 2 Using sort_union(PRIMARY,col_varchar_key); Using where +1 PRIMARY alias2 ALL col_int_key NULL NULL NULL 12 Range checked for each record (index map: 0x2); FirstMatch(t2) SELECT * FROM t2 WHERE (field1) IN (SELECT alias1.col_varchar_nokey AS field1 @@ -3289,8 +3288,7 @@ explain extended SELECT Id FROM t1 WHERE Id in (SELECT t1_Id FROM t2 WHERE t2.col1 IS NULL); id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 system PRIMARY NULL NULL NULL 1 100.00 -1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 100.00 -2 MATERIALIZED t2 ref col1 col1 5 const 2 100.00 Using index condition; Using where +1 PRIMARY t2 ALL col1 NULL NULL NULL 2 100.00 Using where; FirstMatch(t1) Warnings: Note 1003 select 1 AS `Id` from (`test`.`t2`) where `test`.`t2`.`t1_Id` = 1 and `test`.`t2`.`col1` is null DROP TABLE t1, t2; diff --git a/mysql-test/main/subselect_sj.test b/mysql-test/main/subselect_sj.test index c5c3354bc32..4725aeda037 100644 --- a/mysql-test/main/subselect_sj.test +++ b/mysql-test/main/subselect_sj.test @@ -738,6 +738,7 @@ INSERT INTO t1 VALUES (1,'o','ffff','ffff','ffoo','ffff','ffff','ffff','ffff','f CREATE TABLE t2 LIKE t1; INSERT INTO t2 VALUES (1,'i','iiii','iiii','iiii','iiii','ffff','ffff','ffff','ffff','ffff',GeomFromText('POLYGON((0 0, 0 2, 2 2, 2 0, 0 0))')), (2,'f','ffff','ffff','ffff','ffff','ffff','ffff','ffff','ffff','ffff',GeomFromText('POLYGON((0 0, 0 2, 2 2, 2 0, 0 0))')); +insert into t2 (pk) values (-1),(0); # Test that materialization is skipped for semijoins where materialized # table would contain GEOMETRY or different kinds of BLOB/TEXT columns @@ -1738,7 +1739,7 @@ DROP TABLE t1,t2,t3; --echo # --echo # BUG#803457: Wrong result with semijoin + view + outer join in maria-5.3-subqueries-mwl90 ---echo # (Original testcase) +--echo # (Original, slightly modified testcase) --echo # CREATE TABLE t1 (f1 int, f2 int ); @@ -1752,15 +1753,13 @@ INSERT INTO t3 VALUES (2,0),(4,0),(0,NULL),(4,0),(8,0); CREATE TABLE t4 ( f2 int, KEY (f2) ); INSERT INTO t4 VALUES (0),(NULL); - -CREATE VIEW v4 AS SELECT DISTINCT f2 FROM t4 ; +INSERT INTO t4 VALUES (0),(NULL),(-1),(-2),(-3); --echo # The following must not have outer joins: explain extended -SELECT * FROM t1 NATURAL LEFT JOIN (t2, t3) WHERE t2.f3 IN (SELECT * FROM t4); -SELECT * FROM t1 NATURAL LEFT JOIN (t2, t3) WHERE t2.f3 IN (SELECT * FROM t4); +SELECT * FROM t1 NATURAL LEFT JOIN (t2, t3) WHERE t2.f3 IN (SELECT * FROM t4 where f2 = 0 or f2 IS NULL); +SELECT * FROM t1 NATURAL LEFT JOIN (t2, t3) WHERE t2.f3 IN (SELECT * FROM t4 where f2 = 0 or f2 IS NULL); -drop view v4; drop table t1, t2, t3, t4; --echo # @@ -2248,6 +2247,7 @@ INSERT INTO t1 VALUES CREATE TABLE t2 ( a INT, b INT, KEY(a)) ENGINE=MyISAM; INSERT INTO t2 VALUES (3,20),(2,21),(3,22); +--sorted_result SELECT * FROM t1 AS alias1, t1 AS alias2 WHERE ( alias1.c, alias2.c ) @@ -2298,6 +2298,7 @@ explain SELECT a, b, d FROM t1, t2 WHERE ( b, d ) IN ( SELECT b, d FROM t1, t2 WHERE b = c ); +--sorted_result SELECT a, b, d FROM t1, t2 WHERE ( b, d ) IN ( SELECT b, d FROM t1, t2 WHERE b = c ); @@ -2448,6 +2449,7 @@ EXPLAIN SELECT * FROM t1 AS t1_1, t1 AS t1_2 WHERE (t1_1.a, t1_2.a) IN ( SELECT a, b FROM v1 ); +--sorted_result SELECT * FROM t1 AS t1_1, t1 AS t1_2 WHERE (t1_1.a, t1_2.a) IN ( SELECT a, b FROM v1 ); diff --git a/mysql-test/main/subselect_sj2.result b/mysql-test/main/subselect_sj2.result index 477c6034f89..a2eaf0aef23 100644 --- a/mysql-test/main/subselect_sj2.result +++ b/mysql-test/main/subselect_sj2.result @@ -54,9 +54,9 @@ a b 19 14 explain select * from t2 where b in (select a from t1); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t2 ALL b NULL NULL NULL 20 -1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 -2 MATERIALIZED t1 ALL NULL NULL NULL NULL 3 +1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 3 +1 PRIMARY t2 ref b b 5 test.t1.a 2 +2 MATERIALIZED t1 ALL NULL NULL NULL NULL 3 Using where select * from t2 where b in (select a from t1); a b 1 1 @@ -82,9 +82,9 @@ test.t3 analyze status Engine-independent statistics collected test.t3 analyze status OK explain select * from t3 where b in (select a from t1); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t3 ALL b NULL NULL NULL 20 -1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 -2 MATERIALIZED t1 ALL NULL NULL NULL NULL 3 +1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 3 +1 PRIMARY t3 ref b b 5 test.t1.a 2 +2 MATERIALIZED t1 ALL NULL NULL NULL NULL 3 Using where select * from t3 where b in (select a from t1); a b pk1 pk2 pk3 1 1 1 1 1 @@ -108,9 +108,9 @@ A.a + 10*B.a, A.a + 10*B.a, A.a + 10*B.a, A.a + 10*B.a from t0 A, t0 B where B.a <5; explain select * from t3 where b in (select a from t0); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t3 ALL b NULL NULL NULL # -1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func # -2 MATERIALIZED t0 ALL NULL NULL NULL NULL # +1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL # +1 PRIMARY t3 ref b b 5 test.t0.a # +2 MATERIALIZED t0 ALL NULL NULL NULL NULL # Using where select * from t3 where b in (select A.a+B.a from t0 A, t0 B where B.a<5); a b pk1 pk2 0 0 0 0 @@ -303,7 +303,7 @@ from t0 where a in id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t0 ALL NULL NULL NULL NULL 10 1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 8 func 1 Using where -2 MATERIALIZED t1 range a a 5 NULL 10 Using where; Using index +2 MATERIALIZED t1 index a a 5 NULL 10 Using where; Using index 2 MATERIALIZED t2 ref a a 5 test.t1.a 1 Using index 2 MATERIALIZED t3 ref a a 5 test.t1.a 1 Using index drop table t0, t1,t2,t3; @@ -730,9 +730,8 @@ alter table t3 add primary key(id), add key(a); The following must use loose index scan over t3, key a: explain select count(a) from t2 where a in ( SELECT a FROM t3); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t2 index a a 5 NULL 1000 Using index -1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 -2 MATERIALIZED t3 index a a 5 NULL 30000 Using index +1 PRIMARY t2 index a a 5 NULL 1000 Using where; Using index +1 PRIMARY t3 ref a a 5 test.t2.a 30 Using index; FirstMatch(t2) select count(a) from t2 where a in ( SELECT a FROM t3); count(a) 1000 @@ -758,10 +757,9 @@ c2 in (select 1 from t3, t2) and c1 in (select convert(c6,char(1)) from t2); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t2 ALL NULL NULL NULL NULL 1 Using where -1 PRIMARY <subquery3> eq_ref distinct_key distinct_key 4 func 1 Using where +1 PRIMARY t2 ALL NULL NULL NULL NULL 1 Using where; FirstMatch(t2) 1 PRIMARY t2 ALL NULL NULL NULL NULL 1 -1 PRIMARY t3 ALL NULL NULL NULL NULL 2 FirstMatch((sj-nest)) -3 MATERIALIZED t2 ALL NULL NULL NULL NULL 1 +1 PRIMARY t3 ALL NULL NULL NULL NULL 2 FirstMatch(t2) drop table t2, t3; # # BUG#761598: InnoDB: Error: row_search_for_mysql() is called without ha_innobase::external_lock() in maria-5.3 @@ -826,9 +824,9 @@ SELECT * FROM t3 WHERE f12 IN (SELECT alias2.f12 FROM t1 AS alias1, t2 AS alias2, t1 WHERE alias1.f13 = 24); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY alias1 const PRIMARY PRIMARY 4 const # Using index -1 PRIMARY alias2 index f12 f12 7 NULL # Using index; Start temporary -1 PRIMARY t1 index NULL PRIMARY 4 NULL # Using index -1 PRIMARY t3 ALL NULL NULL NULL NULL # Using where; End temporary; Using join buffer (flat, BNL join) +1 PRIMARY alias2 index f12 f12 7 NULL # Using index; LooseScan +1 PRIMARY t1 index NULL PRIMARY 4 NULL # Using index; FirstMatch(alias2) +1 PRIMARY t3 ALL NULL NULL NULL NULL # Using where; Using join buffer (flat, BNL join) SELECT * FROM t3 WHERE f12 IN (SELECT alias2.f12 FROM t1 AS alias1, t2 AS alias2, t1 WHERE alias1.f13 = 24); f12 @@ -1211,9 +1209,9 @@ explain SELECT * FROM t1, t3 WHERE t3_c IN ( SELECT t1_pk2 FROM t4, t2 WHERE t2_c = t1_pk2 AND t2_i >= t3_i ) AND ( t1_pk1 = 'POL' ); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 ref PRIMARY PRIMARY 5 const 1 Using where; Using index -1 PRIMARY t2 ALL NULL NULL NULL NULL 1 Start temporary -1 PRIMARY t3 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join) -1 PRIMARY t4 index NULL PRIMARY 59 NULL 2 Using where; Using index; End temporary +1 PRIMARY t3 ALL NULL NULL NULL NULL 2 Using join buffer (flat, BNL join) +1 PRIMARY t2 ALL NULL NULL NULL NULL 1 Using where +1 PRIMARY t4 index NULL PRIMARY 59 NULL 2 Using where; Using index; FirstMatch(t3) DROP TABLE t1,t2,t3,t4; # # MDEV-6263: Wrong result when using IN subquery with order by @@ -1333,8 +1331,8 @@ T3_0_.t3idref= 1 id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY T3_0_ ref PRIMARY,FK_T3_T2Id PRIMARY 8 const 3 Using index; Start temporary 1 PRIMARY T2_1_ eq_ref PRIMARY,FK_T2_T1Id PRIMARY 8 test.T3_0_.t2idref 1 -1 PRIMARY T1_1_ eq_ref PRIMARY PRIMARY 8 test.T2_1_.t1idref 1 Using index -1 PRIMARY T2_0_ ref FK_T2_T1Id FK_T2_T1Id 8 test.T2_1_.t1idref 1 Using index; End temporary +1 PRIMARY T2_0_ ref FK_T2_T1Id FK_T2_T1Id 8 test.T2_1_.t1idref 1 Using index +1 PRIMARY T1_1_ eq_ref PRIMARY PRIMARY 8 test.T2_1_.t1idref 1 Using index; End temporary drop table t3,t2,t1; set optimizer_search_depth=@tmp7474; # diff --git a/mysql-test/main/subselect_sj2.test b/mysql-test/main/subselect_sj2.test index be2d91571e7..419deb6f7e7 100644 --- a/mysql-test/main/subselect_sj2.test +++ b/mysql-test/main/subselect_sj2.test @@ -1305,8 +1305,6 @@ SELECT * FROM t1 WHERE 9 IN ( SELECT b FROM t2 WHERE 1 IN ( SELECT MIN(c) FROM t DROP TABLE t1,t2,t3; ---source include/have_innodb.inc - --disable_warnings DROP TABLE IF EXISTS t1,t2,t3,t4; --enable_warnings diff --git a/mysql-test/main/subselect_sj2_jcl6.result b/mysql-test/main/subselect_sj2_jcl6.result index ad169028373..f51f06b141c 100644 --- a/mysql-test/main/subselect_sj2_jcl6.result +++ b/mysql-test/main/subselect_sj2_jcl6.result @@ -65,9 +65,9 @@ a b 19 14 explain select * from t2 where b in (select a from t1); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t2 ALL b NULL NULL NULL 20 -1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 -2 MATERIALIZED t1 ALL NULL NULL NULL NULL 3 +1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 3 +1 PRIMARY t2 ref b b 5 test.t1.a 2 Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan +2 MATERIALIZED t1 ALL NULL NULL NULL NULL 3 Using where select * from t2 where b in (select a from t1); a b 1 1 @@ -93,9 +93,9 @@ test.t3 analyze status Engine-independent statistics collected test.t3 analyze status OK explain select * from t3 where b in (select a from t1); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t3 ALL b NULL NULL NULL 20 -1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 -2 MATERIALIZED t1 ALL NULL NULL NULL NULL 3 +1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 3 +1 PRIMARY t3 ref b b 5 test.t1.a 2 Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan +2 MATERIALIZED t1 ALL NULL NULL NULL NULL 3 Using where select * from t3 where b in (select a from t1); a b pk1 pk2 pk3 1 1 1 1 1 @@ -119,9 +119,9 @@ A.a + 10*B.a, A.a + 10*B.a, A.a + 10*B.a, A.a + 10*B.a from t0 A, t0 B where B.a <5; explain select * from t3 where b in (select a from t0); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t3 ALL b NULL NULL NULL # -1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func # -2 MATERIALIZED t0 ALL NULL NULL NULL NULL # +1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL # +1 PRIMARY t3 ref b b 5 test.t0.a # Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan +2 MATERIALIZED t0 ALL NULL NULL NULL NULL # Using where select * from t3 where b in (select A.a+B.a from t0 A, t0 B where B.a<5); a b pk1 pk2 0 0 0 0 @@ -314,7 +314,7 @@ from t0 where a in id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t0 ALL NULL NULL NULL NULL 10 1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 8 func 1 Using where -2 MATERIALIZED t1 range a a 5 NULL 10 Using where; Using index +2 MATERIALIZED t1 index a a 5 NULL 10 Using where; Using index 2 MATERIALIZED t2 ref a a 5 test.t1.a 1 Using index 2 MATERIALIZED t3 ref a a 5 test.t1.a 1 Using index drop table t0, t1,t2,t3; @@ -743,9 +743,8 @@ alter table t3 add primary key(id), add key(a); The following must use loose index scan over t3, key a: explain select count(a) from t2 where a in ( SELECT a FROM t3); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t2 index a a 5 NULL 1000 Using index -1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 -2 MATERIALIZED t3 index a a 5 NULL 30000 Using index +1 PRIMARY t2 index a a 5 NULL 1000 Using where; Using index +1 PRIMARY t3 ref a a 5 test.t2.a 30 Using index; FirstMatch(t2) select count(a) from t2 where a in ( SELECT a FROM t3); count(a) 1000 @@ -771,10 +770,9 @@ c2 in (select 1 from t3, t2) and c1 in (select convert(c6,char(1)) from t2); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t2 ALL NULL NULL NULL NULL 1 Using where -1 PRIMARY <subquery3> eq_ref distinct_key distinct_key 4 func 1 Using where -1 PRIMARY t2 ALL NULL NULL NULL NULL 1 Using join buffer (flat, BNL join) -1 PRIMARY t3 ALL NULL NULL NULL NULL 2 FirstMatch((sj-nest)); Using join buffer (incremental, BNL join) -3 MATERIALIZED t2 ALL NULL NULL NULL NULL 1 +1 PRIMARY t2 ALL NULL NULL NULL NULL 1 Using where; FirstMatch(t2); Using join buffer (flat, BNL join) +1 PRIMARY t2 ALL NULL NULL NULL NULL 1 Using join buffer (incremental, BNL join) +1 PRIMARY t3 ALL NULL NULL NULL NULL 2 FirstMatch(t2); Using join buffer (incremental, BNL join) drop table t2, t3; # # BUG#761598: InnoDB: Error: row_search_for_mysql() is called without ha_innobase::external_lock() in maria-5.3 @@ -1346,8 +1344,8 @@ T3_0_.t3idref= 1 id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY T3_0_ ref PRIMARY,FK_T3_T2Id PRIMARY 8 const 3 Using index; Start temporary 1 PRIMARY T2_1_ eq_ref PRIMARY,FK_T2_T1Id PRIMARY 8 test.T3_0_.t2idref 1 Using join buffer (flat, BKA join); Key-ordered scan -1 PRIMARY T1_1_ eq_ref PRIMARY PRIMARY 8 test.T2_1_.t1idref 1 Using index -1 PRIMARY T2_0_ ref FK_T2_T1Id FK_T2_T1Id 8 test.T2_1_.t1idref 1 Using index; End temporary +1 PRIMARY T2_0_ ref FK_T2_T1Id FK_T2_T1Id 8 test.T2_1_.t1idref 1 Using index +1 PRIMARY T1_1_ eq_ref PRIMARY PRIMARY 8 test.T2_1_.t1idref 1 Using index; End temporary drop table t3,t2,t1; set optimizer_search_depth=@tmp7474; # @@ -1425,10 +1423,9 @@ SELECT t3.* FROM t1 JOIN t3 ON t3.b = t1.b WHERE c IN (SELECT t4.b FROM t4 JOIN t2); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t3 ALL NULL NULL NULL NULL 1 Using where -1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 +1 PRIMARY t2 ALL NULL NULL NULL NULL 1 Using join buffer (flat, BNL join) +1 PRIMARY t4 ALL NULL NULL NULL NULL 2 Using where; FirstMatch(t3); Using join buffer (incremental, BNL join) 1 PRIMARY t1 ref b b 4 test.t3.b 1 Using index -2 MATERIALIZED t2 ALL NULL NULL NULL NULL 1 -2 MATERIALIZED t4 ALL NULL NULL NULL NULL 2 Using join buffer (flat, BNL join) SELECT t3.* FROM t1 JOIN t3 ON t3.b = t1.b WHERE c IN (SELECT t4.b FROM t4 JOIN t2); b c @@ -1446,7 +1443,7 @@ INSERT INTO t2 VALUES (8); CREATE TABLE t3 (pk int PRIMARY KEY, a int); INSERT INTO t3 VALUES (1, 6), (2, 8); CREATE TABLE t4 (b int) ENGINE=InnoDB; -INSERT INTO t4 VALUES (2); +INSERT INTO t4 VALUES (2),(88),(99); set @tmp_optimizer_switch=@@optimizer_switch; SET optimizer_switch = 'semijoin_with_cache=on'; SET join_cache_level = 2; @@ -1454,10 +1451,9 @@ EXPLAIN SELECT * FROM t1, t2 WHERE b IN (SELECT a FROM t3, t4 WHERE b = pk); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t2 ALL NULL NULL NULL NULL 1 -1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 +1 PRIMARY t4 ALL NULL NULL NULL NULL 3 Using where +1 PRIMARY t3 eq_ref PRIMARY PRIMARY 4 test.t4.b 1 Using where; FirstMatch(t2) 1 PRIMARY t1 ALL NULL NULL NULL NULL 2 Using join buffer (flat, BNL join) -2 MATERIALIZED t4 ALL NULL NULL NULL NULL 1 Using where -2 MATERIALIZED t3 eq_ref PRIMARY PRIMARY 4 test.t4.b 1 SELECT * FROM t1, t2 WHERE b IN (SELECT a FROM t3, t4 WHERE b = pk); pk a b 1 6 8 @@ -1479,8 +1475,7 @@ EXPLAIN SELECT * FROM t1 WHERE b IN (SELECT a FROM t2 GROUP BY a); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 1 -1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 -2 MATERIALIZED t2 ALL NULL NULL NULL NULL 1 +1 PRIMARY t2 ALL NULL NULL NULL NULL 1 Using where; FirstMatch(t1); Using join buffer (flat, BNL join) SELECT * FROM t1 WHERE b IN (SELECT a FROM t2 GROUP BY a); a b v v diff --git a/mysql-test/main/subselect_sj2_jcl6.test b/mysql-test/main/subselect_sj2_jcl6.test index a0c8a6c0f04..ea3f07b289a 100644 --- a/mysql-test/main/subselect_sj2_jcl6.test +++ b/mysql-test/main/subselect_sj2_jcl6.test @@ -66,7 +66,7 @@ INSERT INTO t2 VALUES (8); CREATE TABLE t3 (pk int PRIMARY KEY, a int); INSERT INTO t3 VALUES (1, 6), (2, 8); CREATE TABLE t4 (b int) ENGINE=InnoDB; -INSERT INTO t4 VALUES (2); +INSERT INTO t4 VALUES (2),(88),(99); set @tmp_optimizer_switch=@@optimizer_switch; diff --git a/mysql-test/main/subselect_sj2_mat.result b/mysql-test/main/subselect_sj2_mat.result index dd434ff69a9..ec4841fab3d 100644 --- a/mysql-test/main/subselect_sj2_mat.result +++ b/mysql-test/main/subselect_sj2_mat.result @@ -56,9 +56,9 @@ a b 19 14 explain select * from t2 where b in (select a from t1); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t2 ALL b NULL NULL NULL 20 -1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 -2 MATERIALIZED t1 ALL NULL NULL NULL NULL 3 +1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 3 +1 PRIMARY t2 ref b b 5 test.t1.a 2 +2 MATERIALIZED t1 ALL NULL NULL NULL NULL 3 Using where select * from t2 where b in (select a from t1); a b 1 1 @@ -84,9 +84,9 @@ test.t3 analyze status Engine-independent statistics collected test.t3 analyze status OK explain select * from t3 where b in (select a from t1); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t3 ALL b NULL NULL NULL 20 -1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 -2 MATERIALIZED t1 ALL NULL NULL NULL NULL 3 +1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 3 +1 PRIMARY t3 ref b b 5 test.t1.a 2 +2 MATERIALIZED t1 ALL NULL NULL NULL NULL 3 Using where select * from t3 where b in (select a from t1); a b pk1 pk2 pk3 1 1 1 1 1 @@ -110,9 +110,9 @@ A.a + 10*B.a, A.a + 10*B.a, A.a + 10*B.a, A.a + 10*B.a from t0 A, t0 B where B.a <5; explain select * from t3 where b in (select a from t0); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t3 ALL b NULL NULL NULL # -1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func # -2 MATERIALIZED t0 ALL NULL NULL NULL NULL # +1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL # +1 PRIMARY t3 ref b b 5 test.t0.a # +2 MATERIALIZED t0 ALL NULL NULL NULL NULL # Using where select * from t3 where b in (select A.a+B.a from t0 A, t0 B where B.a<5); a b pk1 pk2 0 0 0 0 @@ -305,7 +305,7 @@ from t0 where a in id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t0 ALL NULL NULL NULL NULL 10 1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 8 func 1 Using where -2 MATERIALIZED t1 range a a 5 NULL 10 Using where; Using index +2 MATERIALIZED t1 index a a 5 NULL 10 Using where; Using index 2 MATERIALIZED t2 ref a a 5 test.t1.a 1 Using index 2 MATERIALIZED t3 ref a a 5 test.t1.a 1 Using index drop table t0, t1,t2,t3; @@ -732,9 +732,8 @@ alter table t3 add primary key(id), add key(a); The following must use loose index scan over t3, key a: explain select count(a) from t2 where a in ( SELECT a FROM t3); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t2 index a a 5 NULL 1000 Using index -1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 -2 MATERIALIZED t3 index a a 5 NULL 30000 Using index +1 PRIMARY t2 index a a 5 NULL 1000 Using where; Using index +1 PRIMARY t3 ref a a 5 test.t2.a 30 Using index; FirstMatch(t2) select count(a) from t2 where a in ( SELECT a FROM t3); count(a) 1000 @@ -760,10 +759,9 @@ c2 in (select 1 from t3, t2) and c1 in (select convert(c6,char(1)) from t2); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t2 ALL NULL NULL NULL NULL 1 Using where -1 PRIMARY <subquery3> eq_ref distinct_key distinct_key 4 func 1 Using where +1 PRIMARY t2 ALL NULL NULL NULL NULL 1 Using where; FirstMatch(t2) 1 PRIMARY t2 ALL NULL NULL NULL NULL 1 -1 PRIMARY t3 ALL NULL NULL NULL NULL 2 FirstMatch((sj-nest)) -3 MATERIALIZED t2 ALL NULL NULL NULL NULL 1 +1 PRIMARY t3 ALL NULL NULL NULL NULL 2 FirstMatch(t2) drop table t2, t3; # # BUG#761598: InnoDB: Error: row_search_for_mysql() is called without ha_innobase::external_lock() in maria-5.3 @@ -828,9 +826,9 @@ SELECT * FROM t3 WHERE f12 IN (SELECT alias2.f12 FROM t1 AS alias1, t2 AS alias2, t1 WHERE alias1.f13 = 24); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY alias1 const PRIMARY PRIMARY 4 const # Using index -1 PRIMARY alias2 index f12 f12 7 NULL # Using index; Start temporary -1 PRIMARY t1 index NULL PRIMARY 4 NULL # Using index -1 PRIMARY t3 ALL NULL NULL NULL NULL # Using where; End temporary; Using join buffer (flat, BNL join) +1 PRIMARY alias2 index f12 f12 7 NULL # Using index; LooseScan +1 PRIMARY t1 index NULL PRIMARY 4 NULL # Using index; FirstMatch(alias2) +1 PRIMARY t3 ALL NULL NULL NULL NULL # Using where; Using join buffer (flat, BNL join) SELECT * FROM t3 WHERE f12 IN (SELECT alias2.f12 FROM t1 AS alias1, t2 AS alias2, t1 WHERE alias1.f13 = 24); f12 @@ -1213,9 +1211,9 @@ explain SELECT * FROM t1, t3 WHERE t3_c IN ( SELECT t1_pk2 FROM t4, t2 WHERE t2_c = t1_pk2 AND t2_i >= t3_i ) AND ( t1_pk1 = 'POL' ); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 ref PRIMARY PRIMARY 5 const 1 Using where; Using index -1 PRIMARY t2 ALL NULL NULL NULL NULL 1 Start temporary -1 PRIMARY t3 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join) -1 PRIMARY t4 index NULL PRIMARY 59 NULL 2 Using where; Using index; End temporary +1 PRIMARY t3 ALL NULL NULL NULL NULL 2 Using join buffer (flat, BNL join) +1 PRIMARY t2 ALL NULL NULL NULL NULL 1 Using where +1 PRIMARY t4 index NULL PRIMARY 59 NULL 2 Using where; Using index; FirstMatch(t3) DROP TABLE t1,t2,t3,t4; # # MDEV-6263: Wrong result when using IN subquery with order by @@ -1335,8 +1333,8 @@ T3_0_.t3idref= 1 id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY T3_0_ ref PRIMARY,FK_T3_T2Id PRIMARY 8 const 3 Using index; Start temporary 1 PRIMARY T2_1_ eq_ref PRIMARY,FK_T2_T1Id PRIMARY 8 test.T3_0_.t2idref 1 -1 PRIMARY T1_1_ eq_ref PRIMARY PRIMARY 8 test.T2_1_.t1idref 1 Using index -1 PRIMARY T2_0_ ref FK_T2_T1Id FK_T2_T1Id 8 test.T2_1_.t1idref 1 Using index; End temporary +1 PRIMARY T2_0_ ref FK_T2_T1Id FK_T2_T1Id 8 test.T2_1_.t1idref 1 Using index +1 PRIMARY T1_1_ eq_ref PRIMARY PRIMARY 8 test.T2_1_.t1idref 1 Using index; End temporary drop table t3,t2,t1; set optimizer_search_depth=@tmp7474; # @@ -1511,9 +1509,8 @@ t3.cat_id IN (SELECT cat_id FROM t2) AND t3.sack_id = 33479 AND t3.kit_id = 6; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t3 ref PRIMARY PRIMARY 5 const,const 5 Using index -1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 Using where -1 PRIMARY t1 eq_ref PRIMARY PRIMARY 4 test.t3.cat_id 1 Using index -2 MATERIALIZED t2 index cat_id cat_id 4 NULL 19 Using index +1 PRIMARY t2 ref cat_id cat_id 4 test.t3.cat_id 2 Using where; Using index; FirstMatch(t3) +1 PRIMARY t1 eq_ref PRIMARY PRIMARY 4 test.t2.cat_id 1 Using where; Using index SELECT count(*) FROM t1, t3 WHERE t1.cat_id = t3.cat_id AND t3.cat_id IN (SELECT cat_id FROM t2) AND @@ -1725,7 +1722,7 @@ WHERE f1 IN ( SELECT f2 FROM t2 WHERE f2 > 'bar' ) HAVING f1 != 'foo' ORDER BY f1; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 range f1 f1 11 NULL 2 Using where; Using index +1 PRIMARY t1 index f1 f1 11 NULL 2 Using where; Using index 1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 11 func 1 2 MATERIALIZED t2 ALL NULL NULL NULL NULL 3 Using where DROP TABLE t1,t2; @@ -1929,20 +1926,20 @@ AND t3.id_product IN (SELECT id_product FROM t2 t2_3 WHERE t2_3.id_t2 = 18 OR t2 AND t3.id_product IN (SELECT id_product FROM t2 t2_4 WHERE t2_4.id_t2 = 34 OR t2_4.id_t2 = 23) AND t3.id_product IN (SELECT id_product FROM t2 t2_5 WHERE t2_5.id_t2 = 29 OR t2_5.id_t2 = 28 OR t2_5.id_t2 = 26); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY <subquery3> ALL distinct_key NULL NULL NULL 12 -1 PRIMARY t3 eq_ref PRIMARY PRIMARY 4 test.t2_2.id_product 1 Using where; Using index +1 PRIMARY t1 index NULL PRIMARY 8 NULL 73 Using index +1 PRIMARY t3 eq_ref PRIMARY PRIMARY 4 test.t1.id_product 1 Using index 1 PRIMARY <subquery5> eq_ref distinct_key distinct_key 4 func 1 Using where -1 PRIMARY t5 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join) -1 PRIMARY <subquery6> eq_ref distinct_key distinct_key 4 func 1 Using where -1 PRIMARY t4 eq_ref PRIMARY PRIMARY 8 test.t3.id_product,const 1 Using where; Using index 1 PRIMARY <subquery4> eq_ref distinct_key distinct_key 4 func 1 Using where -1 PRIMARY t1 index NULL PRIMARY 8 NULL 73 Using where; Using index; Using join buffer (flat, BNL join) +1 PRIMARY <subquery3> eq_ref distinct_key distinct_key 4 func 1 Using where 1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 Using where -3 MATERIALIZED t2_2 ref id_t2,id_product id_t2 5 const 12 Using where +1 PRIMARY t4 eq_ref PRIMARY PRIMARY 8 test.t1.id_product,const 1 Using where; Using index +1 PRIMARY <subquery6> eq_ref distinct_key distinct_key 4 func 1 Using where +1 PRIMARY t5 ALL NULL NULL NULL NULL 18 Using where; Using join buffer (flat, BNL join) 5 MATERIALIZED t2_4 range id_t2,id_product id_t2 5 NULL 18 Using index condition; Using where -6 MATERIALIZED t2_5 range id_t2,id_product id_t2 5 NULL 31 Using index condition; Using where 4 MATERIALIZED t2_3 range id_t2,id_product id_t2 5 NULL 33 Using index condition; Using where -2 MATERIALIZED t2_1 ALL id_t2,id_product NULL NULL NULL 223 Using where +3 MATERIALIZED t2_2 ref id_t2,id_product id_t2 5 const 12 +2 MATERIALIZED t2_1 ref id_t2,id_product id_t2 5 const 51 +6 MATERIALIZED t2_5 range id_t2,id_product id_t2 5 NULL 31 Using index condition; Using where set optimizer_switch='rowid_filter=default'; drop table t1,t2,t3,t4,t5; set global innodb_stats_persistent= @innodb_stats_persistent_save; diff --git a/mysql-test/main/subselect_sj_jcl6.result b/mysql-test/main/subselect_sj_jcl6.result index c24fcb28977..ee06bf4f9a0 100644 --- a/mysql-test/main/subselect_sj_jcl6.result +++ b/mysql-test/main/subselect_sj_jcl6.result @@ -171,26 +171,26 @@ id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY s47 ALL NULL NULL NULL NULL 3 Using join buffer (incremental, BNL join) 1 PRIMARY s48 ALL NULL NULL NULL NULL 3 Using join buffer (incremental, BNL join) 1 PRIMARY s49 ALL NULL NULL NULL NULL 3 Using join buffer (incremental, BNL join) -2 MATERIALIZED m00 ALL NULL NULL NULL NULL 3 -2 MATERIALIZED m01 ALL NULL NULL NULL NULL 3 Using join buffer (flat, BNL join) -2 MATERIALIZED m02 ALL NULL NULL NULL NULL 3 Using join buffer (incremental, BNL join) -2 MATERIALIZED m03 ALL NULL NULL NULL NULL 3 Using join buffer (incremental, BNL join) -2 MATERIALIZED m04 ALL NULL NULL NULL NULL 3 Using join buffer (incremental, BNL join) -2 MATERIALIZED m05 ALL NULL NULL NULL NULL 3 Using join buffer (incremental, BNL join) -2 MATERIALIZED m06 ALL NULL NULL NULL NULL 3 Using join buffer (incremental, BNL join) -2 MATERIALIZED m07 ALL NULL NULL NULL NULL 3 Using join buffer (incremental, BNL join) -2 MATERIALIZED m08 ALL NULL NULL NULL NULL 3 Using join buffer (incremental, BNL join) -2 MATERIALIZED m09 ALL NULL NULL NULL NULL 3 Using join buffer (incremental, BNL join) -2 MATERIALIZED m10 ALL NULL NULL NULL NULL 3 Using join buffer (incremental, BNL join) -2 MATERIALIZED m11 ALL NULL NULL NULL NULL 3 Using join buffer (incremental, BNL join) -2 MATERIALIZED m12 ALL NULL NULL NULL NULL 3 Using join buffer (incremental, BNL join) -2 MATERIALIZED m13 ALL NULL NULL NULL NULL 3 Using join buffer (incremental, BNL join) -2 MATERIALIZED m14 ALL NULL NULL NULL NULL 3 Using join buffer (incremental, BNL join) -2 MATERIALIZED m15 ALL NULL NULL NULL NULL 3 Using join buffer (incremental, BNL join) -2 MATERIALIZED m16 ALL NULL NULL NULL NULL 3 Using join buffer (incremental, BNL join) -2 MATERIALIZED m17 ALL NULL NULL NULL NULL 3 Using join buffer (incremental, BNL join) -2 MATERIALIZED m18 ALL NULL NULL NULL NULL 3 Using join buffer (incremental, BNL join) -2 MATERIALIZED m19 ALL NULL NULL NULL NULL 3 Using join buffer (incremental, BNL join) +2 DEPENDENT SUBQUERY m00 ALL NULL NULL NULL NULL 3 Using where +2 DEPENDENT SUBQUERY m01 ALL NULL NULL NULL NULL 3 Using join buffer (flat, BNL join) +2 DEPENDENT SUBQUERY m02 ALL NULL NULL NULL NULL 3 Using join buffer (incremental, BNL join) +2 DEPENDENT SUBQUERY m03 ALL NULL NULL NULL NULL 3 Using join buffer (incremental, BNL join) +2 DEPENDENT SUBQUERY m04 ALL NULL NULL NULL NULL 3 Using join buffer (incremental, BNL join) +2 DEPENDENT SUBQUERY m05 ALL NULL NULL NULL NULL 3 Using join buffer (incremental, BNL join) +2 DEPENDENT SUBQUERY m06 ALL NULL NULL NULL NULL 3 Using join buffer (incremental, BNL join) +2 DEPENDENT SUBQUERY m07 ALL NULL NULL NULL NULL 3 Using join buffer (incremental, BNL join) +2 DEPENDENT SUBQUERY m08 ALL NULL NULL NULL NULL 3 Using join buffer (incremental, BNL join) +2 DEPENDENT SUBQUERY m09 ALL NULL NULL NULL NULL 3 Using join buffer (incremental, BNL join) +2 DEPENDENT SUBQUERY m10 ALL NULL NULL NULL NULL 3 Using join buffer (incremental, BNL join) +2 DEPENDENT SUBQUERY m11 ALL NULL NULL NULL NULL 3 Using join buffer (incremental, BNL join) +2 DEPENDENT SUBQUERY m12 ALL NULL NULL NULL NULL 3 Using join buffer (incremental, BNL join) +2 DEPENDENT SUBQUERY m13 ALL NULL NULL NULL NULL 3 Using join buffer (incremental, BNL join) +2 DEPENDENT SUBQUERY m14 ALL NULL NULL NULL NULL 3 Using join buffer (incremental, BNL join) +2 DEPENDENT SUBQUERY m15 ALL NULL NULL NULL NULL 3 Using join buffer (incremental, BNL join) +2 DEPENDENT SUBQUERY m16 ALL NULL NULL NULL NULL 3 Using join buffer (incremental, BNL join) +2 DEPENDENT SUBQUERY m17 ALL NULL NULL NULL NULL 3 Using join buffer (incremental, BNL join) +2 DEPENDENT SUBQUERY m18 ALL NULL NULL NULL NULL 3 Using join buffer (incremental, BNL join) +2 DEPENDENT SUBQUERY m19 ALL NULL NULL NULL NULL 3 Using join buffer (incremental, BNL join) select * from t1 left join t2 on (t2.a= t1.a and t2.a in (select pk from t10)) where t1.a < 5; @@ -216,10 +216,10 @@ a b a b insert into t1 select (A.a + 10 * B.a),1 from t0 A, t0 B; explain extended select * from t1 where a in (select pk from t10 where pk<3); id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t10 range PRIMARY PRIMARY 4 NULL 3 100.00 Using where; Using index -1 PRIMARY t1 ALL NULL NULL NULL NULL 103 100.00 Using where; Using join buffer (flat, BNL join) +1 PRIMARY t1 ALL NULL NULL NULL NULL 103 100.00 Using where +1 PRIMARY t10 eq_ref PRIMARY PRIMARY 4 test.t1.a 1 100.00 Using index Warnings: -Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t10` join `test`.`t1` where `test`.`t1`.`a` = `test`.`t10`.`pk` and `test`.`t10`.`pk` < 3 +Note 1003 select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from `test`.`t10` join `test`.`t1` where `test`.`t10`.`pk` = `test`.`t1`.`a` and `test`.`t1`.`a` < 3 drop table t0, t1, t2; drop table t10, t11, t12; @@ -355,8 +355,8 @@ WHERE PNUM IN (SELECT PNUM FROM PROJ)); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY STAFF ALL NULL NULL NULL NULL 5 -1 PRIMARY PROJ ALL NULL NULL NULL NULL 6 Start temporary; Using join buffer (flat, BNL join) -1 PRIMARY WORKS ALL NULL NULL NULL NULL 12 Using where; End temporary; Using join buffer (incremental, BNL join) +1 PRIMARY PROJ ALL NULL NULL NULL NULL 6 Using join buffer (flat, BNL join) +1 PRIMARY WORKS ALL NULL NULL NULL NULL 12 Using where; FirstMatch(STAFF); Using join buffer (incremental, BNL join) SELECT EMPNUM, EMPNAME FROM STAFF WHERE EMPNUM IN @@ -813,6 +813,7 @@ PRIMARY KEY (pk) INSERT INTO t1 VALUES (1,'o','ffff','ffff','ffoo','ffff','ffff','ffff','ffff','ffff','ffff',GeomFromText('POLYGON((0 0, 0 2, 2 2, 2 0, 0 0))')), (2,'f','ffff','ffff','ffff', 'ffff','ffff','ffff','ffff','ffff','ffff',GeomFromText('POLYGON((0 0, 0 2, 2 2, 2 0, 0 0))')); CREATE TABLE t2 LIKE t1; INSERT INTO t2 VALUES (1,'i','iiii','iiii','iiii','iiii','ffff','ffff','ffff','ffff','ffff',GeomFromText('POLYGON((0 0, 0 2, 2 2, 2 0, 0 0))')), (2,'f','ffff','ffff','ffff','ffff','ffff','ffff','ffff','ffff','ffff',GeomFromText('POLYGON((0 0, 0 2, 2 2, 2 0, 0 0))')); +insert into t2 (pk) values (-1),(0); EXPLAIN EXTENDED SELECT pk FROM t1 WHERE (a, b) IN (SELECT a, b FROM t2 WHERE pk > 0); id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 @@ -1260,8 +1261,8 @@ INSERT INTO t2 VALUES (1, 0), (1, 1), (2, 0), (2, 1); EXPLAIN SELECT * FROM t1 WHERE (i) IN (SELECT i FROM t2 where j > 0); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 5 -1 PRIMARY t2 index k k 10 NULL 4 Using where; Using index; Start temporary; End temporary; Using join buffer (flat, BNL join) +1 PRIMARY t1 ALL NULL NULL NULL NULL 5 Using where +1 PRIMARY t2 ref k k 5 test.t1.i 1 Using where; Using index; Start temporary; End temporary SELECT * FROM t1 WHERE (i) IN (SELECT i FROM t2 where j > 0); i 1 @@ -1991,7 +1992,7 @@ f1 f3 f4 f2 f4 DROP TABLE t1,t2,t3; # # BUG#803457: Wrong result with semijoin + view + outer join in maria-5.3-subqueries-mwl90 -# (Original testcase) +# (Original, slightly modified testcase) # CREATE TABLE t1 (f1 int, f2 int ); INSERT INTO t1 VALUES (2,0),(4,0),(0,NULL); @@ -2001,24 +2002,23 @@ CREATE TABLE t3 ( f1 int, f3 int ); INSERT INTO t3 VALUES (2,0),(4,0),(0,NULL),(4,0),(8,0); CREATE TABLE t4 ( f2 int, KEY (f2) ); INSERT INTO t4 VALUES (0),(NULL); -CREATE VIEW v4 AS SELECT DISTINCT f2 FROM t4 ; +INSERT INTO t4 VALUES (0),(NULL),(-1),(-2),(-3); # The following must not have outer joins: explain extended -SELECT * FROM t1 NATURAL LEFT JOIN (t2, t3) WHERE t2.f3 IN (SELECT * FROM t4); +SELECT * FROM t1 NATURAL LEFT JOIN (t2, t3) WHERE t2.f3 IN (SELECT * FROM t4 where f2 = 0 or f2 IS NULL); id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t2 ALL NULL NULL NULL NULL 2 100.00 1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 100.00 1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (flat, BNL join) 1 PRIMARY t3 ALL NULL NULL NULL NULL 5 100.00 Using where; Using join buffer (incremental, BNL join) -2 MATERIALIZED t4 index f2 f2 5 NULL 2 100.00 Using index +2 MATERIALIZED t4 ref_or_null f2 f2 5 const 4 100.00 Using where; Using index Warnings: -Note 1003 select `test`.`t1`.`f1` AS `f1`,`test`.`t1`.`f2` AS `f2`,`test`.`t2`.`f3` AS `f3`,`test`.`t3`.`f3` AS `f3` from `test`.`t1` semi join (`test`.`t4`) join `test`.`t2` join `test`.`t3` where `test`.`t3`.`f1` = `test`.`t1`.`f1` and `test`.`t1`.`f2` = `test`.`t2`.`f2` -SELECT * FROM t1 NATURAL LEFT JOIN (t2, t3) WHERE t2.f3 IN (SELECT * FROM t4); +Note 1003 select `test`.`t1`.`f1` AS `f1`,`test`.`t1`.`f2` AS `f2`,`test`.`t2`.`f3` AS `f3`,`test`.`t3`.`f3` AS `f3` from `test`.`t1` semi join (`test`.`t4`) join `test`.`t2` join `test`.`t3` where `test`.`t3`.`f1` = `test`.`t1`.`f1` and `test`.`t1`.`f2` = `test`.`t2`.`f2` and (`test`.`t4`.`f2` = 0 or `test`.`t4`.`f2` is null) +SELECT * FROM t1 NATURAL LEFT JOIN (t2, t3) WHERE t2.f3 IN (SELECT * FROM t4 where f2 = 0 or f2 IS NULL); f1 f2 f3 f3 2 0 0 0 4 0 0 0 4 0 0 0 -drop view v4; drop table t1, t2, t3, t4; # # BUG#803303: Wrong result with semijoin=on, outer join in maria-5.3-subqueries-mwl90 @@ -2164,8 +2164,8 @@ INSERT INTO t3 VALUES (6,5),(6,2),(8,0),(9,1),(6,5); explain SELECT * FROM t1, t2 WHERE (t2.a , t1.b) IN (SELECT a, b FROM t3); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 ALL NULL NULL NULL NULL 2 -1 PRIMARY t3 ALL b NULL NULL NULL 5 Using where; Start temporary; Using join buffer (flat, BNL join) +1 PRIMARY t1 ALL NULL NULL NULL NULL 2 Using where +1 PRIMARY t3 ref b b 5 test.t1.b 2 Start temporary; Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan 1 PRIMARY t2 index PRIMARY PRIMARY 4 NULL 2 Using where; Using index; End temporary; Using join buffer (incremental, BNL join) SELECT * FROM t1, t2 WHERE (t2.a , t1.b) IN (SELECT a, b FROM t3); b a @@ -2361,8 +2361,8 @@ SELECT * FROM t1 WHERE (a) IN (SELECT a FROM t2 JOIN t3 ON b = a); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 9 1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 -2 MATERIALIZED t3 ALL NULL NULL NULL NULL 13 -2 MATERIALIZED t2 index b b 8 NULL 7 Using where; Using index; Using join buffer (flat, BNL join) +2 MATERIALIZED t3 ALL NULL NULL NULL NULL 13 Using where +2 MATERIALIZED t2 ref b b 4 test.t3.a 1 Using index SELECT * FROM t1 WHERE (a) IN (SELECT a FROM t2 JOIN t3 ON b = a); a 19 @@ -2510,10 +2510,9 @@ SELECT * FROM t1, t2 WHERE t1.a = t2.a AND t2.a IN (SELECT b FROM t3 STRAIGHT_JOIN t4); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t3 system NULL NULL NULL NULL 1 -1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 1 -1 PRIMARY t1 ref a a 5 const 1 Using index -1 PRIMARY t2 ref a a 5 func 1 Using index -2 MATERIALIZED t4 ALL NULL NULL NULL NULL 0 +1 PRIMARY t2 ref a a 5 const 1 Using index +1 PRIMARY t4 ALL NULL NULL NULL NULL 0 FirstMatch(t2); Using join buffer (flat, BNL join) +1 PRIMARY t1 ref a a 5 func 1 Using index SELECT * FROM t1, t2 WHERE t1.a = t2.a AND t2.a IN (SELECT b FROM t3 STRAIGHT_JOIN t4); a a @@ -2585,16 +2584,18 @@ SELECT a, b, d FROM t1, t2 WHERE ( b, d ) IN ( SELECT b, d FROM t1, t2 WHERE b = c ); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t2 ALL NULL NULL NULL NULL 7 -1 PRIMARY t1 index b b 5 NULL 10 Using where; Using index; LooseScan -1 PRIMARY t2 ref c c 5 test.t1.b 1 Using where; FirstMatch(t1) -1 PRIMARY t1 ref b b 5 test.t1.b 2 Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan +1 PRIMARY t1 index b b 5 NULL 10 Using where; Using index; Start temporary +1 PRIMARY t2 ref c c 5 test.t1.b 1 Using join buffer (flat, BKA join); Key-ordered Rowid-ordered scan +1 PRIMARY t1 ref b b 5 test.t1.b 2 Using join buffer (incremental, BKA join); Key-ordered Rowid-ordered scan +1 PRIMARY t2 ALL NULL NULL NULL NULL 7 Using where; End temporary; Using join buffer (incremental, BNL join) SELECT a, b, d FROM t1, t2 WHERE ( b, d ) IN ( SELECT b, d FROM t1, t2 WHERE b = c ); a b d 1 2 1 1 2 1 +10 2 1 +10 2 1 2 1 2 2 1 2 3 3 3 @@ -2610,8 +2611,6 @@ a b d 8 4 2 9 3 3 9 3 3 -10 2 1 -10 2 1 DROP TABLE t1, t2; # Another testcase for the above that still uses LooseScan: create table t0(a int primary key); @@ -2779,22 +2778,22 @@ SELECT * FROM t1 AS t1_1, t1 AS t1_2 WHERE (t1_1.a, t1_2.a) IN ( SELECT a, b FROM v1 ); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1_1 ALL NULL NULL NULL NULL 11 Using where -1 PRIMARY t1_2 ALL NULL NULL NULL NULL 11 -1 PRIMARY <derived3> ref key0 key0 5 test.t1_1.a 2 Using where; FirstMatch(t1_2) +1 PRIMARY <derived3> ref key0 key0 5 test.t1_1.a 2 Start temporary +1 PRIMARY t1_2 ALL NULL NULL NULL NULL 11 Using where; End temporary 3 DERIVED t1 ALL NULL NULL NULL NULL 11 SELECT * FROM t1 AS t1_1, t1 AS t1_2 WHERE (t1_1.a, t1_2.a) IN ( SELECT a, b FROM v1 ); a b a b -3 1 9 1 -5 8 4 0 -3 9 9 1 2 4 4 0 2 4 6 8 2 6 4 0 2 6 6 8 +3 1 9 1 +3 9 9 1 5 4 4 0 -7 7 7 7 5 4 4 0 +5 8 4 0 +7 7 7 7 DROP VIEW v1; DROP TABLE t1; set @@join_cache_level= @tmp_jcl_978479; @@ -2938,9 +2937,9 @@ alias2.col_int_key = alias1.col_int_key WHERE alias1.pk = 58 OR alias1.col_varchar_key = 'o' ); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY alias1 index_merge PRIMARY,col_int_key,col_varchar_key PRIMARY,col_varchar_key 4,4 NULL 2 Using sort_union(PRIMARY,col_varchar_key); Using where; Start temporary -1 PRIMARY t2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join) -1 PRIMARY alias2 ALL col_int_key NULL NULL NULL 12 Range checked for each record (index map: 0x2); End temporary +1 PRIMARY t2 ALL NULL NULL NULL NULL 2 +1 PRIMARY alias1 index_merge PRIMARY,col_int_key,col_varchar_key PRIMARY,col_varchar_key 4,4 NULL 2 Using sort_union(PRIMARY,col_varchar_key); Using where +1 PRIMARY alias2 ALL col_int_key NULL NULL NULL 12 Range checked for each record (index map: 0x2); FirstMatch(t2) SELECT * FROM t2 WHERE (field1) IN (SELECT alias1.col_varchar_nokey AS field1 @@ -3300,8 +3299,7 @@ explain extended SELECT Id FROM t1 WHERE Id in (SELECT t1_Id FROM t2 WHERE t2.col1 IS NULL); id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 system PRIMARY NULL NULL NULL 1 100.00 -1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 100.00 -2 MATERIALIZED t2 ref col1 col1 5 const 2 100.00 Using index condition; Using where +1 PRIMARY t2 ALL col1 NULL NULL NULL 2 100.00 Using where; FirstMatch(t1) Warnings: Note 1003 select 1 AS `Id` from (`test`.`t2`) where `test`.`t2`.`t1_Id` = 1 and `test`.`t2`.`col1` is null DROP TABLE t1, t2; diff --git a/mysql-test/main/subselect_sj_mat.result b/mysql-test/main/subselect_sj_mat.result index 40a501b66f2..afd8e3b0734 100644 --- a/mysql-test/main/subselect_sj_mat.result +++ b/mysql-test/main/subselect_sj_mat.result @@ -107,9 +107,9 @@ a1 a2 explain extended select * from t1i where a1 in (select b1 from t2i where b1 > '0'); id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1i range _it1_idx _it1_idx # NULL 3 100.00 Using where; +1 PRIMARY t1i index _it1_idx _it1_idx # NULL 3 100.00 1 PRIMARY <subquery2> eq_ref distinct_key distinct_key # func 1 100.00 -2 MATERIALIZED t2i range it2i1,it2i3 it2i1 # NULL 5 100.00 Using where; +2 MATERIALIZED t2i index it2i1,it2i3 it2i1 # NULL 5 100.00 Using where; Warnings: Note 1003 select `test`.`t1i`.`a1` AS `a1`,`test`.`t1i`.`a2` AS `a2` from `test`.`t1i` semi join (`test`.`t2i`) where `test`.`t2i`.`b1` > '0' select * from t1i where a1 in (select b1 from t2i where b1 > '0'); @@ -131,9 +131,9 @@ a1 a2 explain extended select * from t1i where (a1, a2) in (select b1, b2 from t2i where b1 > '0'); id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1i range _it1_idx _it1_idx # NULL 3 100.00 Using where; +1 PRIMARY t1i index _it1_idx _it1_idx # NULL 3 100.00 1 PRIMARY <subquery2> eq_ref distinct_key distinct_key # func,func 1 100.00 -2 MATERIALIZED t2i range it2i1,it2i2,it2i3 it2i3 # NULL 5 100.00 Using where; +2 MATERIALIZED t2i index it2i1,it2i2,it2i3 it2i3 # NULL 5 100.00 Using where; Warnings: Note 1003 select `test`.`t1i`.`a1` AS `a1`,`test`.`t1i`.`a2` AS `a2` from `test`.`t1i` semi join (`test`.`t2i`) where `test`.`t2i`.`b1` > '0' select * from t1i where (a1, a2) in (select b1, b2 from t2i where b1 > '0'); @@ -278,10 +278,11 @@ a1 a2 explain extended select * from t1i where (a1, a2) in (select b1, b2 from t2i order by b1, b2); id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t2i index it2i1,it2i2,it2i3 it2i3 18 NULL 5 50.00 Using where; Using index; LooseScan -1 PRIMARY t1i ref it1i1,it1i2,it1i3 it1i3 18 test.t2i.b1,test.t2i.b2 1 100.00 Using index +1 PRIMARY t1i index it1i1,it1i2,it1i3 it1i3 18 NULL 3 100.00 Using index +1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 16 func,func 1 100.00 +2 MATERIALIZED t2i index it2i1,it2i2,it2i3 it2i3 18 NULL 5 100.00 Using index Warnings: -Note 1003 select `test`.`t1i`.`a1` AS `a1`,`test`.`t1i`.`a2` AS `a2` from `test`.`t1i` semi join (`test`.`t2i`) where `test`.`t1i`.`a1` = `test`.`t2i`.`b1` and `test`.`t1i`.`a2` = `test`.`t2i`.`b2` +Note 1003 select `test`.`t1i`.`a1` AS `a1`,`test`.`t1i`.`a2` AS `a2` from `test`.`t1i` semi join (`test`.`t2i`) where 1 select * from t1i where (a1, a2) in (select b1, b2 from t2i order by b1, b2); a1 a2 1 - 01 2 - 01 @@ -352,14 +353,12 @@ where (a1, a2) in (select b1, b2 from t2i where b1 > '0') and (a1, a2) in (select c1, c2 from t3i where (c1, c2) in (select b1, b2 from t2i where b2 > '0')); id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY t1i range it1i1,it1i2,it1i3 # # # 3 100.00 # -1 PRIMARY <subquery3> eq_ref distinct_key # # # 1 100.00 # -1 PRIMARY <subquery2> eq_ref distinct_key # # # 1 100.00 # -3 MATERIALIZED t3i range it3i1,it3i2,it3i3 # # # 4 100.00 # -3 MATERIALIZED t2i ref it2i1,it2i2,it2i3 # # # 1 100.00 # -2 MATERIALIZED t2i range it2i1,it2i2,it2i3 # # # 5 100.00 # +1 PRIMARY t2i index it2i1,it2i2,it2i3 # # # 5 50.00 # +1 PRIMARY t1i ref it1i1,it1i2,it1i3 # # # 1 100.00 # +1 PRIMARY t3i ref it3i1,it3i2,it3i3 # # # 1 100.00 # +1 PRIMARY t2i ref it2i1,it2i2,it2i3 # # # 1 100.00 # Warnings: -Note 1003 select `test`.`t1i`.`a1` AS `a1`,`test`.`t1i`.`a2` AS `a2` from `test`.`t1i` semi join (`test`.`t2i`) semi join (`test`.`t2i` join `test`.`t3i`) where `test`.`t2i`.`b1` = `test`.`t3i`.`c1` and `test`.`t2i`.`b2` = `test`.`t3i`.`c2` and `test`.`t2i`.`b1` > '0' and `test`.`t3i`.`c2` > '0' +Note 1003 select `test`.`t1i`.`a1` AS `a1`,`test`.`t1i`.`a2` AS `a2` from `test`.`t1i` semi join (`test`.`t2i`) semi join (`test`.`t2i` join `test`.`t3i`) where `test`.`t1i`.`a1` = `test`.`t2i`.`b1` and `test`.`t3i`.`c1` = `test`.`t2i`.`b1` and `test`.`t2i`.`b1` = `test`.`t2i`.`b1` and `test`.`t1i`.`a2` = `test`.`t2i`.`b2` and `test`.`t3i`.`c2` = `test`.`t2i`.`b2` and `test`.`t2i`.`b2` = `test`.`t2i`.`b2` and `test`.`t2i`.`b1` > '0' and `test`.`t2i`.`b2` > '0' select * from t1i where (a1, a2) in (select b1, b2 from t2i where b1 > '0') and (a1, a2) in (select c1, c2 from t3i @@ -402,15 +401,15 @@ b2 in (select c2 from t3 t3b where c2 LIKE '%03')) and where (c1, c2) in (select b1, b2 from t2i where b2 > '0')); id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 3 99.22 -1 PRIMARY <subquery5> eq_ref distinct_key distinct_key 16 func,func 1 100.00 1 PRIMARY t2 ALL NULL NULL NULL NULL 5 99.22 Using where; Start temporary; End temporary; Using join buffer (flat, BNL join) +1 PRIMARY <subquery5> eq_ref distinct_key distinct_key 16 func,func 1 100.00 5 MATERIALIZED t3c ALL NULL NULL NULL NULL 4 99.22 Using where 5 MATERIALIZED t2i ref it2i1,it2i2,it2i3 it2i3 18 test.t3c.c1,test.t3c.c2 1 100.00 Using index 4 MATERIALIZED t3b ALL NULL NULL NULL NULL 4 100.00 Using where 3 DEPENDENT SUBQUERY t3a ALL NULL NULL NULL NULL 4 100.00 Using where Warnings: Note 1276 Field or reference 'test.t1.a1' of SELECT #3 was resolved in SELECT #1 -Note 1003 /* select#1 */ select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from `test`.`t1` semi join (`test`.`t2`) semi join (`test`.`t2i` join `test`.`t3` `t3c`) where `test`.`t2i`.`b1` = `test`.`t3c`.`c1` and `test`.`t2`.`b1` = `test`.`t1`.`a1` and `test`.`t2i`.`b2` = `test`.`t3c`.`c2` and `test`.`t2`.`b2` = `test`.`t1`.`a2` and (<expr_cache><`test`.`t2`.`b2`,`test`.`t1`.`a1`>(<in_optimizer>(`test`.`t2`.`b2`,<exists>(/* select#3 */ select `test`.`t3a`.`c2` from `test`.`t3` `t3a` where `test`.`t3a`.`c1` = `test`.`t1`.`a1` and <cache>(`test`.`t2`.`b2`) = `test`.`t3a`.`c2`))) or <expr_cache><`test`.`t2`.`b2`>(<in_optimizer>(`test`.`t2`.`b2`,`test`.`t2`.`b2` in ( <materialize> (/* select#4 */ select `test`.`t3b`.`c2` from `test`.`t3` `t3b` where `test`.`t3b`.`c2` like '%03' ), <primary_index_lookup>(`test`.`t2`.`b2` in <temporary table> on distinct_key where `test`.`t2`.`b2` = `<subquery4>`.`c2`))))) and `test`.`t3c`.`c2` > '0' +Note 1003 /* select#1 */ select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from `test`.`t1` semi join (`test`.`t2`) semi join (`test`.`t2i` join `test`.`t3` `t3c`) where `test`.`t2`.`b1` = `test`.`t1`.`a1` and `test`.`t2i`.`b1` = `test`.`t3c`.`c1` and `test`.`t2`.`b2` = `test`.`t1`.`a2` and `test`.`t2i`.`b2` = `test`.`t3c`.`c2` and (<expr_cache><`test`.`t2`.`b2`,`test`.`t1`.`a1`>(<in_optimizer>(`test`.`t2`.`b2`,<exists>(/* select#3 */ select `test`.`t3a`.`c2` from `test`.`t3` `t3a` where `test`.`t3a`.`c1` = `test`.`t1`.`a1` and <cache>(`test`.`t2`.`b2`) = `test`.`t3a`.`c2`))) or <expr_cache><`test`.`t2`.`b2`>(<in_optimizer>(`test`.`t2`.`b2`,`test`.`t2`.`b2` in ( <materialize> (/* select#4 */ select `test`.`t3b`.`c2` from `test`.`t3` `t3b` where `test`.`t3b`.`c2` like '%03' ), <primary_index_lookup>(`test`.`t2`.`b2` in <temporary table> on distinct_key where `test`.`t2`.`b2` = `<subquery4>`.`c2`))))) and `test`.`t3c`.`c2` > '0' select * from t1 where (a1, a2) in (select b1, b2 from t2 where b2 in (select c2 from t3 t3a where c1 = a1) or @@ -442,15 +441,13 @@ id select_type table type possible_keys key key_len ref rows filtered Extra 2 MATERIALIZED t2 ALL NULL # # # 5 99.22 # 4 MATERIALIZED t3 ALL NULL # # # 4 100.00 # 3 MATERIALIZED t3 ALL NULL # # # 4 100.00 # -7 UNION t1i range it1i1,it1i2,it1i3 # # # 3 100.00 # -7 UNION <subquery9> eq_ref distinct_key # # # 1 100.00 # -7 UNION <subquery8> eq_ref distinct_key # # # 1 100.00 # -9 MATERIALIZED t3i range it3i1,it3i2,it3i3 # # # 4 100.00 # -9 MATERIALIZED t2i ref it2i1,it2i2,it2i3 # # # 1 100.00 # -8 MATERIALIZED t2i range it2i1,it2i2,it2i3 # # # 5 100.00 # +7 UNION t2i index it2i1,it2i2,it2i3 # # # 5 50.00 # +7 UNION t1i ref it1i1,it1i2,it1i3 # # # 1 100.00 # +7 UNION t3i ref it3i1,it3i2,it3i3 # # # 1 100.00 # +7 UNION t2i ref it2i1,it2i2,it2i3 # # # 1 100.00 # NULL UNION RESULT <union1,7> ALL NULL # # # NULL NULL # Warnings: -Note 1003 (/* select#1 */ select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from `test`.`t1` semi join (`test`.`t2`) semi join (`test`.`t2i` join `test`.`t3`) where `test`.`t2i`.`b1` = `test`.`t3`.`c1` and `test`.`t2i`.`b2` = `test`.`t3`.`c2` and (<expr_cache><`test`.`t2`.`b2`>(<in_optimizer>(`test`.`t2`.`b2`,`test`.`t2`.`b2` in ( <materialize> (/* select#3 */ select `test`.`t3`.`c2` from `test`.`t3` where `test`.`t3`.`c2` like '%02' ), <primary_index_lookup>(`test`.`t2`.`b2` in <temporary table> on distinct_key where `test`.`t2`.`b2` = `<subquery3>`.`c2`)))) or <expr_cache><`test`.`t2`.`b2`>(<in_optimizer>(`test`.`t2`.`b2`,`test`.`t2`.`b2` in ( <materialize> (/* select#4 */ select `test`.`t3`.`c2` from `test`.`t3` where `test`.`t3`.`c2` like '%03' ), <primary_index_lookup>(`test`.`t2`.`b2` in <temporary table> on distinct_key where `test`.`t2`.`b2` = `<subquery4>`.`c2`))))) and `test`.`t3`.`c2` > '0') union (/* select#7 */ select `test`.`t1i`.`a1` AS `a1`,`test`.`t1i`.`a2` AS `a2` from `test`.`t1i` semi join (`test`.`t2i`) semi join (`test`.`t2i` join `test`.`t3i`) where `test`.`t2i`.`b1` = `test`.`t3i`.`c1` and `test`.`t2i`.`b2` = `test`.`t3i`.`c2` and `test`.`t2i`.`b1` > '0' and `test`.`t3i`.`c2` > '0') +Note 1003 (/* select#1 */ select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from `test`.`t1` semi join (`test`.`t2`) semi join (`test`.`t2i` join `test`.`t3`) where `test`.`t2i`.`b1` = `test`.`t3`.`c1` and `test`.`t2i`.`b2` = `test`.`t3`.`c2` and (<expr_cache><`test`.`t2`.`b2`>(<in_optimizer>(`test`.`t2`.`b2`,`test`.`t2`.`b2` in ( <materialize> (/* select#3 */ select `test`.`t3`.`c2` from `test`.`t3` where `test`.`t3`.`c2` like '%02' ), <primary_index_lookup>(`test`.`t2`.`b2` in <temporary table> on distinct_key where `test`.`t2`.`b2` = `<subquery3>`.`c2`)))) or <expr_cache><`test`.`t2`.`b2`>(<in_optimizer>(`test`.`t2`.`b2`,`test`.`t2`.`b2` in ( <materialize> (/* select#4 */ select `test`.`t3`.`c2` from `test`.`t3` where `test`.`t3`.`c2` like '%03' ), <primary_index_lookup>(`test`.`t2`.`b2` in <temporary table> on distinct_key where `test`.`t2`.`b2` = `<subquery4>`.`c2`))))) and `test`.`t3`.`c2` > '0') union (/* select#7 */ select `test`.`t1i`.`a1` AS `a1`,`test`.`t1i`.`a2` AS `a2` from `test`.`t1i` semi join (`test`.`t2i`) semi join (`test`.`t2i` join `test`.`t3i`) where `test`.`t1i`.`a1` = `test`.`t2i`.`b1` and `test`.`t3i`.`c1` = `test`.`t2i`.`b1` and `test`.`t2i`.`b1` = `test`.`t2i`.`b1` and `test`.`t1i`.`a2` = `test`.`t2i`.`b2` and `test`.`t3i`.`c2` = `test`.`t2i`.`b2` and `test`.`t2i`.`b2` = `test`.`t2i`.`b2` and `test`.`t2i`.`b1` > '0' and `test`.`t2i`.`b2` > '0') (select * from t1 where (a1, a2) in (select b1, b2 from t2 where b2 in (select c2 from t3 where c2 LIKE '%02') or @@ -542,15 +539,15 @@ b2 in (select c2 from t3 t3b where c2 LIKE '%03')) and where (c1, c2) in (select b1, b2 from t2i where b2 > '0' or b2 = a2)); id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00 Using where +1 PRIMARY t2 ALL NULL NULL NULL NULL 5 100.00 Using where; Start temporary; End temporary; Using join buffer (flat, BNL join) 1 PRIMARY t2i ref it2i1,it2i2,it2i3 it2i3 18 test.t1.a1,test.t1.a2 1 100.00 Using index; Start temporary 1 PRIMARY t3c ALL NULL NULL NULL NULL 4 100.00 Using where; End temporary; Using join buffer (flat, BNL join) -1 PRIMARY t2 ALL NULL NULL NULL NULL 5 100.00 Using where; Start temporary; End temporary; Using join buffer (flat, BNL join) 4 MATERIALIZED t3b ALL NULL NULL NULL NULL 4 100.00 Using where 3 DEPENDENT SUBQUERY t3a ALL NULL NULL NULL NULL 4 100.00 Using where Warnings: Note 1276 Field or reference 'test.t1.a1' of SELECT #3 was resolved in SELECT #1 Note 1276 Field or reference 'test.t1.a2' of SELECT #6 was resolved in SELECT #1 -Note 1003 /* select#1 */ select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from `test`.`t1` semi join (`test`.`t2`) semi join (`test`.`t2i` join `test`.`t3` `t3c`) where `test`.`t2i`.`b1` = `test`.`t1`.`a1` and `test`.`t3c`.`c1` = `test`.`t1`.`a1` and `test`.`t2`.`b1` = `test`.`t1`.`a1` and `test`.`t2i`.`b2` = `test`.`t1`.`a2` and `test`.`t3c`.`c2` = `test`.`t1`.`a2` and `test`.`t2`.`b2` = `test`.`t1`.`a2` and (<expr_cache><`test`.`t2`.`b2`,`test`.`t1`.`a1`>(<in_optimizer>(`test`.`t2`.`b2`,<exists>(/* select#3 */ select `test`.`t3a`.`c2` from `test`.`t3` `t3a` where `test`.`t3a`.`c1` = `test`.`t1`.`a1` and <cache>(`test`.`t2`.`b2`) = `test`.`t3a`.`c2`))) or <expr_cache><`test`.`t2`.`b2`>(<in_optimizer>(`test`.`t2`.`b2`,`test`.`t2`.`b2` in ( <materialize> (/* select#4 */ select `test`.`t3b`.`c2` from `test`.`t3` `t3b` where `test`.`t3b`.`c2` like '%03' ), <primary_index_lookup>(`test`.`t2`.`b2` in <temporary table> on distinct_key where `test`.`t2`.`b2` = `<subquery4>`.`c2`))))) +Note 1003 /* select#1 */ select `test`.`t1`.`a1` AS `a1`,`test`.`t1`.`a2` AS `a2` from `test`.`t1` semi join (`test`.`t2`) semi join (`test`.`t2i` join `test`.`t3` `t3c`) where `test`.`t2`.`b1` = `test`.`t1`.`a1` and `test`.`t2i`.`b1` = `test`.`t1`.`a1` and `test`.`t3c`.`c1` = `test`.`t1`.`a1` and `test`.`t2`.`b2` = `test`.`t1`.`a2` and `test`.`t2i`.`b2` = `test`.`t1`.`a2` and `test`.`t3c`.`c2` = `test`.`t1`.`a2` and (<expr_cache><`test`.`t2`.`b2`,`test`.`t1`.`a1`>(<in_optimizer>(`test`.`t2`.`b2`,<exists>(/* select#3 */ select `test`.`t3a`.`c2` from `test`.`t3` `t3a` where `test`.`t3a`.`c1` = `test`.`t1`.`a1` and <cache>(`test`.`t2`.`b2`) = `test`.`t3a`.`c2`))) or <expr_cache><`test`.`t2`.`b2`>(<in_optimizer>(`test`.`t2`.`b2`,`test`.`t2`.`b2` in ( <materialize> (/* select#4 */ select `test`.`t3b`.`c2` from `test`.`t3` `t3b` where `test`.`t3b`.`c2` like '%03' ), <primary_index_lookup>(`test`.`t2`.`b2` in <temporary table> on distinct_key where `test`.`t2`.`b2` = `<subquery4>`.`c2`))))) explain extended select * from t1 where (a1, a2) in (select '1 - 01', '2 - 01'); id select_type table type possible_keys key key_len ref rows filtered Extra @@ -1573,8 +1570,7 @@ SET @@optimizer_switch='semijoin=on,materialization=on'; EXPLAIN SELECT pk FROM t1 WHERE (a) IN (SELECT a FROM t2 WHERE pk > 0); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 2 -1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 -2 MATERIALIZED t2 range PRIMARY PRIMARY 4 NULL 2 Using index condition; Using where; Rowid-ordered scan +1 PRIMARY t2 ALL PRIMARY NULL NULL NULL 2 Using where; FirstMatch(t1); Using join buffer (flat, BNL join) SELECT pk FROM t1 WHERE (a) IN (SELECT a FROM t2 WHERE pk > 0); pk 2 @@ -1993,11 +1989,11 @@ EXPLAIN EXTENDED SELECT * FROM t1 WHERE a IN (SELECT MAX(c) FROM t2) AND b=7 AND (a IS NULL OR a=b); id select_type table type possible_keys key key_len ref rows filtered Extra -1 PRIMARY <subquery2> const distinct_key distinct_key 4 const 1 100.00 -1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00 Using where; Using join buffer (flat, BNL join) +1 PRIMARY t1 ALL NULL NULL NULL NULL 3 100.00 Using where +1 PRIMARY <subquery2> const distinct_key distinct_key 4 const 1 100.00 Using where 2 MATERIALIZED t2 ALL NULL NULL NULL NULL 3 100.00 Warnings: -Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from <materialize> (/* select#2 */ select max(`test`.`t2`.`c`) from `test`.`t2` having `MAX(c)` is null or `MAX(c)` = 7) join `test`.`t1` where `test`.`t1`.`b` = 7 and `test`.`t1`.`a` = `<subquery2>`.`MAX(c)` and (<cache>(/*always not null*/ 1 is null) or `<subquery2>`.`MAX(c)` = 7) +Note 1003 /* select#1 */ select `test`.`t1`.`a` AS `a`,`test`.`t1`.`b` AS `b` from <materialize> (/* select#2 */ select max(`test`.`t2`.`c`) from `test`.`t2` having `MAX(c)` is null or `MAX(c)` = 7) join `test`.`t1` where `test`.`t1`.`b` = 7 and `<subquery2>`.`MAX(c)` = `test`.`t1`.`a` and (`test`.`t1`.`a` is null or `test`.`t1`.`a` = 7) SELECT * FROM t1 WHERE a IN (SELECT MAX(c) FROM t2) AND b=7 AND (a IS NULL OR a=b); a b @@ -2006,8 +2002,8 @@ EXPLAIN SELECT * FROM t1 WHERE a IN (SELECT MAX(c) FROM t2 WHERE c < 4) AND b=7 AND (a IS NULL OR a=b); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY <subquery2> const distinct_key distinct_key 4 const 1 -1 PRIMARY t1 ALL NULL NULL NULL NULL 3 Using where; Using join buffer (flat, BNL join) +1 PRIMARY t1 ALL NULL NULL NULL NULL 3 Using where +1 PRIMARY <subquery2> const distinct_key distinct_key 4 const 1 Using where 2 MATERIALIZED t2 ALL NULL NULL NULL NULL 3 Using where SELECT * FROM t1 WHERE a IN (SELECT MAX(c) FROM t2 WHERE c < 4) AND b=7 AND (a IS NULL OR a=b); @@ -2283,9 +2279,8 @@ WHERE EXISTS ( SELECT * FROM t1 AS sq2 WHERE sq1.`pk` IN ( SELECT f1 FROM t1 ) AND sq2.f1 = sq1.f1 ); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY sq1 ALL NULL NULL NULL NULL 2 Using where -2 DEPENDENT SUBQUERY sq2 ALL NULL NULL NULL NULL 2 Using where -2 DEPENDENT SUBQUERY <subquery3> eq_ref distinct_key distinct_key 4 func 1 -3 MATERIALIZED t1 ALL NULL NULL NULL NULL 2 +2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL 2 Using where; FirstMatch +2 DEPENDENT SUBQUERY sq2 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join) # this checks the result set above set optimizer_switch= 'materialization=off,semijoin=off'; SELECT sq1.f2 FROM t1 AS sq1 @@ -2317,10 +2312,9 @@ WHERE EXISTS ( SELECT * FROM t2, t3 WHERE i3 = i2 AND f1 IN ( SELECT f3 FROM t3 ) ); id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 Using where -2 DEPENDENT SUBQUERY t2 index i2 i2 5 NULL 3 100.00 Using where; Using index -2 DEPENDENT SUBQUERY <subquery3> eq_ref distinct_key distinct_key 4 func 1 100.00 +2 DEPENDENT SUBQUERY t3 ALL NULL NULL NULL NULL 8 100.00 Using where; FirstMatch +2 DEPENDENT SUBQUERY t2 index i2 i2 5 NULL 3 100.00 Using where; Using index; Using join buffer (flat, BNL join) 2 DEPENDENT SUBQUERY t3 ref i3 i3 5 test.t2.i2 2 100.00 Using index -3 MATERIALIZED t3 ALL NULL NULL NULL NULL 8 100.00 Warnings: Note 1276 Field or reference 'test.t1.f1' of SELECT #2 was resolved in SELECT #1 Note 1003 /* select#1 */ select `test`.`t1`.`f1` AS `f1` from `test`.`t1` where <expr_cache><`test`.`t1`.`f1`>(exists(/* select#2 */ select 1 from `test`.`t2` semi join (`test`.`t3`) join `test`.`t3` where `test`.`t3`.`i3` = `test`.`t2`.`i2` and `test`.`t1`.`f1` = `test`.`t3`.`f3` limit 1)) @@ -2356,9 +2350,8 @@ SELECT pk, f1, ( SELECT COUNT(*) FROM t2 WHERE t1.pk IN ( SELECT f2 FROM t2 ) ) AS sq FROM t1; id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 5 100.00 -2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 5 100.00 -2 DEPENDENT SUBQUERY <subquery3> eq_ref distinct_key distinct_key 4 func 1 100.00 -3 MATERIALIZED t2 ALL NULL NULL NULL NULL 5 100.00 +2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 5 100.00 Using where; FirstMatch +2 DEPENDENT SUBQUERY t2 ALL NULL NULL NULL NULL 5 100.00 Using join buffer (flat, BNL join) Warnings: Note 1276 Field or reference 'test.t1.pk' of SELECT #2 was resolved in SELECT #1 Note 1003 /* select#1 */ select `test`.`t1`.`pk` AS `pk`,`test`.`t1`.`f1` AS `f1`,<expr_cache><`test`.`t1`.`pk`>((/* select#2 */ select count(0) from `test`.`t2` semi join (`test`.`t2`) where `test`.`t1`.`pk` = `test`.`t2`.`f2`)) AS `sq` from `test`.`t1` @@ -2441,11 +2434,10 @@ WHERE t2.ugroup = t3_i.sys_id AND t3_i.type LIKE '59e22fb137032000158bbfc8bcbe5d52' AND t2.user = '86826bf03710200044e0bfc8bcbe5d79'); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 2 +1 PRIMARY t2 ref idx3,idx4 idx4 35 const 2 Using index condition; Using where; Start temporary 1 PRIMARY t1 ref idx1,idx2 idx1 35 test.t2.ugroup 2 Using where +1 PRIMARY t3_i eq_ref PRIMARY PRIMARY 32 test.t2.ugroup 1 Using index condition; Using where; End temporary 1 PRIMARY t3 eq_ref PRIMARY PRIMARY 32 test.t1.assignment_group 1 Using where; Using index -2 MATERIALIZED t2 ref idx3,idx4 idx4 35 const 2 Using index condition; Using where -2 MATERIALIZED t3_i eq_ref PRIMARY PRIMARY 32 test.t2.ugroup 1 Using index condition; Using where SELECT t1.assignment_group FROM t1, t3 WHERE t1.assignment_group = t3.sys_id AND @@ -2477,8 +2469,7 @@ explain SELECT 1 FROM t1 where t1.id IN (SELECT t2.i1 FROM t2 WHERE t2.i1 = t2.i2); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 9 -1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 -2 MATERIALIZED t2 ALL NULL NULL NULL NULL 3 Using where +1 PRIMARY t2 ALL NULL NULL NULL NULL 3 Using where; FirstMatch(t1); Using join buffer (flat, BNL join) SELECT 1 FROM t1 where t1.id IN (SELECT t2.i1 FROM t2 WHERE t2.i1 = t2.i2); 1 1 @@ -2489,8 +2480,8 @@ alter table t1 add key(id); explain SELECT 1 FROM t1 where t1.id IN (SELECT t2.i1 FROM t2 WHERE t2.i1 = t2.i2); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 3 -1 PRIMARY t1 ref id id 4 test.t2.i1 2 Using index +1 PRIMARY t1 index id id 4 NULL 9 Using index +1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 2 MATERIALIZED t2 ALL NULL NULL NULL NULL 3 Using where SELECT 1 FROM t1 where t1.id IN (SELECT t2.i1 FROM t2 WHERE t2.i1 = t2.i2); 1 @@ -2546,8 +2537,8 @@ INSERT INTO t2 VALUES (11,11),(12,12),(13,13); CREATE VIEW v1 AS SELECT t2.i1 FROM t2 where t2.i1 = t2.i2; explain SELECT 1 FROM t1 where t1.id IN (SELECT v1.i1 from v1); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 3 -1 PRIMARY t1 ref id id 4 test.t2.i1 2 Using index +1 PRIMARY t1 index id id 4 NULL 9 Using index +1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 func 1 2 MATERIALIZED t2 ALL NULL NULL NULL NULL 3 Using where SELECT 1 FROM t1 where t1.id IN (SELECT v1.i1 from v1); 1 diff --git a/mysql-test/main/subselect_sj_nonmerged.result b/mysql-test/main/subselect_sj_nonmerged.result index 422af02c31a..b97dfbfda9b 100644 --- a/mysql-test/main/subselect_sj_nonmerged.result +++ b/mysql-test/main/subselect_sj_nonmerged.result @@ -47,8 +47,8 @@ id select_type table type possible_keys key key_len ref rows Extra # Compare to this which really will have 50 record combinations: explain select * from t3 where a in (select max(t2.a) from t1, t2 group by t2.b, t1.b); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t3 index PRIMARY PRIMARY 8 NULL 100 Using index -1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 test.t3.a 1 Using where +1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 50 +1 PRIMARY t3 eq_ref PRIMARY PRIMARY 8 <subquery2>.max(t2.a) 1 Using where; Using index 2 MATERIALIZED t2 ALL NULL NULL NULL NULL 5 Using temporary 2 MATERIALIZED t1 ALL NULL NULL NULL NULL 10 Using join buffer (flat, BNL join) SET @save_optimizer_switch=@@optimizer_switch; @@ -57,8 +57,8 @@ SET optimizer_switch='outer_join_with_cache=off'; explain select * from t3 where a in (select max(t2.a) from t1 left join t2 on t1.a=t2.a group by t2.b, t1.b); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t3 index PRIMARY PRIMARY 8 NULL 100 Using index -1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 4 test.t3.a 1 Using where +1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 50 +1 PRIMARY t3 eq_ref PRIMARY PRIMARY 8 <subquery2>.max(t2.a) 1 Using where; Using index 2 MATERIALIZED t1 ALL NULL NULL NULL NULL 10 Using temporary 2 MATERIALIZED t2 ALL NULL NULL NULL NULL 5 Using where SET optimizer_switch=@save_optimizer_switch; @@ -67,8 +67,8 @@ insert into t4 select A.a + 10*B.a, A.a + 10*B.a, 'filler' from t0 A, t0 B; explain select * from t0, t4 where t4.b=t0.a and t4.a in (select max(t2.a) from t1, t2 group by t2.b); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 5 -1 PRIMARY t0 ALL NULL NULL NULL NULL 10 Using where; Using join buffer (flat, BNL join) +1 PRIMARY t0 ALL NULL NULL NULL NULL 10 Using where +1 PRIMARY <subquery2> ALL distinct_key NULL NULL NULL 5 Using join buffer (flat, BNL join) 1 PRIMARY t4 eq_ref a a 10 <subquery2>.max(t2.a),test.t0.a 1 2 MATERIALIZED t2 ALL NULL NULL NULL NULL 5 Using temporary 2 MATERIALIZED t1 ALL NULL NULL NULL NULL 10 Using join buffer (flat, BNL join) diff --git a/mysql-test/main/table_elim.result b/mysql-test/main/table_elim.result index deff0623370..80fa135c6d4 100644 --- a/mysql-test/main/table_elim.result +++ b/mysql-test/main/table_elim.result @@ -337,7 +337,7 @@ id select_type table type possible_keys key key_len ref rows Extra explain select t1.a from t1 left join t2 on t2.pk between 0.5 and 1.5; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 4 -1 SIMPLE t2 range PRIMARY PRIMARY 4 NULL 2 Using where; Using index +1 SIMPLE t2 index PRIMARY PRIMARY 4 NULL 2 Using where; Using index explain select t1.a from t1 left join t2 on t2.pk between 10 and 10; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 4 @@ -408,7 +408,7 @@ select t1.* from t1 left join t2 on t2.pk=3 or t2.pk= 4; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 4 -1 SIMPLE t2 range PRIMARY PRIMARY 4 NULL 2 Using where; Using index +1 SIMPLE t2 index PRIMARY PRIMARY 4 NULL 2 Using where; Using index explain select t1.* from t1 left join t2 on t2.pk=3 or t2.pk= 3; @@ -419,7 +419,7 @@ select t1.* from t1 left join t2 on (t2.pk=3 and t2.b=3) or (t2.pk= 4 and t2.b=3); id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ALL NULL NULL NULL NULL 4 -1 SIMPLE t2 range PRIMARY PRIMARY 4 NULL 2 Using where +1 SIMPLE t2 ALL PRIMARY NULL NULL NULL 2 Using where drop table t1, t2; # # LPBUG#523593: Running RQG optimizer_no_subquery crashes MariaDB @@ -562,10 +562,7 @@ LEFT JOIN t1 ON t4.f1 = t1.f1 JOIN t5 ON t4.f3 ON t3.f1 = t5.f5 ON t2.f4 = t3.f4 WHERE t3.f2 ; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t3 ALL NULL NULL NULL NULL 2 Using where -1 SIMPLE t5 ref f5 f5 5 test.t3.f1 2 Using where; Using index -1 SIMPLE t4 ALL NULL NULL NULL NULL 3 Using where -1 SIMPLE t2 ALL f4 NULL NULL NULL 11 Using where; Using join buffer (flat, BNL join) +1 SIMPLE NULL NULL NULL NULL NULL NULL NULL Impossible WHERE noticed after reading const tables # ^^ The above must not produce a QEP of t3,t5,t2,t4 # as that violates the "no interleaving of outer join nests" rule. DROP TABLE t1,t2,t3,t4,t5; diff --git a/mysql-test/main/tmp_table_count-7586.result b/mysql-test/main/tmp_table_count-7586.result index 637e7385685..ebb2333113f 100644 --- a/mysql-test/main/tmp_table_count-7586.result +++ b/mysql-test/main/tmp_table_count-7586.result @@ -52,6 +52,7 @@ Created_tmp_disk_tables 0 Created_tmp_files 0 Created_tmp_tables 2 drop table t3; +set @@optimizer_switch="firstmatch=off"; EXPLAIN SELECT * FROM t1 WHERE a IN (SELECT * FROM t2 GROUP BY a); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 2 @@ -69,6 +70,7 @@ Variable_name Value Created_tmp_disk_tables 0 Created_tmp_files 0 Created_tmp_tables 1 +set @@optimizer_switch=default; drop table t1,t2,t3; truncate table performance_schema.events_statements_history_long; flush status; diff --git a/mysql-test/main/tmp_table_count-7586.test b/mysql-test/main/tmp_table_count-7586.test index 8bfb0e7c5cf..b994410650b 100644 --- a/mysql-test/main/tmp_table_count-7586.test +++ b/mysql-test/main/tmp_table_count-7586.test @@ -43,6 +43,7 @@ select sum(created_tmp_tables) from performance_schema.events_statements_history show status like '%Created_tmp%'; drop table t3; +set @@optimizer_switch="firstmatch=off"; EXPLAIN SELECT * FROM t1 WHERE a IN (SELECT * FROM t2 GROUP BY a); truncate table performance_schema.events_statements_history_long; flush status; @@ -50,6 +51,7 @@ CREATE TABLE t3 SELECT * FROM t1 WHERE a IN (SELECT * FROM t2 GROUP BY a); --echo # Performance schema should be the same as "Created_tmp_tables" variable below select sum(created_tmp_tables) from performance_schema.events_statements_history_long; show status like '%Created_tmp%'; +set @@optimizer_switch=default; drop table t1,t2,t3; diff --git a/mysql-test/main/type_blob.result b/mysql-test/main/type_blob.result index c2739e4b166..1ea53475155 100644 --- a/mysql-test/main/type_blob.result +++ b/mysql-test/main/type_blob.result @@ -625,7 +625,7 @@ id txt 3 NULL explain select * from t1 where txt='Chevy' or txt is NULL; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref_or_null txt_index txt_index 23 const 3 Using where +1 SIMPLE t1 ALL txt_index NULL NULL NULL 6 Using where explain select * from t1 FORCE INDEX (`txt_index`) where txt='Chevy' or txt is NULL; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 ref_or_null txt_index txt_index 23 const 3 Using where diff --git a/mysql-test/main/type_datetime.result b/mysql-test/main/type_datetime.result index 77d77d218f0..76337ca23fb 100644 --- a/mysql-test/main/type_datetime.result +++ b/mysql-test/main/type_datetime.result @@ -105,7 +105,7 @@ date numfacture expedition 0000-00-00 00:00:00 1212 0001-00-00 00:00:00 EXPLAIN SELECT * FROM t1 WHERE expedition='0001-00-00 00:00:00'; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref expedition expedition 5 const 2 +1 SIMPLE t1 ALL expedition NULL NULL NULL 2 Using where drop table t1; create table t1 (a datetime not null, b datetime not null); insert into t1 values (now(), now()); @@ -545,7 +545,7 @@ select * from t1 where id in (select id from t1 as x1 where (t1.cur_date is null)); id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL 2 100.00 Using where -1 PRIMARY x1 ALL NULL NULL NULL NULL 2 100.00 Using where; Start temporary; End temporary +1 PRIMARY x1 ALL NULL NULL NULL NULL 2 100.00 Using where; FirstMatch(t1) Warnings: Note 1276 Field or reference 'test.t1.cur_date' of SELECT #2 was resolved in SELECT #1 Note 1003 select `test`.`t1`.`id` AS `id`,`test`.`t1`.`cur_date` AS `cur_date` from `test`.`t1` semi join (`test`.`t1` `x1`) where `test`.`x1`.`id` = `test`.`t1`.`id` and `test`.`t1`.`cur_date` = 0 @@ -557,7 +557,7 @@ select * from t2 where id in (select id from t2 as x1 where (t2.cur_date is null)); id select_type table type possible_keys key key_len ref rows filtered Extra 1 PRIMARY t2 ALL NULL NULL NULL NULL 2 100.00 Using where -1 PRIMARY x1 ALL NULL NULL NULL NULL 2 100.00 Using where; Start temporary; End temporary +1 PRIMARY x1 ALL NULL NULL NULL NULL 2 100.00 Using where; FirstMatch(t2) Warnings: Note 1276 Field or reference 'test.t2.cur_date' of SELECT #2 was resolved in SELECT #1 Note 1003 select `test`.`t2`.`id` AS `id`,`test`.`t2`.`cur_date` AS `cur_date` from `test`.`t2` semi join (`test`.`t2` `x1`) where `test`.`x1`.`id` = `test`.`t2`.`id` and `test`.`t2`.`cur_date` = 0 diff --git a/mysql-test/main/user_var.result b/mysql-test/main/user_var.result index de339b4b037..43b41c616b2 100644 --- a/mysql-test/main/user_var.result +++ b/mysql-test/main/user_var.result @@ -22,7 +22,7 @@ i @vv1:=if(sv1.i,1,0) @vv2:=if(sv2.i,1,0) @vv3:=if(sv3.i,1,0) @vv1+@vv2+@vv3 2 1 0 0 1 explain select * from t1 where i=@vv1; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref i i 4 const 2 +1 SIMPLE t1 ALL i NULL NULL NULL 3 Using where select @vv1,i,v from t1 where i=@vv1; @vv1 i v 1 1 1 @@ -35,7 +35,7 @@ id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 index NULL i 4 NULL 3 Using where; Using index explain select * from t1 where i=@vv1; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 ref i i 4 const 2 +1 SIMPLE t1 ALL i NULL NULL NULL 3 Using where drop table t1,t2; set @a=0,@b=0; select @a:=10, @b:=1, @a > @b, @a < @b; diff --git a/mysql-test/main/view.test b/mysql-test/main/view.test index 4bc688efa3d..4d6e0be87de 100644 --- a/mysql-test/main/view.test +++ b/mysql-test/main/view.test @@ -1890,7 +1890,9 @@ CREATE VIEW v1 AS SELECT id, f FROM t1 WHERE id <= 2; INSERT INTO t1 VALUES (2, 'foo2'); INSERT INTO t1 VALUES (1, 'foo1'); +--sorted_result SELECT * FROM v1; +--sorted_result SELECT * FROM v1; DROP VIEW v1; diff --git a/mysql-test/main/xtradb_mrr.result b/mysql-test/main/xtradb_mrr.result index 34fd8300423..2406424fe64 100644 --- a/mysql-test/main/xtradb_mrr.result +++ b/mysql-test/main/xtradb_mrr.result @@ -431,6 +431,12 @@ INSERT INTO `t1` VALUES (97,7,0,'z','z'); INSERT INTO `t1` VALUES (98,1,1,'j','j'); INSERT INTO `t1` VALUES (99,7,8,'c','c'); INSERT INTO `t1` VALUES (100,2,5,'f','f'); +EXPLAIN SELECT table1 .`col_varchar_key` +FROM t1 table1 STRAIGHT_JOIN ( t1 table3 JOIN t1 table4 ON table4 .`pk` = table3 .`col_int_nokey` ) ON table4 .`col_varchar_nokey` ; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE table1 index NULL col_varchar_key 9 NULL 6 Using index +1 SIMPLE table3 ALL NULL NULL NULL NULL 6 Using where; Using join buffer (flat, BNL join) +1 SIMPLE table4 eq_ref PRIMARY PRIMARY 4 test.table3.col_int_nokey 1 Using where SELECT table1 .`col_varchar_key` FROM t1 table1 STRAIGHT_JOIN ( t1 table3 JOIN t1 table4 ON table4 .`pk` = table3 .`col_int_nokey` ) ON table4 .`col_varchar_nokey` ; col_varchar_key diff --git a/mysql-test/main/xtradb_mrr.test b/mysql-test/main/xtradb_mrr.test index 9de9b192b06..fcb4f83af36 100644 --- a/mysql-test/main/xtradb_mrr.test +++ b/mysql-test/main/xtradb_mrr.test @@ -151,6 +151,8 @@ INSERT INTO `t1` VALUES (97,7,0,'z','z'); INSERT INTO `t1` VALUES (98,1,1,'j','j'); INSERT INTO `t1` VALUES (99,7,8,'c','c'); INSERT INTO `t1` VALUES (100,2,5,'f','f'); +EXPLAIN SELECT table1 .`col_varchar_key` +FROM t1 table1 STRAIGHT_JOIN ( t1 table3 JOIN t1 table4 ON table4 .`pk` = table3 .`col_int_nokey` ) ON table4 .`col_varchar_nokey` ; SELECT table1 .`col_varchar_key` FROM t1 table1 STRAIGHT_JOIN ( t1 table3 JOIN t1 table4 ON table4 .`pk` = table3 .`col_int_nokey` ) ON table4 .`col_varchar_nokey` ; DROP TABLE t1; diff --git a/mysql-test/suite/gcol/inc/gcol_keys.inc b/mysql-test/suite/gcol/inc/gcol_keys.inc index e5ac0afd92a..9996d23e42e 100644 --- a/mysql-test/suite/gcol/inc/gcol_keys.inc +++ b/mysql-test/suite/gcol/inc/gcol_keys.inc @@ -14,6 +14,8 @@ # Change: # ################################################################################ +--source include/have_sequence.inc + if (!$support_virtual_index) { let $skip_spatial_index_check=1; let $skip_foreign_key_check=1; @@ -197,12 +199,16 @@ PRIMARY KEY (pk), KEY (col_time_key), KEY (col_datetime_key)); +--disable_warnings INSERT INTO c ( col_time_nokey,col_datetime_nokey,col_varchar_nokey) values ('14:03:03.042673','2001-11-28 00:50:27.051028', 'c'), ('01:46:09.016386','2007-10-09 19:53:04.008332', NULL), ('16:21:18.052408','2001-11-08 21:02:12.009395', 'x'), ('18:56:33.027423','2003-04-01 00:00:00', 'i'); +insert into c (col_time_nokey,col_datetime_nokey,col_varchar_nokey) select '10:10:10', '2021-12-24 01:50:27', 'z' from seq_1_to_10; +--enable_warnings + --replace_column 9 x 10 x EXPLAIN SELECT outr.col_time_key AS x diff --git a/mysql-test/suite/gcol/inc/gcol_select.inc b/mysql-test/suite/gcol/inc/gcol_select.inc index 2386c55fdbc..4c030cb5646 100644 --- a/mysql-test/suite/gcol/inc/gcol_select.inc +++ b/mysql-test/suite/gcol/inc/gcol_select.inc @@ -545,11 +545,11 @@ CREATE TABLE cc ( ); INSERT INTO cc (col_int_nokey) VALUES (0),(1),(7),(0),(4),(5); --replace_column 9 # 10 # -EXPLAIN SELECT pk FROM cc WHERE col_int_key > 3; -SELECT pk FROM cc WHERE col_int_key > 3; +EXPLAIN SELECT pk FROM cc force index(col_int_key) WHERE col_int_key > 3; +SELECT pk FROM cc force index(col_int_key) WHERE col_int_key > 3; --replace_column 9 # 10 # -EXPLAIN SELECT pk FROM cc WHERE col_int_key > 3 ORDER BY 1; -SELECT pk FROM cc WHERE col_int_key > 3 ORDER BY 1; +EXPLAIN SELECT pk FROM cc force index(col_int_key) WHERE col_int_key > 3 ORDER BY 1; +SELECT pk FROM cc force index(col_int_key) WHERE col_int_key > 3 ORDER BY 1; DROP TABLE cc; --echo # diff --git a/mysql-test/suite/gcol/r/gcol_keys_innodb.result b/mysql-test/suite/gcol/r/gcol_keys_innodb.result index c2027d21442..f6dfaec062c 100644 --- a/mysql-test/suite/gcol/r/gcol_keys_innodb.result +++ b/mysql-test/suite/gcol/r/gcol_keys_innodb.result @@ -192,11 +192,7 @@ INSERT INTO c ( col_time_nokey,col_datetime_nokey,col_varchar_nokey) values ('01:46:09.016386','2007-10-09 19:53:04.008332', NULL), ('16:21:18.052408','2001-11-08 21:02:12.009395', 'x'), ('18:56:33.027423','2003-04-01 00:00:00', 'i'); -Warnings: -Note 1265 Data truncated for column 'col_time_key' at row 1 -Note 1265 Data truncated for column 'col_time_key' at row 2 -Note 1265 Data truncated for column 'col_time_key' at row 3 -Note 1265 Data truncated for column 'col_time_key' at row 4 +insert into c (col_time_nokey,col_datetime_nokey,col_varchar_nokey) select '10:10:10', '2021-12-24 01:50:27', 'z' from seq_1_to_10; EXPLAIN SELECT outr.col_time_key AS x FROM c as outr diff --git a/mysql-test/suite/gcol/r/gcol_keys_myisam.result b/mysql-test/suite/gcol/r/gcol_keys_myisam.result index 364d53afe1d..f7ebe63ab82 100644 --- a/mysql-test/suite/gcol/r/gcol_keys_myisam.result +++ b/mysql-test/suite/gcol/r/gcol_keys_myisam.result @@ -192,11 +192,7 @@ INSERT INTO c ( col_time_nokey,col_datetime_nokey,col_varchar_nokey) values ('01:46:09.016386','2007-10-09 19:53:04.008332', NULL), ('16:21:18.052408','2001-11-08 21:02:12.009395', 'x'), ('18:56:33.027423','2003-04-01 00:00:00', 'i'); -Warnings: -Note 1265 Data truncated for column 'col_time_key' at row 1 -Note 1265 Data truncated for column 'col_time_key' at row 2 -Note 1265 Data truncated for column 'col_time_key' at row 3 -Note 1265 Data truncated for column 'col_time_key' at row 4 +insert into c (col_time_nokey,col_datetime_nokey,col_varchar_nokey) select '10:10:10', '2021-12-24 01:50:27', 'z' from seq_1_to_10; EXPLAIN SELECT outr.col_time_key AS x FROM c as outr diff --git a/mysql-test/suite/gcol/r/gcol_select_innodb.result b/mysql-test/suite/gcol/r/gcol_select_innodb.result index e5606663f29..d3f0b1ab87d 100644 --- a/mysql-test/suite/gcol/r/gcol_select_innodb.result +++ b/mysql-test/suite/gcol/r/gcol_select_innodb.result @@ -930,8 +930,8 @@ WHERE t4.c1 < 'o' and t4.i1 < (t2.i1 + 1) ) AND t1.i1 <= t3.i2_key; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t4 ALL NULL NULL NULL NULL 3 Using where; Start temporary -1 PRIMARY t1 ALL NULL NULL NULL NULL 4 Using join buffer (flat, BNL join) +1 PRIMARY t1 ALL NULL NULL NULL NULL 4 +1 PRIMARY t4 ALL NULL NULL NULL NULL 3 Using where; Start temporary; Using join buffer (flat, BNL join) 1 PRIMARY t3 eq_ref PRIMARY PRIMARY 4 test.t4.i1 1 Using where 1 PRIMARY t2 ALL NULL NULL NULL NULL 5 Using where; End temporary; Using join buffer (flat, BNL join) SELECT /*+ NO_SEMIJOIN(@subq1) */ t1.c1, t2.i1 diff --git a/mysql-test/suite/gcol/r/gcol_select_myisam.result b/mysql-test/suite/gcol/r/gcol_select_myisam.result index 01b80ef48bc..454dff2f01a 100644 --- a/mysql-test/suite/gcol/r/gcol_select_myisam.result +++ b/mysql-test/suite/gcol/r/gcol_select_myisam.result @@ -792,18 +792,18 @@ PRIMARY KEY (pk), KEY (col_int_key) ); INSERT INTO cc (col_int_nokey) VALUES (0),(1),(7),(0),(4),(5); -EXPLAIN SELECT pk FROM cc WHERE col_int_key > 3; +EXPLAIN SELECT pk FROM cc force index(col_int_key) WHERE col_int_key > 3; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE cc range col_int_key col_int_key 5 NULL # # -SELECT pk FROM cc WHERE col_int_key > 3; +SELECT pk FROM cc force index(col_int_key) WHERE col_int_key > 3; pk 5 6 3 -EXPLAIN SELECT pk FROM cc WHERE col_int_key > 3 ORDER BY 1; +EXPLAIN SELECT pk FROM cc force index(col_int_key) WHERE col_int_key > 3 ORDER BY 1; id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE cc range col_int_key col_int_key 5 NULL # # -SELECT pk FROM cc WHERE col_int_key > 3 ORDER BY 1; +SELECT pk FROM cc force index(col_int_key) WHERE col_int_key > 3 ORDER BY 1; pk 3 5 @@ -1562,8 +1562,8 @@ WHERE t4.c1 < 'o' and t4.i1 < (t2.i1 + 1) ) AND t1.i1 <= t3.i2_key; id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t4 ALL NULL NULL NULL NULL 3 Using where; Start temporary -1 PRIMARY t1 ALL NULL NULL NULL NULL 4 Using join buffer (flat, BNL join) +1 PRIMARY t1 ALL NULL NULL NULL NULL 4 +1 PRIMARY t4 ALL NULL NULL NULL NULL 3 Using where; Start temporary; Using join buffer (flat, BNL join) 1 PRIMARY t3 eq_ref PRIMARY,v_idx PRIMARY 4 test.t4.i1 1 Using where 1 PRIMARY t2 ALL NULL NULL NULL NULL 5 Using where; End temporary; Using join buffer (flat, BNL join) SELECT /*+ NO_SEMIJOIN(@subq1) */ t1.c1, t2.i1 diff --git a/mysql-test/suite/heap/heap.result b/mysql-test/suite/heap/heap.result index 15bb9ea0b50..241b60d7be2 100644 --- a/mysql-test/suite/heap/heap.result +++ b/mysql-test/suite/heap/heap.result @@ -66,7 +66,7 @@ a alter table t1 engine=myisam; explain select * from t1 where a in (869751,736494,226312,802616); id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range uniq_id uniq_id 4 NULL 4 Using where; Using index +1 SIMPLE t1 index uniq_id uniq_id 4 NULL 5 Using where; Using index drop table t1; create table t1 (x int not null, y int not null, key x (x), unique y (y)) engine=heap; diff --git a/mysql-test/suite/heap/heap_btree.result b/mysql-test/suite/heap/heap_btree.result index 526c76a52e8..a534e25565a 100644 --- a/mysql-test/suite/heap/heap_btree.result +++ b/mysql-test/suite/heap/heap_btree.result @@ -69,6 +69,10 @@ id select_type table type possible_keys key key_len ref rows Extra alter table t1 engine=myisam; explain select * from t1 where a in (869751,736494,226312,802616); id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 index uniq_id uniq_id 4 NULL 5 Using where; Using index +insert into t1 values (1),(2),(3),(4),(5),(6); +explain select * from t1 where a in (869751,736494,226312,802616); +id select_type table type possible_keys key key_len ref rows Extra 1 SIMPLE t1 range uniq_id uniq_id 4 NULL 4 Using where; Using index drop table t1; create table t1 (x int not null, y int not null, key x using BTREE (x,y), unique y using BTREE (y)) diff --git a/mysql-test/suite/heap/heap_btree.test b/mysql-test/suite/heap/heap_btree.test index d3fbe4cc0d2..e8f7c02c6f3 100644 --- a/mysql-test/suite/heap/heap_btree.test +++ b/mysql-test/suite/heap/heap_btree.test @@ -48,6 +48,8 @@ select * from t1 where a in (869751,736494,226312,802616); explain select * from t1 where a in (869751,736494,226312,802616); alter table t1 engine=myisam; explain select * from t1 where a in (869751,736494,226312,802616); +insert into t1 values (1),(2),(3),(4),(5),(6); +explain select * from t1 where a in (869751,736494,226312,802616); drop table t1; create table t1 (x int not null, y int not null, key x using BTREE (x,y), unique y using BTREE (y)) diff --git a/mysql-test/suite/innodb/r/innodb.result b/mysql-test/suite/innodb/r/innodb.result index d799cbb8fd9..2afaffdb4ad 100644 --- a/mysql-test/suite/innodb/r/innodb.result +++ b/mysql-test/suite/innodb/r/innodb.result @@ -1367,14 +1367,28 @@ PRIMARY KEY (`id`), KEY `id_version` (`id_version`) ) ENGINE=InnoDB; INSERT INTO t2 VALUES("3524", "1"),("3525", "1"),("1794", "4"),("102", "5"),("1822", "6"),("3382", "9"); +ANALYZE table t1,t2; +Table Op Msg_type Msg_text +test.t1 analyze status Engine-independent statistics collected +test.t1 analyze Warning Engine-independent statistics are not collected for column 'description' +test.t1 analyze status OK +test.t2 analyze status Engine-independent statistics collected +test.t2 analyze status OK +explain SELECT t2.id, t1.`label` FROM t2 INNER JOIN +(SELECT t1.id_object as id_object FROM t1 WHERE t1.`label` LIKE '%test%') AS lbl +ON (t2.id = lbl.id_object) INNER JOIN t1 ON (t2.id = t1.id_object); +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t1 ALL id_object NULL NULL NULL 6 Using where +1 SIMPLE t2 eq_ref PRIMARY PRIMARY 4 test.t1.id_object 1 Using index +1 SIMPLE t1 ref id_object id_object 5 test.t1.id_object 1 SELECT t2.id, t1.`label` FROM t2 INNER JOIN (SELECT t1.id_object as id_object FROM t1 WHERE t1.`label` LIKE '%test%') AS lbl ON (t2.id = lbl.id_object) INNER JOIN t1 ON (t2.id = t1.id_object); id label -3382 Test 102 Le Pekin (Test) 1794 Test de resto 1822 Test 3 +3382 Test 3524 Societe Test 3525 Fournisseur Test drop table t1,t2; diff --git a/mysql-test/suite/innodb/r/innodb_mysql.result b/mysql-test/suite/innodb/r/innodb_mysql.result index d55a8b50d82..8d5fc9b83f1 100644 --- a/mysql-test/suite/innodb/r/innodb_mysql.result +++ b/mysql-test/suite/innodb/r/innodb_mysql.result @@ -1312,13 +1312,13 @@ EXPLAIN SELECT * FROM t1 WHERE b BETWEEN 1 AND 2 ORDER BY a; id 1 select_type SIMPLE table t1 -type range +type index possible_keys bkey -key bkey -key_len 5 +key PRIMARY +key_len 4 ref NULL rows 32 -Extra Using where; Using index; Using filesort +Extra Using where SELECT * FROM t1 WHERE b BETWEEN 1 AND 2 ORDER BY a; a b 1 2 @@ -3290,8 +3290,8 @@ EXPLAIN SELECT t2.b FROM t1,t2 WHERE t1.a IN (SELECT 1 FROM t2); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t2 ALL NULL NULL NULL NULL 1 -1 PRIMARY t2 index NULL PRIMARY 4 NULL 1 Using index; Start temporary; Using join buffer (flat, BNL join) -1 PRIMARY t1 ALL NULL NULL NULL NULL 2 Using where; End temporary; Using join buffer (incremental, BNL join) +1 PRIMARY t1 ALL NULL NULL NULL NULL 2 Using where; Using join buffer (flat, BNL join) +1 PRIMARY t2 index NULL PRIMARY 4 NULL 1 Using index; FirstMatch(t1); Using join buffer (incremental, BNL join) SELECT t2.b FROM t1,t2 WHERE t1.a IN (SELECT 1 FROM t2); b 1 diff --git a/mysql-test/suite/innodb/r/mdev-14846.result b/mysql-test/suite/innodb/r/mdev-14846.result index 219bd718feb..b41f6e6bf97 100644 --- a/mysql-test/suite/innodb/r/mdev-14846.result +++ b/mysql-test/suite/innodb/r/mdev-14846.result @@ -33,13 +33,25 @@ pk f1 f2 f3 SET DEBUG_SYNC='now SIGNAL default_dml'; connection default; SET DEBUG_SYNC='now WAIT_FOR default_dml'; -UPDATE t3 AS alias1 LEFT JOIN t3 AS alias2 ON ( alias1.f1 <> alias1.f2 ) SET alias1.f3 = 59 WHERE ( EXISTS ( SELECT t1.f3 FROM t1 WHERE t1.f1 = alias1.f1 ) ) OR alias2.f1 = 'h'; +explain UPDATE t3 AS alias1 LEFT JOIN t3 AS alias2 ON ( alias1.f1 <> alias1.f2 ) SET alias1.f3 = 59 WHERE ( EXISTS ( SELECT t1.f3 FROM t1 IGNORE INDEX (f1) WHERE t1.f1 = alias1.f1 ) ) OR alias2.f1 = 'h'; +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY alias1 ALL NULL NULL NULL NULL # +1 PRIMARY alias2 ALL NULL NULL NULL NULL # Using where +2 DEPENDENT SUBQUERY t1 ALL NULL NULL NULL NULL # Using where +UPDATE t3 AS alias1 LEFT JOIN t3 AS alias2 ON ( alias1.f1 <> alias1.f2 ) SET alias1.f3 = 59 WHERE ( EXISTS ( SELECT t1.f3 FROM t1 IGNORE INDEX (f1) WHERE t1.f1 = alias1.f1 ) ) OR alias2.f1 = 'h'; connect con2,localhost,root,,test; set debug_sync='now WAIT_FOR default_dml'; SET DEBUG_SYNC='now SIGNAL con1_dml2'; disconnect con2; connection con1; SET DEBUG_SYNC='now WAIT_FOR con1_dml2'; +explain UPDATE v4, t1 SET t1.pk = 76 WHERE t1.f2 IN ( SELECT t2.f FROM t2 INNER JOIN t3 ); +id select_type table type possible_keys key key_len ref rows Extra +1 PRIMARY t1 index NULL f1 12 NULL # Using index +1 PRIMARY t1 ALL NULL NULL NULL NULL # +1 PRIMARY <subquery2> eq_ref distinct_key distinct_key 13 func # +2 MATERIALIZED t3 ALL NULL NULL NULL NULL # +2 MATERIALIZED t2 ALL NULL NULL NULL NULL # UPDATE v4, t1 SET t1.pk = 76 WHERE t1.f2 IN ( SELECT t2.f FROM t2 INNER JOIN t3 ); connection default; ERROR 40001: Deadlock found when trying to get lock; try restarting transaction diff --git a/mysql-test/suite/innodb/r/temporary_table.result b/mysql-test/suite/innodb/r/temporary_table.result index 37e0eac9ce5..fba04741798 100644 --- a/mysql-test/suite/innodb/r/temporary_table.result +++ b/mysql-test/suite/innodb/r/temporary_table.result @@ -28,7 +28,7 @@ id select_type table type possible_keys key key_len ref rows Extra alter table t1 add index sec_index(f); explain select * from t1 where f > 1.29999; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range sec_index sec_index 5 NULL 3 Using index condition +1 SIMPLE t1 ALL sec_index NULL NULL NULL 5 Using where select * from t1 where f > 1.29999; i f c 98 1.3 jaipur diff --git a/mysql-test/suite/innodb/r/temporary_table_optimization.result b/mysql-test/suite/innodb/r/temporary_table_optimization.result index c678fd56880..086e5621b64 100644 --- a/mysql-test/suite/innodb/r/temporary_table_optimization.result +++ b/mysql-test/suite/innodb/r/temporary_table_optimization.result @@ -128,7 +128,7 @@ ERROR 23000: Duplicate entry '2.5' for key 'sec_index' alter table t1 add index sec_index(t1_f); explain select * from t1 where t1_f >= 2.5; id select_type table type possible_keys key key_len ref rows Extra -1 SIMPLE t1 range sec_index sec_index 5 NULL 3 Using index condition +1 SIMPLE t1 ALL sec_index NULL NULL NULL 4 Using where select * from t1 where t1_f >= 2.5; t1_i t1_f 2 2.5 diff --git a/mysql-test/suite/innodb/t/innodb.test b/mysql-test/suite/innodb/t/innodb.test index 3a8c12dfbbd..35b11a9f367 100644 --- a/mysql-test/suite/innodb/t/innodb.test +++ b/mysql-test/suite/innodb/t/innodb.test @@ -1109,7 +1109,13 @@ CREATE TABLE t2 ( ) ENGINE=InnoDB; INSERT INTO t2 VALUES("3524", "1"),("3525", "1"),("1794", "4"),("102", "5"),("1822", "6"),("3382", "9"); +# We have to analyze the tables to make the row count stable +ANALYZE table t1,t2; +explain SELECT t2.id, t1.`label` FROM t2 INNER JOIN +(SELECT t1.id_object as id_object FROM t1 WHERE t1.`label` LIKE '%test%') AS lbl +ON (t2.id = lbl.id_object) INNER JOIN t1 ON (t2.id = t1.id_object); +--sorted_result SELECT t2.id, t1.`label` FROM t2 INNER JOIN (SELECT t1.id_object as id_object FROM t1 WHERE t1.`label` LIKE '%test%') AS lbl ON (t2.id = lbl.id_object) INNER JOIN t1 ON (t2.id = t1.id_object); diff --git a/mysql-test/suite/innodb/t/mdev-14846.test b/mysql-test/suite/innodb/t/mdev-14846.test index adcefecd52f..079a066cec5 100644 --- a/mysql-test/suite/innodb/t/mdev-14846.test +++ b/mysql-test/suite/innodb/t/mdev-14846.test @@ -38,7 +38,9 @@ SET DEBUG_SYNC='now SIGNAL default_dml'; --connection default SET DEBUG_SYNC='now WAIT_FOR default_dml'; ---send UPDATE t3 AS alias1 LEFT JOIN t3 AS alias2 ON ( alias1.f1 <> alias1.f2 ) SET alias1.f3 = 59 WHERE ( EXISTS ( SELECT t1.f3 FROM t1 WHERE t1.f1 = alias1.f1 ) ) OR alias2.f1 = 'h' +--replace_column 9 # +explain UPDATE t3 AS alias1 LEFT JOIN t3 AS alias2 ON ( alias1.f1 <> alias1.f2 ) SET alias1.f3 = 59 WHERE ( EXISTS ( SELECT t1.f3 FROM t1 IGNORE INDEX (f1) WHERE t1.f1 = alias1.f1 ) ) OR alias2.f1 = 'h'; +--send UPDATE t3 AS alias1 LEFT JOIN t3 AS alias2 ON ( alias1.f1 <> alias1.f2 ) SET alias1.f3 = 59 WHERE ( EXISTS ( SELECT t1.f3 FROM t1 IGNORE INDEX (f1) WHERE t1.f1 = alias1.f1 ) ) OR alias2.f1 = 'h' # It holds the lock of all record in t3 and tries to acquire record lock for the table t1. --connect (con2,localhost,root,,test) @@ -52,6 +54,8 @@ disconnect con2; # Cleanup --connection con1 SET DEBUG_SYNC='now WAIT_FOR con1_dml2'; +--replace_column 9 # +explain UPDATE v4, t1 SET t1.pk = 76 WHERE t1.f2 IN ( SELECT t2.f FROM t2 INNER JOIN t3 ); UPDATE v4, t1 SET t1.pk = 76 WHERE t1.f2 IN ( SELECT t2.f FROM t2 INNER JOIN t3 ); # It holds the record lock on table t1 and tries to acquire record lock on t3. # leads to deadlock (con1 trx is waiting for default trx and vice versa) diff --git a/mysql-test/suite/innodb_fts/r/fulltext_misc.result b/mysql-test/suite/innodb_fts/r/fulltext_misc.result index f3e1ef519fd..7693807db87 100644 --- a/mysql-test/suite/innodb_fts/r/fulltext_misc.result +++ b/mysql-test/suite/innodb_fts/r/fulltext_misc.result @@ -9,8 +9,8 @@ WHERE 1 > ALL((SELECT 1 FROM t1 JOIN t1 a ON (MATCH(t1.f1) AGAINST ("")) WHERE t1.f1 GROUP BY t1.f1)); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 index NULL f1_2 8 NULL 1 Using index -2 SUBQUERY t1 fulltext f1_2,f1 f1 0 1 Using where 2 SUBQUERY a index NULL f1_2 8 NULL 1 Using index +2 SUBQUERY t1 fulltext f1_2,f1 f1 0 1 Using where PREPARE stmt FROM 'EXPLAIN SELECT 1 FROM t1 WHERE 1 > ALL((SELECT 1 FROM t1 RIGHT OUTER JOIN t1 a @@ -19,13 +19,13 @@ PREPARE stmt FROM EXECUTE stmt; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 index NULL f1_2 8 NULL 1 Using index -2 SUBQUERY t1 fulltext f1_2,f1 f1 0 1 Using where 2 SUBQUERY a index NULL f1_2 8 NULL 1 Using index +2 SUBQUERY t1 fulltext f1_2,f1 f1 0 1 Using where EXECUTE stmt; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 index NULL f1_2 8 NULL 1 Using index -2 SUBQUERY t1 fulltext f1_2,f1 f1 0 1 Using where 2 SUBQUERY a index NULL f1_2 8 NULL 1 Using index +2 SUBQUERY t1 fulltext f1_2,f1 f1 0 1 Using where DEALLOCATE PREPARE stmt; PREPARE stmt FROM 'EXPLAIN SELECT 1 FROM t1 @@ -35,13 +35,13 @@ PREPARE stmt FROM EXECUTE stmt; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 index NULL f1_2 8 NULL 1 Using index -2 SUBQUERY t1 fulltext f1_2,f1 f1 0 1 Using where 2 SUBQUERY a index NULL f1_2 8 NULL 1 Using index +2 SUBQUERY t1 fulltext f1_2,f1 f1 0 1 Using where EXECUTE stmt; id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 index NULL f1_2 8 NULL 1 Using index -2 SUBQUERY t1 fulltext f1_2,f1 f1 0 1 Using where 2 SUBQUERY a index NULL f1_2 8 NULL 1 Using index +2 SUBQUERY t1 fulltext f1_2,f1 f1 0 1 Using where DEALLOCATE PREPARE stmt; DROP TABLE t1; drop table if exists t1; diff --git a/mysql-test/suite/json/t/json_table.test b/mysql-test/suite/json/t/json_table.test index f250fcbf58a..5f6bdc7efd0 100644 --- a/mysql-test/suite/json/t/json_table.test +++ b/mysql-test/suite/json/t/json_table.test @@ -69,6 +69,7 @@ insert into t1 select * from t1; set @save_optimizer_switch=@@optimizer_switch; set optimizer_switch='firstmatch=off'; +--sorted_result select * from json_table('[{"color": "blue", "price": 50}, {"color": "red", "price": 100}]', diff --git a/mysql-test/suite/maria/icp.result b/mysql-test/suite/maria/icp.result index 43ec6439144..259078fb1ad 100644 --- a/mysql-test/suite/maria/icp.result +++ b/mysql-test/suite/maria/icp.result @@ -431,8 +431,8 @@ SELECT * FROM t1 WHERE pk IN (SELECT it.pk FROM t2 JOIN t2 AS it ON it.i=it.i WHERE it.pk-t1.i<10); id select_type table type possible_keys key key_len ref rows Extra 1 PRIMARY t1 ALL NULL NULL NULL NULL # Using where +2 DEPENDENT SUBQUERY t2 index NULL PRIMARY 4 NULL # Using index 2 DEPENDENT SUBQUERY it eq_ref PRIMARY PRIMARY 4 func # Using index condition -2 DEPENDENT SUBQUERY t2 index NULL PRIMARY 4 NULL # Using index; Using join buffer (flat, BNL join) SELECT * FROM t1 WHERE pk IN (SELECT it.pk FROM t2 JOIN t2 AS it ON it.i=it.i WHERE it.pk-t1.i<10); pk i diff --git a/mysql-test/suite/optimizer_unfixed_bugs/r/bug45221.result b/mysql-test/suite/optimizer_unfixed_bugs/r/bug45221.result index 79100ca2b48..17edbc19e0e 100644 --- a/mysql-test/suite/optimizer_unfixed_bugs/r/bug45221.result +++ b/mysql-test/suite/optimizer_unfixed_bugs/r/bug45221.result @@ -29,10 +29,10 @@ SELECT `int_key` FROM t2 WHERE `date_nokey` < `datetime_nokey` XOR OUTR .`date_nokey` ) ; pk -9 2 5 6 +9 SELECT `pk` FROM t1 WHERE `pk` IN ( diff --git a/mysql-test/suite/perfschema/r/table_aggregate_global_2u_2t.result b/mysql-test/suite/perfschema/r/table_aggregate_global_2u_2t.result index bc0367b83bf..2cead80faf3 100644 --- a/mysql-test/suite/perfschema/r/table_aggregate_global_2u_2t.result +++ b/mysql-test/suite/perfschema/r/table_aggregate_global_2u_2t.result @@ -200,23 +200,23 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 23 +wait/io/table/sql/handler 24 wait/lock/table/sql/handler 24 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 6 4 2 4 1 1 0 +TABLE test t1 NULL 9 6 3 6 1 2 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 2 1 1 1 0 1 0 +TABLE test t1 PRIMARY 0 0 0 0 0 0 0 TABLE test t3 NULL 13 7 6 7 3 3 0 TABLE test t3 index_b 1 1 0 1 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 1 1 0 1 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 8 5 3 5 1 2 0 +TABLE test t1 9 6 3 6 1 2 0 TABLE test t3 15 9 6 9 3 3 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -224,7 +224,7 @@ TABLE test t1 10 4 6 2 0 0 0 2 0 3 TABLE test t3 14 4 10 2 0 0 0 2 0 5 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 18 +TABLE test t1 19 TABLE test t2 0 TABLE test t3 29 connection con1; @@ -256,23 +256,23 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 23 +wait/io/table/sql/handler 24 wait/lock/table/sql/handler 24 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 6 4 2 4 1 1 0 +TABLE test t1 NULL 9 6 3 6 1 2 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 2 1 1 1 0 1 0 +TABLE test t1 PRIMARY 0 0 0 0 0 0 0 TABLE test t3 NULL 13 7 6 7 3 3 0 TABLE test t3 index_b 1 1 0 1 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 1 1 0 1 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 8 5 3 5 1 2 0 +TABLE test t1 9 6 3 6 1 2 0 TABLE test t3 15 9 6 9 3 3 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -280,7 +280,7 @@ TABLE test t1 10 4 6 2 0 0 0 2 0 3 TABLE test t3 14 4 10 2 0 0 0 2 0 5 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 18 +TABLE test t1 19 TABLE test t2 0 TABLE test t3 29 connect con2, localhost, user2, , ; @@ -318,23 +318,23 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 23 +wait/io/table/sql/handler 24 wait/lock/table/sql/handler 24 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 6 4 2 4 1 1 0 +TABLE test t1 NULL 9 6 3 6 1 2 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 2 1 1 1 0 1 0 +TABLE test t1 PRIMARY 0 0 0 0 0 0 0 TABLE test t3 NULL 13 7 6 7 3 3 0 TABLE test t3 index_b 1 1 0 1 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 1 1 0 1 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 8 5 3 5 1 2 0 +TABLE test t1 9 6 3 6 1 2 0 TABLE test t3 15 9 6 9 3 3 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -342,7 +342,7 @@ TABLE test t1 10 4 6 2 0 0 0 2 0 3 TABLE test t3 14 4 10 2 0 0 0 2 0 5 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 18 +TABLE test t1 19 TABLE test t2 0 TABLE test t3 29 connection con2; @@ -415,23 +415,23 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 58 +wait/io/table/sql/handler 59 wait/lock/table/sql/handler 48 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 14 9 5 9 2 3 0 +TABLE test t1 NULL 17 11 6 11 2 4 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t3 NULL 35 20 15 20 6 9 0 TABLE test t3 index_b 3 3 0 3 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 18 11 7 11 2 5 0 +TABLE test t1 19 12 7 12 2 5 0 TABLE test t3 40 25 15 25 6 9 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -439,7 +439,7 @@ TABLE test t1 20 8 12 4 0 0 0 4 0 6 TABLE test t3 28 8 20 4 0 0 0 4 0 10 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 38 +TABLE test t1 39 TABLE test t2 0 TABLE test t3 68 connect con3, localhost, user3, , ; @@ -482,23 +482,23 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 58 +wait/io/table/sql/handler 59 wait/lock/table/sql/handler 48 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 14 9 5 9 2 3 0 +TABLE test t1 NULL 17 11 6 11 2 4 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t3 NULL 35 20 15 20 6 9 0 TABLE test t3 index_b 3 3 0 3 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 18 11 7 11 2 5 0 +TABLE test t1 19 12 7 12 2 5 0 TABLE test t3 40 25 15 25 6 9 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -506,7 +506,7 @@ TABLE test t1 20 8 12 4 0 0 0 4 0 6 TABLE test t3 28 8 20 4 0 0 0 4 0 10 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 38 +TABLE test t1 39 TABLE test t2 0 TABLE test t3 68 connection con3; @@ -591,23 +591,23 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 106 +wait/io/table/sql/handler 107 wait/lock/table/sql/handler 72 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 25 16 9 16 3 6 0 +TABLE test t1 NULL 28 18 10 18 3 7 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 6 3 3 3 0 3 0 +TABLE test t1 PRIMARY 4 2 2 2 0 2 0 TABLE test t3 NULL 66 39 27 39 9 18 0 TABLE test t3 index_b 6 6 0 6 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 3 3 0 3 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 31 19 12 19 3 9 0 +TABLE test t1 32 20 12 20 3 9 0 TABLE test t3 75 48 27 48 9 18 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -615,7 +615,7 @@ TABLE test t1 30 12 18 6 0 0 0 6 0 9 TABLE test t3 42 12 30 6 0 0 0 6 0 15 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 61 +TABLE test t1 62 TABLE test t2 0 TABLE test t3 117 connect con4, localhost, user4, , ; @@ -663,23 +663,23 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 106 +wait/io/table/sql/handler 107 wait/lock/table/sql/handler 72 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 25 16 9 16 3 6 0 +TABLE test t1 NULL 28 18 10 18 3 7 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 6 3 3 3 0 3 0 +TABLE test t1 PRIMARY 4 2 2 2 0 2 0 TABLE test t3 NULL 66 39 27 39 9 18 0 TABLE test t3 index_b 6 6 0 6 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 3 3 0 3 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 31 19 12 19 3 9 0 +TABLE test t1 32 20 12 20 3 9 0 TABLE test t3 75 48 27 48 9 18 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -687,7 +687,7 @@ TABLE test t1 30 12 18 6 0 0 0 6 0 9 TABLE test t3 42 12 30 6 0 0 0 6 0 15 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 61 +TABLE test t1 62 TABLE test t2 0 TABLE test t3 117 connection con4; @@ -784,23 +784,23 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 167 +wait/io/table/sql/handler 168 wait/lock/table/sql/handler 96 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t3 NULL 106 64 42 64 12 30 0 TABLE test t3 index_b 10 10 0 10 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -808,7 +808,7 @@ TABLE test t1 40 16 24 8 0 0 0 8 0 12 TABLE test t3 56 16 40 8 0 0 0 8 0 20 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 87 +TABLE test t1 88 TABLE test t2 0 TABLE test t3 176 connection con1; @@ -857,23 +857,23 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 167 +wait/io/table/sql/handler 168 wait/lock/table/sql/handler 104 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t3 NULL 106 64 42 64 12 30 0 TABLE test t3 index_b 10 10 0 10 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -881,7 +881,7 @@ TABLE test t1 44 18 26 8 0 0 1 9 0 13 TABLE test t3 60 18 42 8 0 0 1 9 0 21 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 91 +TABLE test t1 92 TABLE test t2 0 TABLE test t3 180 connection default; @@ -927,23 +927,23 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 167 +wait/io/table/sql/handler 168 wait/lock/table/sql/handler 104 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t3 NULL 106 64 42 64 12 30 0 TABLE test t3 index_b 10 10 0 10 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -951,7 +951,7 @@ TABLE test t1 44 18 26 8 0 0 1 9 0 13 TABLE test t3 60 18 42 8 0 0 1 9 0 21 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 91 +TABLE test t1 92 TABLE test t2 0 TABLE test t3 180 set global read_only=1; @@ -997,23 +997,23 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 167 +wait/io/table/sql/handler 168 wait/lock/table/sql/handler 104 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t3 NULL 106 64 42 64 12 30 0 TABLE test t3 index_b 10 10 0 10 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -1021,7 +1021,7 @@ TABLE test t1 44 18 26 8 0 0 1 9 0 13 TABLE test t3 60 18 42 8 0 0 1 9 0 21 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 91 +TABLE test t1 92 TABLE test t2 0 TABLE test t3 180 disconnect con1; @@ -1064,23 +1064,23 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 167 +wait/io/table/sql/handler 168 wait/lock/table/sql/handler 104 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t3 NULL 106 64 42 64 12 30 0 TABLE test t3 index_b 10 10 0 10 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -1088,7 +1088,7 @@ TABLE test t1 44 18 26 8 0 0 1 9 0 13 TABLE test t3 60 18 42 8 0 0 1 9 0 21 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 91 +TABLE test t1 92 TABLE test t2 0 TABLE test t3 180 disconnect con2; @@ -1130,23 +1130,23 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 167 +wait/io/table/sql/handler 168 wait/lock/table/sql/handler 104 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t3 NULL 106 64 42 64 12 30 0 TABLE test t3 index_b 10 10 0 10 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -1154,7 +1154,7 @@ TABLE test t1 44 18 26 8 0 0 1 9 0 13 TABLE test t3 60 18 42 8 0 0 1 9 0 21 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 91 +TABLE test t1 92 TABLE test t2 0 TABLE test t3 180 disconnect con3; @@ -1195,23 +1195,23 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 167 +wait/io/table/sql/handler 168 wait/lock/table/sql/handler 104 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t3 NULL 106 64 42 64 12 30 0 TABLE test t3 index_b 10 10 0 10 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -1219,7 +1219,7 @@ TABLE test t1 44 18 26 8 0 0 1 9 0 13 TABLE test t3 60 18 42 8 0 0 1 9 0 21 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 91 +TABLE test t1 92 TABLE test t2 0 TABLE test t3 180 disconnect con4; @@ -1259,23 +1259,23 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 167 +wait/io/table/sql/handler 168 wait/lock/table/sql/handler 104 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t3 NULL 106 64 42 64 12 30 0 TABLE test t3 index_b 10 10 0 10 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -1283,7 +1283,7 @@ TABLE test t1 44 18 26 8 0 0 1 9 0 13 TABLE test t3 60 18 42 8 0 0 1 9 0 21 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 91 +TABLE test t1 92 TABLE test t2 0 TABLE test t3 180 connection default; @@ -1325,23 +1325,23 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 167 +wait/io/table/sql/handler 168 wait/lock/table/sql/handler 104 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t3 NULL 106 64 42 64 12 30 0 TABLE test t3 index_b 10 10 0 10 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -1349,7 +1349,7 @@ TABLE test t1 44 18 26 8 0 0 1 9 0 13 TABLE test t3 60 18 42 8 0 0 1 9 0 21 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 91 +TABLE test t1 92 TABLE test t2 0 TABLE test t3 180 truncate performance_schema.events_waits_summary_by_account_by_event_name; @@ -1390,23 +1390,23 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 167 +wait/io/table/sql/handler 168 wait/lock/table/sql/handler 104 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t3 NULL 106 64 42 64 12 30 0 TABLE test t3 index_b 10 10 0 10 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -1414,7 +1414,7 @@ TABLE test t1 44 18 26 8 0 0 1 9 0 13 TABLE test t3 60 18 42 8 0 0 1 9 0 21 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 91 +TABLE test t1 92 TABLE test t2 0 TABLE test t3 180 truncate performance_schema.events_waits_summary_by_user_by_event_name; @@ -1455,23 +1455,23 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 167 +wait/io/table/sql/handler 168 wait/lock/table/sql/handler 104 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t3 NULL 106 64 42 64 12 30 0 TABLE test t3 index_b 10 10 0 10 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -1479,7 +1479,7 @@ TABLE test t1 44 18 26 8 0 0 1 9 0 13 TABLE test t3 60 18 42 8 0 0 1 9 0 21 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 91 +TABLE test t1 92 TABLE test t2 0 TABLE test t3 180 truncate performance_schema.events_waits_summary_by_host_by_event_name; @@ -1520,23 +1520,23 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 167 +wait/io/table/sql/handler 168 wait/lock/table/sql/handler 104 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t3 NULL 106 64 42 64 12 30 0 TABLE test t3 index_b 10 10 0 10 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -1544,7 +1544,7 @@ TABLE test t1 44 18 26 8 0 0 1 9 0 13 TABLE test t3 60 18 42 8 0 0 1 9 0 21 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 91 +TABLE test t1 92 TABLE test t2 0 TABLE test t3 180 truncate performance_schema.events_waits_summary_global_by_event_name; diff --git a/mysql-test/suite/perfschema/r/table_aggregate_global_2u_3t.result b/mysql-test/suite/perfschema/r/table_aggregate_global_2u_3t.result index 1be707c48ed..0731bd1c219 100644 --- a/mysql-test/suite/perfschema/r/table_aggregate_global_2u_3t.result +++ b/mysql-test/suite/perfschema/r/table_aggregate_global_2u_3t.result @@ -209,16 +209,16 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 33 +wait/io/table/sql/handler 34 wait/lock/table/sql/handler 36 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 6 4 2 4 1 1 0 +TABLE test t1 NULL 9 6 3 6 1 2 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 2 1 1 1 0 1 0 +TABLE test t1 PRIMARY 0 0 0 0 0 0 0 TABLE test t2 NULL 9 5 4 5 2 2 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -229,7 +229,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 1 1 0 1 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 8 5 3 5 1 2 0 +TABLE test t1 9 6 3 6 1 2 0 TABLE test t2 10 6 4 6 2 2 0 TABLE test t3 15 9 6 9 3 3 0 execute dump_waits_table_lock; @@ -239,7 +239,7 @@ TABLE test t2 12 4 8 2 0 0 0 2 0 4 TABLE test t3 14 4 10 2 0 0 0 2 0 5 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 18 +TABLE test t1 19 TABLE test t2 22 TABLE test t3 29 connection con1; @@ -271,16 +271,16 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 33 +wait/io/table/sql/handler 34 wait/lock/table/sql/handler 36 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 6 4 2 4 1 1 0 +TABLE test t1 NULL 9 6 3 6 1 2 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 2 1 1 1 0 1 0 +TABLE test t1 PRIMARY 0 0 0 0 0 0 0 TABLE test t2 NULL 9 5 4 5 2 2 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -291,7 +291,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 1 1 0 1 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 8 5 3 5 1 2 0 +TABLE test t1 9 6 3 6 1 2 0 TABLE test t2 10 6 4 6 2 2 0 TABLE test t3 15 9 6 9 3 3 0 execute dump_waits_table_lock; @@ -301,7 +301,7 @@ TABLE test t2 12 4 8 2 0 0 0 2 0 4 TABLE test t3 14 4 10 2 0 0 0 2 0 5 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 18 +TABLE test t1 19 TABLE test t2 22 TABLE test t3 29 connect con2, localhost, user2, , ; @@ -339,16 +339,16 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 33 +wait/io/table/sql/handler 34 wait/lock/table/sql/handler 36 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 6 4 2 4 1 1 0 +TABLE test t1 NULL 9 6 3 6 1 2 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 2 1 1 1 0 1 0 +TABLE test t1 PRIMARY 0 0 0 0 0 0 0 TABLE test t2 NULL 9 5 4 5 2 2 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -359,7 +359,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 1 1 0 1 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 8 5 3 5 1 2 0 +TABLE test t1 9 6 3 6 1 2 0 TABLE test t2 10 6 4 6 2 2 0 TABLE test t3 15 9 6 9 3 3 0 execute dump_waits_table_lock; @@ -369,7 +369,7 @@ TABLE test t2 12 4 8 2 0 0 0 2 0 4 TABLE test t3 14 4 10 2 0 0 0 2 0 5 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 18 +TABLE test t1 19 TABLE test t2 22 TABLE test t3 29 connection con2; @@ -442,16 +442,16 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 84 +wait/io/table/sql/handler 85 wait/lock/table/sql/handler 72 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 14 9 5 9 2 3 0 +TABLE test t1 NULL 17 11 6 11 2 4 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t2 NULL 24 14 10 14 4 6 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -462,7 +462,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 18 11 7 11 2 5 0 +TABLE test t1 19 12 7 12 2 5 0 TABLE test t2 26 16 10 16 4 6 0 TABLE test t3 40 25 15 25 6 9 0 execute dump_waits_table_lock; @@ -472,7 +472,7 @@ TABLE test t2 24 8 16 4 0 0 0 4 0 8 TABLE test t3 28 8 20 4 0 0 0 4 0 10 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 38 +TABLE test t1 39 TABLE test t2 50 TABLE test t3 68 connect con3, localhost, user3, , ; @@ -515,16 +515,16 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 84 +wait/io/table/sql/handler 85 wait/lock/table/sql/handler 72 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 14 9 5 9 2 3 0 +TABLE test t1 NULL 17 11 6 11 2 4 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t2 NULL 24 14 10 14 4 6 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -535,7 +535,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 18 11 7 11 2 5 0 +TABLE test t1 19 12 7 12 2 5 0 TABLE test t2 26 16 10 16 4 6 0 TABLE test t3 40 25 15 25 6 9 0 execute dump_waits_table_lock; @@ -545,7 +545,7 @@ TABLE test t2 24 8 16 4 0 0 0 4 0 8 TABLE test t3 28 8 20 4 0 0 0 4 0 10 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 38 +TABLE test t1 39 TABLE test t2 50 TABLE test t3 68 connection con3; @@ -630,16 +630,16 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 154 +wait/io/table/sql/handler 155 wait/lock/table/sql/handler 108 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 25 16 9 16 3 6 0 +TABLE test t1 NULL 28 18 10 18 3 7 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 6 3 3 3 0 3 0 +TABLE test t1 PRIMARY 4 2 2 2 0 2 0 TABLE test t2 NULL 45 27 18 27 6 12 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -650,7 +650,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 3 3 0 3 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 31 19 12 19 3 9 0 +TABLE test t1 32 20 12 20 3 9 0 TABLE test t2 48 30 18 30 6 12 0 TABLE test t3 75 48 27 48 9 18 0 execute dump_waits_table_lock; @@ -660,7 +660,7 @@ TABLE test t2 36 12 24 6 0 0 0 6 0 12 TABLE test t3 42 12 30 6 0 0 0 6 0 15 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 61 +TABLE test t1 62 TABLE test t2 84 TABLE test t3 117 connect con4, localhost, user4, , ; @@ -708,16 +708,16 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 154 +wait/io/table/sql/handler 155 wait/lock/table/sql/handler 108 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 25 16 9 16 3 6 0 +TABLE test t1 NULL 28 18 10 18 3 7 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 6 3 3 3 0 3 0 +TABLE test t1 PRIMARY 4 2 2 2 0 2 0 TABLE test t2 NULL 45 27 18 27 6 12 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -728,7 +728,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 3 3 0 3 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 31 19 12 19 3 9 0 +TABLE test t1 32 20 12 20 3 9 0 TABLE test t2 48 30 18 30 6 12 0 TABLE test t3 75 48 27 48 9 18 0 execute dump_waits_table_lock; @@ -738,7 +738,7 @@ TABLE test t2 36 12 24 6 0 0 0 6 0 12 TABLE test t3 42 12 30 6 0 0 0 6 0 15 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 61 +TABLE test t1 62 TABLE test t2 84 TABLE test t3 117 connection con4; @@ -835,16 +835,16 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 243 +wait/io/table/sql/handler 244 wait/lock/table/sql/handler 144 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t2 NULL 72 44 28 44 8 20 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -855,7 +855,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t2 76 48 28 48 8 20 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; @@ -865,7 +865,7 @@ TABLE test t2 48 16 32 8 0 0 0 8 0 16 TABLE test t3 56 16 40 8 0 0 0 8 0 20 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 87 +TABLE test t1 88 TABLE test t2 124 TABLE test t3 176 connection con1; @@ -914,16 +914,16 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 243 +wait/io/table/sql/handler 244 wait/lock/table/sql/handler 156 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t2 NULL 72 44 28 44 8 20 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -934,7 +934,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t2 76 48 28 48 8 20 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; @@ -944,7 +944,7 @@ TABLE test t2 52 18 34 8 0 0 1 9 0 17 TABLE test t3 60 18 42 8 0 0 1 9 0 21 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 91 +TABLE test t1 92 TABLE test t2 128 TABLE test t3 180 connection default; @@ -990,16 +990,16 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 243 +wait/io/table/sql/handler 244 wait/lock/table/sql/handler 156 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t2 NULL 72 44 28 44 8 20 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -1010,7 +1010,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t2 76 48 28 48 8 20 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; @@ -1020,7 +1020,7 @@ TABLE test t2 52 18 34 8 0 0 1 9 0 17 TABLE test t3 60 18 42 8 0 0 1 9 0 21 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 91 +TABLE test t1 92 TABLE test t2 128 TABLE test t3 180 set global read_only=1; @@ -1066,16 +1066,16 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 243 +wait/io/table/sql/handler 244 wait/lock/table/sql/handler 156 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t2 NULL 72 44 28 44 8 20 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -1086,7 +1086,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t2 76 48 28 48 8 20 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; @@ -1096,7 +1096,7 @@ TABLE test t2 52 18 34 8 0 0 1 9 0 17 TABLE test t3 60 18 42 8 0 0 1 9 0 21 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 91 +TABLE test t1 92 TABLE test t2 128 TABLE test t3 180 disconnect con1; @@ -1139,16 +1139,16 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 243 +wait/io/table/sql/handler 244 wait/lock/table/sql/handler 156 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t2 NULL 72 44 28 44 8 20 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -1159,7 +1159,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t2 76 48 28 48 8 20 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; @@ -1169,7 +1169,7 @@ TABLE test t2 52 18 34 8 0 0 1 9 0 17 TABLE test t3 60 18 42 8 0 0 1 9 0 21 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 91 +TABLE test t1 92 TABLE test t2 128 TABLE test t3 180 disconnect con2; @@ -1211,16 +1211,16 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 243 +wait/io/table/sql/handler 244 wait/lock/table/sql/handler 156 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t2 NULL 72 44 28 44 8 20 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -1231,7 +1231,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t2 76 48 28 48 8 20 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; @@ -1241,7 +1241,7 @@ TABLE test t2 52 18 34 8 0 0 1 9 0 17 TABLE test t3 60 18 42 8 0 0 1 9 0 21 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 91 +TABLE test t1 92 TABLE test t2 128 TABLE test t3 180 disconnect con3; @@ -1282,16 +1282,16 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 243 +wait/io/table/sql/handler 244 wait/lock/table/sql/handler 156 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t2 NULL 72 44 28 44 8 20 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -1302,7 +1302,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t2 76 48 28 48 8 20 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; @@ -1312,7 +1312,7 @@ TABLE test t2 52 18 34 8 0 0 1 9 0 17 TABLE test t3 60 18 42 8 0 0 1 9 0 21 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 91 +TABLE test t1 92 TABLE test t2 128 TABLE test t3 180 disconnect con4; @@ -1352,16 +1352,16 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 243 +wait/io/table/sql/handler 244 wait/lock/table/sql/handler 156 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t2 NULL 72 44 28 44 8 20 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -1372,7 +1372,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t2 76 48 28 48 8 20 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; @@ -1382,7 +1382,7 @@ TABLE test t2 52 18 34 8 0 0 1 9 0 17 TABLE test t3 60 18 42 8 0 0 1 9 0 21 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 91 +TABLE test t1 92 TABLE test t2 128 TABLE test t3 180 connection default; @@ -1424,16 +1424,16 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 243 +wait/io/table/sql/handler 244 wait/lock/table/sql/handler 156 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t2 NULL 72 44 28 44 8 20 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -1444,7 +1444,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t2 76 48 28 48 8 20 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; @@ -1454,7 +1454,7 @@ TABLE test t2 52 18 34 8 0 0 1 9 0 17 TABLE test t3 60 18 42 8 0 0 1 9 0 21 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 91 +TABLE test t1 92 TABLE test t2 128 TABLE test t3 180 truncate performance_schema.events_waits_summary_by_account_by_event_name; @@ -1495,16 +1495,16 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 243 +wait/io/table/sql/handler 244 wait/lock/table/sql/handler 156 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t2 NULL 72 44 28 44 8 20 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -1515,7 +1515,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t2 76 48 28 48 8 20 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; @@ -1525,7 +1525,7 @@ TABLE test t2 52 18 34 8 0 0 1 9 0 17 TABLE test t3 60 18 42 8 0 0 1 9 0 21 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 91 +TABLE test t1 92 TABLE test t2 128 TABLE test t3 180 truncate performance_schema.events_waits_summary_by_user_by_event_name; @@ -1566,16 +1566,16 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 243 +wait/io/table/sql/handler 244 wait/lock/table/sql/handler 156 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t2 NULL 72 44 28 44 8 20 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -1586,7 +1586,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t2 76 48 28 48 8 20 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; @@ -1596,7 +1596,7 @@ TABLE test t2 52 18 34 8 0 0 1 9 0 17 TABLE test t3 60 18 42 8 0 0 1 9 0 21 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 91 +TABLE test t1 92 TABLE test t2 128 TABLE test t3 180 truncate performance_schema.events_waits_summary_by_host_by_event_name; @@ -1637,16 +1637,16 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 243 +wait/io/table/sql/handler 244 wait/lock/table/sql/handler 156 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t2 NULL 72 44 28 44 8 20 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -1657,7 +1657,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t2 76 48 28 48 8 20 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; @@ -1667,7 +1667,7 @@ TABLE test t2 52 18 34 8 0 0 1 9 0 17 TABLE test t3 60 18 42 8 0 0 1 9 0 21 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 91 +TABLE test t1 92 TABLE test t2 128 TABLE test t3 180 truncate performance_schema.events_waits_summary_global_by_event_name; diff --git a/mysql-test/suite/perfschema/r/table_aggregate_global_4u_2t.result b/mysql-test/suite/perfschema/r/table_aggregate_global_4u_2t.result index 0ed76c7ef06..9c63dbcf285 100644 --- a/mysql-test/suite/perfschema/r/table_aggregate_global_4u_2t.result +++ b/mysql-test/suite/perfschema/r/table_aggregate_global_4u_2t.result @@ -200,23 +200,23 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 23 +wait/io/table/sql/handler 24 wait/lock/table/sql/handler 24 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 6 4 2 4 1 1 0 +TABLE test t1 NULL 9 6 3 6 1 2 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 2 1 1 1 0 1 0 +TABLE test t1 PRIMARY 0 0 0 0 0 0 0 TABLE test t3 NULL 13 7 6 7 3 3 0 TABLE test t3 index_b 1 1 0 1 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 1 1 0 1 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 8 5 3 5 1 2 0 +TABLE test t1 9 6 3 6 1 2 0 TABLE test t3 15 9 6 9 3 3 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -224,7 +224,7 @@ TABLE test t1 10 4 6 2 0 0 0 2 0 3 TABLE test t3 14 4 10 2 0 0 0 2 0 5 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 18 +TABLE test t1 19 TABLE test t2 0 TABLE test t3 29 connection con1; @@ -256,23 +256,23 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 23 +wait/io/table/sql/handler 24 wait/lock/table/sql/handler 24 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 6 4 2 4 1 1 0 +TABLE test t1 NULL 9 6 3 6 1 2 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 2 1 1 1 0 1 0 +TABLE test t1 PRIMARY 0 0 0 0 0 0 0 TABLE test t3 NULL 13 7 6 7 3 3 0 TABLE test t3 index_b 1 1 0 1 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 1 1 0 1 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 8 5 3 5 1 2 0 +TABLE test t1 9 6 3 6 1 2 0 TABLE test t3 15 9 6 9 3 3 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -280,7 +280,7 @@ TABLE test t1 10 4 6 2 0 0 0 2 0 3 TABLE test t3 14 4 10 2 0 0 0 2 0 5 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 18 +TABLE test t1 19 TABLE test t2 0 TABLE test t3 29 connect con2, localhost, user2, , ; @@ -318,23 +318,23 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 23 +wait/io/table/sql/handler 24 wait/lock/table/sql/handler 24 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 6 4 2 4 1 1 0 +TABLE test t1 NULL 9 6 3 6 1 2 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 2 1 1 1 0 1 0 +TABLE test t1 PRIMARY 0 0 0 0 0 0 0 TABLE test t3 NULL 13 7 6 7 3 3 0 TABLE test t3 index_b 1 1 0 1 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 1 1 0 1 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 8 5 3 5 1 2 0 +TABLE test t1 9 6 3 6 1 2 0 TABLE test t3 15 9 6 9 3 3 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -342,7 +342,7 @@ TABLE test t1 10 4 6 2 0 0 0 2 0 3 TABLE test t3 14 4 10 2 0 0 0 2 0 5 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 18 +TABLE test t1 19 TABLE test t2 0 TABLE test t3 29 connection con2; @@ -415,23 +415,23 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 58 +wait/io/table/sql/handler 59 wait/lock/table/sql/handler 48 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 14 9 5 9 2 3 0 +TABLE test t1 NULL 17 11 6 11 2 4 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t3 NULL 35 20 15 20 6 9 0 TABLE test t3 index_b 3 3 0 3 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 18 11 7 11 2 5 0 +TABLE test t1 19 12 7 12 2 5 0 TABLE test t3 40 25 15 25 6 9 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -439,7 +439,7 @@ TABLE test t1 20 8 12 4 0 0 0 4 0 6 TABLE test t3 28 8 20 4 0 0 0 4 0 10 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 38 +TABLE test t1 39 TABLE test t2 0 TABLE test t3 68 connect con3, localhost, user3, , ; @@ -482,23 +482,23 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 58 +wait/io/table/sql/handler 59 wait/lock/table/sql/handler 48 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 14 9 5 9 2 3 0 +TABLE test t1 NULL 17 11 6 11 2 4 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t3 NULL 35 20 15 20 6 9 0 TABLE test t3 index_b 3 3 0 3 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 18 11 7 11 2 5 0 +TABLE test t1 19 12 7 12 2 5 0 TABLE test t3 40 25 15 25 6 9 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -506,7 +506,7 @@ TABLE test t1 20 8 12 4 0 0 0 4 0 6 TABLE test t3 28 8 20 4 0 0 0 4 0 10 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 38 +TABLE test t1 39 TABLE test t2 0 TABLE test t3 68 connection con3; @@ -591,23 +591,23 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 106 +wait/io/table/sql/handler 107 wait/lock/table/sql/handler 72 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 25 16 9 16 3 6 0 +TABLE test t1 NULL 28 18 10 18 3 7 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 6 3 3 3 0 3 0 +TABLE test t1 PRIMARY 4 2 2 2 0 2 0 TABLE test t3 NULL 66 39 27 39 9 18 0 TABLE test t3 index_b 6 6 0 6 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 3 3 0 3 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 31 19 12 19 3 9 0 +TABLE test t1 32 20 12 20 3 9 0 TABLE test t3 75 48 27 48 9 18 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -615,7 +615,7 @@ TABLE test t1 30 12 18 6 0 0 0 6 0 9 TABLE test t3 42 12 30 6 0 0 0 6 0 15 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 61 +TABLE test t1 62 TABLE test t2 0 TABLE test t3 117 connect con4, localhost, user4, , ; @@ -663,23 +663,23 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 106 +wait/io/table/sql/handler 107 wait/lock/table/sql/handler 72 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 25 16 9 16 3 6 0 +TABLE test t1 NULL 28 18 10 18 3 7 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 6 3 3 3 0 3 0 +TABLE test t1 PRIMARY 4 2 2 2 0 2 0 TABLE test t3 NULL 66 39 27 39 9 18 0 TABLE test t3 index_b 6 6 0 6 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 3 3 0 3 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 31 19 12 19 3 9 0 +TABLE test t1 32 20 12 20 3 9 0 TABLE test t3 75 48 27 48 9 18 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -687,7 +687,7 @@ TABLE test t1 30 12 18 6 0 0 0 6 0 9 TABLE test t3 42 12 30 6 0 0 0 6 0 15 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 61 +TABLE test t1 62 TABLE test t2 0 TABLE test t3 117 connection con4; @@ -784,23 +784,23 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 167 +wait/io/table/sql/handler 168 wait/lock/table/sql/handler 96 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t3 NULL 106 64 42 64 12 30 0 TABLE test t3 index_b 10 10 0 10 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -808,7 +808,7 @@ TABLE test t1 40 16 24 8 0 0 0 8 0 12 TABLE test t3 56 16 40 8 0 0 0 8 0 20 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 87 +TABLE test t1 88 TABLE test t2 0 TABLE test t3 176 connection con1; @@ -857,23 +857,23 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 167 +wait/io/table/sql/handler 168 wait/lock/table/sql/handler 104 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t3 NULL 106 64 42 64 12 30 0 TABLE test t3 index_b 10 10 0 10 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -881,7 +881,7 @@ TABLE test t1 44 18 26 8 0 0 1 9 0 13 TABLE test t3 60 18 42 8 0 0 1 9 0 21 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 91 +TABLE test t1 92 TABLE test t2 0 TABLE test t3 180 connection default; @@ -927,23 +927,23 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 167 +wait/io/table/sql/handler 168 wait/lock/table/sql/handler 104 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t3 NULL 106 64 42 64 12 30 0 TABLE test t3 index_b 10 10 0 10 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -951,7 +951,7 @@ TABLE test t1 44 18 26 8 0 0 1 9 0 13 TABLE test t3 60 18 42 8 0 0 1 9 0 21 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 91 +TABLE test t1 92 TABLE test t2 0 TABLE test t3 180 set global read_only=1; @@ -997,23 +997,23 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 167 +wait/io/table/sql/handler 168 wait/lock/table/sql/handler 104 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t3 NULL 106 64 42 64 12 30 0 TABLE test t3 index_b 10 10 0 10 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -1021,7 +1021,7 @@ TABLE test t1 44 18 26 8 0 0 1 9 0 13 TABLE test t3 60 18 42 8 0 0 1 9 0 21 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 91 +TABLE test t1 92 TABLE test t2 0 TABLE test t3 180 disconnect con1; @@ -1064,23 +1064,23 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 167 +wait/io/table/sql/handler 168 wait/lock/table/sql/handler 104 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t3 NULL 106 64 42 64 12 30 0 TABLE test t3 index_b 10 10 0 10 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -1088,7 +1088,7 @@ TABLE test t1 44 18 26 8 0 0 1 9 0 13 TABLE test t3 60 18 42 8 0 0 1 9 0 21 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 91 +TABLE test t1 92 TABLE test t2 0 TABLE test t3 180 disconnect con2; @@ -1130,23 +1130,23 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 167 +wait/io/table/sql/handler 168 wait/lock/table/sql/handler 104 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t3 NULL 106 64 42 64 12 30 0 TABLE test t3 index_b 10 10 0 10 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -1154,7 +1154,7 @@ TABLE test t1 44 18 26 8 0 0 1 9 0 13 TABLE test t3 60 18 42 8 0 0 1 9 0 21 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 91 +TABLE test t1 92 TABLE test t2 0 TABLE test t3 180 disconnect con3; @@ -1195,23 +1195,23 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 167 +wait/io/table/sql/handler 168 wait/lock/table/sql/handler 104 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t3 NULL 106 64 42 64 12 30 0 TABLE test t3 index_b 10 10 0 10 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -1219,7 +1219,7 @@ TABLE test t1 44 18 26 8 0 0 1 9 0 13 TABLE test t3 60 18 42 8 0 0 1 9 0 21 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 91 +TABLE test t1 92 TABLE test t2 0 TABLE test t3 180 disconnect con4; @@ -1259,23 +1259,23 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 167 +wait/io/table/sql/handler 168 wait/lock/table/sql/handler 104 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t3 NULL 106 64 42 64 12 30 0 TABLE test t3 index_b 10 10 0 10 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -1283,7 +1283,7 @@ TABLE test t1 44 18 26 8 0 0 1 9 0 13 TABLE test t3 60 18 42 8 0 0 1 9 0 21 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 91 +TABLE test t1 92 TABLE test t2 0 TABLE test t3 180 connection default; @@ -1325,23 +1325,23 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 167 +wait/io/table/sql/handler 168 wait/lock/table/sql/handler 104 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t3 NULL 106 64 42 64 12 30 0 TABLE test t3 index_b 10 10 0 10 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -1349,7 +1349,7 @@ TABLE test t1 44 18 26 8 0 0 1 9 0 13 TABLE test t3 60 18 42 8 0 0 1 9 0 21 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 91 +TABLE test t1 92 TABLE test t2 0 TABLE test t3 180 truncate performance_schema.events_waits_summary_by_account_by_event_name; @@ -1390,23 +1390,23 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 167 +wait/io/table/sql/handler 168 wait/lock/table/sql/handler 104 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t3 NULL 106 64 42 64 12 30 0 TABLE test t3 index_b 10 10 0 10 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -1414,7 +1414,7 @@ TABLE test t1 44 18 26 8 0 0 1 9 0 13 TABLE test t3 60 18 42 8 0 0 1 9 0 21 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 91 +TABLE test t1 92 TABLE test t2 0 TABLE test t3 180 truncate performance_schema.events_waits_summary_by_user_by_event_name; @@ -1455,23 +1455,23 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 167 +wait/io/table/sql/handler 168 wait/lock/table/sql/handler 104 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t3 NULL 106 64 42 64 12 30 0 TABLE test t3 index_b 10 10 0 10 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -1479,7 +1479,7 @@ TABLE test t1 44 18 26 8 0 0 1 9 0 13 TABLE test t3 60 18 42 8 0 0 1 9 0 21 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 91 +TABLE test t1 92 TABLE test t2 0 TABLE test t3 180 truncate performance_schema.events_waits_summary_by_host_by_event_name; @@ -1520,23 +1520,23 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 167 +wait/io/table/sql/handler 168 wait/lock/table/sql/handler 104 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t3 NULL 106 64 42 64 12 30 0 TABLE test t3 index_b 10 10 0 10 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -1544,7 +1544,7 @@ TABLE test t1 44 18 26 8 0 0 1 9 0 13 TABLE test t3 60 18 42 8 0 0 1 9 0 21 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 91 +TABLE test t1 92 TABLE test t2 0 TABLE test t3 180 truncate performance_schema.events_waits_summary_global_by_event_name; diff --git a/mysql-test/suite/perfschema/r/table_aggregate_global_4u_3t.result b/mysql-test/suite/perfschema/r/table_aggregate_global_4u_3t.result index 5d816b58777..58ea5ad88a0 100644 --- a/mysql-test/suite/perfschema/r/table_aggregate_global_4u_3t.result +++ b/mysql-test/suite/perfschema/r/table_aggregate_global_4u_3t.result @@ -209,16 +209,16 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 33 +wait/io/table/sql/handler 34 wait/lock/table/sql/handler 36 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 6 4 2 4 1 1 0 +TABLE test t1 NULL 9 6 3 6 1 2 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 2 1 1 1 0 1 0 +TABLE test t1 PRIMARY 0 0 0 0 0 0 0 TABLE test t2 NULL 9 5 4 5 2 2 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -229,7 +229,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 1 1 0 1 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 8 5 3 5 1 2 0 +TABLE test t1 9 6 3 6 1 2 0 TABLE test t2 10 6 4 6 2 2 0 TABLE test t3 15 9 6 9 3 3 0 execute dump_waits_table_lock; @@ -239,7 +239,7 @@ TABLE test t2 12 4 8 2 0 0 0 2 0 4 TABLE test t3 14 4 10 2 0 0 0 2 0 5 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 18 +TABLE test t1 19 TABLE test t2 22 TABLE test t3 29 connection con1; @@ -271,16 +271,16 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 33 +wait/io/table/sql/handler 34 wait/lock/table/sql/handler 36 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 6 4 2 4 1 1 0 +TABLE test t1 NULL 9 6 3 6 1 2 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 2 1 1 1 0 1 0 +TABLE test t1 PRIMARY 0 0 0 0 0 0 0 TABLE test t2 NULL 9 5 4 5 2 2 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -291,7 +291,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 1 1 0 1 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 8 5 3 5 1 2 0 +TABLE test t1 9 6 3 6 1 2 0 TABLE test t2 10 6 4 6 2 2 0 TABLE test t3 15 9 6 9 3 3 0 execute dump_waits_table_lock; @@ -301,7 +301,7 @@ TABLE test t2 12 4 8 2 0 0 0 2 0 4 TABLE test t3 14 4 10 2 0 0 0 2 0 5 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 18 +TABLE test t1 19 TABLE test t2 22 TABLE test t3 29 connect con2, localhost, user2, , ; @@ -339,16 +339,16 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 33 +wait/io/table/sql/handler 34 wait/lock/table/sql/handler 36 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 6 4 2 4 1 1 0 +TABLE test t1 NULL 9 6 3 6 1 2 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 2 1 1 1 0 1 0 +TABLE test t1 PRIMARY 0 0 0 0 0 0 0 TABLE test t2 NULL 9 5 4 5 2 2 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -359,7 +359,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 1 1 0 1 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 8 5 3 5 1 2 0 +TABLE test t1 9 6 3 6 1 2 0 TABLE test t2 10 6 4 6 2 2 0 TABLE test t3 15 9 6 9 3 3 0 execute dump_waits_table_lock; @@ -369,7 +369,7 @@ TABLE test t2 12 4 8 2 0 0 0 2 0 4 TABLE test t3 14 4 10 2 0 0 0 2 0 5 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 18 +TABLE test t1 19 TABLE test t2 22 TABLE test t3 29 connection con2; @@ -442,16 +442,16 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 84 +wait/io/table/sql/handler 85 wait/lock/table/sql/handler 72 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 14 9 5 9 2 3 0 +TABLE test t1 NULL 17 11 6 11 2 4 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t2 NULL 24 14 10 14 4 6 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -462,7 +462,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 18 11 7 11 2 5 0 +TABLE test t1 19 12 7 12 2 5 0 TABLE test t2 26 16 10 16 4 6 0 TABLE test t3 40 25 15 25 6 9 0 execute dump_waits_table_lock; @@ -472,7 +472,7 @@ TABLE test t2 24 8 16 4 0 0 0 4 0 8 TABLE test t3 28 8 20 4 0 0 0 4 0 10 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 38 +TABLE test t1 39 TABLE test t2 50 TABLE test t3 68 connect con3, localhost, user3, , ; @@ -515,16 +515,16 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 84 +wait/io/table/sql/handler 85 wait/lock/table/sql/handler 72 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 14 9 5 9 2 3 0 +TABLE test t1 NULL 17 11 6 11 2 4 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t2 NULL 24 14 10 14 4 6 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -535,7 +535,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 18 11 7 11 2 5 0 +TABLE test t1 19 12 7 12 2 5 0 TABLE test t2 26 16 10 16 4 6 0 TABLE test t3 40 25 15 25 6 9 0 execute dump_waits_table_lock; @@ -545,7 +545,7 @@ TABLE test t2 24 8 16 4 0 0 0 4 0 8 TABLE test t3 28 8 20 4 0 0 0 4 0 10 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 38 +TABLE test t1 39 TABLE test t2 50 TABLE test t3 68 connection con3; @@ -630,16 +630,16 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 154 +wait/io/table/sql/handler 155 wait/lock/table/sql/handler 108 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 25 16 9 16 3 6 0 +TABLE test t1 NULL 28 18 10 18 3 7 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 6 3 3 3 0 3 0 +TABLE test t1 PRIMARY 4 2 2 2 0 2 0 TABLE test t2 NULL 45 27 18 27 6 12 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -650,7 +650,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 3 3 0 3 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 31 19 12 19 3 9 0 +TABLE test t1 32 20 12 20 3 9 0 TABLE test t2 48 30 18 30 6 12 0 TABLE test t3 75 48 27 48 9 18 0 execute dump_waits_table_lock; @@ -660,7 +660,7 @@ TABLE test t2 36 12 24 6 0 0 0 6 0 12 TABLE test t3 42 12 30 6 0 0 0 6 0 15 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 61 +TABLE test t1 62 TABLE test t2 84 TABLE test t3 117 connect con4, localhost, user4, , ; @@ -708,16 +708,16 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 154 +wait/io/table/sql/handler 155 wait/lock/table/sql/handler 108 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 25 16 9 16 3 6 0 +TABLE test t1 NULL 28 18 10 18 3 7 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 6 3 3 3 0 3 0 +TABLE test t1 PRIMARY 4 2 2 2 0 2 0 TABLE test t2 NULL 45 27 18 27 6 12 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -728,7 +728,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 3 3 0 3 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 31 19 12 19 3 9 0 +TABLE test t1 32 20 12 20 3 9 0 TABLE test t2 48 30 18 30 6 12 0 TABLE test t3 75 48 27 48 9 18 0 execute dump_waits_table_lock; @@ -738,7 +738,7 @@ TABLE test t2 36 12 24 6 0 0 0 6 0 12 TABLE test t3 42 12 30 6 0 0 0 6 0 15 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 61 +TABLE test t1 62 TABLE test t2 84 TABLE test t3 117 connection con4; @@ -835,16 +835,16 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 243 +wait/io/table/sql/handler 244 wait/lock/table/sql/handler 144 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t2 NULL 72 44 28 44 8 20 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -855,7 +855,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t2 76 48 28 48 8 20 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; @@ -865,7 +865,7 @@ TABLE test t2 48 16 32 8 0 0 0 8 0 16 TABLE test t3 56 16 40 8 0 0 0 8 0 20 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 87 +TABLE test t1 88 TABLE test t2 124 TABLE test t3 176 connection con1; @@ -914,16 +914,16 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 243 +wait/io/table/sql/handler 244 wait/lock/table/sql/handler 156 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t2 NULL 72 44 28 44 8 20 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -934,7 +934,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t2 76 48 28 48 8 20 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; @@ -944,7 +944,7 @@ TABLE test t2 52 18 34 8 0 0 1 9 0 17 TABLE test t3 60 18 42 8 0 0 1 9 0 21 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 91 +TABLE test t1 92 TABLE test t2 128 TABLE test t3 180 connection default; @@ -990,16 +990,16 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 243 +wait/io/table/sql/handler 244 wait/lock/table/sql/handler 156 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t2 NULL 72 44 28 44 8 20 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -1010,7 +1010,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t2 76 48 28 48 8 20 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; @@ -1020,7 +1020,7 @@ TABLE test t2 52 18 34 8 0 0 1 9 0 17 TABLE test t3 60 18 42 8 0 0 1 9 0 21 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 91 +TABLE test t1 92 TABLE test t2 128 TABLE test t3 180 set global read_only=1; @@ -1066,16 +1066,16 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 243 +wait/io/table/sql/handler 244 wait/lock/table/sql/handler 156 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t2 NULL 72 44 28 44 8 20 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -1086,7 +1086,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t2 76 48 28 48 8 20 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; @@ -1096,7 +1096,7 @@ TABLE test t2 52 18 34 8 0 0 1 9 0 17 TABLE test t3 60 18 42 8 0 0 1 9 0 21 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 91 +TABLE test t1 92 TABLE test t2 128 TABLE test t3 180 disconnect con1; @@ -1139,16 +1139,16 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 243 +wait/io/table/sql/handler 244 wait/lock/table/sql/handler 156 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t2 NULL 72 44 28 44 8 20 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -1159,7 +1159,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t2 76 48 28 48 8 20 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; @@ -1169,7 +1169,7 @@ TABLE test t2 52 18 34 8 0 0 1 9 0 17 TABLE test t3 60 18 42 8 0 0 1 9 0 21 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 91 +TABLE test t1 92 TABLE test t2 128 TABLE test t3 180 disconnect con2; @@ -1211,16 +1211,16 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 243 +wait/io/table/sql/handler 244 wait/lock/table/sql/handler 156 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t2 NULL 72 44 28 44 8 20 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -1231,7 +1231,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t2 76 48 28 48 8 20 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; @@ -1241,7 +1241,7 @@ TABLE test t2 52 18 34 8 0 0 1 9 0 17 TABLE test t3 60 18 42 8 0 0 1 9 0 21 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 91 +TABLE test t1 92 TABLE test t2 128 TABLE test t3 180 disconnect con3; @@ -1282,16 +1282,16 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 243 +wait/io/table/sql/handler 244 wait/lock/table/sql/handler 156 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t2 NULL 72 44 28 44 8 20 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -1302,7 +1302,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t2 76 48 28 48 8 20 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; @@ -1312,7 +1312,7 @@ TABLE test t2 52 18 34 8 0 0 1 9 0 17 TABLE test t3 60 18 42 8 0 0 1 9 0 21 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 91 +TABLE test t1 92 TABLE test t2 128 TABLE test t3 180 disconnect con4; @@ -1352,16 +1352,16 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 243 +wait/io/table/sql/handler 244 wait/lock/table/sql/handler 156 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t2 NULL 72 44 28 44 8 20 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -1372,7 +1372,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t2 76 48 28 48 8 20 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; @@ -1382,7 +1382,7 @@ TABLE test t2 52 18 34 8 0 0 1 9 0 17 TABLE test t3 60 18 42 8 0 0 1 9 0 21 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 91 +TABLE test t1 92 TABLE test t2 128 TABLE test t3 180 connection default; @@ -1424,16 +1424,16 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 243 +wait/io/table/sql/handler 244 wait/lock/table/sql/handler 156 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t2 NULL 72 44 28 44 8 20 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -1444,7 +1444,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t2 76 48 28 48 8 20 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; @@ -1454,7 +1454,7 @@ TABLE test t2 52 18 34 8 0 0 1 9 0 17 TABLE test t3 60 18 42 8 0 0 1 9 0 21 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 91 +TABLE test t1 92 TABLE test t2 128 TABLE test t3 180 truncate performance_schema.events_waits_summary_by_account_by_event_name; @@ -1495,16 +1495,16 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 243 +wait/io/table/sql/handler 244 wait/lock/table/sql/handler 156 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t2 NULL 72 44 28 44 8 20 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -1515,7 +1515,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t2 76 48 28 48 8 20 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; @@ -1525,7 +1525,7 @@ TABLE test t2 52 18 34 8 0 0 1 9 0 17 TABLE test t3 60 18 42 8 0 0 1 9 0 21 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 91 +TABLE test t1 92 TABLE test t2 128 TABLE test t3 180 truncate performance_schema.events_waits_summary_by_user_by_event_name; @@ -1566,16 +1566,16 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 243 +wait/io/table/sql/handler 244 wait/lock/table/sql/handler 156 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t2 NULL 72 44 28 44 8 20 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -1586,7 +1586,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t2 76 48 28 48 8 20 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; @@ -1596,7 +1596,7 @@ TABLE test t2 52 18 34 8 0 0 1 9 0 17 TABLE test t3 60 18 42 8 0 0 1 9 0 21 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 91 +TABLE test t1 92 TABLE test t2 128 TABLE test t3 180 truncate performance_schema.events_waits_summary_by_host_by_event_name; @@ -1637,16 +1637,16 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 243 +wait/io/table/sql/handler 244 wait/lock/table/sql/handler 156 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t2 NULL 72 44 28 44 8 20 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -1657,7 +1657,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t2 76 48 28 48 8 20 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; @@ -1667,7 +1667,7 @@ TABLE test t2 52 18 34 8 0 0 1 9 0 17 TABLE test t3 60 18 42 8 0 0 1 9 0 21 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 91 +TABLE test t1 92 TABLE test t2 128 TABLE test t3 180 truncate performance_schema.events_waits_summary_global_by_event_name; diff --git a/mysql-test/suite/perfschema/r/table_aggregate_hist_2u_2t.result b/mysql-test/suite/perfschema/r/table_aggregate_hist_2u_2t.result index 52ece6d289d..b1b8707988c 100644 --- a/mysql-test/suite/perfschema/r/table_aggregate_hist_2u_2t.result +++ b/mysql-test/suite/perfschema/r/table_aggregate_hist_2u_2t.result @@ -176,7 +176,7 @@ connection default; "================== Step 3-A ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 24 username status user2 not found @@ -186,39 +186,39 @@ username status user4 not found execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 23 +user1 localhost wait/io/table/sql/handler 24 user1 localhost wait/lock/table/sql/handler 24 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 24 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 23 +localhost wait/io/table/sql/handler 24 localhost wait/lock/table/sql/handler 24 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 23 +wait/io/table/sql/handler 24 wait/lock/table/sql/handler 24 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 8 TABLE test t1 +wait/io/table/sql/handler 9 TABLE test t1 wait/lock/table/sql/handler 10 TABLE test t1 wait/io/table/sql/handler 15 TABLE test t3 wait/lock/table/sql/handler 14 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 6 4 2 4 1 1 0 +TABLE test t1 NULL 9 6 3 6 1 2 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 2 1 1 1 0 1 0 +TABLE test t1 PRIMARY 0 0 0 0 0 0 0 TABLE test t3 NULL 13 7 6 7 3 3 0 TABLE test t3 index_b 1 1 0 1 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 1 1 0 1 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 8 5 3 5 1 2 0 +TABLE test t1 9 6 3 6 1 2 0 TABLE test t3 15 9 6 9 3 3 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -226,7 +226,7 @@ TABLE test t1 10 4 6 2 0 0 0 2 0 3 TABLE test t3 14 4 10 2 0 0 0 2 0 5 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 18 +TABLE test t1 19 TABLE test t2 0 TABLE test t3 29 connection con1; @@ -236,7 +236,7 @@ connection default; "================== Step 3-B ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 24 username status user2 not found @@ -246,39 +246,39 @@ username status user4 not found execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 23 +user1 localhost wait/io/table/sql/handler 24 user1 localhost wait/lock/table/sql/handler 24 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 24 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 23 +localhost wait/io/table/sql/handler 24 localhost wait/lock/table/sql/handler 24 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 23 +wait/io/table/sql/handler 24 wait/lock/table/sql/handler 24 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 8 TABLE test t1 +wait/io/table/sql/handler 9 TABLE test t1 wait/lock/table/sql/handler 10 TABLE test t1 wait/io/table/sql/handler 15 TABLE test t3 wait/lock/table/sql/handler 14 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 6 4 2 4 1 1 0 +TABLE test t1 NULL 9 6 3 6 1 2 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 2 1 1 1 0 1 0 +TABLE test t1 PRIMARY 0 0 0 0 0 0 0 TABLE test t3 NULL 13 7 6 7 3 3 0 TABLE test t3 index_b 1 1 0 1 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 1 1 0 1 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 8 5 3 5 1 2 0 +TABLE test t1 9 6 3 6 1 2 0 TABLE test t3 15 9 6 9 3 3 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -286,7 +286,7 @@ TABLE test t1 10 4 6 2 0 0 0 2 0 3 TABLE test t3 14 4 10 2 0 0 0 2 0 5 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 18 +TABLE test t1 19 TABLE test t2 0 TABLE test t3 29 connect con2, localhost, user2, , ; @@ -297,7 +297,7 @@ connection default; "================== Step 4 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 24 username event_name count_star user2 wait/io/table/sql/handler 0 @@ -308,43 +308,43 @@ username status user4 not found execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 23 +user1 localhost wait/io/table/sql/handler 24 user1 localhost wait/lock/table/sql/handler 24 user2 localhost wait/io/table/sql/handler 0 user2 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 24 user2 wait/io/table/sql/handler 0 user2 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 23 +localhost wait/io/table/sql/handler 24 localhost wait/lock/table/sql/handler 24 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 23 +wait/io/table/sql/handler 24 wait/lock/table/sql/handler 24 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 8 TABLE test t1 +wait/io/table/sql/handler 9 TABLE test t1 wait/lock/table/sql/handler 10 TABLE test t1 wait/io/table/sql/handler 15 TABLE test t3 wait/lock/table/sql/handler 14 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 6 4 2 4 1 1 0 +TABLE test t1 NULL 9 6 3 6 1 2 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 2 1 1 1 0 1 0 +TABLE test t1 PRIMARY 0 0 0 0 0 0 0 TABLE test t3 NULL 13 7 6 7 3 3 0 TABLE test t3 index_b 1 1 0 1 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 1 1 0 1 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 8 5 3 5 1 2 0 +TABLE test t1 9 6 3 6 1 2 0 TABLE test t3 15 9 6 9 3 3 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -352,7 +352,7 @@ TABLE test t1 10 4 6 2 0 0 0 2 0 3 TABLE test t3 14 4 10 2 0 0 0 2 0 5 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 18 +TABLE test t1 19 TABLE test t2 0 TABLE test t3 29 connection con2; @@ -398,7 +398,7 @@ connection default; "================== Step 5 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 24 username event_name count_star user2 wait/io/table/sql/handler 0 @@ -409,43 +409,43 @@ username status user4 not found execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 23 +user1 localhost wait/io/table/sql/handler 24 user1 localhost wait/lock/table/sql/handler 24 user2 localhost wait/io/table/sql/handler 0 user2 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 24 user2 wait/io/table/sql/handler 0 user2 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 23 +localhost wait/io/table/sql/handler 24 localhost wait/lock/table/sql/handler 24 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 23 +wait/io/table/sql/handler 24 wait/lock/table/sql/handler 24 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 8 TABLE test t1 +wait/io/table/sql/handler 9 TABLE test t1 wait/lock/table/sql/handler 10 TABLE test t1 wait/io/table/sql/handler 15 TABLE test t3 wait/lock/table/sql/handler 14 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 6 4 2 4 1 1 0 +TABLE test t1 NULL 9 6 3 6 1 2 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 2 1 1 1 0 1 0 +TABLE test t1 PRIMARY 0 0 0 0 0 0 0 TABLE test t3 NULL 13 7 6 7 3 3 0 TABLE test t3 index_b 1 1 0 1 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 1 1 0 1 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 8 5 3 5 1 2 0 +TABLE test t1 9 6 3 6 1 2 0 TABLE test t3 15 9 6 9 3 3 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -453,7 +453,7 @@ TABLE test t1 10 4 6 2 0 0 0 2 0 3 TABLE test t3 14 4 10 2 0 0 0 2 0 5 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 18 +TABLE test t1 19 TABLE test t2 0 TABLE test t3 29 connect con3, localhost, user3, , ; @@ -464,7 +464,7 @@ connection default; "================== Step 6 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 24 username event_name count_star user2 wait/io/table/sql/handler 0 @@ -476,7 +476,7 @@ username status user4 not found execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 23 +user1 localhost wait/io/table/sql/handler 24 user1 localhost wait/lock/table/sql/handler 24 user2 localhost wait/io/table/sql/handler 0 user2 localhost wait/lock/table/sql/handler 0 @@ -484,7 +484,7 @@ user3 localhost wait/io/table/sql/handler 0 user3 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 24 user2 wait/io/table/sql/handler 0 user2 wait/lock/table/sql/handler 0 @@ -492,31 +492,31 @@ user3 wait/io/table/sql/handler 0 user3 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 23 +localhost wait/io/table/sql/handler 24 localhost wait/lock/table/sql/handler 24 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 23 +wait/io/table/sql/handler 24 wait/lock/table/sql/handler 24 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 8 TABLE test t1 +wait/io/table/sql/handler 9 TABLE test t1 wait/lock/table/sql/handler 10 TABLE test t1 wait/io/table/sql/handler 15 TABLE test t3 wait/lock/table/sql/handler 14 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 6 4 2 4 1 1 0 +TABLE test t1 NULL 9 6 3 6 1 2 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 2 1 1 1 0 1 0 +TABLE test t1 PRIMARY 0 0 0 0 0 0 0 TABLE test t3 NULL 13 7 6 7 3 3 0 TABLE test t3 index_b 1 1 0 1 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 1 1 0 1 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 8 5 3 5 1 2 0 +TABLE test t1 9 6 3 6 1 2 0 TABLE test t3 15 9 6 9 3 3 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -524,7 +524,7 @@ TABLE test t1 10 4 6 2 0 0 0 2 0 3 TABLE test t3 14 4 10 2 0 0 0 2 0 5 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 18 +TABLE test t1 19 TABLE test t2 0 TABLE test t3 29 connection con3; @@ -577,7 +577,7 @@ connection default; "================== Step 7 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 24 username event_name count_star user2 wait/io/table/sql/handler 0 @@ -589,7 +589,7 @@ username status user4 not found execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 23 +user1 localhost wait/io/table/sql/handler 24 user1 localhost wait/lock/table/sql/handler 24 user2 localhost wait/io/table/sql/handler 0 user2 localhost wait/lock/table/sql/handler 0 @@ -597,7 +597,7 @@ user3 localhost wait/io/table/sql/handler 48 user3 localhost wait/lock/table/sql/handler 24 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 24 user2 wait/io/table/sql/handler 0 user2 wait/lock/table/sql/handler 0 @@ -605,31 +605,31 @@ user3 wait/io/table/sql/handler 48 user3 wait/lock/table/sql/handler 24 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 71 +localhost wait/io/table/sql/handler 72 localhost wait/lock/table/sql/handler 48 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 71 +wait/io/table/sql/handler 72 wait/lock/table/sql/handler 48 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 21 TABLE test t1 +wait/io/table/sql/handler 22 TABLE test t1 wait/lock/table/sql/handler 20 TABLE test t1 wait/io/table/sql/handler 50 TABLE test t3 wait/lock/table/sql/handler 28 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 17 11 6 11 2 4 0 +TABLE test t1 NULL 20 13 7 13 2 5 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t3 NULL 44 26 18 26 6 12 0 TABLE test t3 index_b 4 4 0 4 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 21 13 8 13 2 6 0 +TABLE test t1 22 14 8 14 2 6 0 TABLE test t3 50 32 18 32 6 12 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -637,7 +637,7 @@ TABLE test t1 20 8 12 4 0 0 0 4 0 6 TABLE test t3 28 8 20 4 0 0 0 4 0 10 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 41 +TABLE test t1 42 TABLE test t2 0 TABLE test t3 78 connect con4, localhost, user4, , ; @@ -648,7 +648,7 @@ connection default; "================== Step 8 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 24 username event_name count_star user2 wait/io/table/sql/handler 0 @@ -661,7 +661,7 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 23 +user1 localhost wait/io/table/sql/handler 24 user1 localhost wait/lock/table/sql/handler 24 user2 localhost wait/io/table/sql/handler 0 user2 localhost wait/lock/table/sql/handler 0 @@ -671,7 +671,7 @@ user4 localhost wait/io/table/sql/handler 0 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 24 user2 wait/io/table/sql/handler 0 user2 wait/lock/table/sql/handler 0 @@ -681,31 +681,31 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 71 +localhost wait/io/table/sql/handler 72 localhost wait/lock/table/sql/handler 48 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 71 +wait/io/table/sql/handler 72 wait/lock/table/sql/handler 48 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 21 TABLE test t1 +wait/io/table/sql/handler 22 TABLE test t1 wait/lock/table/sql/handler 20 TABLE test t1 wait/io/table/sql/handler 50 TABLE test t3 wait/lock/table/sql/handler 28 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 17 11 6 11 2 4 0 +TABLE test t1 NULL 20 13 7 13 2 5 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t3 NULL 44 26 18 26 6 12 0 TABLE test t3 index_b 4 4 0 4 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 21 13 8 13 2 6 0 +TABLE test t1 22 14 8 14 2 6 0 TABLE test t3 50 32 18 32 6 12 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -713,7 +713,7 @@ TABLE test t1 20 8 12 4 0 0 0 4 0 6 TABLE test t3 28 8 20 4 0 0 0 4 0 10 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 41 +TABLE test t1 42 TABLE test t2 0 TABLE test t3 78 connection con4; @@ -773,7 +773,7 @@ connection default; "================== Step 9 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 24 username event_name count_star user2 wait/io/table/sql/handler 0 @@ -786,7 +786,7 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 23 +user1 localhost wait/io/table/sql/handler 24 user1 localhost wait/lock/table/sql/handler 24 user2 localhost wait/io/table/sql/handler 0 user2 localhost wait/lock/table/sql/handler 0 @@ -796,7 +796,7 @@ user4 localhost wait/io/table/sql/handler 0 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 24 user2 wait/io/table/sql/handler 0 user2 wait/lock/table/sql/handler 0 @@ -806,31 +806,31 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 71 +localhost wait/io/table/sql/handler 72 localhost wait/lock/table/sql/handler 48 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 71 +wait/io/table/sql/handler 72 wait/lock/table/sql/handler 48 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 21 TABLE test t1 +wait/io/table/sql/handler 22 TABLE test t1 wait/lock/table/sql/handler 20 TABLE test t1 wait/io/table/sql/handler 50 TABLE test t3 wait/lock/table/sql/handler 28 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 17 11 6 11 2 4 0 +TABLE test t1 NULL 20 13 7 13 2 5 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t3 NULL 44 26 18 26 6 12 0 TABLE test t3 index_b 4 4 0 4 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 21 13 8 13 2 6 0 +TABLE test t1 22 14 8 14 2 6 0 TABLE test t3 50 32 18 32 6 12 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -838,7 +838,7 @@ TABLE test t1 20 8 12 4 0 0 0 4 0 6 TABLE test t3 28 8 20 4 0 0 0 4 0 10 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 41 +TABLE test t1 42 TABLE test t2 0 TABLE test t3 78 connection con1; @@ -850,7 +850,7 @@ connection default; "================== Step 10 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 32 username event_name count_star user2 wait/io/table/sql/handler 0 @@ -863,7 +863,7 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 23 +user1 localhost wait/io/table/sql/handler 24 user1 localhost wait/lock/table/sql/handler 32 user2 localhost wait/io/table/sql/handler 0 user2 localhost wait/lock/table/sql/handler 0 @@ -873,7 +873,7 @@ user4 localhost wait/io/table/sql/handler 0 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 32 user2 wait/io/table/sql/handler 0 user2 wait/lock/table/sql/handler 0 @@ -883,31 +883,31 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 71 +localhost wait/io/table/sql/handler 72 localhost wait/lock/table/sql/handler 56 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 71 +wait/io/table/sql/handler 72 wait/lock/table/sql/handler 56 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 21 TABLE test t1 +wait/io/table/sql/handler 22 TABLE test t1 wait/lock/table/sql/handler 24 TABLE test t1 wait/io/table/sql/handler 50 TABLE test t3 wait/lock/table/sql/handler 32 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 17 11 6 11 2 4 0 +TABLE test t1 NULL 20 13 7 13 2 5 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t3 NULL 44 26 18 26 6 12 0 TABLE test t3 index_b 4 4 0 4 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 21 13 8 13 2 6 0 +TABLE test t1 22 14 8 14 2 6 0 TABLE test t3 50 32 18 32 6 12 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -915,7 +915,7 @@ TABLE test t1 24 10 14 4 0 0 1 5 0 7 TABLE test t3 32 10 22 4 0 0 1 5 0 11 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 45 +TABLE test t1 46 TABLE test t2 0 TABLE test t3 82 connection default; @@ -924,7 +924,7 @@ flush tables; "================== Step 11 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 32 username event_name count_star user2 wait/io/table/sql/handler 0 @@ -937,7 +937,7 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 23 +user1 localhost wait/io/table/sql/handler 24 user1 localhost wait/lock/table/sql/handler 32 user2 localhost wait/io/table/sql/handler 0 user2 localhost wait/lock/table/sql/handler 0 @@ -947,7 +947,7 @@ user4 localhost wait/io/table/sql/handler 0 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 32 user2 wait/io/table/sql/handler 0 user2 wait/lock/table/sql/handler 0 @@ -957,31 +957,31 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 71 +localhost wait/io/table/sql/handler 72 localhost wait/lock/table/sql/handler 56 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 71 +wait/io/table/sql/handler 72 wait/lock/table/sql/handler 56 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 21 TABLE test t1 +wait/io/table/sql/handler 22 TABLE test t1 wait/lock/table/sql/handler 24 TABLE test t1 wait/io/table/sql/handler 50 TABLE test t3 wait/lock/table/sql/handler 32 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 17 11 6 11 2 4 0 +TABLE test t1 NULL 20 13 7 13 2 5 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t3 NULL 44 26 18 26 6 12 0 TABLE test t3 index_b 4 4 0 4 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 21 13 8 13 2 6 0 +TABLE test t1 22 14 8 14 2 6 0 TABLE test t3 50 32 18 32 6 12 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -989,7 +989,7 @@ TABLE test t1 24 10 14 4 0 0 1 5 0 7 TABLE test t3 32 10 22 4 0 0 1 5 0 11 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 45 +TABLE test t1 46 TABLE test t2 0 TABLE test t3 82 set global read_only=1; @@ -998,7 +998,7 @@ set global read_only=0; "================== Step 12 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 32 username event_name count_star user2 wait/io/table/sql/handler 0 @@ -1011,7 +1011,7 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 23 +user1 localhost wait/io/table/sql/handler 24 user1 localhost wait/lock/table/sql/handler 32 user2 localhost wait/io/table/sql/handler 0 user2 localhost wait/lock/table/sql/handler 0 @@ -1021,7 +1021,7 @@ user4 localhost wait/io/table/sql/handler 0 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 32 user2 wait/io/table/sql/handler 0 user2 wait/lock/table/sql/handler 0 @@ -1031,31 +1031,31 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 71 +localhost wait/io/table/sql/handler 72 localhost wait/lock/table/sql/handler 56 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 71 +wait/io/table/sql/handler 72 wait/lock/table/sql/handler 56 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 21 TABLE test t1 +wait/io/table/sql/handler 22 TABLE test t1 wait/lock/table/sql/handler 24 TABLE test t1 wait/io/table/sql/handler 50 TABLE test t3 wait/lock/table/sql/handler 32 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 17 11 6 11 2 4 0 +TABLE test t1 NULL 20 13 7 13 2 5 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t3 NULL 44 26 18 26 6 12 0 TABLE test t3 index_b 4 4 0 4 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 21 13 8 13 2 6 0 +TABLE test t1 22 14 8 14 2 6 0 TABLE test t3 50 32 18 32 6 12 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -1063,7 +1063,7 @@ TABLE test t1 24 10 14 4 0 0 1 5 0 7 TABLE test t3 32 10 22 4 0 0 1 5 0 11 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 45 +TABLE test t1 46 TABLE test t2 0 TABLE test t3 82 disconnect con1; @@ -1082,7 +1082,7 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 23 +user1 localhost wait/io/table/sql/handler 24 user1 localhost wait/lock/table/sql/handler 32 user2 localhost wait/io/table/sql/handler 0 user2 localhost wait/lock/table/sql/handler 0 @@ -1092,7 +1092,7 @@ user4 localhost wait/io/table/sql/handler 0 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 32 user2 wait/io/table/sql/handler 0 user2 wait/lock/table/sql/handler 0 @@ -1102,31 +1102,31 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 71 +localhost wait/io/table/sql/handler 72 localhost wait/lock/table/sql/handler 56 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 71 +wait/io/table/sql/handler 72 wait/lock/table/sql/handler 56 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 21 TABLE test t1 +wait/io/table/sql/handler 22 TABLE test t1 wait/lock/table/sql/handler 24 TABLE test t1 wait/io/table/sql/handler 50 TABLE test t3 wait/lock/table/sql/handler 32 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 17 11 6 11 2 4 0 +TABLE test t1 NULL 20 13 7 13 2 5 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t3 NULL 44 26 18 26 6 12 0 TABLE test t3 index_b 4 4 0 4 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 21 13 8 13 2 6 0 +TABLE test t1 22 14 8 14 2 6 0 TABLE test t3 50 32 18 32 6 12 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -1134,7 +1134,7 @@ TABLE test t1 24 10 14 4 0 0 1 5 0 7 TABLE test t3 32 10 22 4 0 0 1 5 0 11 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 45 +TABLE test t1 46 TABLE test t2 0 TABLE test t3 82 disconnect con2; @@ -1152,7 +1152,7 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 23 +user1 localhost wait/io/table/sql/handler 24 user1 localhost wait/lock/table/sql/handler 32 user2 localhost wait/io/table/sql/handler 0 user2 localhost wait/lock/table/sql/handler 0 @@ -1162,7 +1162,7 @@ user4 localhost wait/io/table/sql/handler 0 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 32 user2 wait/io/table/sql/handler 0 user2 wait/lock/table/sql/handler 0 @@ -1172,31 +1172,31 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 71 +localhost wait/io/table/sql/handler 72 localhost wait/lock/table/sql/handler 56 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 71 +wait/io/table/sql/handler 72 wait/lock/table/sql/handler 56 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 21 TABLE test t1 +wait/io/table/sql/handler 22 TABLE test t1 wait/lock/table/sql/handler 24 TABLE test t1 wait/io/table/sql/handler 50 TABLE test t3 wait/lock/table/sql/handler 32 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 17 11 6 11 2 4 0 +TABLE test t1 NULL 20 13 7 13 2 5 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t3 NULL 44 26 18 26 6 12 0 TABLE test t3 index_b 4 4 0 4 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 21 13 8 13 2 6 0 +TABLE test t1 22 14 8 14 2 6 0 TABLE test t3 50 32 18 32 6 12 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -1204,7 +1204,7 @@ TABLE test t1 24 10 14 4 0 0 1 5 0 7 TABLE test t3 32 10 22 4 0 0 1 5 0 11 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 45 +TABLE test t1 46 TABLE test t2 0 TABLE test t3 82 disconnect con3; @@ -1221,7 +1221,7 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 23 +user1 localhost wait/io/table/sql/handler 24 user1 localhost wait/lock/table/sql/handler 32 user2 localhost wait/io/table/sql/handler 0 user2 localhost wait/lock/table/sql/handler 0 @@ -1231,7 +1231,7 @@ user4 localhost wait/io/table/sql/handler 0 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 32 user2 wait/io/table/sql/handler 0 user2 wait/lock/table/sql/handler 0 @@ -1241,31 +1241,31 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 71 +localhost wait/io/table/sql/handler 72 localhost wait/lock/table/sql/handler 56 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 71 +wait/io/table/sql/handler 72 wait/lock/table/sql/handler 56 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 21 TABLE test t1 +wait/io/table/sql/handler 22 TABLE test t1 wait/lock/table/sql/handler 24 TABLE test t1 wait/io/table/sql/handler 50 TABLE test t3 wait/lock/table/sql/handler 32 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 17 11 6 11 2 4 0 +TABLE test t1 NULL 20 13 7 13 2 5 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t3 NULL 44 26 18 26 6 12 0 TABLE test t3 index_b 4 4 0 4 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 21 13 8 13 2 6 0 +TABLE test t1 22 14 8 14 2 6 0 TABLE test t3 50 32 18 32 6 12 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -1273,7 +1273,7 @@ TABLE test t1 24 10 14 4 0 0 1 5 0 7 TABLE test t3 32 10 22 4 0 0 1 5 0 11 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 45 +TABLE test t1 46 TABLE test t2 0 TABLE test t3 82 disconnect con4; @@ -1289,7 +1289,7 @@ username status user4 not found execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 23 +user1 localhost wait/io/table/sql/handler 24 user1 localhost wait/lock/table/sql/handler 32 user2 localhost wait/io/table/sql/handler 0 user2 localhost wait/lock/table/sql/handler 0 @@ -1299,7 +1299,7 @@ user4 localhost wait/io/table/sql/handler 0 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 32 user2 wait/io/table/sql/handler 0 user2 wait/lock/table/sql/handler 0 @@ -1309,31 +1309,31 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 71 +localhost wait/io/table/sql/handler 72 localhost wait/lock/table/sql/handler 56 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 71 +wait/io/table/sql/handler 72 wait/lock/table/sql/handler 56 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 21 TABLE test t1 +wait/io/table/sql/handler 22 TABLE test t1 wait/lock/table/sql/handler 24 TABLE test t1 wait/io/table/sql/handler 50 TABLE test t3 wait/lock/table/sql/handler 32 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 17 11 6 11 2 4 0 +TABLE test t1 NULL 20 13 7 13 2 5 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t3 NULL 44 26 18 26 6 12 0 TABLE test t3 index_b 4 4 0 4 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 21 13 8 13 2 6 0 +TABLE test t1 22 14 8 14 2 6 0 TABLE test t3 50 32 18 32 6 12 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -1341,7 +1341,7 @@ TABLE test t1 24 10 14 4 0 0 1 5 0 7 TABLE test t3 32 10 22 4 0 0 1 5 0 11 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 45 +TABLE test t1 46 TABLE test t2 0 TABLE test t3 82 connection default; @@ -1359,7 +1359,7 @@ username status user4 not found execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 23 +user1 localhost wait/io/table/sql/handler 24 user1 localhost wait/lock/table/sql/handler 32 user2 localhost wait/io/table/sql/handler 0 user2 localhost wait/lock/table/sql/handler 0 @@ -1369,7 +1369,7 @@ user4 localhost wait/io/table/sql/handler 0 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 32 user2 wait/io/table/sql/handler 0 user2 wait/lock/table/sql/handler 0 @@ -1379,31 +1379,31 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 71 +localhost wait/io/table/sql/handler 72 localhost wait/lock/table/sql/handler 56 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 71 +wait/io/table/sql/handler 72 wait/lock/table/sql/handler 56 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 21 TABLE test t1 +wait/io/table/sql/handler 22 TABLE test t1 wait/lock/table/sql/handler 24 TABLE test t1 wait/io/table/sql/handler 50 TABLE test t3 wait/lock/table/sql/handler 32 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 17 11 6 11 2 4 0 +TABLE test t1 NULL 20 13 7 13 2 5 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t3 NULL 44 26 18 26 6 12 0 TABLE test t3 index_b 4 4 0 4 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 21 13 8 13 2 6 0 +TABLE test t1 22 14 8 14 2 6 0 TABLE test t3 50 32 18 32 6 12 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -1411,7 +1411,7 @@ TABLE test t1 24 10 14 4 0 0 1 5 0 7 TABLE test t3 32 10 22 4 0 0 1 5 0 11 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 45 +TABLE test t1 46 TABLE test t2 0 TABLE test t3 82 truncate performance_schema.events_waits_summary_by_account_by_event_name; @@ -1438,7 +1438,7 @@ user4 localhost wait/io/table/sql/handler 0 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 32 user2 wait/io/table/sql/handler 0 user2 wait/lock/table/sql/handler 0 @@ -1448,31 +1448,31 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 71 +localhost wait/io/table/sql/handler 72 localhost wait/lock/table/sql/handler 56 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 71 +wait/io/table/sql/handler 72 wait/lock/table/sql/handler 56 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 21 TABLE test t1 +wait/io/table/sql/handler 22 TABLE test t1 wait/lock/table/sql/handler 24 TABLE test t1 wait/io/table/sql/handler 50 TABLE test t3 wait/lock/table/sql/handler 32 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 17 11 6 11 2 4 0 +TABLE test t1 NULL 20 13 7 13 2 5 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t3 NULL 44 26 18 26 6 12 0 TABLE test t3 index_b 4 4 0 4 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 21 13 8 13 2 6 0 +TABLE test t1 22 14 8 14 2 6 0 TABLE test t3 50 32 18 32 6 12 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -1480,7 +1480,7 @@ TABLE test t1 24 10 14 4 0 0 1 5 0 7 TABLE test t3 32 10 22 4 0 0 1 5 0 11 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 45 +TABLE test t1 46 TABLE test t2 0 TABLE test t3 82 truncate performance_schema.events_waits_summary_by_user_by_event_name; @@ -1517,31 +1517,31 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 71 +localhost wait/io/table/sql/handler 72 localhost wait/lock/table/sql/handler 56 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 71 +wait/io/table/sql/handler 72 wait/lock/table/sql/handler 56 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 21 TABLE test t1 +wait/io/table/sql/handler 22 TABLE test t1 wait/lock/table/sql/handler 24 TABLE test t1 wait/io/table/sql/handler 50 TABLE test t3 wait/lock/table/sql/handler 32 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 17 11 6 11 2 4 0 +TABLE test t1 NULL 20 13 7 13 2 5 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t3 NULL 44 26 18 26 6 12 0 TABLE test t3 index_b 4 4 0 4 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 21 13 8 13 2 6 0 +TABLE test t1 22 14 8 14 2 6 0 TABLE test t3 50 32 18 32 6 12 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -1549,7 +1549,7 @@ TABLE test t1 24 10 14 4 0 0 1 5 0 7 TABLE test t3 32 10 22 4 0 0 1 5 0 11 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 45 +TABLE test t1 46 TABLE test t2 0 TABLE test t3 82 truncate performance_schema.events_waits_summary_by_host_by_event_name; @@ -1590,27 +1590,27 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 71 +wait/io/table/sql/handler 72 wait/lock/table/sql/handler 56 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 21 TABLE test t1 +wait/io/table/sql/handler 22 TABLE test t1 wait/lock/table/sql/handler 24 TABLE test t1 wait/io/table/sql/handler 50 TABLE test t3 wait/lock/table/sql/handler 32 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 17 11 6 11 2 4 0 +TABLE test t1 NULL 20 13 7 13 2 5 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t3 NULL 44 26 18 26 6 12 0 TABLE test t3 index_b 4 4 0 4 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 21 13 8 13 2 6 0 +TABLE test t1 22 14 8 14 2 6 0 TABLE test t3 50 32 18 32 6 12 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -1618,7 +1618,7 @@ TABLE test t1 24 10 14 4 0 0 1 5 0 7 TABLE test t3 32 10 22 4 0 0 1 5 0 11 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 45 +TABLE test t1 46 TABLE test t2 0 TABLE test t3 82 truncate performance_schema.events_waits_summary_global_by_event_name; @@ -1663,7 +1663,7 @@ wait/io/table/sql/handler 0 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 21 TABLE test t1 +wait/io/table/sql/handler 22 TABLE test t1 wait/lock/table/sql/handler 24 TABLE test t1 wait/io/table/sql/handler 50 TABLE test t3 wait/lock/table/sql/handler 32 TABLE test t3 diff --git a/mysql-test/suite/perfschema/r/table_aggregate_hist_2u_3t.result b/mysql-test/suite/perfschema/r/table_aggregate_hist_2u_3t.result index b0ea06f4254..6aa67f54b6a 100644 --- a/mysql-test/suite/perfschema/r/table_aggregate_hist_2u_3t.result +++ b/mysql-test/suite/perfschema/r/table_aggregate_hist_2u_3t.result @@ -185,7 +185,7 @@ connection default; "================== Step 3-A ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 36 username status user2 not found @@ -195,23 +195,23 @@ username status user4 not found execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 33 +user1 localhost wait/io/table/sql/handler 34 user1 localhost wait/lock/table/sql/handler 36 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 36 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 33 +localhost wait/io/table/sql/handler 34 localhost wait/lock/table/sql/handler 36 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 33 +wait/io/table/sql/handler 34 wait/lock/table/sql/handler 36 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 8 TABLE test t1 +wait/io/table/sql/handler 9 TABLE test t1 wait/lock/table/sql/handler 10 TABLE test t1 wait/io/table/sql/handler 10 TABLE test t2 wait/lock/table/sql/handler 12 TABLE test t2 @@ -219,10 +219,10 @@ wait/io/table/sql/handler 15 TABLE test t3 wait/lock/table/sql/handler 14 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 6 4 2 4 1 1 0 +TABLE test t1 NULL 9 6 3 6 1 2 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 2 1 1 1 0 1 0 +TABLE test t1 PRIMARY 0 0 0 0 0 0 0 TABLE test t2 NULL 9 5 4 5 2 2 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -233,7 +233,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 1 1 0 1 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 8 5 3 5 1 2 0 +TABLE test t1 9 6 3 6 1 2 0 TABLE test t2 10 6 4 6 2 2 0 TABLE test t3 15 9 6 9 3 3 0 execute dump_waits_table_lock; @@ -243,7 +243,7 @@ TABLE test t2 12 4 8 2 0 0 0 2 0 4 TABLE test t3 14 4 10 2 0 0 0 2 0 5 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 18 +TABLE test t1 19 TABLE test t2 22 TABLE test t3 29 connection con1; @@ -253,7 +253,7 @@ connection default; "================== Step 3-B ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 36 username status user2 not found @@ -263,23 +263,23 @@ username status user4 not found execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 33 +user1 localhost wait/io/table/sql/handler 34 user1 localhost wait/lock/table/sql/handler 36 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 36 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 33 +localhost wait/io/table/sql/handler 34 localhost wait/lock/table/sql/handler 36 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 33 +wait/io/table/sql/handler 34 wait/lock/table/sql/handler 36 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 8 TABLE test t1 +wait/io/table/sql/handler 9 TABLE test t1 wait/lock/table/sql/handler 10 TABLE test t1 wait/io/table/sql/handler 10 TABLE test t2 wait/lock/table/sql/handler 12 TABLE test t2 @@ -287,10 +287,10 @@ wait/io/table/sql/handler 15 TABLE test t3 wait/lock/table/sql/handler 14 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 6 4 2 4 1 1 0 +TABLE test t1 NULL 9 6 3 6 1 2 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 2 1 1 1 0 1 0 +TABLE test t1 PRIMARY 0 0 0 0 0 0 0 TABLE test t2 NULL 9 5 4 5 2 2 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -301,7 +301,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 1 1 0 1 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 8 5 3 5 1 2 0 +TABLE test t1 9 6 3 6 1 2 0 TABLE test t2 10 6 4 6 2 2 0 TABLE test t3 15 9 6 9 3 3 0 execute dump_waits_table_lock; @@ -311,7 +311,7 @@ TABLE test t2 12 4 8 2 0 0 0 2 0 4 TABLE test t3 14 4 10 2 0 0 0 2 0 5 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 18 +TABLE test t1 19 TABLE test t2 22 TABLE test t3 29 connect con2, localhost, user2, , ; @@ -322,7 +322,7 @@ connection default; "================== Step 4 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 36 username event_name count_star user2 wait/io/table/sql/handler 0 @@ -333,27 +333,27 @@ username status user4 not found execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 33 +user1 localhost wait/io/table/sql/handler 34 user1 localhost wait/lock/table/sql/handler 36 user2 localhost wait/io/table/sql/handler 0 user2 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 36 user2 wait/io/table/sql/handler 0 user2 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 33 +localhost wait/io/table/sql/handler 34 localhost wait/lock/table/sql/handler 36 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 33 +wait/io/table/sql/handler 34 wait/lock/table/sql/handler 36 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 8 TABLE test t1 +wait/io/table/sql/handler 9 TABLE test t1 wait/lock/table/sql/handler 10 TABLE test t1 wait/io/table/sql/handler 10 TABLE test t2 wait/lock/table/sql/handler 12 TABLE test t2 @@ -361,10 +361,10 @@ wait/io/table/sql/handler 15 TABLE test t3 wait/lock/table/sql/handler 14 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 6 4 2 4 1 1 0 +TABLE test t1 NULL 9 6 3 6 1 2 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 2 1 1 1 0 1 0 +TABLE test t1 PRIMARY 0 0 0 0 0 0 0 TABLE test t2 NULL 9 5 4 5 2 2 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -375,7 +375,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 1 1 0 1 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 8 5 3 5 1 2 0 +TABLE test t1 9 6 3 6 1 2 0 TABLE test t2 10 6 4 6 2 2 0 TABLE test t3 15 9 6 9 3 3 0 execute dump_waits_table_lock; @@ -385,7 +385,7 @@ TABLE test t2 12 4 8 2 0 0 0 2 0 4 TABLE test t3 14 4 10 2 0 0 0 2 0 5 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 18 +TABLE test t1 19 TABLE test t2 22 TABLE test t3 29 connection con2; @@ -431,7 +431,7 @@ connection default; "================== Step 5 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 36 username event_name count_star user2 wait/io/table/sql/handler 0 @@ -442,27 +442,27 @@ username status user4 not found execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 33 +user1 localhost wait/io/table/sql/handler 34 user1 localhost wait/lock/table/sql/handler 36 user2 localhost wait/io/table/sql/handler 0 user2 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 36 user2 wait/io/table/sql/handler 0 user2 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 33 +localhost wait/io/table/sql/handler 34 localhost wait/lock/table/sql/handler 36 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 33 +wait/io/table/sql/handler 34 wait/lock/table/sql/handler 36 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 8 TABLE test t1 +wait/io/table/sql/handler 9 TABLE test t1 wait/lock/table/sql/handler 10 TABLE test t1 wait/io/table/sql/handler 10 TABLE test t2 wait/lock/table/sql/handler 12 TABLE test t2 @@ -470,10 +470,10 @@ wait/io/table/sql/handler 15 TABLE test t3 wait/lock/table/sql/handler 14 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 6 4 2 4 1 1 0 +TABLE test t1 NULL 9 6 3 6 1 2 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 2 1 1 1 0 1 0 +TABLE test t1 PRIMARY 0 0 0 0 0 0 0 TABLE test t2 NULL 9 5 4 5 2 2 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -484,7 +484,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 1 1 0 1 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 8 5 3 5 1 2 0 +TABLE test t1 9 6 3 6 1 2 0 TABLE test t2 10 6 4 6 2 2 0 TABLE test t3 15 9 6 9 3 3 0 execute dump_waits_table_lock; @@ -494,7 +494,7 @@ TABLE test t2 12 4 8 2 0 0 0 2 0 4 TABLE test t3 14 4 10 2 0 0 0 2 0 5 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 18 +TABLE test t1 19 TABLE test t2 22 TABLE test t3 29 connect con3, localhost, user3, , ; @@ -505,7 +505,7 @@ connection default; "================== Step 6 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 36 username event_name count_star user2 wait/io/table/sql/handler 0 @@ -517,7 +517,7 @@ username status user4 not found execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 33 +user1 localhost wait/io/table/sql/handler 34 user1 localhost wait/lock/table/sql/handler 36 user2 localhost wait/io/table/sql/handler 0 user2 localhost wait/lock/table/sql/handler 0 @@ -525,7 +525,7 @@ user3 localhost wait/io/table/sql/handler 0 user3 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 36 user2 wait/io/table/sql/handler 0 user2 wait/lock/table/sql/handler 0 @@ -533,15 +533,15 @@ user3 wait/io/table/sql/handler 0 user3 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 33 +localhost wait/io/table/sql/handler 34 localhost wait/lock/table/sql/handler 36 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 33 +wait/io/table/sql/handler 34 wait/lock/table/sql/handler 36 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 8 TABLE test t1 +wait/io/table/sql/handler 9 TABLE test t1 wait/lock/table/sql/handler 10 TABLE test t1 wait/io/table/sql/handler 10 TABLE test t2 wait/lock/table/sql/handler 12 TABLE test t2 @@ -549,10 +549,10 @@ wait/io/table/sql/handler 15 TABLE test t3 wait/lock/table/sql/handler 14 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 6 4 2 4 1 1 0 +TABLE test t1 NULL 9 6 3 6 1 2 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 2 1 1 1 0 1 0 +TABLE test t1 PRIMARY 0 0 0 0 0 0 0 TABLE test t2 NULL 9 5 4 5 2 2 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -563,7 +563,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 1 1 0 1 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 8 5 3 5 1 2 0 +TABLE test t1 9 6 3 6 1 2 0 TABLE test t2 10 6 4 6 2 2 0 TABLE test t3 15 9 6 9 3 3 0 execute dump_waits_table_lock; @@ -573,7 +573,7 @@ TABLE test t2 12 4 8 2 0 0 0 2 0 4 TABLE test t3 14 4 10 2 0 0 0 2 0 5 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 18 +TABLE test t1 19 TABLE test t2 22 TABLE test t3 29 connection con3; @@ -626,7 +626,7 @@ connection default; "================== Step 7 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 36 username event_name count_star user2 wait/io/table/sql/handler 0 @@ -638,7 +638,7 @@ username status user4 not found execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 33 +user1 localhost wait/io/table/sql/handler 34 user1 localhost wait/lock/table/sql/handler 36 user2 localhost wait/io/table/sql/handler 0 user2 localhost wait/lock/table/sql/handler 0 @@ -646,7 +646,7 @@ user3 localhost wait/io/table/sql/handler 70 user3 localhost wait/lock/table/sql/handler 36 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 36 user2 wait/io/table/sql/handler 0 user2 wait/lock/table/sql/handler 0 @@ -654,15 +654,15 @@ user3 wait/io/table/sql/handler 70 user3 wait/lock/table/sql/handler 36 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 103 +localhost wait/io/table/sql/handler 104 localhost wait/lock/table/sql/handler 72 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 103 +wait/io/table/sql/handler 104 wait/lock/table/sql/handler 72 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 21 TABLE test t1 +wait/io/table/sql/handler 22 TABLE test t1 wait/lock/table/sql/handler 20 TABLE test t1 wait/io/table/sql/handler 32 TABLE test t2 wait/lock/table/sql/handler 24 TABLE test t2 @@ -670,10 +670,10 @@ wait/io/table/sql/handler 50 TABLE test t3 wait/lock/table/sql/handler 28 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 17 11 6 11 2 4 0 +TABLE test t1 NULL 20 13 7 13 2 5 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t2 NULL 30 18 12 18 4 8 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -684,7 +684,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 21 13 8 13 2 6 0 +TABLE test t1 22 14 8 14 2 6 0 TABLE test t2 32 20 12 20 4 8 0 TABLE test t3 50 32 18 32 6 12 0 execute dump_waits_table_lock; @@ -694,7 +694,7 @@ TABLE test t2 24 8 16 4 0 0 0 4 0 8 TABLE test t3 28 8 20 4 0 0 0 4 0 10 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 41 +TABLE test t1 42 TABLE test t2 56 TABLE test t3 78 connect con4, localhost, user4, , ; @@ -705,7 +705,7 @@ connection default; "================== Step 8 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 36 username event_name count_star user2 wait/io/table/sql/handler 0 @@ -718,7 +718,7 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 33 +user1 localhost wait/io/table/sql/handler 34 user1 localhost wait/lock/table/sql/handler 36 user2 localhost wait/io/table/sql/handler 0 user2 localhost wait/lock/table/sql/handler 0 @@ -728,7 +728,7 @@ user4 localhost wait/io/table/sql/handler 0 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 36 user2 wait/io/table/sql/handler 0 user2 wait/lock/table/sql/handler 0 @@ -738,15 +738,15 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 103 +localhost wait/io/table/sql/handler 104 localhost wait/lock/table/sql/handler 72 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 103 +wait/io/table/sql/handler 104 wait/lock/table/sql/handler 72 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 21 TABLE test t1 +wait/io/table/sql/handler 22 TABLE test t1 wait/lock/table/sql/handler 20 TABLE test t1 wait/io/table/sql/handler 32 TABLE test t2 wait/lock/table/sql/handler 24 TABLE test t2 @@ -754,10 +754,10 @@ wait/io/table/sql/handler 50 TABLE test t3 wait/lock/table/sql/handler 28 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 17 11 6 11 2 4 0 +TABLE test t1 NULL 20 13 7 13 2 5 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t2 NULL 30 18 12 18 4 8 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -768,7 +768,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 21 13 8 13 2 6 0 +TABLE test t1 22 14 8 14 2 6 0 TABLE test t2 32 20 12 20 4 8 0 TABLE test t3 50 32 18 32 6 12 0 execute dump_waits_table_lock; @@ -778,7 +778,7 @@ TABLE test t2 24 8 16 4 0 0 0 4 0 8 TABLE test t3 28 8 20 4 0 0 0 4 0 10 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 41 +TABLE test t1 42 TABLE test t2 56 TABLE test t3 78 connection con4; @@ -838,7 +838,7 @@ connection default; "================== Step 9 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 36 username event_name count_star user2 wait/io/table/sql/handler 0 @@ -851,7 +851,7 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 33 +user1 localhost wait/io/table/sql/handler 34 user1 localhost wait/lock/table/sql/handler 36 user2 localhost wait/io/table/sql/handler 0 user2 localhost wait/lock/table/sql/handler 0 @@ -861,7 +861,7 @@ user4 localhost wait/io/table/sql/handler 0 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 36 user2 wait/io/table/sql/handler 0 user2 wait/lock/table/sql/handler 0 @@ -871,15 +871,15 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 103 +localhost wait/io/table/sql/handler 104 localhost wait/lock/table/sql/handler 72 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 103 +wait/io/table/sql/handler 104 wait/lock/table/sql/handler 72 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 21 TABLE test t1 +wait/io/table/sql/handler 22 TABLE test t1 wait/lock/table/sql/handler 20 TABLE test t1 wait/io/table/sql/handler 32 TABLE test t2 wait/lock/table/sql/handler 24 TABLE test t2 @@ -887,10 +887,10 @@ wait/io/table/sql/handler 50 TABLE test t3 wait/lock/table/sql/handler 28 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 17 11 6 11 2 4 0 +TABLE test t1 NULL 20 13 7 13 2 5 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t2 NULL 30 18 12 18 4 8 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -901,7 +901,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 21 13 8 13 2 6 0 +TABLE test t1 22 14 8 14 2 6 0 TABLE test t2 32 20 12 20 4 8 0 TABLE test t3 50 32 18 32 6 12 0 execute dump_waits_table_lock; @@ -911,7 +911,7 @@ TABLE test t2 24 8 16 4 0 0 0 4 0 8 TABLE test t3 28 8 20 4 0 0 0 4 0 10 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 41 +TABLE test t1 42 TABLE test t2 56 TABLE test t3 78 connection con1; @@ -923,7 +923,7 @@ connection default; "================== Step 10 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 48 username event_name count_star user2 wait/io/table/sql/handler 0 @@ -936,7 +936,7 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 33 +user1 localhost wait/io/table/sql/handler 34 user1 localhost wait/lock/table/sql/handler 48 user2 localhost wait/io/table/sql/handler 0 user2 localhost wait/lock/table/sql/handler 0 @@ -946,7 +946,7 @@ user4 localhost wait/io/table/sql/handler 0 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 48 user2 wait/io/table/sql/handler 0 user2 wait/lock/table/sql/handler 0 @@ -956,15 +956,15 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 103 +localhost wait/io/table/sql/handler 104 localhost wait/lock/table/sql/handler 84 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 103 +wait/io/table/sql/handler 104 wait/lock/table/sql/handler 84 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 21 TABLE test t1 +wait/io/table/sql/handler 22 TABLE test t1 wait/lock/table/sql/handler 24 TABLE test t1 wait/io/table/sql/handler 32 TABLE test t2 wait/lock/table/sql/handler 28 TABLE test t2 @@ -972,10 +972,10 @@ wait/io/table/sql/handler 50 TABLE test t3 wait/lock/table/sql/handler 32 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 17 11 6 11 2 4 0 +TABLE test t1 NULL 20 13 7 13 2 5 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t2 NULL 30 18 12 18 4 8 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -986,7 +986,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 21 13 8 13 2 6 0 +TABLE test t1 22 14 8 14 2 6 0 TABLE test t2 32 20 12 20 4 8 0 TABLE test t3 50 32 18 32 6 12 0 execute dump_waits_table_lock; @@ -996,7 +996,7 @@ TABLE test t2 28 10 18 4 0 0 1 5 0 9 TABLE test t3 32 10 22 4 0 0 1 5 0 11 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 45 +TABLE test t1 46 TABLE test t2 60 TABLE test t3 82 connection default; @@ -1005,7 +1005,7 @@ flush tables; "================== Step 11 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 48 username event_name count_star user2 wait/io/table/sql/handler 0 @@ -1018,7 +1018,7 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 33 +user1 localhost wait/io/table/sql/handler 34 user1 localhost wait/lock/table/sql/handler 48 user2 localhost wait/io/table/sql/handler 0 user2 localhost wait/lock/table/sql/handler 0 @@ -1028,7 +1028,7 @@ user4 localhost wait/io/table/sql/handler 0 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 48 user2 wait/io/table/sql/handler 0 user2 wait/lock/table/sql/handler 0 @@ -1038,15 +1038,15 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 103 +localhost wait/io/table/sql/handler 104 localhost wait/lock/table/sql/handler 84 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 103 +wait/io/table/sql/handler 104 wait/lock/table/sql/handler 84 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 21 TABLE test t1 +wait/io/table/sql/handler 22 TABLE test t1 wait/lock/table/sql/handler 24 TABLE test t1 wait/io/table/sql/handler 32 TABLE test t2 wait/lock/table/sql/handler 28 TABLE test t2 @@ -1054,10 +1054,10 @@ wait/io/table/sql/handler 50 TABLE test t3 wait/lock/table/sql/handler 32 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 17 11 6 11 2 4 0 +TABLE test t1 NULL 20 13 7 13 2 5 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t2 NULL 30 18 12 18 4 8 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -1068,7 +1068,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 21 13 8 13 2 6 0 +TABLE test t1 22 14 8 14 2 6 0 TABLE test t2 32 20 12 20 4 8 0 TABLE test t3 50 32 18 32 6 12 0 execute dump_waits_table_lock; @@ -1078,7 +1078,7 @@ TABLE test t2 28 10 18 4 0 0 1 5 0 9 TABLE test t3 32 10 22 4 0 0 1 5 0 11 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 45 +TABLE test t1 46 TABLE test t2 60 TABLE test t3 82 set global read_only=1; @@ -1087,7 +1087,7 @@ set global read_only=0; "================== Step 12 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 48 username event_name count_star user2 wait/io/table/sql/handler 0 @@ -1100,7 +1100,7 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 33 +user1 localhost wait/io/table/sql/handler 34 user1 localhost wait/lock/table/sql/handler 48 user2 localhost wait/io/table/sql/handler 0 user2 localhost wait/lock/table/sql/handler 0 @@ -1110,7 +1110,7 @@ user4 localhost wait/io/table/sql/handler 0 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 48 user2 wait/io/table/sql/handler 0 user2 wait/lock/table/sql/handler 0 @@ -1120,15 +1120,15 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 103 +localhost wait/io/table/sql/handler 104 localhost wait/lock/table/sql/handler 84 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 103 +wait/io/table/sql/handler 104 wait/lock/table/sql/handler 84 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 21 TABLE test t1 +wait/io/table/sql/handler 22 TABLE test t1 wait/lock/table/sql/handler 24 TABLE test t1 wait/io/table/sql/handler 32 TABLE test t2 wait/lock/table/sql/handler 28 TABLE test t2 @@ -1136,10 +1136,10 @@ wait/io/table/sql/handler 50 TABLE test t3 wait/lock/table/sql/handler 32 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 17 11 6 11 2 4 0 +TABLE test t1 NULL 20 13 7 13 2 5 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t2 NULL 30 18 12 18 4 8 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -1150,7 +1150,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 21 13 8 13 2 6 0 +TABLE test t1 22 14 8 14 2 6 0 TABLE test t2 32 20 12 20 4 8 0 TABLE test t3 50 32 18 32 6 12 0 execute dump_waits_table_lock; @@ -1160,7 +1160,7 @@ TABLE test t2 28 10 18 4 0 0 1 5 0 9 TABLE test t3 32 10 22 4 0 0 1 5 0 11 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 45 +TABLE test t1 46 TABLE test t2 60 TABLE test t3 82 disconnect con1; @@ -1179,7 +1179,7 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 33 +user1 localhost wait/io/table/sql/handler 34 user1 localhost wait/lock/table/sql/handler 48 user2 localhost wait/io/table/sql/handler 0 user2 localhost wait/lock/table/sql/handler 0 @@ -1189,7 +1189,7 @@ user4 localhost wait/io/table/sql/handler 0 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 48 user2 wait/io/table/sql/handler 0 user2 wait/lock/table/sql/handler 0 @@ -1199,15 +1199,15 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 103 +localhost wait/io/table/sql/handler 104 localhost wait/lock/table/sql/handler 84 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 103 +wait/io/table/sql/handler 104 wait/lock/table/sql/handler 84 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 21 TABLE test t1 +wait/io/table/sql/handler 22 TABLE test t1 wait/lock/table/sql/handler 24 TABLE test t1 wait/io/table/sql/handler 32 TABLE test t2 wait/lock/table/sql/handler 28 TABLE test t2 @@ -1215,10 +1215,10 @@ wait/io/table/sql/handler 50 TABLE test t3 wait/lock/table/sql/handler 32 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 17 11 6 11 2 4 0 +TABLE test t1 NULL 20 13 7 13 2 5 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t2 NULL 30 18 12 18 4 8 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -1229,7 +1229,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 21 13 8 13 2 6 0 +TABLE test t1 22 14 8 14 2 6 0 TABLE test t2 32 20 12 20 4 8 0 TABLE test t3 50 32 18 32 6 12 0 execute dump_waits_table_lock; @@ -1239,7 +1239,7 @@ TABLE test t2 28 10 18 4 0 0 1 5 0 9 TABLE test t3 32 10 22 4 0 0 1 5 0 11 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 45 +TABLE test t1 46 TABLE test t2 60 TABLE test t3 82 disconnect con2; @@ -1257,7 +1257,7 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 33 +user1 localhost wait/io/table/sql/handler 34 user1 localhost wait/lock/table/sql/handler 48 user2 localhost wait/io/table/sql/handler 0 user2 localhost wait/lock/table/sql/handler 0 @@ -1267,7 +1267,7 @@ user4 localhost wait/io/table/sql/handler 0 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 48 user2 wait/io/table/sql/handler 0 user2 wait/lock/table/sql/handler 0 @@ -1277,15 +1277,15 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 103 +localhost wait/io/table/sql/handler 104 localhost wait/lock/table/sql/handler 84 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 103 +wait/io/table/sql/handler 104 wait/lock/table/sql/handler 84 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 21 TABLE test t1 +wait/io/table/sql/handler 22 TABLE test t1 wait/lock/table/sql/handler 24 TABLE test t1 wait/io/table/sql/handler 32 TABLE test t2 wait/lock/table/sql/handler 28 TABLE test t2 @@ -1293,10 +1293,10 @@ wait/io/table/sql/handler 50 TABLE test t3 wait/lock/table/sql/handler 32 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 17 11 6 11 2 4 0 +TABLE test t1 NULL 20 13 7 13 2 5 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t2 NULL 30 18 12 18 4 8 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -1307,7 +1307,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 21 13 8 13 2 6 0 +TABLE test t1 22 14 8 14 2 6 0 TABLE test t2 32 20 12 20 4 8 0 TABLE test t3 50 32 18 32 6 12 0 execute dump_waits_table_lock; @@ -1317,7 +1317,7 @@ TABLE test t2 28 10 18 4 0 0 1 5 0 9 TABLE test t3 32 10 22 4 0 0 1 5 0 11 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 45 +TABLE test t1 46 TABLE test t2 60 TABLE test t3 82 disconnect con3; @@ -1334,7 +1334,7 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 33 +user1 localhost wait/io/table/sql/handler 34 user1 localhost wait/lock/table/sql/handler 48 user2 localhost wait/io/table/sql/handler 0 user2 localhost wait/lock/table/sql/handler 0 @@ -1344,7 +1344,7 @@ user4 localhost wait/io/table/sql/handler 0 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 48 user2 wait/io/table/sql/handler 0 user2 wait/lock/table/sql/handler 0 @@ -1354,15 +1354,15 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 103 +localhost wait/io/table/sql/handler 104 localhost wait/lock/table/sql/handler 84 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 103 +wait/io/table/sql/handler 104 wait/lock/table/sql/handler 84 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 21 TABLE test t1 +wait/io/table/sql/handler 22 TABLE test t1 wait/lock/table/sql/handler 24 TABLE test t1 wait/io/table/sql/handler 32 TABLE test t2 wait/lock/table/sql/handler 28 TABLE test t2 @@ -1370,10 +1370,10 @@ wait/io/table/sql/handler 50 TABLE test t3 wait/lock/table/sql/handler 32 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 17 11 6 11 2 4 0 +TABLE test t1 NULL 20 13 7 13 2 5 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t2 NULL 30 18 12 18 4 8 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -1384,7 +1384,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 21 13 8 13 2 6 0 +TABLE test t1 22 14 8 14 2 6 0 TABLE test t2 32 20 12 20 4 8 0 TABLE test t3 50 32 18 32 6 12 0 execute dump_waits_table_lock; @@ -1394,7 +1394,7 @@ TABLE test t2 28 10 18 4 0 0 1 5 0 9 TABLE test t3 32 10 22 4 0 0 1 5 0 11 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 45 +TABLE test t1 46 TABLE test t2 60 TABLE test t3 82 disconnect con4; @@ -1410,7 +1410,7 @@ username status user4 not found execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 33 +user1 localhost wait/io/table/sql/handler 34 user1 localhost wait/lock/table/sql/handler 48 user2 localhost wait/io/table/sql/handler 0 user2 localhost wait/lock/table/sql/handler 0 @@ -1420,7 +1420,7 @@ user4 localhost wait/io/table/sql/handler 0 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 48 user2 wait/io/table/sql/handler 0 user2 wait/lock/table/sql/handler 0 @@ -1430,15 +1430,15 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 103 +localhost wait/io/table/sql/handler 104 localhost wait/lock/table/sql/handler 84 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 103 +wait/io/table/sql/handler 104 wait/lock/table/sql/handler 84 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 21 TABLE test t1 +wait/io/table/sql/handler 22 TABLE test t1 wait/lock/table/sql/handler 24 TABLE test t1 wait/io/table/sql/handler 32 TABLE test t2 wait/lock/table/sql/handler 28 TABLE test t2 @@ -1446,10 +1446,10 @@ wait/io/table/sql/handler 50 TABLE test t3 wait/lock/table/sql/handler 32 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 17 11 6 11 2 4 0 +TABLE test t1 NULL 20 13 7 13 2 5 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t2 NULL 30 18 12 18 4 8 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -1460,7 +1460,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 21 13 8 13 2 6 0 +TABLE test t1 22 14 8 14 2 6 0 TABLE test t2 32 20 12 20 4 8 0 TABLE test t3 50 32 18 32 6 12 0 execute dump_waits_table_lock; @@ -1470,7 +1470,7 @@ TABLE test t2 28 10 18 4 0 0 1 5 0 9 TABLE test t3 32 10 22 4 0 0 1 5 0 11 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 45 +TABLE test t1 46 TABLE test t2 60 TABLE test t3 82 connection default; @@ -1488,7 +1488,7 @@ username status user4 not found execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 33 +user1 localhost wait/io/table/sql/handler 34 user1 localhost wait/lock/table/sql/handler 48 user2 localhost wait/io/table/sql/handler 0 user2 localhost wait/lock/table/sql/handler 0 @@ -1498,7 +1498,7 @@ user4 localhost wait/io/table/sql/handler 0 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 48 user2 wait/io/table/sql/handler 0 user2 wait/lock/table/sql/handler 0 @@ -1508,15 +1508,15 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 103 +localhost wait/io/table/sql/handler 104 localhost wait/lock/table/sql/handler 84 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 103 +wait/io/table/sql/handler 104 wait/lock/table/sql/handler 84 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 21 TABLE test t1 +wait/io/table/sql/handler 22 TABLE test t1 wait/lock/table/sql/handler 24 TABLE test t1 wait/io/table/sql/handler 32 TABLE test t2 wait/lock/table/sql/handler 28 TABLE test t2 @@ -1524,10 +1524,10 @@ wait/io/table/sql/handler 50 TABLE test t3 wait/lock/table/sql/handler 32 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 17 11 6 11 2 4 0 +TABLE test t1 NULL 20 13 7 13 2 5 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t2 NULL 30 18 12 18 4 8 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -1538,7 +1538,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 21 13 8 13 2 6 0 +TABLE test t1 22 14 8 14 2 6 0 TABLE test t2 32 20 12 20 4 8 0 TABLE test t3 50 32 18 32 6 12 0 execute dump_waits_table_lock; @@ -1548,7 +1548,7 @@ TABLE test t2 28 10 18 4 0 0 1 5 0 9 TABLE test t3 32 10 22 4 0 0 1 5 0 11 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 45 +TABLE test t1 46 TABLE test t2 60 TABLE test t3 82 truncate performance_schema.events_waits_summary_by_account_by_event_name; @@ -1575,7 +1575,7 @@ user4 localhost wait/io/table/sql/handler 0 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 48 user2 wait/io/table/sql/handler 0 user2 wait/lock/table/sql/handler 0 @@ -1585,15 +1585,15 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 103 +localhost wait/io/table/sql/handler 104 localhost wait/lock/table/sql/handler 84 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 103 +wait/io/table/sql/handler 104 wait/lock/table/sql/handler 84 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 21 TABLE test t1 +wait/io/table/sql/handler 22 TABLE test t1 wait/lock/table/sql/handler 24 TABLE test t1 wait/io/table/sql/handler 32 TABLE test t2 wait/lock/table/sql/handler 28 TABLE test t2 @@ -1601,10 +1601,10 @@ wait/io/table/sql/handler 50 TABLE test t3 wait/lock/table/sql/handler 32 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 17 11 6 11 2 4 0 +TABLE test t1 NULL 20 13 7 13 2 5 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t2 NULL 30 18 12 18 4 8 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -1615,7 +1615,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 21 13 8 13 2 6 0 +TABLE test t1 22 14 8 14 2 6 0 TABLE test t2 32 20 12 20 4 8 0 TABLE test t3 50 32 18 32 6 12 0 execute dump_waits_table_lock; @@ -1625,7 +1625,7 @@ TABLE test t2 28 10 18 4 0 0 1 5 0 9 TABLE test t3 32 10 22 4 0 0 1 5 0 11 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 45 +TABLE test t1 46 TABLE test t2 60 TABLE test t3 82 truncate performance_schema.events_waits_summary_by_user_by_event_name; @@ -1662,15 +1662,15 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 103 +localhost wait/io/table/sql/handler 104 localhost wait/lock/table/sql/handler 84 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 103 +wait/io/table/sql/handler 104 wait/lock/table/sql/handler 84 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 21 TABLE test t1 +wait/io/table/sql/handler 22 TABLE test t1 wait/lock/table/sql/handler 24 TABLE test t1 wait/io/table/sql/handler 32 TABLE test t2 wait/lock/table/sql/handler 28 TABLE test t2 @@ -1678,10 +1678,10 @@ wait/io/table/sql/handler 50 TABLE test t3 wait/lock/table/sql/handler 32 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 17 11 6 11 2 4 0 +TABLE test t1 NULL 20 13 7 13 2 5 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t2 NULL 30 18 12 18 4 8 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -1692,7 +1692,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 21 13 8 13 2 6 0 +TABLE test t1 22 14 8 14 2 6 0 TABLE test t2 32 20 12 20 4 8 0 TABLE test t3 50 32 18 32 6 12 0 execute dump_waits_table_lock; @@ -1702,7 +1702,7 @@ TABLE test t2 28 10 18 4 0 0 1 5 0 9 TABLE test t3 32 10 22 4 0 0 1 5 0 11 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 45 +TABLE test t1 46 TABLE test t2 60 TABLE test t3 82 truncate performance_schema.events_waits_summary_by_host_by_event_name; @@ -1743,11 +1743,11 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 103 +wait/io/table/sql/handler 104 wait/lock/table/sql/handler 84 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 21 TABLE test t1 +wait/io/table/sql/handler 22 TABLE test t1 wait/lock/table/sql/handler 24 TABLE test t1 wait/io/table/sql/handler 32 TABLE test t2 wait/lock/table/sql/handler 28 TABLE test t2 @@ -1755,10 +1755,10 @@ wait/io/table/sql/handler 50 TABLE test t3 wait/lock/table/sql/handler 32 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 17 11 6 11 2 4 0 +TABLE test t1 NULL 20 13 7 13 2 5 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t2 NULL 30 18 12 18 4 8 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -1769,7 +1769,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 21 13 8 13 2 6 0 +TABLE test t1 22 14 8 14 2 6 0 TABLE test t2 32 20 12 20 4 8 0 TABLE test t3 50 32 18 32 6 12 0 execute dump_waits_table_lock; @@ -1779,7 +1779,7 @@ TABLE test t2 28 10 18 4 0 0 1 5 0 9 TABLE test t3 32 10 22 4 0 0 1 5 0 11 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 45 +TABLE test t1 46 TABLE test t2 60 TABLE test t3 82 truncate performance_schema.events_waits_summary_global_by_event_name; @@ -1824,7 +1824,7 @@ wait/io/table/sql/handler 0 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 21 TABLE test t1 +wait/io/table/sql/handler 22 TABLE test t1 wait/lock/table/sql/handler 24 TABLE test t1 wait/io/table/sql/handler 32 TABLE test t2 wait/lock/table/sql/handler 28 TABLE test t2 diff --git a/mysql-test/suite/perfschema/r/table_aggregate_hist_4u_2t.result b/mysql-test/suite/perfschema/r/table_aggregate_hist_4u_2t.result index 0a6dea739e4..800e0bd9df7 100644 --- a/mysql-test/suite/perfschema/r/table_aggregate_hist_4u_2t.result +++ b/mysql-test/suite/perfschema/r/table_aggregate_hist_4u_2t.result @@ -176,7 +176,7 @@ connection default; "================== Step 3-A ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 24 username status user2 not found @@ -186,39 +186,39 @@ username status user4 not found execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 23 +user1 localhost wait/io/table/sql/handler 24 user1 localhost wait/lock/table/sql/handler 24 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 24 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 23 +localhost wait/io/table/sql/handler 24 localhost wait/lock/table/sql/handler 24 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 23 +wait/io/table/sql/handler 24 wait/lock/table/sql/handler 24 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 8 TABLE test t1 +wait/io/table/sql/handler 9 TABLE test t1 wait/lock/table/sql/handler 10 TABLE test t1 wait/io/table/sql/handler 15 TABLE test t3 wait/lock/table/sql/handler 14 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 6 4 2 4 1 1 0 +TABLE test t1 NULL 9 6 3 6 1 2 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 2 1 1 1 0 1 0 +TABLE test t1 PRIMARY 0 0 0 0 0 0 0 TABLE test t3 NULL 13 7 6 7 3 3 0 TABLE test t3 index_b 1 1 0 1 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 1 1 0 1 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 8 5 3 5 1 2 0 +TABLE test t1 9 6 3 6 1 2 0 TABLE test t3 15 9 6 9 3 3 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -226,7 +226,7 @@ TABLE test t1 10 4 6 2 0 0 0 2 0 3 TABLE test t3 14 4 10 2 0 0 0 2 0 5 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 18 +TABLE test t1 19 TABLE test t2 0 TABLE test t3 29 connection con1; @@ -236,7 +236,7 @@ connection default; "================== Step 3-B ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 24 username status user2 not found @@ -246,39 +246,39 @@ username status user4 not found execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 23 +user1 localhost wait/io/table/sql/handler 24 user1 localhost wait/lock/table/sql/handler 24 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 24 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 23 +localhost wait/io/table/sql/handler 24 localhost wait/lock/table/sql/handler 24 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 23 +wait/io/table/sql/handler 24 wait/lock/table/sql/handler 24 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 8 TABLE test t1 +wait/io/table/sql/handler 9 TABLE test t1 wait/lock/table/sql/handler 10 TABLE test t1 wait/io/table/sql/handler 15 TABLE test t3 wait/lock/table/sql/handler 14 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 6 4 2 4 1 1 0 +TABLE test t1 NULL 9 6 3 6 1 2 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 2 1 1 1 0 1 0 +TABLE test t1 PRIMARY 0 0 0 0 0 0 0 TABLE test t3 NULL 13 7 6 7 3 3 0 TABLE test t3 index_b 1 1 0 1 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 1 1 0 1 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 8 5 3 5 1 2 0 +TABLE test t1 9 6 3 6 1 2 0 TABLE test t3 15 9 6 9 3 3 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -286,7 +286,7 @@ TABLE test t1 10 4 6 2 0 0 0 2 0 3 TABLE test t3 14 4 10 2 0 0 0 2 0 5 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 18 +TABLE test t1 19 TABLE test t2 0 TABLE test t3 29 connect con2, localhost, user2, , ; @@ -297,7 +297,7 @@ connection default; "================== Step 4 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 24 username event_name count_star user2 wait/io/table/sql/handler 0 @@ -308,43 +308,43 @@ username status user4 not found execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 23 +user1 localhost wait/io/table/sql/handler 24 user1 localhost wait/lock/table/sql/handler 24 user2 localhost wait/io/table/sql/handler 0 user2 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 24 user2 wait/io/table/sql/handler 0 user2 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 23 +localhost wait/io/table/sql/handler 24 localhost wait/lock/table/sql/handler 24 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 23 +wait/io/table/sql/handler 24 wait/lock/table/sql/handler 24 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 8 TABLE test t1 +wait/io/table/sql/handler 9 TABLE test t1 wait/lock/table/sql/handler 10 TABLE test t1 wait/io/table/sql/handler 15 TABLE test t3 wait/lock/table/sql/handler 14 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 6 4 2 4 1 1 0 +TABLE test t1 NULL 9 6 3 6 1 2 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 2 1 1 1 0 1 0 +TABLE test t1 PRIMARY 0 0 0 0 0 0 0 TABLE test t3 NULL 13 7 6 7 3 3 0 TABLE test t3 index_b 1 1 0 1 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 1 1 0 1 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 8 5 3 5 1 2 0 +TABLE test t1 9 6 3 6 1 2 0 TABLE test t3 15 9 6 9 3 3 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -352,7 +352,7 @@ TABLE test t1 10 4 6 2 0 0 0 2 0 3 TABLE test t3 14 4 10 2 0 0 0 2 0 5 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 18 +TABLE test t1 19 TABLE test t2 0 TABLE test t3 29 connection con2; @@ -398,7 +398,7 @@ connection default; "================== Step 5 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 24 username event_name count_star user2 wait/io/table/sql/handler 35 @@ -409,43 +409,43 @@ username status user4 not found execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 23 +user1 localhost wait/io/table/sql/handler 24 user1 localhost wait/lock/table/sql/handler 24 user2 localhost wait/io/table/sql/handler 35 user2 localhost wait/lock/table/sql/handler 24 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 24 user2 wait/io/table/sql/handler 35 user2 wait/lock/table/sql/handler 24 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 58 +localhost wait/io/table/sql/handler 59 localhost wait/lock/table/sql/handler 48 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 58 +wait/io/table/sql/handler 59 wait/lock/table/sql/handler 48 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 18 TABLE test t1 +wait/io/table/sql/handler 19 TABLE test t1 wait/lock/table/sql/handler 20 TABLE test t1 wait/io/table/sql/handler 40 TABLE test t3 wait/lock/table/sql/handler 28 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 14 9 5 9 2 3 0 +TABLE test t1 NULL 17 11 6 11 2 4 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t3 NULL 35 20 15 20 6 9 0 TABLE test t3 index_b 3 3 0 3 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 18 11 7 11 2 5 0 +TABLE test t1 19 12 7 12 2 5 0 TABLE test t3 40 25 15 25 6 9 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -453,7 +453,7 @@ TABLE test t1 20 8 12 4 0 0 0 4 0 6 TABLE test t3 28 8 20 4 0 0 0 4 0 10 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 38 +TABLE test t1 39 TABLE test t2 0 TABLE test t3 68 connect con3, localhost, user3, , ; @@ -464,7 +464,7 @@ connection default; "================== Step 6 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 24 username event_name count_star user2 wait/io/table/sql/handler 35 @@ -476,7 +476,7 @@ username status user4 not found execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 23 +user1 localhost wait/io/table/sql/handler 24 user1 localhost wait/lock/table/sql/handler 24 user2 localhost wait/io/table/sql/handler 35 user2 localhost wait/lock/table/sql/handler 24 @@ -484,7 +484,7 @@ user3 localhost wait/io/table/sql/handler 0 user3 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 24 user2 wait/io/table/sql/handler 35 user2 wait/lock/table/sql/handler 24 @@ -492,31 +492,31 @@ user3 wait/io/table/sql/handler 0 user3 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 58 +localhost wait/io/table/sql/handler 59 localhost wait/lock/table/sql/handler 48 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 58 +wait/io/table/sql/handler 59 wait/lock/table/sql/handler 48 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 18 TABLE test t1 +wait/io/table/sql/handler 19 TABLE test t1 wait/lock/table/sql/handler 20 TABLE test t1 wait/io/table/sql/handler 40 TABLE test t3 wait/lock/table/sql/handler 28 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 14 9 5 9 2 3 0 +TABLE test t1 NULL 17 11 6 11 2 4 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t3 NULL 35 20 15 20 6 9 0 TABLE test t3 index_b 3 3 0 3 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 18 11 7 11 2 5 0 +TABLE test t1 19 12 7 12 2 5 0 TABLE test t3 40 25 15 25 6 9 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -524,7 +524,7 @@ TABLE test t1 20 8 12 4 0 0 0 4 0 6 TABLE test t3 28 8 20 4 0 0 0 4 0 10 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 38 +TABLE test t1 39 TABLE test t2 0 TABLE test t3 68 connection con3; @@ -577,7 +577,7 @@ connection default; "================== Step 7 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 24 username event_name count_star user2 wait/io/table/sql/handler 35 @@ -589,7 +589,7 @@ username status user4 not found execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 23 +user1 localhost wait/io/table/sql/handler 24 user1 localhost wait/lock/table/sql/handler 24 user2 localhost wait/io/table/sql/handler 35 user2 localhost wait/lock/table/sql/handler 24 @@ -597,7 +597,7 @@ user3 localhost wait/io/table/sql/handler 48 user3 localhost wait/lock/table/sql/handler 24 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 24 user2 wait/io/table/sql/handler 35 user2 wait/lock/table/sql/handler 24 @@ -605,31 +605,31 @@ user3 wait/io/table/sql/handler 48 user3 wait/lock/table/sql/handler 24 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 106 +localhost wait/io/table/sql/handler 107 localhost wait/lock/table/sql/handler 72 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 106 +wait/io/table/sql/handler 107 wait/lock/table/sql/handler 72 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 31 TABLE test t1 +wait/io/table/sql/handler 32 TABLE test t1 wait/lock/table/sql/handler 30 TABLE test t1 wait/io/table/sql/handler 75 TABLE test t3 wait/lock/table/sql/handler 42 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 25 16 9 16 3 6 0 +TABLE test t1 NULL 28 18 10 18 3 7 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 6 3 3 3 0 3 0 +TABLE test t1 PRIMARY 4 2 2 2 0 2 0 TABLE test t3 NULL 66 39 27 39 9 18 0 TABLE test t3 index_b 6 6 0 6 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 3 3 0 3 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 31 19 12 19 3 9 0 +TABLE test t1 32 20 12 20 3 9 0 TABLE test t3 75 48 27 48 9 18 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -637,7 +637,7 @@ TABLE test t1 30 12 18 6 0 0 0 6 0 9 TABLE test t3 42 12 30 6 0 0 0 6 0 15 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 61 +TABLE test t1 62 TABLE test t2 0 TABLE test t3 117 connect con4, localhost, user4, , ; @@ -648,7 +648,7 @@ connection default; "================== Step 8 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 24 username event_name count_star user2 wait/io/table/sql/handler 35 @@ -661,7 +661,7 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 23 +user1 localhost wait/io/table/sql/handler 24 user1 localhost wait/lock/table/sql/handler 24 user2 localhost wait/io/table/sql/handler 35 user2 localhost wait/lock/table/sql/handler 24 @@ -671,7 +671,7 @@ user4 localhost wait/io/table/sql/handler 0 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 24 user2 wait/io/table/sql/handler 35 user2 wait/lock/table/sql/handler 24 @@ -681,31 +681,31 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 106 +localhost wait/io/table/sql/handler 107 localhost wait/lock/table/sql/handler 72 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 106 +wait/io/table/sql/handler 107 wait/lock/table/sql/handler 72 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 31 TABLE test t1 +wait/io/table/sql/handler 32 TABLE test t1 wait/lock/table/sql/handler 30 TABLE test t1 wait/io/table/sql/handler 75 TABLE test t3 wait/lock/table/sql/handler 42 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 25 16 9 16 3 6 0 +TABLE test t1 NULL 28 18 10 18 3 7 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 6 3 3 3 0 3 0 +TABLE test t1 PRIMARY 4 2 2 2 0 2 0 TABLE test t3 NULL 66 39 27 39 9 18 0 TABLE test t3 index_b 6 6 0 6 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 3 3 0 3 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 31 19 12 19 3 9 0 +TABLE test t1 32 20 12 20 3 9 0 TABLE test t3 75 48 27 48 9 18 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -713,7 +713,7 @@ TABLE test t1 30 12 18 6 0 0 0 6 0 9 TABLE test t3 42 12 30 6 0 0 0 6 0 15 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 61 +TABLE test t1 62 TABLE test t2 0 TABLE test t3 117 connection con4; @@ -773,7 +773,7 @@ connection default; "================== Step 9 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 24 username event_name count_star user2 wait/io/table/sql/handler 35 @@ -786,7 +786,7 @@ user4 wait/io/table/sql/handler 61 user4 wait/lock/table/sql/handler 24 execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 23 +user1 localhost wait/io/table/sql/handler 24 user1 localhost wait/lock/table/sql/handler 24 user2 localhost wait/io/table/sql/handler 35 user2 localhost wait/lock/table/sql/handler 24 @@ -796,7 +796,7 @@ user4 localhost wait/io/table/sql/handler 61 user4 localhost wait/lock/table/sql/handler 24 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 24 user2 wait/io/table/sql/handler 35 user2 wait/lock/table/sql/handler 24 @@ -806,31 +806,31 @@ user4 wait/io/table/sql/handler 61 user4 wait/lock/table/sql/handler 24 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 167 +localhost wait/io/table/sql/handler 168 localhost wait/lock/table/sql/handler 96 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 167 +wait/io/table/sql/handler 168 wait/lock/table/sql/handler 96 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 47 TABLE test t1 +wait/io/table/sql/handler 48 TABLE test t1 wait/lock/table/sql/handler 40 TABLE test t1 wait/io/table/sql/handler 120 TABLE test t3 wait/lock/table/sql/handler 56 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t3 NULL 106 64 42 64 12 30 0 TABLE test t3 index_b 10 10 0 10 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -838,7 +838,7 @@ TABLE test t1 40 16 24 8 0 0 0 8 0 12 TABLE test t3 56 16 40 8 0 0 0 8 0 20 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 87 +TABLE test t1 88 TABLE test t2 0 TABLE test t3 176 connection con1; @@ -850,7 +850,7 @@ connection default; "================== Step 10 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 32 username event_name count_star user2 wait/io/table/sql/handler 35 @@ -863,7 +863,7 @@ user4 wait/io/table/sql/handler 61 user4 wait/lock/table/sql/handler 24 execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 23 +user1 localhost wait/io/table/sql/handler 24 user1 localhost wait/lock/table/sql/handler 32 user2 localhost wait/io/table/sql/handler 35 user2 localhost wait/lock/table/sql/handler 24 @@ -873,7 +873,7 @@ user4 localhost wait/io/table/sql/handler 61 user4 localhost wait/lock/table/sql/handler 24 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 32 user2 wait/io/table/sql/handler 35 user2 wait/lock/table/sql/handler 24 @@ -883,31 +883,31 @@ user4 wait/io/table/sql/handler 61 user4 wait/lock/table/sql/handler 24 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 167 +localhost wait/io/table/sql/handler 168 localhost wait/lock/table/sql/handler 104 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 167 +wait/io/table/sql/handler 168 wait/lock/table/sql/handler 104 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 47 TABLE test t1 +wait/io/table/sql/handler 48 TABLE test t1 wait/lock/table/sql/handler 44 TABLE test t1 wait/io/table/sql/handler 120 TABLE test t3 wait/lock/table/sql/handler 60 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t3 NULL 106 64 42 64 12 30 0 TABLE test t3 index_b 10 10 0 10 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -915,7 +915,7 @@ TABLE test t1 44 18 26 8 0 0 1 9 0 13 TABLE test t3 60 18 42 8 0 0 1 9 0 21 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 91 +TABLE test t1 92 TABLE test t2 0 TABLE test t3 180 connection default; @@ -924,7 +924,7 @@ flush tables; "================== Step 11 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 32 username event_name count_star user2 wait/io/table/sql/handler 35 @@ -937,7 +937,7 @@ user4 wait/io/table/sql/handler 61 user4 wait/lock/table/sql/handler 24 execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 23 +user1 localhost wait/io/table/sql/handler 24 user1 localhost wait/lock/table/sql/handler 32 user2 localhost wait/io/table/sql/handler 35 user2 localhost wait/lock/table/sql/handler 24 @@ -947,7 +947,7 @@ user4 localhost wait/io/table/sql/handler 61 user4 localhost wait/lock/table/sql/handler 24 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 32 user2 wait/io/table/sql/handler 35 user2 wait/lock/table/sql/handler 24 @@ -957,31 +957,31 @@ user4 wait/io/table/sql/handler 61 user4 wait/lock/table/sql/handler 24 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 167 +localhost wait/io/table/sql/handler 168 localhost wait/lock/table/sql/handler 104 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 167 +wait/io/table/sql/handler 168 wait/lock/table/sql/handler 104 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 47 TABLE test t1 +wait/io/table/sql/handler 48 TABLE test t1 wait/lock/table/sql/handler 44 TABLE test t1 wait/io/table/sql/handler 120 TABLE test t3 wait/lock/table/sql/handler 60 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t3 NULL 106 64 42 64 12 30 0 TABLE test t3 index_b 10 10 0 10 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -989,7 +989,7 @@ TABLE test t1 44 18 26 8 0 0 1 9 0 13 TABLE test t3 60 18 42 8 0 0 1 9 0 21 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 91 +TABLE test t1 92 TABLE test t2 0 TABLE test t3 180 set global read_only=1; @@ -998,7 +998,7 @@ set global read_only=0; "================== Step 12 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 32 username event_name count_star user2 wait/io/table/sql/handler 35 @@ -1011,7 +1011,7 @@ user4 wait/io/table/sql/handler 61 user4 wait/lock/table/sql/handler 24 execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 23 +user1 localhost wait/io/table/sql/handler 24 user1 localhost wait/lock/table/sql/handler 32 user2 localhost wait/io/table/sql/handler 35 user2 localhost wait/lock/table/sql/handler 24 @@ -1021,7 +1021,7 @@ user4 localhost wait/io/table/sql/handler 61 user4 localhost wait/lock/table/sql/handler 24 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 32 user2 wait/io/table/sql/handler 35 user2 wait/lock/table/sql/handler 24 @@ -1031,31 +1031,31 @@ user4 wait/io/table/sql/handler 61 user4 wait/lock/table/sql/handler 24 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 167 +localhost wait/io/table/sql/handler 168 localhost wait/lock/table/sql/handler 104 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 167 +wait/io/table/sql/handler 168 wait/lock/table/sql/handler 104 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 47 TABLE test t1 +wait/io/table/sql/handler 48 TABLE test t1 wait/lock/table/sql/handler 44 TABLE test t1 wait/io/table/sql/handler 120 TABLE test t3 wait/lock/table/sql/handler 60 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t3 NULL 106 64 42 64 12 30 0 TABLE test t3 index_b 10 10 0 10 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -1063,7 +1063,7 @@ TABLE test t1 44 18 26 8 0 0 1 9 0 13 TABLE test t3 60 18 42 8 0 0 1 9 0 21 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 91 +TABLE test t1 92 TABLE test t2 0 TABLE test t3 180 disconnect con1; @@ -1082,7 +1082,7 @@ user4 wait/io/table/sql/handler 61 user4 wait/lock/table/sql/handler 24 execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 23 +user1 localhost wait/io/table/sql/handler 24 user1 localhost wait/lock/table/sql/handler 32 user2 localhost wait/io/table/sql/handler 35 user2 localhost wait/lock/table/sql/handler 24 @@ -1092,7 +1092,7 @@ user4 localhost wait/io/table/sql/handler 61 user4 localhost wait/lock/table/sql/handler 24 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 32 user2 wait/io/table/sql/handler 35 user2 wait/lock/table/sql/handler 24 @@ -1102,31 +1102,31 @@ user4 wait/io/table/sql/handler 61 user4 wait/lock/table/sql/handler 24 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 167 +localhost wait/io/table/sql/handler 168 localhost wait/lock/table/sql/handler 104 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 167 +wait/io/table/sql/handler 168 wait/lock/table/sql/handler 104 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 47 TABLE test t1 +wait/io/table/sql/handler 48 TABLE test t1 wait/lock/table/sql/handler 44 TABLE test t1 wait/io/table/sql/handler 120 TABLE test t3 wait/lock/table/sql/handler 60 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t3 NULL 106 64 42 64 12 30 0 TABLE test t3 index_b 10 10 0 10 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -1134,7 +1134,7 @@ TABLE test t1 44 18 26 8 0 0 1 9 0 13 TABLE test t3 60 18 42 8 0 0 1 9 0 21 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 91 +TABLE test t1 92 TABLE test t2 0 TABLE test t3 180 disconnect con2; @@ -1152,7 +1152,7 @@ user4 wait/io/table/sql/handler 61 user4 wait/lock/table/sql/handler 24 execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 23 +user1 localhost wait/io/table/sql/handler 24 user1 localhost wait/lock/table/sql/handler 32 user2 localhost wait/io/table/sql/handler 35 user2 localhost wait/lock/table/sql/handler 24 @@ -1162,7 +1162,7 @@ user4 localhost wait/io/table/sql/handler 61 user4 localhost wait/lock/table/sql/handler 24 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 32 user2 wait/io/table/sql/handler 35 user2 wait/lock/table/sql/handler 24 @@ -1172,31 +1172,31 @@ user4 wait/io/table/sql/handler 61 user4 wait/lock/table/sql/handler 24 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 167 +localhost wait/io/table/sql/handler 168 localhost wait/lock/table/sql/handler 104 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 167 +wait/io/table/sql/handler 168 wait/lock/table/sql/handler 104 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 47 TABLE test t1 +wait/io/table/sql/handler 48 TABLE test t1 wait/lock/table/sql/handler 44 TABLE test t1 wait/io/table/sql/handler 120 TABLE test t3 wait/lock/table/sql/handler 60 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t3 NULL 106 64 42 64 12 30 0 TABLE test t3 index_b 10 10 0 10 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -1204,7 +1204,7 @@ TABLE test t1 44 18 26 8 0 0 1 9 0 13 TABLE test t3 60 18 42 8 0 0 1 9 0 21 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 91 +TABLE test t1 92 TABLE test t2 0 TABLE test t3 180 disconnect con3; @@ -1221,7 +1221,7 @@ user4 wait/io/table/sql/handler 61 user4 wait/lock/table/sql/handler 24 execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 23 +user1 localhost wait/io/table/sql/handler 24 user1 localhost wait/lock/table/sql/handler 32 user2 localhost wait/io/table/sql/handler 35 user2 localhost wait/lock/table/sql/handler 24 @@ -1231,7 +1231,7 @@ user4 localhost wait/io/table/sql/handler 61 user4 localhost wait/lock/table/sql/handler 24 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 32 user2 wait/io/table/sql/handler 35 user2 wait/lock/table/sql/handler 24 @@ -1241,31 +1241,31 @@ user4 wait/io/table/sql/handler 61 user4 wait/lock/table/sql/handler 24 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 167 +localhost wait/io/table/sql/handler 168 localhost wait/lock/table/sql/handler 104 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 167 +wait/io/table/sql/handler 168 wait/lock/table/sql/handler 104 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 47 TABLE test t1 +wait/io/table/sql/handler 48 TABLE test t1 wait/lock/table/sql/handler 44 TABLE test t1 wait/io/table/sql/handler 120 TABLE test t3 wait/lock/table/sql/handler 60 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t3 NULL 106 64 42 64 12 30 0 TABLE test t3 index_b 10 10 0 10 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -1273,7 +1273,7 @@ TABLE test t1 44 18 26 8 0 0 1 9 0 13 TABLE test t3 60 18 42 8 0 0 1 9 0 21 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 91 +TABLE test t1 92 TABLE test t2 0 TABLE test t3 180 disconnect con4; @@ -1289,7 +1289,7 @@ username status user4 not found execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 23 +user1 localhost wait/io/table/sql/handler 24 user1 localhost wait/lock/table/sql/handler 32 user2 localhost wait/io/table/sql/handler 35 user2 localhost wait/lock/table/sql/handler 24 @@ -1299,7 +1299,7 @@ user4 localhost wait/io/table/sql/handler 61 user4 localhost wait/lock/table/sql/handler 24 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 32 user2 wait/io/table/sql/handler 35 user2 wait/lock/table/sql/handler 24 @@ -1309,31 +1309,31 @@ user4 wait/io/table/sql/handler 61 user4 wait/lock/table/sql/handler 24 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 167 +localhost wait/io/table/sql/handler 168 localhost wait/lock/table/sql/handler 104 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 167 +wait/io/table/sql/handler 168 wait/lock/table/sql/handler 104 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 47 TABLE test t1 +wait/io/table/sql/handler 48 TABLE test t1 wait/lock/table/sql/handler 44 TABLE test t1 wait/io/table/sql/handler 120 TABLE test t3 wait/lock/table/sql/handler 60 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t3 NULL 106 64 42 64 12 30 0 TABLE test t3 index_b 10 10 0 10 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -1341,7 +1341,7 @@ TABLE test t1 44 18 26 8 0 0 1 9 0 13 TABLE test t3 60 18 42 8 0 0 1 9 0 21 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 91 +TABLE test t1 92 TABLE test t2 0 TABLE test t3 180 connection default; @@ -1359,7 +1359,7 @@ username status user4 not found execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 23 +user1 localhost wait/io/table/sql/handler 24 user1 localhost wait/lock/table/sql/handler 32 user2 localhost wait/io/table/sql/handler 35 user2 localhost wait/lock/table/sql/handler 24 @@ -1369,7 +1369,7 @@ user4 localhost wait/io/table/sql/handler 61 user4 localhost wait/lock/table/sql/handler 24 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 32 user2 wait/io/table/sql/handler 35 user2 wait/lock/table/sql/handler 24 @@ -1379,31 +1379,31 @@ user4 wait/io/table/sql/handler 61 user4 wait/lock/table/sql/handler 24 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 167 +localhost wait/io/table/sql/handler 168 localhost wait/lock/table/sql/handler 104 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 167 +wait/io/table/sql/handler 168 wait/lock/table/sql/handler 104 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 47 TABLE test t1 +wait/io/table/sql/handler 48 TABLE test t1 wait/lock/table/sql/handler 44 TABLE test t1 wait/io/table/sql/handler 120 TABLE test t3 wait/lock/table/sql/handler 60 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t3 NULL 106 64 42 64 12 30 0 TABLE test t3 index_b 10 10 0 10 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -1411,7 +1411,7 @@ TABLE test t1 44 18 26 8 0 0 1 9 0 13 TABLE test t3 60 18 42 8 0 0 1 9 0 21 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 91 +TABLE test t1 92 TABLE test t2 0 TABLE test t3 180 truncate performance_schema.events_waits_summary_by_account_by_event_name; @@ -1438,7 +1438,7 @@ user4 localhost wait/io/table/sql/handler 0 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 32 user2 wait/io/table/sql/handler 35 user2 wait/lock/table/sql/handler 24 @@ -1448,31 +1448,31 @@ user4 wait/io/table/sql/handler 61 user4 wait/lock/table/sql/handler 24 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 167 +localhost wait/io/table/sql/handler 168 localhost wait/lock/table/sql/handler 104 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 167 +wait/io/table/sql/handler 168 wait/lock/table/sql/handler 104 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 47 TABLE test t1 +wait/io/table/sql/handler 48 TABLE test t1 wait/lock/table/sql/handler 44 TABLE test t1 wait/io/table/sql/handler 120 TABLE test t3 wait/lock/table/sql/handler 60 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t3 NULL 106 64 42 64 12 30 0 TABLE test t3 index_b 10 10 0 10 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -1480,7 +1480,7 @@ TABLE test t1 44 18 26 8 0 0 1 9 0 13 TABLE test t3 60 18 42 8 0 0 1 9 0 21 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 91 +TABLE test t1 92 TABLE test t2 0 TABLE test t3 180 truncate performance_schema.events_waits_summary_by_user_by_event_name; @@ -1517,31 +1517,31 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 167 +localhost wait/io/table/sql/handler 168 localhost wait/lock/table/sql/handler 104 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 167 +wait/io/table/sql/handler 168 wait/lock/table/sql/handler 104 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 47 TABLE test t1 +wait/io/table/sql/handler 48 TABLE test t1 wait/lock/table/sql/handler 44 TABLE test t1 wait/io/table/sql/handler 120 TABLE test t3 wait/lock/table/sql/handler 60 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t3 NULL 106 64 42 64 12 30 0 TABLE test t3 index_b 10 10 0 10 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -1549,7 +1549,7 @@ TABLE test t1 44 18 26 8 0 0 1 9 0 13 TABLE test t3 60 18 42 8 0 0 1 9 0 21 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 91 +TABLE test t1 92 TABLE test t2 0 TABLE test t3 180 truncate performance_schema.events_waits_summary_by_host_by_event_name; @@ -1590,27 +1590,27 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 167 +wait/io/table/sql/handler 168 wait/lock/table/sql/handler 104 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 47 TABLE test t1 +wait/io/table/sql/handler 48 TABLE test t1 wait/lock/table/sql/handler 44 TABLE test t1 wait/io/table/sql/handler 120 TABLE test t3 wait/lock/table/sql/handler 60 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t3 NULL 106 64 42 64 12 30 0 TABLE test t3 index_b 10 10 0 10 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -1618,7 +1618,7 @@ TABLE test t1 44 18 26 8 0 0 1 9 0 13 TABLE test t3 60 18 42 8 0 0 1 9 0 21 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 91 +TABLE test t1 92 TABLE test t2 0 TABLE test t3 180 truncate performance_schema.events_waits_summary_global_by_event_name; @@ -1663,7 +1663,7 @@ wait/io/table/sql/handler 0 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 47 TABLE test t1 +wait/io/table/sql/handler 48 TABLE test t1 wait/lock/table/sql/handler 44 TABLE test t1 wait/io/table/sql/handler 120 TABLE test t3 wait/lock/table/sql/handler 60 TABLE test t3 diff --git a/mysql-test/suite/perfschema/r/table_aggregate_hist_4u_3t.result b/mysql-test/suite/perfschema/r/table_aggregate_hist_4u_3t.result index c2eda2b8f23..349fa5ae5eb 100644 --- a/mysql-test/suite/perfschema/r/table_aggregate_hist_4u_3t.result +++ b/mysql-test/suite/perfschema/r/table_aggregate_hist_4u_3t.result @@ -185,7 +185,7 @@ connection default; "================== Step 3-A ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 36 username status user2 not found @@ -195,23 +195,23 @@ username status user4 not found execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 33 +user1 localhost wait/io/table/sql/handler 34 user1 localhost wait/lock/table/sql/handler 36 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 36 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 33 +localhost wait/io/table/sql/handler 34 localhost wait/lock/table/sql/handler 36 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 33 +wait/io/table/sql/handler 34 wait/lock/table/sql/handler 36 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 8 TABLE test t1 +wait/io/table/sql/handler 9 TABLE test t1 wait/lock/table/sql/handler 10 TABLE test t1 wait/io/table/sql/handler 10 TABLE test t2 wait/lock/table/sql/handler 12 TABLE test t2 @@ -219,10 +219,10 @@ wait/io/table/sql/handler 15 TABLE test t3 wait/lock/table/sql/handler 14 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 6 4 2 4 1 1 0 +TABLE test t1 NULL 9 6 3 6 1 2 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 2 1 1 1 0 1 0 +TABLE test t1 PRIMARY 0 0 0 0 0 0 0 TABLE test t2 NULL 9 5 4 5 2 2 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -233,7 +233,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 1 1 0 1 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 8 5 3 5 1 2 0 +TABLE test t1 9 6 3 6 1 2 0 TABLE test t2 10 6 4 6 2 2 0 TABLE test t3 15 9 6 9 3 3 0 execute dump_waits_table_lock; @@ -243,7 +243,7 @@ TABLE test t2 12 4 8 2 0 0 0 2 0 4 TABLE test t3 14 4 10 2 0 0 0 2 0 5 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 18 +TABLE test t1 19 TABLE test t2 22 TABLE test t3 29 connection con1; @@ -253,7 +253,7 @@ connection default; "================== Step 3-B ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 36 username status user2 not found @@ -263,23 +263,23 @@ username status user4 not found execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 33 +user1 localhost wait/io/table/sql/handler 34 user1 localhost wait/lock/table/sql/handler 36 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 36 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 33 +localhost wait/io/table/sql/handler 34 localhost wait/lock/table/sql/handler 36 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 33 +wait/io/table/sql/handler 34 wait/lock/table/sql/handler 36 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 8 TABLE test t1 +wait/io/table/sql/handler 9 TABLE test t1 wait/lock/table/sql/handler 10 TABLE test t1 wait/io/table/sql/handler 10 TABLE test t2 wait/lock/table/sql/handler 12 TABLE test t2 @@ -287,10 +287,10 @@ wait/io/table/sql/handler 15 TABLE test t3 wait/lock/table/sql/handler 14 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 6 4 2 4 1 1 0 +TABLE test t1 NULL 9 6 3 6 1 2 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 2 1 1 1 0 1 0 +TABLE test t1 PRIMARY 0 0 0 0 0 0 0 TABLE test t2 NULL 9 5 4 5 2 2 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -301,7 +301,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 1 1 0 1 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 8 5 3 5 1 2 0 +TABLE test t1 9 6 3 6 1 2 0 TABLE test t2 10 6 4 6 2 2 0 TABLE test t3 15 9 6 9 3 3 0 execute dump_waits_table_lock; @@ -311,7 +311,7 @@ TABLE test t2 12 4 8 2 0 0 0 2 0 4 TABLE test t3 14 4 10 2 0 0 0 2 0 5 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 18 +TABLE test t1 19 TABLE test t2 22 TABLE test t3 29 connect con2, localhost, user2, , ; @@ -322,7 +322,7 @@ connection default; "================== Step 4 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 36 username event_name count_star user2 wait/io/table/sql/handler 0 @@ -333,27 +333,27 @@ username status user4 not found execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 33 +user1 localhost wait/io/table/sql/handler 34 user1 localhost wait/lock/table/sql/handler 36 user2 localhost wait/io/table/sql/handler 0 user2 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 36 user2 wait/io/table/sql/handler 0 user2 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 33 +localhost wait/io/table/sql/handler 34 localhost wait/lock/table/sql/handler 36 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 33 +wait/io/table/sql/handler 34 wait/lock/table/sql/handler 36 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 8 TABLE test t1 +wait/io/table/sql/handler 9 TABLE test t1 wait/lock/table/sql/handler 10 TABLE test t1 wait/io/table/sql/handler 10 TABLE test t2 wait/lock/table/sql/handler 12 TABLE test t2 @@ -361,10 +361,10 @@ wait/io/table/sql/handler 15 TABLE test t3 wait/lock/table/sql/handler 14 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 6 4 2 4 1 1 0 +TABLE test t1 NULL 9 6 3 6 1 2 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 2 1 1 1 0 1 0 +TABLE test t1 PRIMARY 0 0 0 0 0 0 0 TABLE test t2 NULL 9 5 4 5 2 2 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -375,7 +375,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 1 1 0 1 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 8 5 3 5 1 2 0 +TABLE test t1 9 6 3 6 1 2 0 TABLE test t2 10 6 4 6 2 2 0 TABLE test t3 15 9 6 9 3 3 0 execute dump_waits_table_lock; @@ -385,7 +385,7 @@ TABLE test t2 12 4 8 2 0 0 0 2 0 4 TABLE test t3 14 4 10 2 0 0 0 2 0 5 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 18 +TABLE test t1 19 TABLE test t2 22 TABLE test t3 29 connection con2; @@ -431,7 +431,7 @@ connection default; "================== Step 5 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 36 username event_name count_star user2 wait/io/table/sql/handler 51 @@ -442,27 +442,27 @@ username status user4 not found execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 33 +user1 localhost wait/io/table/sql/handler 34 user1 localhost wait/lock/table/sql/handler 36 user2 localhost wait/io/table/sql/handler 51 user2 localhost wait/lock/table/sql/handler 36 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 36 user2 wait/io/table/sql/handler 51 user2 wait/lock/table/sql/handler 36 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 84 +localhost wait/io/table/sql/handler 85 localhost wait/lock/table/sql/handler 72 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 84 +wait/io/table/sql/handler 85 wait/lock/table/sql/handler 72 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 18 TABLE test t1 +wait/io/table/sql/handler 19 TABLE test t1 wait/lock/table/sql/handler 20 TABLE test t1 wait/io/table/sql/handler 26 TABLE test t2 wait/lock/table/sql/handler 24 TABLE test t2 @@ -470,10 +470,10 @@ wait/io/table/sql/handler 40 TABLE test t3 wait/lock/table/sql/handler 28 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 14 9 5 9 2 3 0 +TABLE test t1 NULL 17 11 6 11 2 4 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t2 NULL 24 14 10 14 4 6 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -484,7 +484,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 18 11 7 11 2 5 0 +TABLE test t1 19 12 7 12 2 5 0 TABLE test t2 26 16 10 16 4 6 0 TABLE test t3 40 25 15 25 6 9 0 execute dump_waits_table_lock; @@ -494,7 +494,7 @@ TABLE test t2 24 8 16 4 0 0 0 4 0 8 TABLE test t3 28 8 20 4 0 0 0 4 0 10 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 38 +TABLE test t1 39 TABLE test t2 50 TABLE test t3 68 connect con3, localhost, user3, , ; @@ -505,7 +505,7 @@ connection default; "================== Step 6 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 36 username event_name count_star user2 wait/io/table/sql/handler 51 @@ -517,7 +517,7 @@ username status user4 not found execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 33 +user1 localhost wait/io/table/sql/handler 34 user1 localhost wait/lock/table/sql/handler 36 user2 localhost wait/io/table/sql/handler 51 user2 localhost wait/lock/table/sql/handler 36 @@ -525,7 +525,7 @@ user3 localhost wait/io/table/sql/handler 0 user3 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 36 user2 wait/io/table/sql/handler 51 user2 wait/lock/table/sql/handler 36 @@ -533,15 +533,15 @@ user3 wait/io/table/sql/handler 0 user3 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 84 +localhost wait/io/table/sql/handler 85 localhost wait/lock/table/sql/handler 72 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 84 +wait/io/table/sql/handler 85 wait/lock/table/sql/handler 72 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 18 TABLE test t1 +wait/io/table/sql/handler 19 TABLE test t1 wait/lock/table/sql/handler 20 TABLE test t1 wait/io/table/sql/handler 26 TABLE test t2 wait/lock/table/sql/handler 24 TABLE test t2 @@ -549,10 +549,10 @@ wait/io/table/sql/handler 40 TABLE test t3 wait/lock/table/sql/handler 28 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 14 9 5 9 2 3 0 +TABLE test t1 NULL 17 11 6 11 2 4 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t2 NULL 24 14 10 14 4 6 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -563,7 +563,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 18 11 7 11 2 5 0 +TABLE test t1 19 12 7 12 2 5 0 TABLE test t2 26 16 10 16 4 6 0 TABLE test t3 40 25 15 25 6 9 0 execute dump_waits_table_lock; @@ -573,7 +573,7 @@ TABLE test t2 24 8 16 4 0 0 0 4 0 8 TABLE test t3 28 8 20 4 0 0 0 4 0 10 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 38 +TABLE test t1 39 TABLE test t2 50 TABLE test t3 68 connection con3; @@ -626,7 +626,7 @@ connection default; "================== Step 7 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 36 username event_name count_star user2 wait/io/table/sql/handler 51 @@ -638,7 +638,7 @@ username status user4 not found execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 33 +user1 localhost wait/io/table/sql/handler 34 user1 localhost wait/lock/table/sql/handler 36 user2 localhost wait/io/table/sql/handler 51 user2 localhost wait/lock/table/sql/handler 36 @@ -646,7 +646,7 @@ user3 localhost wait/io/table/sql/handler 70 user3 localhost wait/lock/table/sql/handler 36 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 36 user2 wait/io/table/sql/handler 51 user2 wait/lock/table/sql/handler 36 @@ -654,15 +654,15 @@ user3 wait/io/table/sql/handler 70 user3 wait/lock/table/sql/handler 36 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 154 +localhost wait/io/table/sql/handler 155 localhost wait/lock/table/sql/handler 108 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 154 +wait/io/table/sql/handler 155 wait/lock/table/sql/handler 108 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 31 TABLE test t1 +wait/io/table/sql/handler 32 TABLE test t1 wait/lock/table/sql/handler 30 TABLE test t1 wait/io/table/sql/handler 48 TABLE test t2 wait/lock/table/sql/handler 36 TABLE test t2 @@ -670,10 +670,10 @@ wait/io/table/sql/handler 75 TABLE test t3 wait/lock/table/sql/handler 42 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 25 16 9 16 3 6 0 +TABLE test t1 NULL 28 18 10 18 3 7 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 6 3 3 3 0 3 0 +TABLE test t1 PRIMARY 4 2 2 2 0 2 0 TABLE test t2 NULL 45 27 18 27 6 12 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -684,7 +684,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 3 3 0 3 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 31 19 12 19 3 9 0 +TABLE test t1 32 20 12 20 3 9 0 TABLE test t2 48 30 18 30 6 12 0 TABLE test t3 75 48 27 48 9 18 0 execute dump_waits_table_lock; @@ -694,7 +694,7 @@ TABLE test t2 36 12 24 6 0 0 0 6 0 12 TABLE test t3 42 12 30 6 0 0 0 6 0 15 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 61 +TABLE test t1 62 TABLE test t2 84 TABLE test t3 117 connect con4, localhost, user4, , ; @@ -705,7 +705,7 @@ connection default; "================== Step 8 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 36 username event_name count_star user2 wait/io/table/sql/handler 51 @@ -718,7 +718,7 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 33 +user1 localhost wait/io/table/sql/handler 34 user1 localhost wait/lock/table/sql/handler 36 user2 localhost wait/io/table/sql/handler 51 user2 localhost wait/lock/table/sql/handler 36 @@ -728,7 +728,7 @@ user4 localhost wait/io/table/sql/handler 0 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 36 user2 wait/io/table/sql/handler 51 user2 wait/lock/table/sql/handler 36 @@ -738,15 +738,15 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 154 +localhost wait/io/table/sql/handler 155 localhost wait/lock/table/sql/handler 108 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 154 +wait/io/table/sql/handler 155 wait/lock/table/sql/handler 108 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 31 TABLE test t1 +wait/io/table/sql/handler 32 TABLE test t1 wait/lock/table/sql/handler 30 TABLE test t1 wait/io/table/sql/handler 48 TABLE test t2 wait/lock/table/sql/handler 36 TABLE test t2 @@ -754,10 +754,10 @@ wait/io/table/sql/handler 75 TABLE test t3 wait/lock/table/sql/handler 42 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 25 16 9 16 3 6 0 +TABLE test t1 NULL 28 18 10 18 3 7 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 6 3 3 3 0 3 0 +TABLE test t1 PRIMARY 4 2 2 2 0 2 0 TABLE test t2 NULL 45 27 18 27 6 12 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -768,7 +768,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 3 3 0 3 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 31 19 12 19 3 9 0 +TABLE test t1 32 20 12 20 3 9 0 TABLE test t2 48 30 18 30 6 12 0 TABLE test t3 75 48 27 48 9 18 0 execute dump_waits_table_lock; @@ -778,7 +778,7 @@ TABLE test t2 36 12 24 6 0 0 0 6 0 12 TABLE test t3 42 12 30 6 0 0 0 6 0 15 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 61 +TABLE test t1 62 TABLE test t2 84 TABLE test t3 117 connection con4; @@ -838,7 +838,7 @@ connection default; "================== Step 9 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 36 username event_name count_star user2 wait/io/table/sql/handler 51 @@ -851,7 +851,7 @@ user4 wait/io/table/sql/handler 89 user4 wait/lock/table/sql/handler 36 execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 33 +user1 localhost wait/io/table/sql/handler 34 user1 localhost wait/lock/table/sql/handler 36 user2 localhost wait/io/table/sql/handler 51 user2 localhost wait/lock/table/sql/handler 36 @@ -861,7 +861,7 @@ user4 localhost wait/io/table/sql/handler 89 user4 localhost wait/lock/table/sql/handler 36 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 36 user2 wait/io/table/sql/handler 51 user2 wait/lock/table/sql/handler 36 @@ -871,15 +871,15 @@ user4 wait/io/table/sql/handler 89 user4 wait/lock/table/sql/handler 36 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 243 +localhost wait/io/table/sql/handler 244 localhost wait/lock/table/sql/handler 144 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 243 +wait/io/table/sql/handler 244 wait/lock/table/sql/handler 144 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 47 TABLE test t1 +wait/io/table/sql/handler 48 TABLE test t1 wait/lock/table/sql/handler 40 TABLE test t1 wait/io/table/sql/handler 76 TABLE test t2 wait/lock/table/sql/handler 48 TABLE test t2 @@ -887,10 +887,10 @@ wait/io/table/sql/handler 120 TABLE test t3 wait/lock/table/sql/handler 56 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t2 NULL 72 44 28 44 8 20 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -901,7 +901,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t2 76 48 28 48 8 20 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; @@ -911,7 +911,7 @@ TABLE test t2 48 16 32 8 0 0 0 8 0 16 TABLE test t3 56 16 40 8 0 0 0 8 0 20 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 87 +TABLE test t1 88 TABLE test t2 124 TABLE test t3 176 connection con1; @@ -923,7 +923,7 @@ connection default; "================== Step 10 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 48 username event_name count_star user2 wait/io/table/sql/handler 51 @@ -936,7 +936,7 @@ user4 wait/io/table/sql/handler 89 user4 wait/lock/table/sql/handler 36 execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 33 +user1 localhost wait/io/table/sql/handler 34 user1 localhost wait/lock/table/sql/handler 48 user2 localhost wait/io/table/sql/handler 51 user2 localhost wait/lock/table/sql/handler 36 @@ -946,7 +946,7 @@ user4 localhost wait/io/table/sql/handler 89 user4 localhost wait/lock/table/sql/handler 36 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 48 user2 wait/io/table/sql/handler 51 user2 wait/lock/table/sql/handler 36 @@ -956,15 +956,15 @@ user4 wait/io/table/sql/handler 89 user4 wait/lock/table/sql/handler 36 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 243 +localhost wait/io/table/sql/handler 244 localhost wait/lock/table/sql/handler 156 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 243 +wait/io/table/sql/handler 244 wait/lock/table/sql/handler 156 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 47 TABLE test t1 +wait/io/table/sql/handler 48 TABLE test t1 wait/lock/table/sql/handler 44 TABLE test t1 wait/io/table/sql/handler 76 TABLE test t2 wait/lock/table/sql/handler 52 TABLE test t2 @@ -972,10 +972,10 @@ wait/io/table/sql/handler 120 TABLE test t3 wait/lock/table/sql/handler 60 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t2 NULL 72 44 28 44 8 20 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -986,7 +986,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t2 76 48 28 48 8 20 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; @@ -996,7 +996,7 @@ TABLE test t2 52 18 34 8 0 0 1 9 0 17 TABLE test t3 60 18 42 8 0 0 1 9 0 21 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 91 +TABLE test t1 92 TABLE test t2 128 TABLE test t3 180 connection default; @@ -1005,7 +1005,7 @@ flush tables; "================== Step 11 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 48 username event_name count_star user2 wait/io/table/sql/handler 51 @@ -1018,7 +1018,7 @@ user4 wait/io/table/sql/handler 89 user4 wait/lock/table/sql/handler 36 execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 33 +user1 localhost wait/io/table/sql/handler 34 user1 localhost wait/lock/table/sql/handler 48 user2 localhost wait/io/table/sql/handler 51 user2 localhost wait/lock/table/sql/handler 36 @@ -1028,7 +1028,7 @@ user4 localhost wait/io/table/sql/handler 89 user4 localhost wait/lock/table/sql/handler 36 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 48 user2 wait/io/table/sql/handler 51 user2 wait/lock/table/sql/handler 36 @@ -1038,15 +1038,15 @@ user4 wait/io/table/sql/handler 89 user4 wait/lock/table/sql/handler 36 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 243 +localhost wait/io/table/sql/handler 244 localhost wait/lock/table/sql/handler 156 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 243 +wait/io/table/sql/handler 244 wait/lock/table/sql/handler 156 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 47 TABLE test t1 +wait/io/table/sql/handler 48 TABLE test t1 wait/lock/table/sql/handler 44 TABLE test t1 wait/io/table/sql/handler 76 TABLE test t2 wait/lock/table/sql/handler 52 TABLE test t2 @@ -1054,10 +1054,10 @@ wait/io/table/sql/handler 120 TABLE test t3 wait/lock/table/sql/handler 60 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t2 NULL 72 44 28 44 8 20 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -1068,7 +1068,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t2 76 48 28 48 8 20 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; @@ -1078,7 +1078,7 @@ TABLE test t2 52 18 34 8 0 0 1 9 0 17 TABLE test t3 60 18 42 8 0 0 1 9 0 21 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 91 +TABLE test t1 92 TABLE test t2 128 TABLE test t3 180 set global read_only=1; @@ -1087,7 +1087,7 @@ set global read_only=0; "================== Step 12 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 48 username event_name count_star user2 wait/io/table/sql/handler 51 @@ -1100,7 +1100,7 @@ user4 wait/io/table/sql/handler 89 user4 wait/lock/table/sql/handler 36 execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 33 +user1 localhost wait/io/table/sql/handler 34 user1 localhost wait/lock/table/sql/handler 48 user2 localhost wait/io/table/sql/handler 51 user2 localhost wait/lock/table/sql/handler 36 @@ -1110,7 +1110,7 @@ user4 localhost wait/io/table/sql/handler 89 user4 localhost wait/lock/table/sql/handler 36 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 48 user2 wait/io/table/sql/handler 51 user2 wait/lock/table/sql/handler 36 @@ -1120,15 +1120,15 @@ user4 wait/io/table/sql/handler 89 user4 wait/lock/table/sql/handler 36 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 243 +localhost wait/io/table/sql/handler 244 localhost wait/lock/table/sql/handler 156 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 243 +wait/io/table/sql/handler 244 wait/lock/table/sql/handler 156 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 47 TABLE test t1 +wait/io/table/sql/handler 48 TABLE test t1 wait/lock/table/sql/handler 44 TABLE test t1 wait/io/table/sql/handler 76 TABLE test t2 wait/lock/table/sql/handler 52 TABLE test t2 @@ -1136,10 +1136,10 @@ wait/io/table/sql/handler 120 TABLE test t3 wait/lock/table/sql/handler 60 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t2 NULL 72 44 28 44 8 20 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -1150,7 +1150,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t2 76 48 28 48 8 20 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; @@ -1160,7 +1160,7 @@ TABLE test t2 52 18 34 8 0 0 1 9 0 17 TABLE test t3 60 18 42 8 0 0 1 9 0 21 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 91 +TABLE test t1 92 TABLE test t2 128 TABLE test t3 180 disconnect con1; @@ -1179,7 +1179,7 @@ user4 wait/io/table/sql/handler 89 user4 wait/lock/table/sql/handler 36 execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 33 +user1 localhost wait/io/table/sql/handler 34 user1 localhost wait/lock/table/sql/handler 48 user2 localhost wait/io/table/sql/handler 51 user2 localhost wait/lock/table/sql/handler 36 @@ -1189,7 +1189,7 @@ user4 localhost wait/io/table/sql/handler 89 user4 localhost wait/lock/table/sql/handler 36 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 48 user2 wait/io/table/sql/handler 51 user2 wait/lock/table/sql/handler 36 @@ -1199,15 +1199,15 @@ user4 wait/io/table/sql/handler 89 user4 wait/lock/table/sql/handler 36 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 243 +localhost wait/io/table/sql/handler 244 localhost wait/lock/table/sql/handler 156 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 243 +wait/io/table/sql/handler 244 wait/lock/table/sql/handler 156 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 47 TABLE test t1 +wait/io/table/sql/handler 48 TABLE test t1 wait/lock/table/sql/handler 44 TABLE test t1 wait/io/table/sql/handler 76 TABLE test t2 wait/lock/table/sql/handler 52 TABLE test t2 @@ -1215,10 +1215,10 @@ wait/io/table/sql/handler 120 TABLE test t3 wait/lock/table/sql/handler 60 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t2 NULL 72 44 28 44 8 20 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -1229,7 +1229,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t2 76 48 28 48 8 20 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; @@ -1239,7 +1239,7 @@ TABLE test t2 52 18 34 8 0 0 1 9 0 17 TABLE test t3 60 18 42 8 0 0 1 9 0 21 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 91 +TABLE test t1 92 TABLE test t2 128 TABLE test t3 180 disconnect con2; @@ -1257,7 +1257,7 @@ user4 wait/io/table/sql/handler 89 user4 wait/lock/table/sql/handler 36 execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 33 +user1 localhost wait/io/table/sql/handler 34 user1 localhost wait/lock/table/sql/handler 48 user2 localhost wait/io/table/sql/handler 51 user2 localhost wait/lock/table/sql/handler 36 @@ -1267,7 +1267,7 @@ user4 localhost wait/io/table/sql/handler 89 user4 localhost wait/lock/table/sql/handler 36 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 48 user2 wait/io/table/sql/handler 51 user2 wait/lock/table/sql/handler 36 @@ -1277,15 +1277,15 @@ user4 wait/io/table/sql/handler 89 user4 wait/lock/table/sql/handler 36 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 243 +localhost wait/io/table/sql/handler 244 localhost wait/lock/table/sql/handler 156 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 243 +wait/io/table/sql/handler 244 wait/lock/table/sql/handler 156 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 47 TABLE test t1 +wait/io/table/sql/handler 48 TABLE test t1 wait/lock/table/sql/handler 44 TABLE test t1 wait/io/table/sql/handler 76 TABLE test t2 wait/lock/table/sql/handler 52 TABLE test t2 @@ -1293,10 +1293,10 @@ wait/io/table/sql/handler 120 TABLE test t3 wait/lock/table/sql/handler 60 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t2 NULL 72 44 28 44 8 20 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -1307,7 +1307,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t2 76 48 28 48 8 20 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; @@ -1317,7 +1317,7 @@ TABLE test t2 52 18 34 8 0 0 1 9 0 17 TABLE test t3 60 18 42 8 0 0 1 9 0 21 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 91 +TABLE test t1 92 TABLE test t2 128 TABLE test t3 180 disconnect con3; @@ -1334,7 +1334,7 @@ user4 wait/io/table/sql/handler 89 user4 wait/lock/table/sql/handler 36 execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 33 +user1 localhost wait/io/table/sql/handler 34 user1 localhost wait/lock/table/sql/handler 48 user2 localhost wait/io/table/sql/handler 51 user2 localhost wait/lock/table/sql/handler 36 @@ -1344,7 +1344,7 @@ user4 localhost wait/io/table/sql/handler 89 user4 localhost wait/lock/table/sql/handler 36 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 48 user2 wait/io/table/sql/handler 51 user2 wait/lock/table/sql/handler 36 @@ -1354,15 +1354,15 @@ user4 wait/io/table/sql/handler 89 user4 wait/lock/table/sql/handler 36 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 243 +localhost wait/io/table/sql/handler 244 localhost wait/lock/table/sql/handler 156 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 243 +wait/io/table/sql/handler 244 wait/lock/table/sql/handler 156 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 47 TABLE test t1 +wait/io/table/sql/handler 48 TABLE test t1 wait/lock/table/sql/handler 44 TABLE test t1 wait/io/table/sql/handler 76 TABLE test t2 wait/lock/table/sql/handler 52 TABLE test t2 @@ -1370,10 +1370,10 @@ wait/io/table/sql/handler 120 TABLE test t3 wait/lock/table/sql/handler 60 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t2 NULL 72 44 28 44 8 20 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -1384,7 +1384,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t2 76 48 28 48 8 20 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; @@ -1394,7 +1394,7 @@ TABLE test t2 52 18 34 8 0 0 1 9 0 17 TABLE test t3 60 18 42 8 0 0 1 9 0 21 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 91 +TABLE test t1 92 TABLE test t2 128 TABLE test t3 180 disconnect con4; @@ -1410,7 +1410,7 @@ username status user4 not found execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 33 +user1 localhost wait/io/table/sql/handler 34 user1 localhost wait/lock/table/sql/handler 48 user2 localhost wait/io/table/sql/handler 51 user2 localhost wait/lock/table/sql/handler 36 @@ -1420,7 +1420,7 @@ user4 localhost wait/io/table/sql/handler 89 user4 localhost wait/lock/table/sql/handler 36 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 48 user2 wait/io/table/sql/handler 51 user2 wait/lock/table/sql/handler 36 @@ -1430,15 +1430,15 @@ user4 wait/io/table/sql/handler 89 user4 wait/lock/table/sql/handler 36 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 243 +localhost wait/io/table/sql/handler 244 localhost wait/lock/table/sql/handler 156 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 243 +wait/io/table/sql/handler 244 wait/lock/table/sql/handler 156 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 47 TABLE test t1 +wait/io/table/sql/handler 48 TABLE test t1 wait/lock/table/sql/handler 44 TABLE test t1 wait/io/table/sql/handler 76 TABLE test t2 wait/lock/table/sql/handler 52 TABLE test t2 @@ -1446,10 +1446,10 @@ wait/io/table/sql/handler 120 TABLE test t3 wait/lock/table/sql/handler 60 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t2 NULL 72 44 28 44 8 20 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -1460,7 +1460,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t2 76 48 28 48 8 20 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; @@ -1470,7 +1470,7 @@ TABLE test t2 52 18 34 8 0 0 1 9 0 17 TABLE test t3 60 18 42 8 0 0 1 9 0 21 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 91 +TABLE test t1 92 TABLE test t2 128 TABLE test t3 180 connection default; @@ -1488,7 +1488,7 @@ username status user4 not found execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 33 +user1 localhost wait/io/table/sql/handler 34 user1 localhost wait/lock/table/sql/handler 48 user2 localhost wait/io/table/sql/handler 51 user2 localhost wait/lock/table/sql/handler 36 @@ -1498,7 +1498,7 @@ user4 localhost wait/io/table/sql/handler 89 user4 localhost wait/lock/table/sql/handler 36 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 48 user2 wait/io/table/sql/handler 51 user2 wait/lock/table/sql/handler 36 @@ -1508,15 +1508,15 @@ user4 wait/io/table/sql/handler 89 user4 wait/lock/table/sql/handler 36 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 243 +localhost wait/io/table/sql/handler 244 localhost wait/lock/table/sql/handler 156 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 243 +wait/io/table/sql/handler 244 wait/lock/table/sql/handler 156 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 47 TABLE test t1 +wait/io/table/sql/handler 48 TABLE test t1 wait/lock/table/sql/handler 44 TABLE test t1 wait/io/table/sql/handler 76 TABLE test t2 wait/lock/table/sql/handler 52 TABLE test t2 @@ -1524,10 +1524,10 @@ wait/io/table/sql/handler 120 TABLE test t3 wait/lock/table/sql/handler 60 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t2 NULL 72 44 28 44 8 20 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -1538,7 +1538,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t2 76 48 28 48 8 20 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; @@ -1548,7 +1548,7 @@ TABLE test t2 52 18 34 8 0 0 1 9 0 17 TABLE test t3 60 18 42 8 0 0 1 9 0 21 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 91 +TABLE test t1 92 TABLE test t2 128 TABLE test t3 180 truncate performance_schema.events_waits_summary_by_account_by_event_name; @@ -1575,7 +1575,7 @@ user4 localhost wait/io/table/sql/handler 0 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 48 user2 wait/io/table/sql/handler 51 user2 wait/lock/table/sql/handler 36 @@ -1585,15 +1585,15 @@ user4 wait/io/table/sql/handler 89 user4 wait/lock/table/sql/handler 36 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 243 +localhost wait/io/table/sql/handler 244 localhost wait/lock/table/sql/handler 156 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 243 +wait/io/table/sql/handler 244 wait/lock/table/sql/handler 156 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 47 TABLE test t1 +wait/io/table/sql/handler 48 TABLE test t1 wait/lock/table/sql/handler 44 TABLE test t1 wait/io/table/sql/handler 76 TABLE test t2 wait/lock/table/sql/handler 52 TABLE test t2 @@ -1601,10 +1601,10 @@ wait/io/table/sql/handler 120 TABLE test t3 wait/lock/table/sql/handler 60 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t2 NULL 72 44 28 44 8 20 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -1615,7 +1615,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t2 76 48 28 48 8 20 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; @@ -1625,7 +1625,7 @@ TABLE test t2 52 18 34 8 0 0 1 9 0 17 TABLE test t3 60 18 42 8 0 0 1 9 0 21 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 91 +TABLE test t1 92 TABLE test t2 128 TABLE test t3 180 truncate performance_schema.events_waits_summary_by_user_by_event_name; @@ -1662,15 +1662,15 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 243 +localhost wait/io/table/sql/handler 244 localhost wait/lock/table/sql/handler 156 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 243 +wait/io/table/sql/handler 244 wait/lock/table/sql/handler 156 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 47 TABLE test t1 +wait/io/table/sql/handler 48 TABLE test t1 wait/lock/table/sql/handler 44 TABLE test t1 wait/io/table/sql/handler 76 TABLE test t2 wait/lock/table/sql/handler 52 TABLE test t2 @@ -1678,10 +1678,10 @@ wait/io/table/sql/handler 120 TABLE test t3 wait/lock/table/sql/handler 60 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t2 NULL 72 44 28 44 8 20 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -1692,7 +1692,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t2 76 48 28 48 8 20 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; @@ -1702,7 +1702,7 @@ TABLE test t2 52 18 34 8 0 0 1 9 0 17 TABLE test t3 60 18 42 8 0 0 1 9 0 21 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 91 +TABLE test t1 92 TABLE test t2 128 TABLE test t3 180 truncate performance_schema.events_waits_summary_by_host_by_event_name; @@ -1743,11 +1743,11 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 243 +wait/io/table/sql/handler 244 wait/lock/table/sql/handler 156 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 47 TABLE test t1 +wait/io/table/sql/handler 48 TABLE test t1 wait/lock/table/sql/handler 44 TABLE test t1 wait/io/table/sql/handler 76 TABLE test t2 wait/lock/table/sql/handler 52 TABLE test t2 @@ -1755,10 +1755,10 @@ wait/io/table/sql/handler 120 TABLE test t3 wait/lock/table/sql/handler 60 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t2 NULL 72 44 28 44 8 20 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -1769,7 +1769,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t2 76 48 28 48 8 20 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; @@ -1779,7 +1779,7 @@ TABLE test t2 52 18 34 8 0 0 1 9 0 17 TABLE test t3 60 18 42 8 0 0 1 9 0 21 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 91 +TABLE test t1 92 TABLE test t2 128 TABLE test t3 180 truncate performance_schema.events_waits_summary_global_by_event_name; @@ -1824,7 +1824,7 @@ wait/io/table/sql/handler 0 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 47 TABLE test t1 +wait/io/table/sql/handler 48 TABLE test t1 wait/lock/table/sql/handler 44 TABLE test t1 wait/io/table/sql/handler 76 TABLE test t2 wait/lock/table/sql/handler 52 TABLE test t2 diff --git a/mysql-test/suite/perfschema/r/table_aggregate_thread_2u_2t.result b/mysql-test/suite/perfschema/r/table_aggregate_thread_2u_2t.result index eb4bdc0317e..b983c3480c6 100644 --- a/mysql-test/suite/perfschema/r/table_aggregate_thread_2u_2t.result +++ b/mysql-test/suite/perfschema/r/table_aggregate_thread_2u_2t.result @@ -178,7 +178,7 @@ connection default; "================== Step 3-A ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 24 username status user2 not found @@ -188,35 +188,35 @@ username status user4 not found execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 23 +user1 localhost wait/io/table/sql/handler 24 user1 localhost wait/lock/table/sql/handler 24 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 24 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 23 +localhost wait/io/table/sql/handler 24 localhost wait/lock/table/sql/handler 24 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 23 +wait/io/table/sql/handler 24 wait/lock/table/sql/handler 24 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 6 4 2 4 1 1 0 +TABLE test t1 NULL 9 6 3 6 1 2 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 2 1 1 1 0 1 0 +TABLE test t1 PRIMARY 0 0 0 0 0 0 0 TABLE test t3 NULL 13 7 6 7 3 3 0 TABLE test t3 index_b 1 1 0 1 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 1 1 0 1 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 8 5 3 5 1 2 0 +TABLE test t1 9 6 3 6 1 2 0 TABLE test t3 15 9 6 9 3 3 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -224,7 +224,7 @@ TABLE test t1 10 4 6 2 0 0 0 2 0 3 TABLE test t3 14 4 10 2 0 0 0 2 0 5 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 18 +TABLE test t1 19 TABLE test t2 0 TABLE test t3 29 connection con1; @@ -234,7 +234,7 @@ connection default; "================== Step 3-B ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 24 username status user2 not found @@ -244,35 +244,35 @@ username status user4 not found execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 23 +user1 localhost wait/io/table/sql/handler 24 user1 localhost wait/lock/table/sql/handler 24 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 24 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 23 +localhost wait/io/table/sql/handler 24 localhost wait/lock/table/sql/handler 24 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 23 +wait/io/table/sql/handler 24 wait/lock/table/sql/handler 24 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 6 4 2 4 1 1 0 +TABLE test t1 NULL 9 6 3 6 1 2 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 2 1 1 1 0 1 0 +TABLE test t1 PRIMARY 0 0 0 0 0 0 0 TABLE test t3 NULL 13 7 6 7 3 3 0 TABLE test t3 index_b 1 1 0 1 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 1 1 0 1 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 8 5 3 5 1 2 0 +TABLE test t1 9 6 3 6 1 2 0 TABLE test t3 15 9 6 9 3 3 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -280,7 +280,7 @@ TABLE test t1 10 4 6 2 0 0 0 2 0 3 TABLE test t3 14 4 10 2 0 0 0 2 0 5 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 18 +TABLE test t1 19 TABLE test t2 0 TABLE test t3 29 connect con2, localhost, user2, , ; @@ -291,7 +291,7 @@ connection default; "================== Step 4 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 24 username event_name count_star user2 wait/io/table/sql/handler 0 @@ -302,39 +302,39 @@ username status user4 not found execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 23 +user1 localhost wait/io/table/sql/handler 24 user1 localhost wait/lock/table/sql/handler 24 user2 localhost wait/io/table/sql/handler 0 user2 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 24 user2 wait/io/table/sql/handler 0 user2 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 23 +localhost wait/io/table/sql/handler 24 localhost wait/lock/table/sql/handler 24 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 23 +wait/io/table/sql/handler 24 wait/lock/table/sql/handler 24 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 6 4 2 4 1 1 0 +TABLE test t1 NULL 9 6 3 6 1 2 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 2 1 1 1 0 1 0 +TABLE test t1 PRIMARY 0 0 0 0 0 0 0 TABLE test t3 NULL 13 7 6 7 3 3 0 TABLE test t3 index_b 1 1 0 1 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 1 1 0 1 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 8 5 3 5 1 2 0 +TABLE test t1 9 6 3 6 1 2 0 TABLE test t3 15 9 6 9 3 3 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -342,7 +342,7 @@ TABLE test t1 10 4 6 2 0 0 0 2 0 3 TABLE test t3 14 4 10 2 0 0 0 2 0 5 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 18 +TABLE test t1 19 TABLE test t2 0 TABLE test t3 29 connection con2; @@ -388,7 +388,7 @@ connection default; "================== Step 5 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 24 username event_name count_star user2 wait/io/table/sql/handler 0 @@ -399,39 +399,39 @@ username status user4 not found execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 23 +user1 localhost wait/io/table/sql/handler 24 user1 localhost wait/lock/table/sql/handler 24 user2 localhost wait/io/table/sql/handler 0 user2 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 24 user2 wait/io/table/sql/handler 0 user2 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 23 +localhost wait/io/table/sql/handler 24 localhost wait/lock/table/sql/handler 24 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 23 +wait/io/table/sql/handler 24 wait/lock/table/sql/handler 24 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 6 4 2 4 1 1 0 +TABLE test t1 NULL 9 6 3 6 1 2 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 2 1 1 1 0 1 0 +TABLE test t1 PRIMARY 0 0 0 0 0 0 0 TABLE test t3 NULL 13 7 6 7 3 3 0 TABLE test t3 index_b 1 1 0 1 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 1 1 0 1 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 8 5 3 5 1 2 0 +TABLE test t1 9 6 3 6 1 2 0 TABLE test t3 15 9 6 9 3 3 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -439,7 +439,7 @@ TABLE test t1 10 4 6 2 0 0 0 2 0 3 TABLE test t3 14 4 10 2 0 0 0 2 0 5 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 18 +TABLE test t1 19 TABLE test t2 0 TABLE test t3 29 connect con3, localhost, user3, , ; @@ -450,7 +450,7 @@ connection default; "================== Step 6 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 24 username event_name count_star user2 wait/io/table/sql/handler 0 @@ -462,7 +462,7 @@ username status user4 not found execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 23 +user1 localhost wait/io/table/sql/handler 24 user1 localhost wait/lock/table/sql/handler 24 user2 localhost wait/io/table/sql/handler 0 user2 localhost wait/lock/table/sql/handler 0 @@ -470,7 +470,7 @@ user3 localhost wait/io/table/sql/handler 0 user3 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 24 user2 wait/io/table/sql/handler 0 user2 wait/lock/table/sql/handler 0 @@ -478,27 +478,27 @@ user3 wait/io/table/sql/handler 0 user3 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 23 +localhost wait/io/table/sql/handler 24 localhost wait/lock/table/sql/handler 24 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 23 +wait/io/table/sql/handler 24 wait/lock/table/sql/handler 24 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 6 4 2 4 1 1 0 +TABLE test t1 NULL 9 6 3 6 1 2 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 2 1 1 1 0 1 0 +TABLE test t1 PRIMARY 0 0 0 0 0 0 0 TABLE test t3 NULL 13 7 6 7 3 3 0 TABLE test t3 index_b 1 1 0 1 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 1 1 0 1 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 8 5 3 5 1 2 0 +TABLE test t1 9 6 3 6 1 2 0 TABLE test t3 15 9 6 9 3 3 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -506,7 +506,7 @@ TABLE test t1 10 4 6 2 0 0 0 2 0 3 TABLE test t3 14 4 10 2 0 0 0 2 0 5 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 18 +TABLE test t1 19 TABLE test t2 0 TABLE test t3 29 connection con3; @@ -559,7 +559,7 @@ connection default; "================== Step 7 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 24 username event_name count_star user2 wait/io/table/sql/handler 0 @@ -571,7 +571,7 @@ username status user4 not found execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 23 +user1 localhost wait/io/table/sql/handler 24 user1 localhost wait/lock/table/sql/handler 24 user2 localhost wait/io/table/sql/handler 0 user2 localhost wait/lock/table/sql/handler 0 @@ -579,7 +579,7 @@ user3 localhost wait/io/table/sql/handler 48 user3 localhost wait/lock/table/sql/handler 24 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 24 user2 wait/io/table/sql/handler 0 user2 wait/lock/table/sql/handler 0 @@ -587,27 +587,27 @@ user3 wait/io/table/sql/handler 48 user3 wait/lock/table/sql/handler 24 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 71 +localhost wait/io/table/sql/handler 72 localhost wait/lock/table/sql/handler 48 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 71 +wait/io/table/sql/handler 72 wait/lock/table/sql/handler 48 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 17 11 6 11 2 4 0 +TABLE test t1 NULL 20 13 7 13 2 5 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t3 NULL 44 26 18 26 6 12 0 TABLE test t3 index_b 4 4 0 4 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 21 13 8 13 2 6 0 +TABLE test t1 22 14 8 14 2 6 0 TABLE test t3 50 32 18 32 6 12 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -615,7 +615,7 @@ TABLE test t1 20 8 12 4 0 0 0 4 0 6 TABLE test t3 28 8 20 4 0 0 0 4 0 10 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 41 +TABLE test t1 42 TABLE test t2 0 TABLE test t3 78 connect con4, localhost, user4, , ; @@ -626,7 +626,7 @@ connection default; "================== Step 8 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 24 username event_name count_star user2 wait/io/table/sql/handler 0 @@ -639,7 +639,7 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 23 +user1 localhost wait/io/table/sql/handler 24 user1 localhost wait/lock/table/sql/handler 24 user2 localhost wait/io/table/sql/handler 0 user2 localhost wait/lock/table/sql/handler 0 @@ -649,7 +649,7 @@ user4 localhost wait/io/table/sql/handler 0 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 24 user2 wait/io/table/sql/handler 0 user2 wait/lock/table/sql/handler 0 @@ -659,27 +659,27 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 71 +localhost wait/io/table/sql/handler 72 localhost wait/lock/table/sql/handler 48 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 71 +wait/io/table/sql/handler 72 wait/lock/table/sql/handler 48 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 17 11 6 11 2 4 0 +TABLE test t1 NULL 20 13 7 13 2 5 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t3 NULL 44 26 18 26 6 12 0 TABLE test t3 index_b 4 4 0 4 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 21 13 8 13 2 6 0 +TABLE test t1 22 14 8 14 2 6 0 TABLE test t3 50 32 18 32 6 12 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -687,7 +687,7 @@ TABLE test t1 20 8 12 4 0 0 0 4 0 6 TABLE test t3 28 8 20 4 0 0 0 4 0 10 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 41 +TABLE test t1 42 TABLE test t2 0 TABLE test t3 78 connection con4; @@ -747,7 +747,7 @@ connection default; "================== Step 9 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 24 username event_name count_star user2 wait/io/table/sql/handler 0 @@ -760,7 +760,7 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 23 +user1 localhost wait/io/table/sql/handler 24 user1 localhost wait/lock/table/sql/handler 24 user2 localhost wait/io/table/sql/handler 0 user2 localhost wait/lock/table/sql/handler 0 @@ -770,7 +770,7 @@ user4 localhost wait/io/table/sql/handler 0 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 24 user2 wait/io/table/sql/handler 0 user2 wait/lock/table/sql/handler 0 @@ -780,27 +780,27 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 71 +localhost wait/io/table/sql/handler 72 localhost wait/lock/table/sql/handler 48 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 71 +wait/io/table/sql/handler 72 wait/lock/table/sql/handler 48 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 17 11 6 11 2 4 0 +TABLE test t1 NULL 20 13 7 13 2 5 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t3 NULL 44 26 18 26 6 12 0 TABLE test t3 index_b 4 4 0 4 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 21 13 8 13 2 6 0 +TABLE test t1 22 14 8 14 2 6 0 TABLE test t3 50 32 18 32 6 12 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -808,7 +808,7 @@ TABLE test t1 20 8 12 4 0 0 0 4 0 6 TABLE test t3 28 8 20 4 0 0 0 4 0 10 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 41 +TABLE test t1 42 TABLE test t2 0 TABLE test t3 78 connection con1; @@ -820,7 +820,7 @@ connection default; "================== Step 10 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 32 username event_name count_star user2 wait/io/table/sql/handler 0 @@ -833,7 +833,7 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 23 +user1 localhost wait/io/table/sql/handler 24 user1 localhost wait/lock/table/sql/handler 32 user2 localhost wait/io/table/sql/handler 0 user2 localhost wait/lock/table/sql/handler 0 @@ -843,7 +843,7 @@ user4 localhost wait/io/table/sql/handler 0 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 32 user2 wait/io/table/sql/handler 0 user2 wait/lock/table/sql/handler 0 @@ -853,27 +853,27 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 71 +localhost wait/io/table/sql/handler 72 localhost wait/lock/table/sql/handler 56 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 71 +wait/io/table/sql/handler 72 wait/lock/table/sql/handler 56 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 17 11 6 11 2 4 0 +TABLE test t1 NULL 20 13 7 13 2 5 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t3 NULL 44 26 18 26 6 12 0 TABLE test t3 index_b 4 4 0 4 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 21 13 8 13 2 6 0 +TABLE test t1 22 14 8 14 2 6 0 TABLE test t3 50 32 18 32 6 12 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -881,7 +881,7 @@ TABLE test t1 24 10 14 4 0 0 1 5 0 7 TABLE test t3 32 10 22 4 0 0 1 5 0 11 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 45 +TABLE test t1 46 TABLE test t2 0 TABLE test t3 82 connection default; @@ -890,7 +890,7 @@ flush tables; "================== Step 11 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 32 username event_name count_star user2 wait/io/table/sql/handler 0 @@ -903,7 +903,7 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 23 +user1 localhost wait/io/table/sql/handler 24 user1 localhost wait/lock/table/sql/handler 32 user2 localhost wait/io/table/sql/handler 0 user2 localhost wait/lock/table/sql/handler 0 @@ -913,7 +913,7 @@ user4 localhost wait/io/table/sql/handler 0 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 32 user2 wait/io/table/sql/handler 0 user2 wait/lock/table/sql/handler 0 @@ -923,27 +923,27 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 71 +localhost wait/io/table/sql/handler 72 localhost wait/lock/table/sql/handler 56 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 71 +wait/io/table/sql/handler 72 wait/lock/table/sql/handler 56 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 17 11 6 11 2 4 0 +TABLE test t1 NULL 20 13 7 13 2 5 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t3 NULL 44 26 18 26 6 12 0 TABLE test t3 index_b 4 4 0 4 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 21 13 8 13 2 6 0 +TABLE test t1 22 14 8 14 2 6 0 TABLE test t3 50 32 18 32 6 12 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -951,7 +951,7 @@ TABLE test t1 24 10 14 4 0 0 1 5 0 7 TABLE test t3 32 10 22 4 0 0 1 5 0 11 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 45 +TABLE test t1 46 TABLE test t2 0 TABLE test t3 82 set global read_only=1; @@ -960,7 +960,7 @@ set global read_only=0; "================== Step 12 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 32 username event_name count_star user2 wait/io/table/sql/handler 0 @@ -973,7 +973,7 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 23 +user1 localhost wait/io/table/sql/handler 24 user1 localhost wait/lock/table/sql/handler 32 user2 localhost wait/io/table/sql/handler 0 user2 localhost wait/lock/table/sql/handler 0 @@ -983,7 +983,7 @@ user4 localhost wait/io/table/sql/handler 0 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 32 user2 wait/io/table/sql/handler 0 user2 wait/lock/table/sql/handler 0 @@ -993,27 +993,27 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 71 +localhost wait/io/table/sql/handler 72 localhost wait/lock/table/sql/handler 56 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 71 +wait/io/table/sql/handler 72 wait/lock/table/sql/handler 56 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 17 11 6 11 2 4 0 +TABLE test t1 NULL 20 13 7 13 2 5 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t3 NULL 44 26 18 26 6 12 0 TABLE test t3 index_b 4 4 0 4 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 21 13 8 13 2 6 0 +TABLE test t1 22 14 8 14 2 6 0 TABLE test t3 50 32 18 32 6 12 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -1021,7 +1021,7 @@ TABLE test t1 24 10 14 4 0 0 1 5 0 7 TABLE test t3 32 10 22 4 0 0 1 5 0 11 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 45 +TABLE test t1 46 TABLE test t2 0 TABLE test t3 82 disconnect con1; @@ -1040,7 +1040,7 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 23 +user1 localhost wait/io/table/sql/handler 24 user1 localhost wait/lock/table/sql/handler 32 user2 localhost wait/io/table/sql/handler 0 user2 localhost wait/lock/table/sql/handler 0 @@ -1050,7 +1050,7 @@ user4 localhost wait/io/table/sql/handler 0 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 32 user2 wait/io/table/sql/handler 0 user2 wait/lock/table/sql/handler 0 @@ -1060,27 +1060,27 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 71 +localhost wait/io/table/sql/handler 72 localhost wait/lock/table/sql/handler 56 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 71 +wait/io/table/sql/handler 72 wait/lock/table/sql/handler 56 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 17 11 6 11 2 4 0 +TABLE test t1 NULL 20 13 7 13 2 5 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t3 NULL 44 26 18 26 6 12 0 TABLE test t3 index_b 4 4 0 4 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 21 13 8 13 2 6 0 +TABLE test t1 22 14 8 14 2 6 0 TABLE test t3 50 32 18 32 6 12 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -1088,7 +1088,7 @@ TABLE test t1 24 10 14 4 0 0 1 5 0 7 TABLE test t3 32 10 22 4 0 0 1 5 0 11 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 45 +TABLE test t1 46 TABLE test t2 0 TABLE test t3 82 disconnect con2; @@ -1106,7 +1106,7 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 23 +user1 localhost wait/io/table/sql/handler 24 user1 localhost wait/lock/table/sql/handler 32 user2 localhost wait/io/table/sql/handler 0 user2 localhost wait/lock/table/sql/handler 0 @@ -1116,7 +1116,7 @@ user4 localhost wait/io/table/sql/handler 0 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 32 user2 wait/io/table/sql/handler 0 user2 wait/lock/table/sql/handler 0 @@ -1126,27 +1126,27 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 71 +localhost wait/io/table/sql/handler 72 localhost wait/lock/table/sql/handler 56 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 71 +wait/io/table/sql/handler 72 wait/lock/table/sql/handler 56 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 17 11 6 11 2 4 0 +TABLE test t1 NULL 20 13 7 13 2 5 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t3 NULL 44 26 18 26 6 12 0 TABLE test t3 index_b 4 4 0 4 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 21 13 8 13 2 6 0 +TABLE test t1 22 14 8 14 2 6 0 TABLE test t3 50 32 18 32 6 12 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -1154,7 +1154,7 @@ TABLE test t1 24 10 14 4 0 0 1 5 0 7 TABLE test t3 32 10 22 4 0 0 1 5 0 11 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 45 +TABLE test t1 46 TABLE test t2 0 TABLE test t3 82 disconnect con3; @@ -1171,7 +1171,7 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 23 +user1 localhost wait/io/table/sql/handler 24 user1 localhost wait/lock/table/sql/handler 32 user2 localhost wait/io/table/sql/handler 0 user2 localhost wait/lock/table/sql/handler 0 @@ -1181,7 +1181,7 @@ user4 localhost wait/io/table/sql/handler 0 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 32 user2 wait/io/table/sql/handler 0 user2 wait/lock/table/sql/handler 0 @@ -1191,27 +1191,27 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 71 +localhost wait/io/table/sql/handler 72 localhost wait/lock/table/sql/handler 56 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 71 +wait/io/table/sql/handler 72 wait/lock/table/sql/handler 56 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 17 11 6 11 2 4 0 +TABLE test t1 NULL 20 13 7 13 2 5 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t3 NULL 44 26 18 26 6 12 0 TABLE test t3 index_b 4 4 0 4 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 21 13 8 13 2 6 0 +TABLE test t1 22 14 8 14 2 6 0 TABLE test t3 50 32 18 32 6 12 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -1219,7 +1219,7 @@ TABLE test t1 24 10 14 4 0 0 1 5 0 7 TABLE test t3 32 10 22 4 0 0 1 5 0 11 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 45 +TABLE test t1 46 TABLE test t2 0 TABLE test t3 82 disconnect con4; @@ -1235,7 +1235,7 @@ username status user4 not found execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 23 +user1 localhost wait/io/table/sql/handler 24 user1 localhost wait/lock/table/sql/handler 32 user2 localhost wait/io/table/sql/handler 0 user2 localhost wait/lock/table/sql/handler 0 @@ -1245,7 +1245,7 @@ user4 localhost wait/io/table/sql/handler 0 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 32 user2 wait/io/table/sql/handler 0 user2 wait/lock/table/sql/handler 0 @@ -1255,27 +1255,27 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 71 +localhost wait/io/table/sql/handler 72 localhost wait/lock/table/sql/handler 56 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 71 +wait/io/table/sql/handler 72 wait/lock/table/sql/handler 56 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 17 11 6 11 2 4 0 +TABLE test t1 NULL 20 13 7 13 2 5 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t3 NULL 44 26 18 26 6 12 0 TABLE test t3 index_b 4 4 0 4 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 21 13 8 13 2 6 0 +TABLE test t1 22 14 8 14 2 6 0 TABLE test t3 50 32 18 32 6 12 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -1283,7 +1283,7 @@ TABLE test t1 24 10 14 4 0 0 1 5 0 7 TABLE test t3 32 10 22 4 0 0 1 5 0 11 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 45 +TABLE test t1 46 TABLE test t2 0 TABLE test t3 82 connection default; @@ -1301,7 +1301,7 @@ username status user4 not found execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 23 +user1 localhost wait/io/table/sql/handler 24 user1 localhost wait/lock/table/sql/handler 32 user2 localhost wait/io/table/sql/handler 0 user2 localhost wait/lock/table/sql/handler 0 @@ -1311,7 +1311,7 @@ user4 localhost wait/io/table/sql/handler 0 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 32 user2 wait/io/table/sql/handler 0 user2 wait/lock/table/sql/handler 0 @@ -1321,27 +1321,27 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 71 +localhost wait/io/table/sql/handler 72 localhost wait/lock/table/sql/handler 56 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 71 +wait/io/table/sql/handler 72 wait/lock/table/sql/handler 56 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 17 11 6 11 2 4 0 +TABLE test t1 NULL 20 13 7 13 2 5 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t3 NULL 44 26 18 26 6 12 0 TABLE test t3 index_b 4 4 0 4 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 21 13 8 13 2 6 0 +TABLE test t1 22 14 8 14 2 6 0 TABLE test t3 50 32 18 32 6 12 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -1349,7 +1349,7 @@ TABLE test t1 24 10 14 4 0 0 1 5 0 7 TABLE test t3 32 10 22 4 0 0 1 5 0 11 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 45 +TABLE test t1 46 TABLE test t2 0 TABLE test t3 82 truncate performance_schema.events_waits_summary_by_account_by_event_name; @@ -1376,7 +1376,7 @@ user4 localhost wait/io/table/sql/handler 0 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 32 user2 wait/io/table/sql/handler 0 user2 wait/lock/table/sql/handler 0 @@ -1386,27 +1386,27 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 71 +localhost wait/io/table/sql/handler 72 localhost wait/lock/table/sql/handler 56 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 71 +wait/io/table/sql/handler 72 wait/lock/table/sql/handler 56 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 17 11 6 11 2 4 0 +TABLE test t1 NULL 20 13 7 13 2 5 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t3 NULL 44 26 18 26 6 12 0 TABLE test t3 index_b 4 4 0 4 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 21 13 8 13 2 6 0 +TABLE test t1 22 14 8 14 2 6 0 TABLE test t3 50 32 18 32 6 12 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -1414,7 +1414,7 @@ TABLE test t1 24 10 14 4 0 0 1 5 0 7 TABLE test t3 32 10 22 4 0 0 1 5 0 11 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 45 +TABLE test t1 46 TABLE test t2 0 TABLE test t3 82 truncate performance_schema.events_waits_summary_by_user_by_event_name; @@ -1451,27 +1451,27 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 71 +localhost wait/io/table/sql/handler 72 localhost wait/lock/table/sql/handler 56 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 71 +wait/io/table/sql/handler 72 wait/lock/table/sql/handler 56 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 17 11 6 11 2 4 0 +TABLE test t1 NULL 20 13 7 13 2 5 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t3 NULL 44 26 18 26 6 12 0 TABLE test t3 index_b 4 4 0 4 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 21 13 8 13 2 6 0 +TABLE test t1 22 14 8 14 2 6 0 TABLE test t3 50 32 18 32 6 12 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -1479,7 +1479,7 @@ TABLE test t1 24 10 14 4 0 0 1 5 0 7 TABLE test t3 32 10 22 4 0 0 1 5 0 11 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 45 +TABLE test t1 46 TABLE test t2 0 TABLE test t3 82 truncate performance_schema.events_waits_summary_by_host_by_event_name; @@ -1520,23 +1520,23 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 71 +wait/io/table/sql/handler 72 wait/lock/table/sql/handler 56 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 17 11 6 11 2 4 0 +TABLE test t1 NULL 20 13 7 13 2 5 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t3 NULL 44 26 18 26 6 12 0 TABLE test t3 index_b 4 4 0 4 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 21 13 8 13 2 6 0 +TABLE test t1 22 14 8 14 2 6 0 TABLE test t3 50 32 18 32 6 12 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -1544,7 +1544,7 @@ TABLE test t1 24 10 14 4 0 0 1 5 0 7 TABLE test t3 32 10 22 4 0 0 1 5 0 11 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 45 +TABLE test t1 46 TABLE test t2 0 TABLE test t3 82 truncate performance_schema.events_waits_summary_global_by_event_name; diff --git a/mysql-test/suite/perfschema/r/table_aggregate_thread_2u_3t.result b/mysql-test/suite/perfschema/r/table_aggregate_thread_2u_3t.result index 3d993ada59f..646af510955 100644 --- a/mysql-test/suite/perfschema/r/table_aggregate_thread_2u_3t.result +++ b/mysql-test/suite/perfschema/r/table_aggregate_thread_2u_3t.result @@ -187,7 +187,7 @@ connection default; "================== Step 3-A ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 36 username status user2 not found @@ -197,28 +197,28 @@ username status user4 not found execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 33 +user1 localhost wait/io/table/sql/handler 34 user1 localhost wait/lock/table/sql/handler 36 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 36 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 33 +localhost wait/io/table/sql/handler 34 localhost wait/lock/table/sql/handler 36 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 33 +wait/io/table/sql/handler 34 wait/lock/table/sql/handler 36 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 6 4 2 4 1 1 0 +TABLE test t1 NULL 9 6 3 6 1 2 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 2 1 1 1 0 1 0 +TABLE test t1 PRIMARY 0 0 0 0 0 0 0 TABLE test t2 NULL 9 5 4 5 2 2 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -229,7 +229,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 1 1 0 1 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 8 5 3 5 1 2 0 +TABLE test t1 9 6 3 6 1 2 0 TABLE test t2 10 6 4 6 2 2 0 TABLE test t3 15 9 6 9 3 3 0 execute dump_waits_table_lock; @@ -239,7 +239,7 @@ TABLE test t2 12 4 8 2 0 0 0 2 0 4 TABLE test t3 14 4 10 2 0 0 0 2 0 5 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 18 +TABLE test t1 19 TABLE test t2 22 TABLE test t3 29 connection con1; @@ -249,7 +249,7 @@ connection default; "================== Step 3-B ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 36 username status user2 not found @@ -259,28 +259,28 @@ username status user4 not found execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 33 +user1 localhost wait/io/table/sql/handler 34 user1 localhost wait/lock/table/sql/handler 36 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 36 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 33 +localhost wait/io/table/sql/handler 34 localhost wait/lock/table/sql/handler 36 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 33 +wait/io/table/sql/handler 34 wait/lock/table/sql/handler 36 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 6 4 2 4 1 1 0 +TABLE test t1 NULL 9 6 3 6 1 2 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 2 1 1 1 0 1 0 +TABLE test t1 PRIMARY 0 0 0 0 0 0 0 TABLE test t2 NULL 9 5 4 5 2 2 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -291,7 +291,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 1 1 0 1 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 8 5 3 5 1 2 0 +TABLE test t1 9 6 3 6 1 2 0 TABLE test t2 10 6 4 6 2 2 0 TABLE test t3 15 9 6 9 3 3 0 execute dump_waits_table_lock; @@ -301,7 +301,7 @@ TABLE test t2 12 4 8 2 0 0 0 2 0 4 TABLE test t3 14 4 10 2 0 0 0 2 0 5 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 18 +TABLE test t1 19 TABLE test t2 22 TABLE test t3 29 connect con2, localhost, user2, , ; @@ -312,7 +312,7 @@ connection default; "================== Step 4 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 36 username event_name count_star user2 wait/io/table/sql/handler 0 @@ -323,32 +323,32 @@ username status user4 not found execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 33 +user1 localhost wait/io/table/sql/handler 34 user1 localhost wait/lock/table/sql/handler 36 user2 localhost wait/io/table/sql/handler 0 user2 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 36 user2 wait/io/table/sql/handler 0 user2 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 33 +localhost wait/io/table/sql/handler 34 localhost wait/lock/table/sql/handler 36 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 33 +wait/io/table/sql/handler 34 wait/lock/table/sql/handler 36 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 6 4 2 4 1 1 0 +TABLE test t1 NULL 9 6 3 6 1 2 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 2 1 1 1 0 1 0 +TABLE test t1 PRIMARY 0 0 0 0 0 0 0 TABLE test t2 NULL 9 5 4 5 2 2 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -359,7 +359,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 1 1 0 1 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 8 5 3 5 1 2 0 +TABLE test t1 9 6 3 6 1 2 0 TABLE test t2 10 6 4 6 2 2 0 TABLE test t3 15 9 6 9 3 3 0 execute dump_waits_table_lock; @@ -369,7 +369,7 @@ TABLE test t2 12 4 8 2 0 0 0 2 0 4 TABLE test t3 14 4 10 2 0 0 0 2 0 5 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 18 +TABLE test t1 19 TABLE test t2 22 TABLE test t3 29 connection con2; @@ -415,7 +415,7 @@ connection default; "================== Step 5 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 36 username event_name count_star user2 wait/io/table/sql/handler 0 @@ -426,32 +426,32 @@ username status user4 not found execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 33 +user1 localhost wait/io/table/sql/handler 34 user1 localhost wait/lock/table/sql/handler 36 user2 localhost wait/io/table/sql/handler 0 user2 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 36 user2 wait/io/table/sql/handler 0 user2 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 33 +localhost wait/io/table/sql/handler 34 localhost wait/lock/table/sql/handler 36 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 33 +wait/io/table/sql/handler 34 wait/lock/table/sql/handler 36 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 6 4 2 4 1 1 0 +TABLE test t1 NULL 9 6 3 6 1 2 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 2 1 1 1 0 1 0 +TABLE test t1 PRIMARY 0 0 0 0 0 0 0 TABLE test t2 NULL 9 5 4 5 2 2 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -462,7 +462,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 1 1 0 1 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 8 5 3 5 1 2 0 +TABLE test t1 9 6 3 6 1 2 0 TABLE test t2 10 6 4 6 2 2 0 TABLE test t3 15 9 6 9 3 3 0 execute dump_waits_table_lock; @@ -472,7 +472,7 @@ TABLE test t2 12 4 8 2 0 0 0 2 0 4 TABLE test t3 14 4 10 2 0 0 0 2 0 5 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 18 +TABLE test t1 19 TABLE test t2 22 TABLE test t3 29 connect con3, localhost, user3, , ; @@ -483,7 +483,7 @@ connection default; "================== Step 6 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 36 username event_name count_star user2 wait/io/table/sql/handler 0 @@ -495,7 +495,7 @@ username status user4 not found execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 33 +user1 localhost wait/io/table/sql/handler 34 user1 localhost wait/lock/table/sql/handler 36 user2 localhost wait/io/table/sql/handler 0 user2 localhost wait/lock/table/sql/handler 0 @@ -503,7 +503,7 @@ user3 localhost wait/io/table/sql/handler 0 user3 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 36 user2 wait/io/table/sql/handler 0 user2 wait/lock/table/sql/handler 0 @@ -511,20 +511,20 @@ user3 wait/io/table/sql/handler 0 user3 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 33 +localhost wait/io/table/sql/handler 34 localhost wait/lock/table/sql/handler 36 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 33 +wait/io/table/sql/handler 34 wait/lock/table/sql/handler 36 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 6 4 2 4 1 1 0 +TABLE test t1 NULL 9 6 3 6 1 2 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 2 1 1 1 0 1 0 +TABLE test t1 PRIMARY 0 0 0 0 0 0 0 TABLE test t2 NULL 9 5 4 5 2 2 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -535,7 +535,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 1 1 0 1 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 8 5 3 5 1 2 0 +TABLE test t1 9 6 3 6 1 2 0 TABLE test t2 10 6 4 6 2 2 0 TABLE test t3 15 9 6 9 3 3 0 execute dump_waits_table_lock; @@ -545,7 +545,7 @@ TABLE test t2 12 4 8 2 0 0 0 2 0 4 TABLE test t3 14 4 10 2 0 0 0 2 0 5 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 18 +TABLE test t1 19 TABLE test t2 22 TABLE test t3 29 connection con3; @@ -598,7 +598,7 @@ connection default; "================== Step 7 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 36 username event_name count_star user2 wait/io/table/sql/handler 0 @@ -610,7 +610,7 @@ username status user4 not found execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 33 +user1 localhost wait/io/table/sql/handler 34 user1 localhost wait/lock/table/sql/handler 36 user2 localhost wait/io/table/sql/handler 0 user2 localhost wait/lock/table/sql/handler 0 @@ -618,7 +618,7 @@ user3 localhost wait/io/table/sql/handler 70 user3 localhost wait/lock/table/sql/handler 36 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 36 user2 wait/io/table/sql/handler 0 user2 wait/lock/table/sql/handler 0 @@ -626,20 +626,20 @@ user3 wait/io/table/sql/handler 70 user3 wait/lock/table/sql/handler 36 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 103 +localhost wait/io/table/sql/handler 104 localhost wait/lock/table/sql/handler 72 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 103 +wait/io/table/sql/handler 104 wait/lock/table/sql/handler 72 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 17 11 6 11 2 4 0 +TABLE test t1 NULL 20 13 7 13 2 5 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t2 NULL 30 18 12 18 4 8 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -650,7 +650,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 21 13 8 13 2 6 0 +TABLE test t1 22 14 8 14 2 6 0 TABLE test t2 32 20 12 20 4 8 0 TABLE test t3 50 32 18 32 6 12 0 execute dump_waits_table_lock; @@ -660,7 +660,7 @@ TABLE test t2 24 8 16 4 0 0 0 4 0 8 TABLE test t3 28 8 20 4 0 0 0 4 0 10 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 41 +TABLE test t1 42 TABLE test t2 56 TABLE test t3 78 connect con4, localhost, user4, , ; @@ -671,7 +671,7 @@ connection default; "================== Step 8 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 36 username event_name count_star user2 wait/io/table/sql/handler 0 @@ -684,7 +684,7 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 33 +user1 localhost wait/io/table/sql/handler 34 user1 localhost wait/lock/table/sql/handler 36 user2 localhost wait/io/table/sql/handler 0 user2 localhost wait/lock/table/sql/handler 0 @@ -694,7 +694,7 @@ user4 localhost wait/io/table/sql/handler 0 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 36 user2 wait/io/table/sql/handler 0 user2 wait/lock/table/sql/handler 0 @@ -704,20 +704,20 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 103 +localhost wait/io/table/sql/handler 104 localhost wait/lock/table/sql/handler 72 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 103 +wait/io/table/sql/handler 104 wait/lock/table/sql/handler 72 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 17 11 6 11 2 4 0 +TABLE test t1 NULL 20 13 7 13 2 5 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t2 NULL 30 18 12 18 4 8 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -728,7 +728,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 21 13 8 13 2 6 0 +TABLE test t1 22 14 8 14 2 6 0 TABLE test t2 32 20 12 20 4 8 0 TABLE test t3 50 32 18 32 6 12 0 execute dump_waits_table_lock; @@ -738,7 +738,7 @@ TABLE test t2 24 8 16 4 0 0 0 4 0 8 TABLE test t3 28 8 20 4 0 0 0 4 0 10 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 41 +TABLE test t1 42 TABLE test t2 56 TABLE test t3 78 connection con4; @@ -798,7 +798,7 @@ connection default; "================== Step 9 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 36 username event_name count_star user2 wait/io/table/sql/handler 0 @@ -811,7 +811,7 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 33 +user1 localhost wait/io/table/sql/handler 34 user1 localhost wait/lock/table/sql/handler 36 user2 localhost wait/io/table/sql/handler 0 user2 localhost wait/lock/table/sql/handler 0 @@ -821,7 +821,7 @@ user4 localhost wait/io/table/sql/handler 0 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 36 user2 wait/io/table/sql/handler 0 user2 wait/lock/table/sql/handler 0 @@ -831,20 +831,20 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 103 +localhost wait/io/table/sql/handler 104 localhost wait/lock/table/sql/handler 72 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 103 +wait/io/table/sql/handler 104 wait/lock/table/sql/handler 72 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 17 11 6 11 2 4 0 +TABLE test t1 NULL 20 13 7 13 2 5 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t2 NULL 30 18 12 18 4 8 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -855,7 +855,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 21 13 8 13 2 6 0 +TABLE test t1 22 14 8 14 2 6 0 TABLE test t2 32 20 12 20 4 8 0 TABLE test t3 50 32 18 32 6 12 0 execute dump_waits_table_lock; @@ -865,7 +865,7 @@ TABLE test t2 24 8 16 4 0 0 0 4 0 8 TABLE test t3 28 8 20 4 0 0 0 4 0 10 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 41 +TABLE test t1 42 TABLE test t2 56 TABLE test t3 78 connection con1; @@ -877,7 +877,7 @@ connection default; "================== Step 10 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 48 username event_name count_star user2 wait/io/table/sql/handler 0 @@ -890,7 +890,7 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 33 +user1 localhost wait/io/table/sql/handler 34 user1 localhost wait/lock/table/sql/handler 48 user2 localhost wait/io/table/sql/handler 0 user2 localhost wait/lock/table/sql/handler 0 @@ -900,7 +900,7 @@ user4 localhost wait/io/table/sql/handler 0 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 48 user2 wait/io/table/sql/handler 0 user2 wait/lock/table/sql/handler 0 @@ -910,20 +910,20 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 103 +localhost wait/io/table/sql/handler 104 localhost wait/lock/table/sql/handler 84 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 103 +wait/io/table/sql/handler 104 wait/lock/table/sql/handler 84 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 17 11 6 11 2 4 0 +TABLE test t1 NULL 20 13 7 13 2 5 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t2 NULL 30 18 12 18 4 8 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -934,7 +934,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 21 13 8 13 2 6 0 +TABLE test t1 22 14 8 14 2 6 0 TABLE test t2 32 20 12 20 4 8 0 TABLE test t3 50 32 18 32 6 12 0 execute dump_waits_table_lock; @@ -944,7 +944,7 @@ TABLE test t2 28 10 18 4 0 0 1 5 0 9 TABLE test t3 32 10 22 4 0 0 1 5 0 11 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 45 +TABLE test t1 46 TABLE test t2 60 TABLE test t3 82 connection default; @@ -953,7 +953,7 @@ flush tables; "================== Step 11 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 48 username event_name count_star user2 wait/io/table/sql/handler 0 @@ -966,7 +966,7 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 33 +user1 localhost wait/io/table/sql/handler 34 user1 localhost wait/lock/table/sql/handler 48 user2 localhost wait/io/table/sql/handler 0 user2 localhost wait/lock/table/sql/handler 0 @@ -976,7 +976,7 @@ user4 localhost wait/io/table/sql/handler 0 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 48 user2 wait/io/table/sql/handler 0 user2 wait/lock/table/sql/handler 0 @@ -986,20 +986,20 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 103 +localhost wait/io/table/sql/handler 104 localhost wait/lock/table/sql/handler 84 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 103 +wait/io/table/sql/handler 104 wait/lock/table/sql/handler 84 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 17 11 6 11 2 4 0 +TABLE test t1 NULL 20 13 7 13 2 5 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t2 NULL 30 18 12 18 4 8 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -1010,7 +1010,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 21 13 8 13 2 6 0 +TABLE test t1 22 14 8 14 2 6 0 TABLE test t2 32 20 12 20 4 8 0 TABLE test t3 50 32 18 32 6 12 0 execute dump_waits_table_lock; @@ -1020,7 +1020,7 @@ TABLE test t2 28 10 18 4 0 0 1 5 0 9 TABLE test t3 32 10 22 4 0 0 1 5 0 11 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 45 +TABLE test t1 46 TABLE test t2 60 TABLE test t3 82 set global read_only=1; @@ -1029,7 +1029,7 @@ set global read_only=0; "================== Step 12 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 48 username event_name count_star user2 wait/io/table/sql/handler 0 @@ -1042,7 +1042,7 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 33 +user1 localhost wait/io/table/sql/handler 34 user1 localhost wait/lock/table/sql/handler 48 user2 localhost wait/io/table/sql/handler 0 user2 localhost wait/lock/table/sql/handler 0 @@ -1052,7 +1052,7 @@ user4 localhost wait/io/table/sql/handler 0 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 48 user2 wait/io/table/sql/handler 0 user2 wait/lock/table/sql/handler 0 @@ -1062,20 +1062,20 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 103 +localhost wait/io/table/sql/handler 104 localhost wait/lock/table/sql/handler 84 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 103 +wait/io/table/sql/handler 104 wait/lock/table/sql/handler 84 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 17 11 6 11 2 4 0 +TABLE test t1 NULL 20 13 7 13 2 5 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t2 NULL 30 18 12 18 4 8 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -1086,7 +1086,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 21 13 8 13 2 6 0 +TABLE test t1 22 14 8 14 2 6 0 TABLE test t2 32 20 12 20 4 8 0 TABLE test t3 50 32 18 32 6 12 0 execute dump_waits_table_lock; @@ -1096,7 +1096,7 @@ TABLE test t2 28 10 18 4 0 0 1 5 0 9 TABLE test t3 32 10 22 4 0 0 1 5 0 11 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 45 +TABLE test t1 46 TABLE test t2 60 TABLE test t3 82 disconnect con1; @@ -1115,7 +1115,7 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 33 +user1 localhost wait/io/table/sql/handler 34 user1 localhost wait/lock/table/sql/handler 48 user2 localhost wait/io/table/sql/handler 0 user2 localhost wait/lock/table/sql/handler 0 @@ -1125,7 +1125,7 @@ user4 localhost wait/io/table/sql/handler 0 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 48 user2 wait/io/table/sql/handler 0 user2 wait/lock/table/sql/handler 0 @@ -1135,20 +1135,20 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 103 +localhost wait/io/table/sql/handler 104 localhost wait/lock/table/sql/handler 84 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 103 +wait/io/table/sql/handler 104 wait/lock/table/sql/handler 84 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 17 11 6 11 2 4 0 +TABLE test t1 NULL 20 13 7 13 2 5 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t2 NULL 30 18 12 18 4 8 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -1159,7 +1159,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 21 13 8 13 2 6 0 +TABLE test t1 22 14 8 14 2 6 0 TABLE test t2 32 20 12 20 4 8 0 TABLE test t3 50 32 18 32 6 12 0 execute dump_waits_table_lock; @@ -1169,7 +1169,7 @@ TABLE test t2 28 10 18 4 0 0 1 5 0 9 TABLE test t3 32 10 22 4 0 0 1 5 0 11 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 45 +TABLE test t1 46 TABLE test t2 60 TABLE test t3 82 disconnect con2; @@ -1187,7 +1187,7 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 33 +user1 localhost wait/io/table/sql/handler 34 user1 localhost wait/lock/table/sql/handler 48 user2 localhost wait/io/table/sql/handler 0 user2 localhost wait/lock/table/sql/handler 0 @@ -1197,7 +1197,7 @@ user4 localhost wait/io/table/sql/handler 0 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 48 user2 wait/io/table/sql/handler 0 user2 wait/lock/table/sql/handler 0 @@ -1207,20 +1207,20 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 103 +localhost wait/io/table/sql/handler 104 localhost wait/lock/table/sql/handler 84 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 103 +wait/io/table/sql/handler 104 wait/lock/table/sql/handler 84 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 17 11 6 11 2 4 0 +TABLE test t1 NULL 20 13 7 13 2 5 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t2 NULL 30 18 12 18 4 8 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -1231,7 +1231,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 21 13 8 13 2 6 0 +TABLE test t1 22 14 8 14 2 6 0 TABLE test t2 32 20 12 20 4 8 0 TABLE test t3 50 32 18 32 6 12 0 execute dump_waits_table_lock; @@ -1241,7 +1241,7 @@ TABLE test t2 28 10 18 4 0 0 1 5 0 9 TABLE test t3 32 10 22 4 0 0 1 5 0 11 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 45 +TABLE test t1 46 TABLE test t2 60 TABLE test t3 82 disconnect con3; @@ -1258,7 +1258,7 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 33 +user1 localhost wait/io/table/sql/handler 34 user1 localhost wait/lock/table/sql/handler 48 user2 localhost wait/io/table/sql/handler 0 user2 localhost wait/lock/table/sql/handler 0 @@ -1268,7 +1268,7 @@ user4 localhost wait/io/table/sql/handler 0 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 48 user2 wait/io/table/sql/handler 0 user2 wait/lock/table/sql/handler 0 @@ -1278,20 +1278,20 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 103 +localhost wait/io/table/sql/handler 104 localhost wait/lock/table/sql/handler 84 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 103 +wait/io/table/sql/handler 104 wait/lock/table/sql/handler 84 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 17 11 6 11 2 4 0 +TABLE test t1 NULL 20 13 7 13 2 5 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t2 NULL 30 18 12 18 4 8 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -1302,7 +1302,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 21 13 8 13 2 6 0 +TABLE test t1 22 14 8 14 2 6 0 TABLE test t2 32 20 12 20 4 8 0 TABLE test t3 50 32 18 32 6 12 0 execute dump_waits_table_lock; @@ -1312,7 +1312,7 @@ TABLE test t2 28 10 18 4 0 0 1 5 0 9 TABLE test t3 32 10 22 4 0 0 1 5 0 11 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 45 +TABLE test t1 46 TABLE test t2 60 TABLE test t3 82 disconnect con4; @@ -1328,7 +1328,7 @@ username status user4 not found execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 33 +user1 localhost wait/io/table/sql/handler 34 user1 localhost wait/lock/table/sql/handler 48 user2 localhost wait/io/table/sql/handler 0 user2 localhost wait/lock/table/sql/handler 0 @@ -1338,7 +1338,7 @@ user4 localhost wait/io/table/sql/handler 0 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 48 user2 wait/io/table/sql/handler 0 user2 wait/lock/table/sql/handler 0 @@ -1348,20 +1348,20 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 103 +localhost wait/io/table/sql/handler 104 localhost wait/lock/table/sql/handler 84 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 103 +wait/io/table/sql/handler 104 wait/lock/table/sql/handler 84 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 17 11 6 11 2 4 0 +TABLE test t1 NULL 20 13 7 13 2 5 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t2 NULL 30 18 12 18 4 8 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -1372,7 +1372,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 21 13 8 13 2 6 0 +TABLE test t1 22 14 8 14 2 6 0 TABLE test t2 32 20 12 20 4 8 0 TABLE test t3 50 32 18 32 6 12 0 execute dump_waits_table_lock; @@ -1382,7 +1382,7 @@ TABLE test t2 28 10 18 4 0 0 1 5 0 9 TABLE test t3 32 10 22 4 0 0 1 5 0 11 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 45 +TABLE test t1 46 TABLE test t2 60 TABLE test t3 82 connection default; @@ -1400,7 +1400,7 @@ username status user4 not found execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 33 +user1 localhost wait/io/table/sql/handler 34 user1 localhost wait/lock/table/sql/handler 48 user2 localhost wait/io/table/sql/handler 0 user2 localhost wait/lock/table/sql/handler 0 @@ -1410,7 +1410,7 @@ user4 localhost wait/io/table/sql/handler 0 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 48 user2 wait/io/table/sql/handler 0 user2 wait/lock/table/sql/handler 0 @@ -1420,20 +1420,20 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 103 +localhost wait/io/table/sql/handler 104 localhost wait/lock/table/sql/handler 84 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 103 +wait/io/table/sql/handler 104 wait/lock/table/sql/handler 84 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 17 11 6 11 2 4 0 +TABLE test t1 NULL 20 13 7 13 2 5 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t2 NULL 30 18 12 18 4 8 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -1444,7 +1444,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 21 13 8 13 2 6 0 +TABLE test t1 22 14 8 14 2 6 0 TABLE test t2 32 20 12 20 4 8 0 TABLE test t3 50 32 18 32 6 12 0 execute dump_waits_table_lock; @@ -1454,7 +1454,7 @@ TABLE test t2 28 10 18 4 0 0 1 5 0 9 TABLE test t3 32 10 22 4 0 0 1 5 0 11 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 45 +TABLE test t1 46 TABLE test t2 60 TABLE test t3 82 truncate performance_schema.events_waits_summary_by_account_by_event_name; @@ -1481,7 +1481,7 @@ user4 localhost wait/io/table/sql/handler 0 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 48 user2 wait/io/table/sql/handler 0 user2 wait/lock/table/sql/handler 0 @@ -1491,20 +1491,20 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 103 +localhost wait/io/table/sql/handler 104 localhost wait/lock/table/sql/handler 84 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 103 +wait/io/table/sql/handler 104 wait/lock/table/sql/handler 84 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 17 11 6 11 2 4 0 +TABLE test t1 NULL 20 13 7 13 2 5 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t2 NULL 30 18 12 18 4 8 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -1515,7 +1515,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 21 13 8 13 2 6 0 +TABLE test t1 22 14 8 14 2 6 0 TABLE test t2 32 20 12 20 4 8 0 TABLE test t3 50 32 18 32 6 12 0 execute dump_waits_table_lock; @@ -1525,7 +1525,7 @@ TABLE test t2 28 10 18 4 0 0 1 5 0 9 TABLE test t3 32 10 22 4 0 0 1 5 0 11 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 45 +TABLE test t1 46 TABLE test t2 60 TABLE test t3 82 truncate performance_schema.events_waits_summary_by_user_by_event_name; @@ -1562,20 +1562,20 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 103 +localhost wait/io/table/sql/handler 104 localhost wait/lock/table/sql/handler 84 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 103 +wait/io/table/sql/handler 104 wait/lock/table/sql/handler 84 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 17 11 6 11 2 4 0 +TABLE test t1 NULL 20 13 7 13 2 5 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t2 NULL 30 18 12 18 4 8 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -1586,7 +1586,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 21 13 8 13 2 6 0 +TABLE test t1 22 14 8 14 2 6 0 TABLE test t2 32 20 12 20 4 8 0 TABLE test t3 50 32 18 32 6 12 0 execute dump_waits_table_lock; @@ -1596,7 +1596,7 @@ TABLE test t2 28 10 18 4 0 0 1 5 0 9 TABLE test t3 32 10 22 4 0 0 1 5 0 11 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 45 +TABLE test t1 46 TABLE test t2 60 TABLE test t3 82 truncate performance_schema.events_waits_summary_by_host_by_event_name; @@ -1637,16 +1637,16 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 103 +wait/io/table/sql/handler 104 wait/lock/table/sql/handler 84 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 17 11 6 11 2 4 0 +TABLE test t1 NULL 20 13 7 13 2 5 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t2 NULL 30 18 12 18 4 8 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -1657,7 +1657,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 21 13 8 13 2 6 0 +TABLE test t1 22 14 8 14 2 6 0 TABLE test t2 32 20 12 20 4 8 0 TABLE test t3 50 32 18 32 6 12 0 execute dump_waits_table_lock; @@ -1667,7 +1667,7 @@ TABLE test t2 28 10 18 4 0 0 1 5 0 9 TABLE test t3 32 10 22 4 0 0 1 5 0 11 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 45 +TABLE test t1 46 TABLE test t2 60 TABLE test t3 82 truncate performance_schema.events_waits_summary_global_by_event_name; diff --git a/mysql-test/suite/perfschema/r/table_aggregate_thread_4u_2t.result b/mysql-test/suite/perfschema/r/table_aggregate_thread_4u_2t.result index 0c4f6592245..8f3ecffa856 100644 --- a/mysql-test/suite/perfschema/r/table_aggregate_thread_4u_2t.result +++ b/mysql-test/suite/perfschema/r/table_aggregate_thread_4u_2t.result @@ -178,7 +178,7 @@ connection default; "================== Step 3-A ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 24 username status user2 not found @@ -188,35 +188,35 @@ username status user4 not found execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 23 +user1 localhost wait/io/table/sql/handler 24 user1 localhost wait/lock/table/sql/handler 24 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 24 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 23 +localhost wait/io/table/sql/handler 24 localhost wait/lock/table/sql/handler 24 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 23 +wait/io/table/sql/handler 24 wait/lock/table/sql/handler 24 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 6 4 2 4 1 1 0 +TABLE test t1 NULL 9 6 3 6 1 2 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 2 1 1 1 0 1 0 +TABLE test t1 PRIMARY 0 0 0 0 0 0 0 TABLE test t3 NULL 13 7 6 7 3 3 0 TABLE test t3 index_b 1 1 0 1 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 1 1 0 1 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 8 5 3 5 1 2 0 +TABLE test t1 9 6 3 6 1 2 0 TABLE test t3 15 9 6 9 3 3 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -224,7 +224,7 @@ TABLE test t1 10 4 6 2 0 0 0 2 0 3 TABLE test t3 14 4 10 2 0 0 0 2 0 5 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 18 +TABLE test t1 19 TABLE test t2 0 TABLE test t3 29 connection con1; @@ -234,7 +234,7 @@ connection default; "================== Step 3-B ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 24 username status user2 not found @@ -244,35 +244,35 @@ username status user4 not found execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 23 +user1 localhost wait/io/table/sql/handler 24 user1 localhost wait/lock/table/sql/handler 24 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 24 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 23 +localhost wait/io/table/sql/handler 24 localhost wait/lock/table/sql/handler 24 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 23 +wait/io/table/sql/handler 24 wait/lock/table/sql/handler 24 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 6 4 2 4 1 1 0 +TABLE test t1 NULL 9 6 3 6 1 2 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 2 1 1 1 0 1 0 +TABLE test t1 PRIMARY 0 0 0 0 0 0 0 TABLE test t3 NULL 13 7 6 7 3 3 0 TABLE test t3 index_b 1 1 0 1 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 1 1 0 1 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 8 5 3 5 1 2 0 +TABLE test t1 9 6 3 6 1 2 0 TABLE test t3 15 9 6 9 3 3 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -280,7 +280,7 @@ TABLE test t1 10 4 6 2 0 0 0 2 0 3 TABLE test t3 14 4 10 2 0 0 0 2 0 5 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 18 +TABLE test t1 19 TABLE test t2 0 TABLE test t3 29 connect con2, localhost, user2, , ; @@ -291,7 +291,7 @@ connection default; "================== Step 4 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 24 username event_name count_star user2 wait/io/table/sql/handler 0 @@ -302,39 +302,39 @@ username status user4 not found execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 23 +user1 localhost wait/io/table/sql/handler 24 user1 localhost wait/lock/table/sql/handler 24 user2 localhost wait/io/table/sql/handler 0 user2 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 24 user2 wait/io/table/sql/handler 0 user2 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 23 +localhost wait/io/table/sql/handler 24 localhost wait/lock/table/sql/handler 24 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 23 +wait/io/table/sql/handler 24 wait/lock/table/sql/handler 24 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 6 4 2 4 1 1 0 +TABLE test t1 NULL 9 6 3 6 1 2 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 2 1 1 1 0 1 0 +TABLE test t1 PRIMARY 0 0 0 0 0 0 0 TABLE test t3 NULL 13 7 6 7 3 3 0 TABLE test t3 index_b 1 1 0 1 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 1 1 0 1 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 8 5 3 5 1 2 0 +TABLE test t1 9 6 3 6 1 2 0 TABLE test t3 15 9 6 9 3 3 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -342,7 +342,7 @@ TABLE test t1 10 4 6 2 0 0 0 2 0 3 TABLE test t3 14 4 10 2 0 0 0 2 0 5 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 18 +TABLE test t1 19 TABLE test t2 0 TABLE test t3 29 connection con2; @@ -388,7 +388,7 @@ connection default; "================== Step 5 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 24 username event_name count_star user2 wait/io/table/sql/handler 35 @@ -399,39 +399,39 @@ username status user4 not found execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 23 +user1 localhost wait/io/table/sql/handler 24 user1 localhost wait/lock/table/sql/handler 24 user2 localhost wait/io/table/sql/handler 35 user2 localhost wait/lock/table/sql/handler 24 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 24 user2 wait/io/table/sql/handler 35 user2 wait/lock/table/sql/handler 24 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 58 +localhost wait/io/table/sql/handler 59 localhost wait/lock/table/sql/handler 48 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 58 +wait/io/table/sql/handler 59 wait/lock/table/sql/handler 48 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 14 9 5 9 2 3 0 +TABLE test t1 NULL 17 11 6 11 2 4 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t3 NULL 35 20 15 20 6 9 0 TABLE test t3 index_b 3 3 0 3 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 18 11 7 11 2 5 0 +TABLE test t1 19 12 7 12 2 5 0 TABLE test t3 40 25 15 25 6 9 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -439,7 +439,7 @@ TABLE test t1 20 8 12 4 0 0 0 4 0 6 TABLE test t3 28 8 20 4 0 0 0 4 0 10 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 38 +TABLE test t1 39 TABLE test t2 0 TABLE test t3 68 connect con3, localhost, user3, , ; @@ -450,7 +450,7 @@ connection default; "================== Step 6 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 24 username event_name count_star user2 wait/io/table/sql/handler 35 @@ -462,7 +462,7 @@ username status user4 not found execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 23 +user1 localhost wait/io/table/sql/handler 24 user1 localhost wait/lock/table/sql/handler 24 user2 localhost wait/io/table/sql/handler 35 user2 localhost wait/lock/table/sql/handler 24 @@ -470,7 +470,7 @@ user3 localhost wait/io/table/sql/handler 0 user3 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 24 user2 wait/io/table/sql/handler 35 user2 wait/lock/table/sql/handler 24 @@ -478,27 +478,27 @@ user3 wait/io/table/sql/handler 0 user3 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 58 +localhost wait/io/table/sql/handler 59 localhost wait/lock/table/sql/handler 48 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 58 +wait/io/table/sql/handler 59 wait/lock/table/sql/handler 48 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 14 9 5 9 2 3 0 +TABLE test t1 NULL 17 11 6 11 2 4 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t3 NULL 35 20 15 20 6 9 0 TABLE test t3 index_b 3 3 0 3 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 18 11 7 11 2 5 0 +TABLE test t1 19 12 7 12 2 5 0 TABLE test t3 40 25 15 25 6 9 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -506,7 +506,7 @@ TABLE test t1 20 8 12 4 0 0 0 4 0 6 TABLE test t3 28 8 20 4 0 0 0 4 0 10 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 38 +TABLE test t1 39 TABLE test t2 0 TABLE test t3 68 connection con3; @@ -559,7 +559,7 @@ connection default; "================== Step 7 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 24 username event_name count_star user2 wait/io/table/sql/handler 35 @@ -571,7 +571,7 @@ username status user4 not found execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 23 +user1 localhost wait/io/table/sql/handler 24 user1 localhost wait/lock/table/sql/handler 24 user2 localhost wait/io/table/sql/handler 35 user2 localhost wait/lock/table/sql/handler 24 @@ -579,7 +579,7 @@ user3 localhost wait/io/table/sql/handler 48 user3 localhost wait/lock/table/sql/handler 24 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 24 user2 wait/io/table/sql/handler 35 user2 wait/lock/table/sql/handler 24 @@ -587,27 +587,27 @@ user3 wait/io/table/sql/handler 48 user3 wait/lock/table/sql/handler 24 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 106 +localhost wait/io/table/sql/handler 107 localhost wait/lock/table/sql/handler 72 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 106 +wait/io/table/sql/handler 107 wait/lock/table/sql/handler 72 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 25 16 9 16 3 6 0 +TABLE test t1 NULL 28 18 10 18 3 7 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 6 3 3 3 0 3 0 +TABLE test t1 PRIMARY 4 2 2 2 0 2 0 TABLE test t3 NULL 66 39 27 39 9 18 0 TABLE test t3 index_b 6 6 0 6 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 3 3 0 3 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 31 19 12 19 3 9 0 +TABLE test t1 32 20 12 20 3 9 0 TABLE test t3 75 48 27 48 9 18 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -615,7 +615,7 @@ TABLE test t1 30 12 18 6 0 0 0 6 0 9 TABLE test t3 42 12 30 6 0 0 0 6 0 15 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 61 +TABLE test t1 62 TABLE test t2 0 TABLE test t3 117 connect con4, localhost, user4, , ; @@ -626,7 +626,7 @@ connection default; "================== Step 8 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 24 username event_name count_star user2 wait/io/table/sql/handler 35 @@ -639,7 +639,7 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 23 +user1 localhost wait/io/table/sql/handler 24 user1 localhost wait/lock/table/sql/handler 24 user2 localhost wait/io/table/sql/handler 35 user2 localhost wait/lock/table/sql/handler 24 @@ -649,7 +649,7 @@ user4 localhost wait/io/table/sql/handler 0 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 24 user2 wait/io/table/sql/handler 35 user2 wait/lock/table/sql/handler 24 @@ -659,27 +659,27 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 106 +localhost wait/io/table/sql/handler 107 localhost wait/lock/table/sql/handler 72 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 106 +wait/io/table/sql/handler 107 wait/lock/table/sql/handler 72 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 25 16 9 16 3 6 0 +TABLE test t1 NULL 28 18 10 18 3 7 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 6 3 3 3 0 3 0 +TABLE test t1 PRIMARY 4 2 2 2 0 2 0 TABLE test t3 NULL 66 39 27 39 9 18 0 TABLE test t3 index_b 6 6 0 6 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 3 3 0 3 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 31 19 12 19 3 9 0 +TABLE test t1 32 20 12 20 3 9 0 TABLE test t3 75 48 27 48 9 18 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -687,7 +687,7 @@ TABLE test t1 30 12 18 6 0 0 0 6 0 9 TABLE test t3 42 12 30 6 0 0 0 6 0 15 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 61 +TABLE test t1 62 TABLE test t2 0 TABLE test t3 117 connection con4; @@ -747,7 +747,7 @@ connection default; "================== Step 9 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 24 username event_name count_star user2 wait/io/table/sql/handler 35 @@ -760,7 +760,7 @@ user4 wait/io/table/sql/handler 61 user4 wait/lock/table/sql/handler 24 execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 23 +user1 localhost wait/io/table/sql/handler 24 user1 localhost wait/lock/table/sql/handler 24 user2 localhost wait/io/table/sql/handler 35 user2 localhost wait/lock/table/sql/handler 24 @@ -770,7 +770,7 @@ user4 localhost wait/io/table/sql/handler 61 user4 localhost wait/lock/table/sql/handler 24 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 24 user2 wait/io/table/sql/handler 35 user2 wait/lock/table/sql/handler 24 @@ -780,27 +780,27 @@ user4 wait/io/table/sql/handler 61 user4 wait/lock/table/sql/handler 24 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 167 +localhost wait/io/table/sql/handler 168 localhost wait/lock/table/sql/handler 96 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 167 +wait/io/table/sql/handler 168 wait/lock/table/sql/handler 96 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t3 NULL 106 64 42 64 12 30 0 TABLE test t3 index_b 10 10 0 10 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -808,7 +808,7 @@ TABLE test t1 40 16 24 8 0 0 0 8 0 12 TABLE test t3 56 16 40 8 0 0 0 8 0 20 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 87 +TABLE test t1 88 TABLE test t2 0 TABLE test t3 176 connection con1; @@ -820,7 +820,7 @@ connection default; "================== Step 10 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 32 username event_name count_star user2 wait/io/table/sql/handler 35 @@ -833,7 +833,7 @@ user4 wait/io/table/sql/handler 61 user4 wait/lock/table/sql/handler 24 execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 23 +user1 localhost wait/io/table/sql/handler 24 user1 localhost wait/lock/table/sql/handler 32 user2 localhost wait/io/table/sql/handler 35 user2 localhost wait/lock/table/sql/handler 24 @@ -843,7 +843,7 @@ user4 localhost wait/io/table/sql/handler 61 user4 localhost wait/lock/table/sql/handler 24 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 32 user2 wait/io/table/sql/handler 35 user2 wait/lock/table/sql/handler 24 @@ -853,27 +853,27 @@ user4 wait/io/table/sql/handler 61 user4 wait/lock/table/sql/handler 24 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 167 +localhost wait/io/table/sql/handler 168 localhost wait/lock/table/sql/handler 104 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 167 +wait/io/table/sql/handler 168 wait/lock/table/sql/handler 104 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t3 NULL 106 64 42 64 12 30 0 TABLE test t3 index_b 10 10 0 10 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -881,7 +881,7 @@ TABLE test t1 44 18 26 8 0 0 1 9 0 13 TABLE test t3 60 18 42 8 0 0 1 9 0 21 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 91 +TABLE test t1 92 TABLE test t2 0 TABLE test t3 180 connection default; @@ -890,7 +890,7 @@ flush tables; "================== Step 11 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 32 username event_name count_star user2 wait/io/table/sql/handler 35 @@ -903,7 +903,7 @@ user4 wait/io/table/sql/handler 61 user4 wait/lock/table/sql/handler 24 execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 23 +user1 localhost wait/io/table/sql/handler 24 user1 localhost wait/lock/table/sql/handler 32 user2 localhost wait/io/table/sql/handler 35 user2 localhost wait/lock/table/sql/handler 24 @@ -913,7 +913,7 @@ user4 localhost wait/io/table/sql/handler 61 user4 localhost wait/lock/table/sql/handler 24 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 32 user2 wait/io/table/sql/handler 35 user2 wait/lock/table/sql/handler 24 @@ -923,27 +923,27 @@ user4 wait/io/table/sql/handler 61 user4 wait/lock/table/sql/handler 24 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 167 +localhost wait/io/table/sql/handler 168 localhost wait/lock/table/sql/handler 104 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 167 +wait/io/table/sql/handler 168 wait/lock/table/sql/handler 104 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t3 NULL 106 64 42 64 12 30 0 TABLE test t3 index_b 10 10 0 10 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -951,7 +951,7 @@ TABLE test t1 44 18 26 8 0 0 1 9 0 13 TABLE test t3 60 18 42 8 0 0 1 9 0 21 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 91 +TABLE test t1 92 TABLE test t2 0 TABLE test t3 180 set global read_only=1; @@ -960,7 +960,7 @@ set global read_only=0; "================== Step 12 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 32 username event_name count_star user2 wait/io/table/sql/handler 35 @@ -973,7 +973,7 @@ user4 wait/io/table/sql/handler 61 user4 wait/lock/table/sql/handler 24 execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 23 +user1 localhost wait/io/table/sql/handler 24 user1 localhost wait/lock/table/sql/handler 32 user2 localhost wait/io/table/sql/handler 35 user2 localhost wait/lock/table/sql/handler 24 @@ -983,7 +983,7 @@ user4 localhost wait/io/table/sql/handler 61 user4 localhost wait/lock/table/sql/handler 24 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 32 user2 wait/io/table/sql/handler 35 user2 wait/lock/table/sql/handler 24 @@ -993,27 +993,27 @@ user4 wait/io/table/sql/handler 61 user4 wait/lock/table/sql/handler 24 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 167 +localhost wait/io/table/sql/handler 168 localhost wait/lock/table/sql/handler 104 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 167 +wait/io/table/sql/handler 168 wait/lock/table/sql/handler 104 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t3 NULL 106 64 42 64 12 30 0 TABLE test t3 index_b 10 10 0 10 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -1021,7 +1021,7 @@ TABLE test t1 44 18 26 8 0 0 1 9 0 13 TABLE test t3 60 18 42 8 0 0 1 9 0 21 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 91 +TABLE test t1 92 TABLE test t2 0 TABLE test t3 180 disconnect con1; @@ -1040,7 +1040,7 @@ user4 wait/io/table/sql/handler 61 user4 wait/lock/table/sql/handler 24 execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 23 +user1 localhost wait/io/table/sql/handler 24 user1 localhost wait/lock/table/sql/handler 32 user2 localhost wait/io/table/sql/handler 35 user2 localhost wait/lock/table/sql/handler 24 @@ -1050,7 +1050,7 @@ user4 localhost wait/io/table/sql/handler 61 user4 localhost wait/lock/table/sql/handler 24 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 32 user2 wait/io/table/sql/handler 35 user2 wait/lock/table/sql/handler 24 @@ -1060,27 +1060,27 @@ user4 wait/io/table/sql/handler 61 user4 wait/lock/table/sql/handler 24 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 167 +localhost wait/io/table/sql/handler 168 localhost wait/lock/table/sql/handler 104 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 167 +wait/io/table/sql/handler 168 wait/lock/table/sql/handler 104 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t3 NULL 106 64 42 64 12 30 0 TABLE test t3 index_b 10 10 0 10 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -1088,7 +1088,7 @@ TABLE test t1 44 18 26 8 0 0 1 9 0 13 TABLE test t3 60 18 42 8 0 0 1 9 0 21 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 91 +TABLE test t1 92 TABLE test t2 0 TABLE test t3 180 disconnect con2; @@ -1106,7 +1106,7 @@ user4 wait/io/table/sql/handler 61 user4 wait/lock/table/sql/handler 24 execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 23 +user1 localhost wait/io/table/sql/handler 24 user1 localhost wait/lock/table/sql/handler 32 user2 localhost wait/io/table/sql/handler 35 user2 localhost wait/lock/table/sql/handler 24 @@ -1116,7 +1116,7 @@ user4 localhost wait/io/table/sql/handler 61 user4 localhost wait/lock/table/sql/handler 24 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 32 user2 wait/io/table/sql/handler 35 user2 wait/lock/table/sql/handler 24 @@ -1126,27 +1126,27 @@ user4 wait/io/table/sql/handler 61 user4 wait/lock/table/sql/handler 24 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 167 +localhost wait/io/table/sql/handler 168 localhost wait/lock/table/sql/handler 104 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 167 +wait/io/table/sql/handler 168 wait/lock/table/sql/handler 104 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t3 NULL 106 64 42 64 12 30 0 TABLE test t3 index_b 10 10 0 10 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -1154,7 +1154,7 @@ TABLE test t1 44 18 26 8 0 0 1 9 0 13 TABLE test t3 60 18 42 8 0 0 1 9 0 21 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 91 +TABLE test t1 92 TABLE test t2 0 TABLE test t3 180 disconnect con3; @@ -1171,7 +1171,7 @@ user4 wait/io/table/sql/handler 61 user4 wait/lock/table/sql/handler 24 execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 23 +user1 localhost wait/io/table/sql/handler 24 user1 localhost wait/lock/table/sql/handler 32 user2 localhost wait/io/table/sql/handler 35 user2 localhost wait/lock/table/sql/handler 24 @@ -1181,7 +1181,7 @@ user4 localhost wait/io/table/sql/handler 61 user4 localhost wait/lock/table/sql/handler 24 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 32 user2 wait/io/table/sql/handler 35 user2 wait/lock/table/sql/handler 24 @@ -1191,27 +1191,27 @@ user4 wait/io/table/sql/handler 61 user4 wait/lock/table/sql/handler 24 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 167 +localhost wait/io/table/sql/handler 168 localhost wait/lock/table/sql/handler 104 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 167 +wait/io/table/sql/handler 168 wait/lock/table/sql/handler 104 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t3 NULL 106 64 42 64 12 30 0 TABLE test t3 index_b 10 10 0 10 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -1219,7 +1219,7 @@ TABLE test t1 44 18 26 8 0 0 1 9 0 13 TABLE test t3 60 18 42 8 0 0 1 9 0 21 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 91 +TABLE test t1 92 TABLE test t2 0 TABLE test t3 180 disconnect con4; @@ -1235,7 +1235,7 @@ username status user4 not found execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 23 +user1 localhost wait/io/table/sql/handler 24 user1 localhost wait/lock/table/sql/handler 32 user2 localhost wait/io/table/sql/handler 35 user2 localhost wait/lock/table/sql/handler 24 @@ -1245,7 +1245,7 @@ user4 localhost wait/io/table/sql/handler 61 user4 localhost wait/lock/table/sql/handler 24 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 32 user2 wait/io/table/sql/handler 35 user2 wait/lock/table/sql/handler 24 @@ -1255,27 +1255,27 @@ user4 wait/io/table/sql/handler 61 user4 wait/lock/table/sql/handler 24 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 167 +localhost wait/io/table/sql/handler 168 localhost wait/lock/table/sql/handler 104 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 167 +wait/io/table/sql/handler 168 wait/lock/table/sql/handler 104 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t3 NULL 106 64 42 64 12 30 0 TABLE test t3 index_b 10 10 0 10 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -1283,7 +1283,7 @@ TABLE test t1 44 18 26 8 0 0 1 9 0 13 TABLE test t3 60 18 42 8 0 0 1 9 0 21 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 91 +TABLE test t1 92 TABLE test t2 0 TABLE test t3 180 connection default; @@ -1301,7 +1301,7 @@ username status user4 not found execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 23 +user1 localhost wait/io/table/sql/handler 24 user1 localhost wait/lock/table/sql/handler 32 user2 localhost wait/io/table/sql/handler 35 user2 localhost wait/lock/table/sql/handler 24 @@ -1311,7 +1311,7 @@ user4 localhost wait/io/table/sql/handler 61 user4 localhost wait/lock/table/sql/handler 24 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 32 user2 wait/io/table/sql/handler 35 user2 wait/lock/table/sql/handler 24 @@ -1321,27 +1321,27 @@ user4 wait/io/table/sql/handler 61 user4 wait/lock/table/sql/handler 24 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 167 +localhost wait/io/table/sql/handler 168 localhost wait/lock/table/sql/handler 104 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 167 +wait/io/table/sql/handler 168 wait/lock/table/sql/handler 104 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t3 NULL 106 64 42 64 12 30 0 TABLE test t3 index_b 10 10 0 10 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -1349,7 +1349,7 @@ TABLE test t1 44 18 26 8 0 0 1 9 0 13 TABLE test t3 60 18 42 8 0 0 1 9 0 21 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 91 +TABLE test t1 92 TABLE test t2 0 TABLE test t3 180 truncate performance_schema.events_waits_summary_by_account_by_event_name; @@ -1376,7 +1376,7 @@ user4 localhost wait/io/table/sql/handler 0 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 32 user2 wait/io/table/sql/handler 35 user2 wait/lock/table/sql/handler 24 @@ -1386,27 +1386,27 @@ user4 wait/io/table/sql/handler 61 user4 wait/lock/table/sql/handler 24 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 167 +localhost wait/io/table/sql/handler 168 localhost wait/lock/table/sql/handler 104 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 167 +wait/io/table/sql/handler 168 wait/lock/table/sql/handler 104 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t3 NULL 106 64 42 64 12 30 0 TABLE test t3 index_b 10 10 0 10 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -1414,7 +1414,7 @@ TABLE test t1 44 18 26 8 0 0 1 9 0 13 TABLE test t3 60 18 42 8 0 0 1 9 0 21 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 91 +TABLE test t1 92 TABLE test t2 0 TABLE test t3 180 truncate performance_schema.events_waits_summary_by_user_by_event_name; @@ -1451,27 +1451,27 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 167 +localhost wait/io/table/sql/handler 168 localhost wait/lock/table/sql/handler 104 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 167 +wait/io/table/sql/handler 168 wait/lock/table/sql/handler 104 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t3 NULL 106 64 42 64 12 30 0 TABLE test t3 index_b 10 10 0 10 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -1479,7 +1479,7 @@ TABLE test t1 44 18 26 8 0 0 1 9 0 13 TABLE test t3 60 18 42 8 0 0 1 9 0 21 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 91 +TABLE test t1 92 TABLE test t2 0 TABLE test t3 180 truncate performance_schema.events_waits_summary_by_host_by_event_name; @@ -1520,23 +1520,23 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 167 +wait/io/table/sql/handler 168 wait/lock/table/sql/handler 104 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t3 NULL 106 64 42 64 12 30 0 TABLE test t3 index_b 10 10 0 10 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -1544,7 +1544,7 @@ TABLE test t1 44 18 26 8 0 0 1 9 0 13 TABLE test t3 60 18 42 8 0 0 1 9 0 21 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 91 +TABLE test t1 92 TABLE test t2 0 TABLE test t3 180 truncate performance_schema.events_waits_summary_global_by_event_name; diff --git a/mysql-test/suite/perfschema/r/table_aggregate_thread_4u_3t.result b/mysql-test/suite/perfschema/r/table_aggregate_thread_4u_3t.result index 603e5950b12..972ef78d4a1 100644 --- a/mysql-test/suite/perfschema/r/table_aggregate_thread_4u_3t.result +++ b/mysql-test/suite/perfschema/r/table_aggregate_thread_4u_3t.result @@ -187,7 +187,7 @@ connection default; "================== Step 3-A ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 36 username status user2 not found @@ -197,28 +197,28 @@ username status user4 not found execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 33 +user1 localhost wait/io/table/sql/handler 34 user1 localhost wait/lock/table/sql/handler 36 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 36 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 33 +localhost wait/io/table/sql/handler 34 localhost wait/lock/table/sql/handler 36 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 33 +wait/io/table/sql/handler 34 wait/lock/table/sql/handler 36 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 6 4 2 4 1 1 0 +TABLE test t1 NULL 9 6 3 6 1 2 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 2 1 1 1 0 1 0 +TABLE test t1 PRIMARY 0 0 0 0 0 0 0 TABLE test t2 NULL 9 5 4 5 2 2 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -229,7 +229,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 1 1 0 1 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 8 5 3 5 1 2 0 +TABLE test t1 9 6 3 6 1 2 0 TABLE test t2 10 6 4 6 2 2 0 TABLE test t3 15 9 6 9 3 3 0 execute dump_waits_table_lock; @@ -239,7 +239,7 @@ TABLE test t2 12 4 8 2 0 0 0 2 0 4 TABLE test t3 14 4 10 2 0 0 0 2 0 5 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 18 +TABLE test t1 19 TABLE test t2 22 TABLE test t3 29 connection con1; @@ -249,7 +249,7 @@ connection default; "================== Step 3-B ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 36 username status user2 not found @@ -259,28 +259,28 @@ username status user4 not found execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 33 +user1 localhost wait/io/table/sql/handler 34 user1 localhost wait/lock/table/sql/handler 36 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 36 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 33 +localhost wait/io/table/sql/handler 34 localhost wait/lock/table/sql/handler 36 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 33 +wait/io/table/sql/handler 34 wait/lock/table/sql/handler 36 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 6 4 2 4 1 1 0 +TABLE test t1 NULL 9 6 3 6 1 2 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 2 1 1 1 0 1 0 +TABLE test t1 PRIMARY 0 0 0 0 0 0 0 TABLE test t2 NULL 9 5 4 5 2 2 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -291,7 +291,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 1 1 0 1 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 8 5 3 5 1 2 0 +TABLE test t1 9 6 3 6 1 2 0 TABLE test t2 10 6 4 6 2 2 0 TABLE test t3 15 9 6 9 3 3 0 execute dump_waits_table_lock; @@ -301,7 +301,7 @@ TABLE test t2 12 4 8 2 0 0 0 2 0 4 TABLE test t3 14 4 10 2 0 0 0 2 0 5 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 18 +TABLE test t1 19 TABLE test t2 22 TABLE test t3 29 connect con2, localhost, user2, , ; @@ -312,7 +312,7 @@ connection default; "================== Step 4 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 36 username event_name count_star user2 wait/io/table/sql/handler 0 @@ -323,32 +323,32 @@ username status user4 not found execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 33 +user1 localhost wait/io/table/sql/handler 34 user1 localhost wait/lock/table/sql/handler 36 user2 localhost wait/io/table/sql/handler 0 user2 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 36 user2 wait/io/table/sql/handler 0 user2 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 33 +localhost wait/io/table/sql/handler 34 localhost wait/lock/table/sql/handler 36 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 33 +wait/io/table/sql/handler 34 wait/lock/table/sql/handler 36 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 6 4 2 4 1 1 0 +TABLE test t1 NULL 9 6 3 6 1 2 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 2 1 1 1 0 1 0 +TABLE test t1 PRIMARY 0 0 0 0 0 0 0 TABLE test t2 NULL 9 5 4 5 2 2 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -359,7 +359,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 1 1 0 1 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 8 5 3 5 1 2 0 +TABLE test t1 9 6 3 6 1 2 0 TABLE test t2 10 6 4 6 2 2 0 TABLE test t3 15 9 6 9 3 3 0 execute dump_waits_table_lock; @@ -369,7 +369,7 @@ TABLE test t2 12 4 8 2 0 0 0 2 0 4 TABLE test t3 14 4 10 2 0 0 0 2 0 5 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 18 +TABLE test t1 19 TABLE test t2 22 TABLE test t3 29 connection con2; @@ -415,7 +415,7 @@ connection default; "================== Step 5 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 36 username event_name count_star user2 wait/io/table/sql/handler 51 @@ -426,32 +426,32 @@ username status user4 not found execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 33 +user1 localhost wait/io/table/sql/handler 34 user1 localhost wait/lock/table/sql/handler 36 user2 localhost wait/io/table/sql/handler 51 user2 localhost wait/lock/table/sql/handler 36 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 36 user2 wait/io/table/sql/handler 51 user2 wait/lock/table/sql/handler 36 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 84 +localhost wait/io/table/sql/handler 85 localhost wait/lock/table/sql/handler 72 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 84 +wait/io/table/sql/handler 85 wait/lock/table/sql/handler 72 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 14 9 5 9 2 3 0 +TABLE test t1 NULL 17 11 6 11 2 4 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t2 NULL 24 14 10 14 4 6 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -462,7 +462,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 18 11 7 11 2 5 0 +TABLE test t1 19 12 7 12 2 5 0 TABLE test t2 26 16 10 16 4 6 0 TABLE test t3 40 25 15 25 6 9 0 execute dump_waits_table_lock; @@ -472,7 +472,7 @@ TABLE test t2 24 8 16 4 0 0 0 4 0 8 TABLE test t3 28 8 20 4 0 0 0 4 0 10 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 38 +TABLE test t1 39 TABLE test t2 50 TABLE test t3 68 connect con3, localhost, user3, , ; @@ -483,7 +483,7 @@ connection default; "================== Step 6 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 36 username event_name count_star user2 wait/io/table/sql/handler 51 @@ -495,7 +495,7 @@ username status user4 not found execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 33 +user1 localhost wait/io/table/sql/handler 34 user1 localhost wait/lock/table/sql/handler 36 user2 localhost wait/io/table/sql/handler 51 user2 localhost wait/lock/table/sql/handler 36 @@ -503,7 +503,7 @@ user3 localhost wait/io/table/sql/handler 0 user3 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 36 user2 wait/io/table/sql/handler 51 user2 wait/lock/table/sql/handler 36 @@ -511,20 +511,20 @@ user3 wait/io/table/sql/handler 0 user3 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 84 +localhost wait/io/table/sql/handler 85 localhost wait/lock/table/sql/handler 72 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 84 +wait/io/table/sql/handler 85 wait/lock/table/sql/handler 72 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 14 9 5 9 2 3 0 +TABLE test t1 NULL 17 11 6 11 2 4 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t2 NULL 24 14 10 14 4 6 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -535,7 +535,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 18 11 7 11 2 5 0 +TABLE test t1 19 12 7 12 2 5 0 TABLE test t2 26 16 10 16 4 6 0 TABLE test t3 40 25 15 25 6 9 0 execute dump_waits_table_lock; @@ -545,7 +545,7 @@ TABLE test t2 24 8 16 4 0 0 0 4 0 8 TABLE test t3 28 8 20 4 0 0 0 4 0 10 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 38 +TABLE test t1 39 TABLE test t2 50 TABLE test t3 68 connection con3; @@ -598,7 +598,7 @@ connection default; "================== Step 7 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 36 username event_name count_star user2 wait/io/table/sql/handler 51 @@ -610,7 +610,7 @@ username status user4 not found execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 33 +user1 localhost wait/io/table/sql/handler 34 user1 localhost wait/lock/table/sql/handler 36 user2 localhost wait/io/table/sql/handler 51 user2 localhost wait/lock/table/sql/handler 36 @@ -618,7 +618,7 @@ user3 localhost wait/io/table/sql/handler 70 user3 localhost wait/lock/table/sql/handler 36 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 36 user2 wait/io/table/sql/handler 51 user2 wait/lock/table/sql/handler 36 @@ -626,20 +626,20 @@ user3 wait/io/table/sql/handler 70 user3 wait/lock/table/sql/handler 36 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 154 +localhost wait/io/table/sql/handler 155 localhost wait/lock/table/sql/handler 108 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 154 +wait/io/table/sql/handler 155 wait/lock/table/sql/handler 108 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 25 16 9 16 3 6 0 +TABLE test t1 NULL 28 18 10 18 3 7 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 6 3 3 3 0 3 0 +TABLE test t1 PRIMARY 4 2 2 2 0 2 0 TABLE test t2 NULL 45 27 18 27 6 12 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -650,7 +650,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 3 3 0 3 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 31 19 12 19 3 9 0 +TABLE test t1 32 20 12 20 3 9 0 TABLE test t2 48 30 18 30 6 12 0 TABLE test t3 75 48 27 48 9 18 0 execute dump_waits_table_lock; @@ -660,7 +660,7 @@ TABLE test t2 36 12 24 6 0 0 0 6 0 12 TABLE test t3 42 12 30 6 0 0 0 6 0 15 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 61 +TABLE test t1 62 TABLE test t2 84 TABLE test t3 117 connect con4, localhost, user4, , ; @@ -671,7 +671,7 @@ connection default; "================== Step 8 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 36 username event_name count_star user2 wait/io/table/sql/handler 51 @@ -684,7 +684,7 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 33 +user1 localhost wait/io/table/sql/handler 34 user1 localhost wait/lock/table/sql/handler 36 user2 localhost wait/io/table/sql/handler 51 user2 localhost wait/lock/table/sql/handler 36 @@ -694,7 +694,7 @@ user4 localhost wait/io/table/sql/handler 0 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 36 user2 wait/io/table/sql/handler 51 user2 wait/lock/table/sql/handler 36 @@ -704,20 +704,20 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 154 +localhost wait/io/table/sql/handler 155 localhost wait/lock/table/sql/handler 108 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 154 +wait/io/table/sql/handler 155 wait/lock/table/sql/handler 108 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 25 16 9 16 3 6 0 +TABLE test t1 NULL 28 18 10 18 3 7 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 6 3 3 3 0 3 0 +TABLE test t1 PRIMARY 4 2 2 2 0 2 0 TABLE test t2 NULL 45 27 18 27 6 12 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -728,7 +728,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 3 3 0 3 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 31 19 12 19 3 9 0 +TABLE test t1 32 20 12 20 3 9 0 TABLE test t2 48 30 18 30 6 12 0 TABLE test t3 75 48 27 48 9 18 0 execute dump_waits_table_lock; @@ -738,7 +738,7 @@ TABLE test t2 36 12 24 6 0 0 0 6 0 12 TABLE test t3 42 12 30 6 0 0 0 6 0 15 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 61 +TABLE test t1 62 TABLE test t2 84 TABLE test t3 117 connection con4; @@ -798,7 +798,7 @@ connection default; "================== Step 9 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 36 username event_name count_star user2 wait/io/table/sql/handler 51 @@ -811,7 +811,7 @@ user4 wait/io/table/sql/handler 89 user4 wait/lock/table/sql/handler 36 execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 33 +user1 localhost wait/io/table/sql/handler 34 user1 localhost wait/lock/table/sql/handler 36 user2 localhost wait/io/table/sql/handler 51 user2 localhost wait/lock/table/sql/handler 36 @@ -821,7 +821,7 @@ user4 localhost wait/io/table/sql/handler 89 user4 localhost wait/lock/table/sql/handler 36 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 36 user2 wait/io/table/sql/handler 51 user2 wait/lock/table/sql/handler 36 @@ -831,20 +831,20 @@ user4 wait/io/table/sql/handler 89 user4 wait/lock/table/sql/handler 36 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 243 +localhost wait/io/table/sql/handler 244 localhost wait/lock/table/sql/handler 144 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 243 +wait/io/table/sql/handler 244 wait/lock/table/sql/handler 144 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t2 NULL 72 44 28 44 8 20 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -855,7 +855,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t2 76 48 28 48 8 20 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; @@ -865,7 +865,7 @@ TABLE test t2 48 16 32 8 0 0 0 8 0 16 TABLE test t3 56 16 40 8 0 0 0 8 0 20 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 87 +TABLE test t1 88 TABLE test t2 124 TABLE test t3 176 connection con1; @@ -877,7 +877,7 @@ connection default; "================== Step 10 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 48 username event_name count_star user2 wait/io/table/sql/handler 51 @@ -890,7 +890,7 @@ user4 wait/io/table/sql/handler 89 user4 wait/lock/table/sql/handler 36 execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 33 +user1 localhost wait/io/table/sql/handler 34 user1 localhost wait/lock/table/sql/handler 48 user2 localhost wait/io/table/sql/handler 51 user2 localhost wait/lock/table/sql/handler 36 @@ -900,7 +900,7 @@ user4 localhost wait/io/table/sql/handler 89 user4 localhost wait/lock/table/sql/handler 36 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 48 user2 wait/io/table/sql/handler 51 user2 wait/lock/table/sql/handler 36 @@ -910,20 +910,20 @@ user4 wait/io/table/sql/handler 89 user4 wait/lock/table/sql/handler 36 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 243 +localhost wait/io/table/sql/handler 244 localhost wait/lock/table/sql/handler 156 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 243 +wait/io/table/sql/handler 244 wait/lock/table/sql/handler 156 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t2 NULL 72 44 28 44 8 20 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -934,7 +934,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t2 76 48 28 48 8 20 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; @@ -944,7 +944,7 @@ TABLE test t2 52 18 34 8 0 0 1 9 0 17 TABLE test t3 60 18 42 8 0 0 1 9 0 21 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 91 +TABLE test t1 92 TABLE test t2 128 TABLE test t3 180 connection default; @@ -953,7 +953,7 @@ flush tables; "================== Step 11 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 48 username event_name count_star user2 wait/io/table/sql/handler 51 @@ -966,7 +966,7 @@ user4 wait/io/table/sql/handler 89 user4 wait/lock/table/sql/handler 36 execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 33 +user1 localhost wait/io/table/sql/handler 34 user1 localhost wait/lock/table/sql/handler 48 user2 localhost wait/io/table/sql/handler 51 user2 localhost wait/lock/table/sql/handler 36 @@ -976,7 +976,7 @@ user4 localhost wait/io/table/sql/handler 89 user4 localhost wait/lock/table/sql/handler 36 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 48 user2 wait/io/table/sql/handler 51 user2 wait/lock/table/sql/handler 36 @@ -986,20 +986,20 @@ user4 wait/io/table/sql/handler 89 user4 wait/lock/table/sql/handler 36 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 243 +localhost wait/io/table/sql/handler 244 localhost wait/lock/table/sql/handler 156 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 243 +wait/io/table/sql/handler 244 wait/lock/table/sql/handler 156 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t2 NULL 72 44 28 44 8 20 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -1010,7 +1010,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t2 76 48 28 48 8 20 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; @@ -1020,7 +1020,7 @@ TABLE test t2 52 18 34 8 0 0 1 9 0 17 TABLE test t3 60 18 42 8 0 0 1 9 0 21 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 91 +TABLE test t1 92 TABLE test t2 128 TABLE test t3 180 set global read_only=1; @@ -1029,7 +1029,7 @@ set global read_only=0; "================== Step 12 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 48 username event_name count_star user2 wait/io/table/sql/handler 51 @@ -1042,7 +1042,7 @@ user4 wait/io/table/sql/handler 89 user4 wait/lock/table/sql/handler 36 execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 33 +user1 localhost wait/io/table/sql/handler 34 user1 localhost wait/lock/table/sql/handler 48 user2 localhost wait/io/table/sql/handler 51 user2 localhost wait/lock/table/sql/handler 36 @@ -1052,7 +1052,7 @@ user4 localhost wait/io/table/sql/handler 89 user4 localhost wait/lock/table/sql/handler 36 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 48 user2 wait/io/table/sql/handler 51 user2 wait/lock/table/sql/handler 36 @@ -1062,20 +1062,20 @@ user4 wait/io/table/sql/handler 89 user4 wait/lock/table/sql/handler 36 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 243 +localhost wait/io/table/sql/handler 244 localhost wait/lock/table/sql/handler 156 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 243 +wait/io/table/sql/handler 244 wait/lock/table/sql/handler 156 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t2 NULL 72 44 28 44 8 20 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -1086,7 +1086,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t2 76 48 28 48 8 20 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; @@ -1096,7 +1096,7 @@ TABLE test t2 52 18 34 8 0 0 1 9 0 17 TABLE test t3 60 18 42 8 0 0 1 9 0 21 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 91 +TABLE test t1 92 TABLE test t2 128 TABLE test t3 180 disconnect con1; @@ -1115,7 +1115,7 @@ user4 wait/io/table/sql/handler 89 user4 wait/lock/table/sql/handler 36 execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 33 +user1 localhost wait/io/table/sql/handler 34 user1 localhost wait/lock/table/sql/handler 48 user2 localhost wait/io/table/sql/handler 51 user2 localhost wait/lock/table/sql/handler 36 @@ -1125,7 +1125,7 @@ user4 localhost wait/io/table/sql/handler 89 user4 localhost wait/lock/table/sql/handler 36 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 48 user2 wait/io/table/sql/handler 51 user2 wait/lock/table/sql/handler 36 @@ -1135,20 +1135,20 @@ user4 wait/io/table/sql/handler 89 user4 wait/lock/table/sql/handler 36 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 243 +localhost wait/io/table/sql/handler 244 localhost wait/lock/table/sql/handler 156 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 243 +wait/io/table/sql/handler 244 wait/lock/table/sql/handler 156 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t2 NULL 72 44 28 44 8 20 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -1159,7 +1159,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t2 76 48 28 48 8 20 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; @@ -1169,7 +1169,7 @@ TABLE test t2 52 18 34 8 0 0 1 9 0 17 TABLE test t3 60 18 42 8 0 0 1 9 0 21 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 91 +TABLE test t1 92 TABLE test t2 128 TABLE test t3 180 disconnect con2; @@ -1187,7 +1187,7 @@ user4 wait/io/table/sql/handler 89 user4 wait/lock/table/sql/handler 36 execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 33 +user1 localhost wait/io/table/sql/handler 34 user1 localhost wait/lock/table/sql/handler 48 user2 localhost wait/io/table/sql/handler 51 user2 localhost wait/lock/table/sql/handler 36 @@ -1197,7 +1197,7 @@ user4 localhost wait/io/table/sql/handler 89 user4 localhost wait/lock/table/sql/handler 36 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 48 user2 wait/io/table/sql/handler 51 user2 wait/lock/table/sql/handler 36 @@ -1207,20 +1207,20 @@ user4 wait/io/table/sql/handler 89 user4 wait/lock/table/sql/handler 36 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 243 +localhost wait/io/table/sql/handler 244 localhost wait/lock/table/sql/handler 156 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 243 +wait/io/table/sql/handler 244 wait/lock/table/sql/handler 156 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t2 NULL 72 44 28 44 8 20 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -1231,7 +1231,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t2 76 48 28 48 8 20 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; @@ -1241,7 +1241,7 @@ TABLE test t2 52 18 34 8 0 0 1 9 0 17 TABLE test t3 60 18 42 8 0 0 1 9 0 21 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 91 +TABLE test t1 92 TABLE test t2 128 TABLE test t3 180 disconnect con3; @@ -1258,7 +1258,7 @@ user4 wait/io/table/sql/handler 89 user4 wait/lock/table/sql/handler 36 execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 33 +user1 localhost wait/io/table/sql/handler 34 user1 localhost wait/lock/table/sql/handler 48 user2 localhost wait/io/table/sql/handler 51 user2 localhost wait/lock/table/sql/handler 36 @@ -1268,7 +1268,7 @@ user4 localhost wait/io/table/sql/handler 89 user4 localhost wait/lock/table/sql/handler 36 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 48 user2 wait/io/table/sql/handler 51 user2 wait/lock/table/sql/handler 36 @@ -1278,20 +1278,20 @@ user4 wait/io/table/sql/handler 89 user4 wait/lock/table/sql/handler 36 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 243 +localhost wait/io/table/sql/handler 244 localhost wait/lock/table/sql/handler 156 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 243 +wait/io/table/sql/handler 244 wait/lock/table/sql/handler 156 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t2 NULL 72 44 28 44 8 20 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -1302,7 +1302,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t2 76 48 28 48 8 20 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; @@ -1312,7 +1312,7 @@ TABLE test t2 52 18 34 8 0 0 1 9 0 17 TABLE test t3 60 18 42 8 0 0 1 9 0 21 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 91 +TABLE test t1 92 TABLE test t2 128 TABLE test t3 180 disconnect con4; @@ -1328,7 +1328,7 @@ username status user4 not found execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 33 +user1 localhost wait/io/table/sql/handler 34 user1 localhost wait/lock/table/sql/handler 48 user2 localhost wait/io/table/sql/handler 51 user2 localhost wait/lock/table/sql/handler 36 @@ -1338,7 +1338,7 @@ user4 localhost wait/io/table/sql/handler 89 user4 localhost wait/lock/table/sql/handler 36 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 48 user2 wait/io/table/sql/handler 51 user2 wait/lock/table/sql/handler 36 @@ -1348,20 +1348,20 @@ user4 wait/io/table/sql/handler 89 user4 wait/lock/table/sql/handler 36 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 243 +localhost wait/io/table/sql/handler 244 localhost wait/lock/table/sql/handler 156 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 243 +wait/io/table/sql/handler 244 wait/lock/table/sql/handler 156 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t2 NULL 72 44 28 44 8 20 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -1372,7 +1372,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t2 76 48 28 48 8 20 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; @@ -1382,7 +1382,7 @@ TABLE test t2 52 18 34 8 0 0 1 9 0 17 TABLE test t3 60 18 42 8 0 0 1 9 0 21 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 91 +TABLE test t1 92 TABLE test t2 128 TABLE test t3 180 connection default; @@ -1400,7 +1400,7 @@ username status user4 not found execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 33 +user1 localhost wait/io/table/sql/handler 34 user1 localhost wait/lock/table/sql/handler 48 user2 localhost wait/io/table/sql/handler 51 user2 localhost wait/lock/table/sql/handler 36 @@ -1410,7 +1410,7 @@ user4 localhost wait/io/table/sql/handler 89 user4 localhost wait/lock/table/sql/handler 36 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 48 user2 wait/io/table/sql/handler 51 user2 wait/lock/table/sql/handler 36 @@ -1420,20 +1420,20 @@ user4 wait/io/table/sql/handler 89 user4 wait/lock/table/sql/handler 36 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 243 +localhost wait/io/table/sql/handler 244 localhost wait/lock/table/sql/handler 156 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 243 +wait/io/table/sql/handler 244 wait/lock/table/sql/handler 156 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t2 NULL 72 44 28 44 8 20 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -1444,7 +1444,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t2 76 48 28 48 8 20 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; @@ -1454,7 +1454,7 @@ TABLE test t2 52 18 34 8 0 0 1 9 0 17 TABLE test t3 60 18 42 8 0 0 1 9 0 21 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 91 +TABLE test t1 92 TABLE test t2 128 TABLE test t3 180 truncate performance_schema.events_waits_summary_by_account_by_event_name; @@ -1481,7 +1481,7 @@ user4 localhost wait/io/table/sql/handler 0 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 48 user2 wait/io/table/sql/handler 51 user2 wait/lock/table/sql/handler 36 @@ -1491,20 +1491,20 @@ user4 wait/io/table/sql/handler 89 user4 wait/lock/table/sql/handler 36 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 243 +localhost wait/io/table/sql/handler 244 localhost wait/lock/table/sql/handler 156 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 243 +wait/io/table/sql/handler 244 wait/lock/table/sql/handler 156 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t2 NULL 72 44 28 44 8 20 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -1515,7 +1515,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t2 76 48 28 48 8 20 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; @@ -1525,7 +1525,7 @@ TABLE test t2 52 18 34 8 0 0 1 9 0 17 TABLE test t3 60 18 42 8 0 0 1 9 0 21 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 91 +TABLE test t1 92 TABLE test t2 128 TABLE test t3 180 truncate performance_schema.events_waits_summary_by_user_by_event_name; @@ -1562,20 +1562,20 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 243 +localhost wait/io/table/sql/handler 244 localhost wait/lock/table/sql/handler 156 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 243 +wait/io/table/sql/handler 244 wait/lock/table/sql/handler 156 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t2 NULL 72 44 28 44 8 20 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -1586,7 +1586,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t2 76 48 28 48 8 20 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; @@ -1596,7 +1596,7 @@ TABLE test t2 52 18 34 8 0 0 1 9 0 17 TABLE test t3 60 18 42 8 0 0 1 9 0 21 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 91 +TABLE test t1 92 TABLE test t2 128 TABLE test t3 180 truncate performance_schema.events_waits_summary_by_host_by_event_name; @@ -1637,16 +1637,16 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 243 +wait/io/table/sql/handler 244 wait/lock/table/sql/handler 156 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t2 NULL 72 44 28 44 8 20 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -1657,7 +1657,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t2 76 48 28 48 8 20 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; @@ -1667,7 +1667,7 @@ TABLE test t2 52 18 34 8 0 0 1 9 0 17 TABLE test t3 60 18 42 8 0 0 1 9 0 21 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 91 +TABLE test t1 92 TABLE test t2 128 TABLE test t3 180 truncate performance_schema.events_waits_summary_global_by_event_name; diff --git a/mysql-test/suite/perfschema/r/table_io_aggregate_global_2u_2t.result b/mysql-test/suite/perfschema/r/table_io_aggregate_global_2u_2t.result index abecba095bb..670325451ba 100644 --- a/mysql-test/suite/perfschema/r/table_io_aggregate_global_2u_2t.result +++ b/mysql-test/suite/perfschema/r/table_io_aggregate_global_2u_2t.result @@ -202,23 +202,23 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 23 +wait/io/table/sql/handler 24 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 6 4 2 4 1 1 0 +TABLE test t1 NULL 9 6 3 6 1 2 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 2 1 1 1 0 1 0 +TABLE test t1 PRIMARY 0 0 0 0 0 0 0 TABLE test t3 NULL 13 7 6 7 3 3 0 TABLE test t3 index_b 1 1 0 1 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 1 1 0 1 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 8 5 3 5 1 2 0 +TABLE test t1 9 6 3 6 1 2 0 TABLE test t3 15 9 6 9 3 3 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -226,7 +226,7 @@ TABLE test t1 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 8 +TABLE test t1 9 TABLE test t2 0 TABLE test t3 15 connection con1; @@ -258,23 +258,23 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 23 +wait/io/table/sql/handler 24 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 6 4 2 4 1 1 0 +TABLE test t1 NULL 9 6 3 6 1 2 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 2 1 1 1 0 1 0 +TABLE test t1 PRIMARY 0 0 0 0 0 0 0 TABLE test t3 NULL 13 7 6 7 3 3 0 TABLE test t3 index_b 1 1 0 1 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 1 1 0 1 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 8 5 3 5 1 2 0 +TABLE test t1 9 6 3 6 1 2 0 TABLE test t3 15 9 6 9 3 3 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -282,7 +282,7 @@ TABLE test t1 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 8 +TABLE test t1 9 TABLE test t2 0 TABLE test t3 15 connect con2, localhost, user2, , ; @@ -320,23 +320,23 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 23 +wait/io/table/sql/handler 24 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 6 4 2 4 1 1 0 +TABLE test t1 NULL 9 6 3 6 1 2 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 2 1 1 1 0 1 0 +TABLE test t1 PRIMARY 0 0 0 0 0 0 0 TABLE test t3 NULL 13 7 6 7 3 3 0 TABLE test t3 index_b 1 1 0 1 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 1 1 0 1 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 8 5 3 5 1 2 0 +TABLE test t1 9 6 3 6 1 2 0 TABLE test t3 15 9 6 9 3 3 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -344,7 +344,7 @@ TABLE test t1 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 8 +TABLE test t1 9 TABLE test t2 0 TABLE test t3 15 connection con2; @@ -417,23 +417,23 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 58 +wait/io/table/sql/handler 59 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 14 9 5 9 2 3 0 +TABLE test t1 NULL 17 11 6 11 2 4 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t3 NULL 35 20 15 20 6 9 0 TABLE test t3 index_b 3 3 0 3 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 18 11 7 11 2 5 0 +TABLE test t1 19 12 7 12 2 5 0 TABLE test t3 40 25 15 25 6 9 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -441,7 +441,7 @@ TABLE test t1 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 18 +TABLE test t1 19 TABLE test t2 0 TABLE test t3 40 connect con3, localhost, user3, , ; @@ -484,23 +484,23 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 58 +wait/io/table/sql/handler 59 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 14 9 5 9 2 3 0 +TABLE test t1 NULL 17 11 6 11 2 4 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t3 NULL 35 20 15 20 6 9 0 TABLE test t3 index_b 3 3 0 3 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 18 11 7 11 2 5 0 +TABLE test t1 19 12 7 12 2 5 0 TABLE test t3 40 25 15 25 6 9 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -508,7 +508,7 @@ TABLE test t1 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 18 +TABLE test t1 19 TABLE test t2 0 TABLE test t3 40 connection con3; @@ -593,23 +593,23 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 106 +wait/io/table/sql/handler 107 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 25 16 9 16 3 6 0 +TABLE test t1 NULL 28 18 10 18 3 7 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 6 3 3 3 0 3 0 +TABLE test t1 PRIMARY 4 2 2 2 0 2 0 TABLE test t3 NULL 66 39 27 39 9 18 0 TABLE test t3 index_b 6 6 0 6 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 3 3 0 3 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 31 19 12 19 3 9 0 +TABLE test t1 32 20 12 20 3 9 0 TABLE test t3 75 48 27 48 9 18 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -617,7 +617,7 @@ TABLE test t1 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 31 +TABLE test t1 32 TABLE test t2 0 TABLE test t3 75 connect con4, localhost, user4, , ; @@ -665,23 +665,23 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 106 +wait/io/table/sql/handler 107 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 25 16 9 16 3 6 0 +TABLE test t1 NULL 28 18 10 18 3 7 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 6 3 3 3 0 3 0 +TABLE test t1 PRIMARY 4 2 2 2 0 2 0 TABLE test t3 NULL 66 39 27 39 9 18 0 TABLE test t3 index_b 6 6 0 6 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 3 3 0 3 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 31 19 12 19 3 9 0 +TABLE test t1 32 20 12 20 3 9 0 TABLE test t3 75 48 27 48 9 18 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -689,7 +689,7 @@ TABLE test t1 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 31 +TABLE test t1 32 TABLE test t2 0 TABLE test t3 75 connection con4; @@ -786,23 +786,23 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 167 +wait/io/table/sql/handler 168 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t3 NULL 106 64 42 64 12 30 0 TABLE test t3 index_b 10 10 0 10 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -810,7 +810,7 @@ TABLE test t1 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 47 +TABLE test t1 48 TABLE test t2 0 TABLE test t3 120 connection con1; @@ -859,23 +859,23 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 167 +wait/io/table/sql/handler 168 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t3 NULL 106 64 42 64 12 30 0 TABLE test t3 index_b 10 10 0 10 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -883,7 +883,7 @@ TABLE test t1 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 47 +TABLE test t1 48 TABLE test t2 0 TABLE test t3 120 connection default; @@ -929,23 +929,23 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 167 +wait/io/table/sql/handler 168 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t3 NULL 106 64 42 64 12 30 0 TABLE test t3 index_b 10 10 0 10 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -953,7 +953,7 @@ TABLE test t1 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 47 +TABLE test t1 48 TABLE test t2 0 TABLE test t3 120 set global read_only=1; @@ -999,23 +999,23 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 167 +wait/io/table/sql/handler 168 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t3 NULL 106 64 42 64 12 30 0 TABLE test t3 index_b 10 10 0 10 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -1023,7 +1023,7 @@ TABLE test t1 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 47 +TABLE test t1 48 TABLE test t2 0 TABLE test t3 120 disconnect con1; @@ -1066,23 +1066,23 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 167 +wait/io/table/sql/handler 168 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t3 NULL 106 64 42 64 12 30 0 TABLE test t3 index_b 10 10 0 10 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -1090,7 +1090,7 @@ TABLE test t1 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 47 +TABLE test t1 48 TABLE test t2 0 TABLE test t3 120 disconnect con2; @@ -1132,23 +1132,23 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 167 +wait/io/table/sql/handler 168 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t3 NULL 106 64 42 64 12 30 0 TABLE test t3 index_b 10 10 0 10 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -1156,7 +1156,7 @@ TABLE test t1 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 47 +TABLE test t1 48 TABLE test t2 0 TABLE test t3 120 disconnect con3; @@ -1197,23 +1197,23 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 167 +wait/io/table/sql/handler 168 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t3 NULL 106 64 42 64 12 30 0 TABLE test t3 index_b 10 10 0 10 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -1221,7 +1221,7 @@ TABLE test t1 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 47 +TABLE test t1 48 TABLE test t2 0 TABLE test t3 120 disconnect con4; @@ -1261,23 +1261,23 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 167 +wait/io/table/sql/handler 168 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t3 NULL 106 64 42 64 12 30 0 TABLE test t3 index_b 10 10 0 10 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -1285,7 +1285,7 @@ TABLE test t1 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 47 +TABLE test t1 48 TABLE test t2 0 TABLE test t3 120 connection default; @@ -1327,23 +1327,23 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 167 +wait/io/table/sql/handler 168 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t3 NULL 106 64 42 64 12 30 0 TABLE test t3 index_b 10 10 0 10 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -1351,7 +1351,7 @@ TABLE test t1 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 47 +TABLE test t1 48 TABLE test t2 0 TABLE test t3 120 truncate performance_schema.events_waits_summary_by_account_by_event_name; @@ -1392,23 +1392,23 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 167 +wait/io/table/sql/handler 168 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t3 NULL 106 64 42 64 12 30 0 TABLE test t3 index_b 10 10 0 10 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -1416,7 +1416,7 @@ TABLE test t1 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 47 +TABLE test t1 48 TABLE test t2 0 TABLE test t3 120 truncate performance_schema.events_waits_summary_by_user_by_event_name; @@ -1457,23 +1457,23 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 167 +wait/io/table/sql/handler 168 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t3 NULL 106 64 42 64 12 30 0 TABLE test t3 index_b 10 10 0 10 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -1481,7 +1481,7 @@ TABLE test t1 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 47 +TABLE test t1 48 TABLE test t2 0 TABLE test t3 120 truncate performance_schema.events_waits_summary_by_host_by_event_name; @@ -1522,23 +1522,23 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 167 +wait/io/table/sql/handler 168 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t3 NULL 106 64 42 64 12 30 0 TABLE test t3 index_b 10 10 0 10 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -1546,7 +1546,7 @@ TABLE test t1 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 47 +TABLE test t1 48 TABLE test t2 0 TABLE test t3 120 truncate performance_schema.events_waits_summary_global_by_event_name; diff --git a/mysql-test/suite/perfschema/r/table_io_aggregate_global_2u_3t.result b/mysql-test/suite/perfschema/r/table_io_aggregate_global_2u_3t.result index 6df4cad7899..5a261869ba0 100644 --- a/mysql-test/suite/perfschema/r/table_io_aggregate_global_2u_3t.result +++ b/mysql-test/suite/perfschema/r/table_io_aggregate_global_2u_3t.result @@ -211,16 +211,16 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 33 +wait/io/table/sql/handler 34 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 6 4 2 4 1 1 0 +TABLE test t1 NULL 9 6 3 6 1 2 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 2 1 1 1 0 1 0 +TABLE test t1 PRIMARY 0 0 0 0 0 0 0 TABLE test t2 NULL 9 5 4 5 2 2 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -231,7 +231,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 1 1 0 1 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 8 5 3 5 1 2 0 +TABLE test t1 9 6 3 6 1 2 0 TABLE test t2 10 6 4 6 2 2 0 TABLE test t3 15 9 6 9 3 3 0 execute dump_waits_table_lock; @@ -241,7 +241,7 @@ TABLE test t2 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 8 +TABLE test t1 9 TABLE test t2 10 TABLE test t3 15 connection con1; @@ -273,16 +273,16 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 33 +wait/io/table/sql/handler 34 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 6 4 2 4 1 1 0 +TABLE test t1 NULL 9 6 3 6 1 2 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 2 1 1 1 0 1 0 +TABLE test t1 PRIMARY 0 0 0 0 0 0 0 TABLE test t2 NULL 9 5 4 5 2 2 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -293,7 +293,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 1 1 0 1 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 8 5 3 5 1 2 0 +TABLE test t1 9 6 3 6 1 2 0 TABLE test t2 10 6 4 6 2 2 0 TABLE test t3 15 9 6 9 3 3 0 execute dump_waits_table_lock; @@ -303,7 +303,7 @@ TABLE test t2 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 8 +TABLE test t1 9 TABLE test t2 10 TABLE test t3 15 connect con2, localhost, user2, , ; @@ -341,16 +341,16 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 33 +wait/io/table/sql/handler 34 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 6 4 2 4 1 1 0 +TABLE test t1 NULL 9 6 3 6 1 2 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 2 1 1 1 0 1 0 +TABLE test t1 PRIMARY 0 0 0 0 0 0 0 TABLE test t2 NULL 9 5 4 5 2 2 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -361,7 +361,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 1 1 0 1 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 8 5 3 5 1 2 0 +TABLE test t1 9 6 3 6 1 2 0 TABLE test t2 10 6 4 6 2 2 0 TABLE test t3 15 9 6 9 3 3 0 execute dump_waits_table_lock; @@ -371,7 +371,7 @@ TABLE test t2 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 8 +TABLE test t1 9 TABLE test t2 10 TABLE test t3 15 connection con2; @@ -444,16 +444,16 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 84 +wait/io/table/sql/handler 85 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 14 9 5 9 2 3 0 +TABLE test t1 NULL 17 11 6 11 2 4 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t2 NULL 24 14 10 14 4 6 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -464,7 +464,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 18 11 7 11 2 5 0 +TABLE test t1 19 12 7 12 2 5 0 TABLE test t2 26 16 10 16 4 6 0 TABLE test t3 40 25 15 25 6 9 0 execute dump_waits_table_lock; @@ -474,7 +474,7 @@ TABLE test t2 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 18 +TABLE test t1 19 TABLE test t2 26 TABLE test t3 40 connect con3, localhost, user3, , ; @@ -517,16 +517,16 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 84 +wait/io/table/sql/handler 85 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 14 9 5 9 2 3 0 +TABLE test t1 NULL 17 11 6 11 2 4 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t2 NULL 24 14 10 14 4 6 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -537,7 +537,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 18 11 7 11 2 5 0 +TABLE test t1 19 12 7 12 2 5 0 TABLE test t2 26 16 10 16 4 6 0 TABLE test t3 40 25 15 25 6 9 0 execute dump_waits_table_lock; @@ -547,7 +547,7 @@ TABLE test t2 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 18 +TABLE test t1 19 TABLE test t2 26 TABLE test t3 40 connection con3; @@ -632,16 +632,16 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 154 +wait/io/table/sql/handler 155 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 25 16 9 16 3 6 0 +TABLE test t1 NULL 28 18 10 18 3 7 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 6 3 3 3 0 3 0 +TABLE test t1 PRIMARY 4 2 2 2 0 2 0 TABLE test t2 NULL 45 27 18 27 6 12 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -652,7 +652,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 3 3 0 3 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 31 19 12 19 3 9 0 +TABLE test t1 32 20 12 20 3 9 0 TABLE test t2 48 30 18 30 6 12 0 TABLE test t3 75 48 27 48 9 18 0 execute dump_waits_table_lock; @@ -662,7 +662,7 @@ TABLE test t2 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 31 +TABLE test t1 32 TABLE test t2 48 TABLE test t3 75 connect con4, localhost, user4, , ; @@ -710,16 +710,16 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 154 +wait/io/table/sql/handler 155 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 25 16 9 16 3 6 0 +TABLE test t1 NULL 28 18 10 18 3 7 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 6 3 3 3 0 3 0 +TABLE test t1 PRIMARY 4 2 2 2 0 2 0 TABLE test t2 NULL 45 27 18 27 6 12 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -730,7 +730,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 3 3 0 3 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 31 19 12 19 3 9 0 +TABLE test t1 32 20 12 20 3 9 0 TABLE test t2 48 30 18 30 6 12 0 TABLE test t3 75 48 27 48 9 18 0 execute dump_waits_table_lock; @@ -740,7 +740,7 @@ TABLE test t2 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 31 +TABLE test t1 32 TABLE test t2 48 TABLE test t3 75 connection con4; @@ -837,16 +837,16 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 243 +wait/io/table/sql/handler 244 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t2 NULL 72 44 28 44 8 20 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -857,7 +857,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t2 76 48 28 48 8 20 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; @@ -867,7 +867,7 @@ TABLE test t2 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 47 +TABLE test t1 48 TABLE test t2 76 TABLE test t3 120 connection con1; @@ -916,16 +916,16 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 243 +wait/io/table/sql/handler 244 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t2 NULL 72 44 28 44 8 20 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -936,7 +936,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t2 76 48 28 48 8 20 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; @@ -946,7 +946,7 @@ TABLE test t2 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 47 +TABLE test t1 48 TABLE test t2 76 TABLE test t3 120 connection default; @@ -992,16 +992,16 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 243 +wait/io/table/sql/handler 244 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t2 NULL 72 44 28 44 8 20 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -1012,7 +1012,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t2 76 48 28 48 8 20 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; @@ -1022,7 +1022,7 @@ TABLE test t2 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 47 +TABLE test t1 48 TABLE test t2 76 TABLE test t3 120 set global read_only=1; @@ -1068,16 +1068,16 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 243 +wait/io/table/sql/handler 244 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t2 NULL 72 44 28 44 8 20 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -1088,7 +1088,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t2 76 48 28 48 8 20 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; @@ -1098,7 +1098,7 @@ TABLE test t2 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 47 +TABLE test t1 48 TABLE test t2 76 TABLE test t3 120 disconnect con1; @@ -1141,16 +1141,16 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 243 +wait/io/table/sql/handler 244 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t2 NULL 72 44 28 44 8 20 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -1161,7 +1161,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t2 76 48 28 48 8 20 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; @@ -1171,7 +1171,7 @@ TABLE test t2 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 47 +TABLE test t1 48 TABLE test t2 76 TABLE test t3 120 disconnect con2; @@ -1213,16 +1213,16 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 243 +wait/io/table/sql/handler 244 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t2 NULL 72 44 28 44 8 20 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -1233,7 +1233,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t2 76 48 28 48 8 20 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; @@ -1243,7 +1243,7 @@ TABLE test t2 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 47 +TABLE test t1 48 TABLE test t2 76 TABLE test t3 120 disconnect con3; @@ -1284,16 +1284,16 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 243 +wait/io/table/sql/handler 244 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t2 NULL 72 44 28 44 8 20 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -1304,7 +1304,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t2 76 48 28 48 8 20 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; @@ -1314,7 +1314,7 @@ TABLE test t2 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 47 +TABLE test t1 48 TABLE test t2 76 TABLE test t3 120 disconnect con4; @@ -1354,16 +1354,16 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 243 +wait/io/table/sql/handler 244 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t2 NULL 72 44 28 44 8 20 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -1374,7 +1374,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t2 76 48 28 48 8 20 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; @@ -1384,7 +1384,7 @@ TABLE test t2 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 47 +TABLE test t1 48 TABLE test t2 76 TABLE test t3 120 connection default; @@ -1426,16 +1426,16 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 243 +wait/io/table/sql/handler 244 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t2 NULL 72 44 28 44 8 20 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -1446,7 +1446,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t2 76 48 28 48 8 20 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; @@ -1456,7 +1456,7 @@ TABLE test t2 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 47 +TABLE test t1 48 TABLE test t2 76 TABLE test t3 120 truncate performance_schema.events_waits_summary_by_account_by_event_name; @@ -1497,16 +1497,16 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 243 +wait/io/table/sql/handler 244 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t2 NULL 72 44 28 44 8 20 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -1517,7 +1517,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t2 76 48 28 48 8 20 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; @@ -1527,7 +1527,7 @@ TABLE test t2 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 47 +TABLE test t1 48 TABLE test t2 76 TABLE test t3 120 truncate performance_schema.events_waits_summary_by_user_by_event_name; @@ -1568,16 +1568,16 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 243 +wait/io/table/sql/handler 244 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t2 NULL 72 44 28 44 8 20 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -1588,7 +1588,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t2 76 48 28 48 8 20 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; @@ -1598,7 +1598,7 @@ TABLE test t2 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 47 +TABLE test t1 48 TABLE test t2 76 TABLE test t3 120 truncate performance_schema.events_waits_summary_by_host_by_event_name; @@ -1639,16 +1639,16 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 243 +wait/io/table/sql/handler 244 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t2 NULL 72 44 28 44 8 20 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -1659,7 +1659,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t2 76 48 28 48 8 20 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; @@ -1669,7 +1669,7 @@ TABLE test t2 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 47 +TABLE test t1 48 TABLE test t2 76 TABLE test t3 120 truncate performance_schema.events_waits_summary_global_by_event_name; diff --git a/mysql-test/suite/perfschema/r/table_io_aggregate_global_4u_2t.result b/mysql-test/suite/perfschema/r/table_io_aggregate_global_4u_2t.result index 47397d72d4a..20cf49db9fd 100644 --- a/mysql-test/suite/perfschema/r/table_io_aggregate_global_4u_2t.result +++ b/mysql-test/suite/perfschema/r/table_io_aggregate_global_4u_2t.result @@ -202,23 +202,23 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 23 +wait/io/table/sql/handler 24 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 6 4 2 4 1 1 0 +TABLE test t1 NULL 9 6 3 6 1 2 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 2 1 1 1 0 1 0 +TABLE test t1 PRIMARY 0 0 0 0 0 0 0 TABLE test t3 NULL 13 7 6 7 3 3 0 TABLE test t3 index_b 1 1 0 1 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 1 1 0 1 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 8 5 3 5 1 2 0 +TABLE test t1 9 6 3 6 1 2 0 TABLE test t3 15 9 6 9 3 3 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -226,7 +226,7 @@ TABLE test t1 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 8 +TABLE test t1 9 TABLE test t2 0 TABLE test t3 15 connection con1; @@ -258,23 +258,23 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 23 +wait/io/table/sql/handler 24 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 6 4 2 4 1 1 0 +TABLE test t1 NULL 9 6 3 6 1 2 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 2 1 1 1 0 1 0 +TABLE test t1 PRIMARY 0 0 0 0 0 0 0 TABLE test t3 NULL 13 7 6 7 3 3 0 TABLE test t3 index_b 1 1 0 1 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 1 1 0 1 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 8 5 3 5 1 2 0 +TABLE test t1 9 6 3 6 1 2 0 TABLE test t3 15 9 6 9 3 3 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -282,7 +282,7 @@ TABLE test t1 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 8 +TABLE test t1 9 TABLE test t2 0 TABLE test t3 15 connect con2, localhost, user2, , ; @@ -320,23 +320,23 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 23 +wait/io/table/sql/handler 24 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 6 4 2 4 1 1 0 +TABLE test t1 NULL 9 6 3 6 1 2 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 2 1 1 1 0 1 0 +TABLE test t1 PRIMARY 0 0 0 0 0 0 0 TABLE test t3 NULL 13 7 6 7 3 3 0 TABLE test t3 index_b 1 1 0 1 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 1 1 0 1 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 8 5 3 5 1 2 0 +TABLE test t1 9 6 3 6 1 2 0 TABLE test t3 15 9 6 9 3 3 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -344,7 +344,7 @@ TABLE test t1 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 8 +TABLE test t1 9 TABLE test t2 0 TABLE test t3 15 connection con2; @@ -417,23 +417,23 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 58 +wait/io/table/sql/handler 59 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 14 9 5 9 2 3 0 +TABLE test t1 NULL 17 11 6 11 2 4 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t3 NULL 35 20 15 20 6 9 0 TABLE test t3 index_b 3 3 0 3 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 18 11 7 11 2 5 0 +TABLE test t1 19 12 7 12 2 5 0 TABLE test t3 40 25 15 25 6 9 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -441,7 +441,7 @@ TABLE test t1 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 18 +TABLE test t1 19 TABLE test t2 0 TABLE test t3 40 connect con3, localhost, user3, , ; @@ -484,23 +484,23 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 58 +wait/io/table/sql/handler 59 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 14 9 5 9 2 3 0 +TABLE test t1 NULL 17 11 6 11 2 4 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t3 NULL 35 20 15 20 6 9 0 TABLE test t3 index_b 3 3 0 3 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 18 11 7 11 2 5 0 +TABLE test t1 19 12 7 12 2 5 0 TABLE test t3 40 25 15 25 6 9 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -508,7 +508,7 @@ TABLE test t1 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 18 +TABLE test t1 19 TABLE test t2 0 TABLE test t3 40 connection con3; @@ -593,23 +593,23 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 106 +wait/io/table/sql/handler 107 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 25 16 9 16 3 6 0 +TABLE test t1 NULL 28 18 10 18 3 7 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 6 3 3 3 0 3 0 +TABLE test t1 PRIMARY 4 2 2 2 0 2 0 TABLE test t3 NULL 66 39 27 39 9 18 0 TABLE test t3 index_b 6 6 0 6 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 3 3 0 3 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 31 19 12 19 3 9 0 +TABLE test t1 32 20 12 20 3 9 0 TABLE test t3 75 48 27 48 9 18 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -617,7 +617,7 @@ TABLE test t1 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 31 +TABLE test t1 32 TABLE test t2 0 TABLE test t3 75 connect con4, localhost, user4, , ; @@ -665,23 +665,23 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 106 +wait/io/table/sql/handler 107 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 25 16 9 16 3 6 0 +TABLE test t1 NULL 28 18 10 18 3 7 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 6 3 3 3 0 3 0 +TABLE test t1 PRIMARY 4 2 2 2 0 2 0 TABLE test t3 NULL 66 39 27 39 9 18 0 TABLE test t3 index_b 6 6 0 6 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 3 3 0 3 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 31 19 12 19 3 9 0 +TABLE test t1 32 20 12 20 3 9 0 TABLE test t3 75 48 27 48 9 18 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -689,7 +689,7 @@ TABLE test t1 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 31 +TABLE test t1 32 TABLE test t2 0 TABLE test t3 75 connection con4; @@ -786,23 +786,23 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 167 +wait/io/table/sql/handler 168 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t3 NULL 106 64 42 64 12 30 0 TABLE test t3 index_b 10 10 0 10 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -810,7 +810,7 @@ TABLE test t1 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 47 +TABLE test t1 48 TABLE test t2 0 TABLE test t3 120 connection con1; @@ -859,23 +859,23 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 167 +wait/io/table/sql/handler 168 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t3 NULL 106 64 42 64 12 30 0 TABLE test t3 index_b 10 10 0 10 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -883,7 +883,7 @@ TABLE test t1 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 47 +TABLE test t1 48 TABLE test t2 0 TABLE test t3 120 connection default; @@ -929,23 +929,23 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 167 +wait/io/table/sql/handler 168 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t3 NULL 106 64 42 64 12 30 0 TABLE test t3 index_b 10 10 0 10 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -953,7 +953,7 @@ TABLE test t1 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 47 +TABLE test t1 48 TABLE test t2 0 TABLE test t3 120 set global read_only=1; @@ -999,23 +999,23 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 167 +wait/io/table/sql/handler 168 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t3 NULL 106 64 42 64 12 30 0 TABLE test t3 index_b 10 10 0 10 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -1023,7 +1023,7 @@ TABLE test t1 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 47 +TABLE test t1 48 TABLE test t2 0 TABLE test t3 120 disconnect con1; @@ -1066,23 +1066,23 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 167 +wait/io/table/sql/handler 168 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t3 NULL 106 64 42 64 12 30 0 TABLE test t3 index_b 10 10 0 10 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -1090,7 +1090,7 @@ TABLE test t1 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 47 +TABLE test t1 48 TABLE test t2 0 TABLE test t3 120 disconnect con2; @@ -1132,23 +1132,23 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 167 +wait/io/table/sql/handler 168 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t3 NULL 106 64 42 64 12 30 0 TABLE test t3 index_b 10 10 0 10 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -1156,7 +1156,7 @@ TABLE test t1 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 47 +TABLE test t1 48 TABLE test t2 0 TABLE test t3 120 disconnect con3; @@ -1197,23 +1197,23 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 167 +wait/io/table/sql/handler 168 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t3 NULL 106 64 42 64 12 30 0 TABLE test t3 index_b 10 10 0 10 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -1221,7 +1221,7 @@ TABLE test t1 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 47 +TABLE test t1 48 TABLE test t2 0 TABLE test t3 120 disconnect con4; @@ -1261,23 +1261,23 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 167 +wait/io/table/sql/handler 168 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t3 NULL 106 64 42 64 12 30 0 TABLE test t3 index_b 10 10 0 10 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -1285,7 +1285,7 @@ TABLE test t1 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 47 +TABLE test t1 48 TABLE test t2 0 TABLE test t3 120 connection default; @@ -1327,23 +1327,23 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 167 +wait/io/table/sql/handler 168 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t3 NULL 106 64 42 64 12 30 0 TABLE test t3 index_b 10 10 0 10 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -1351,7 +1351,7 @@ TABLE test t1 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 47 +TABLE test t1 48 TABLE test t2 0 TABLE test t3 120 truncate performance_schema.events_waits_summary_by_account_by_event_name; @@ -1392,23 +1392,23 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 167 +wait/io/table/sql/handler 168 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t3 NULL 106 64 42 64 12 30 0 TABLE test t3 index_b 10 10 0 10 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -1416,7 +1416,7 @@ TABLE test t1 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 47 +TABLE test t1 48 TABLE test t2 0 TABLE test t3 120 truncate performance_schema.events_waits_summary_by_user_by_event_name; @@ -1457,23 +1457,23 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 167 +wait/io/table/sql/handler 168 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t3 NULL 106 64 42 64 12 30 0 TABLE test t3 index_b 10 10 0 10 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -1481,7 +1481,7 @@ TABLE test t1 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 47 +TABLE test t1 48 TABLE test t2 0 TABLE test t3 120 truncate performance_schema.events_waits_summary_by_host_by_event_name; @@ -1522,23 +1522,23 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 167 +wait/io/table/sql/handler 168 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t3 NULL 106 64 42 64 12 30 0 TABLE test t3 index_b 10 10 0 10 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -1546,7 +1546,7 @@ TABLE test t1 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 47 +TABLE test t1 48 TABLE test t2 0 TABLE test t3 120 truncate performance_schema.events_waits_summary_global_by_event_name; diff --git a/mysql-test/suite/perfschema/r/table_io_aggregate_global_4u_3t.result b/mysql-test/suite/perfschema/r/table_io_aggregate_global_4u_3t.result index a697a1ae36d..59c9173e7cc 100644 --- a/mysql-test/suite/perfschema/r/table_io_aggregate_global_4u_3t.result +++ b/mysql-test/suite/perfschema/r/table_io_aggregate_global_4u_3t.result @@ -211,16 +211,16 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 33 +wait/io/table/sql/handler 34 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 6 4 2 4 1 1 0 +TABLE test t1 NULL 9 6 3 6 1 2 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 2 1 1 1 0 1 0 +TABLE test t1 PRIMARY 0 0 0 0 0 0 0 TABLE test t2 NULL 9 5 4 5 2 2 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -231,7 +231,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 1 1 0 1 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 8 5 3 5 1 2 0 +TABLE test t1 9 6 3 6 1 2 0 TABLE test t2 10 6 4 6 2 2 0 TABLE test t3 15 9 6 9 3 3 0 execute dump_waits_table_lock; @@ -241,7 +241,7 @@ TABLE test t2 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 8 +TABLE test t1 9 TABLE test t2 10 TABLE test t3 15 connection con1; @@ -273,16 +273,16 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 33 +wait/io/table/sql/handler 34 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 6 4 2 4 1 1 0 +TABLE test t1 NULL 9 6 3 6 1 2 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 2 1 1 1 0 1 0 +TABLE test t1 PRIMARY 0 0 0 0 0 0 0 TABLE test t2 NULL 9 5 4 5 2 2 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -293,7 +293,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 1 1 0 1 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 8 5 3 5 1 2 0 +TABLE test t1 9 6 3 6 1 2 0 TABLE test t2 10 6 4 6 2 2 0 TABLE test t3 15 9 6 9 3 3 0 execute dump_waits_table_lock; @@ -303,7 +303,7 @@ TABLE test t2 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 8 +TABLE test t1 9 TABLE test t2 10 TABLE test t3 15 connect con2, localhost, user2, , ; @@ -341,16 +341,16 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 33 +wait/io/table/sql/handler 34 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 6 4 2 4 1 1 0 +TABLE test t1 NULL 9 6 3 6 1 2 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 2 1 1 1 0 1 0 +TABLE test t1 PRIMARY 0 0 0 0 0 0 0 TABLE test t2 NULL 9 5 4 5 2 2 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -361,7 +361,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 1 1 0 1 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 8 5 3 5 1 2 0 +TABLE test t1 9 6 3 6 1 2 0 TABLE test t2 10 6 4 6 2 2 0 TABLE test t3 15 9 6 9 3 3 0 execute dump_waits_table_lock; @@ -371,7 +371,7 @@ TABLE test t2 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 8 +TABLE test t1 9 TABLE test t2 10 TABLE test t3 15 connection con2; @@ -444,16 +444,16 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 84 +wait/io/table/sql/handler 85 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 14 9 5 9 2 3 0 +TABLE test t1 NULL 17 11 6 11 2 4 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t2 NULL 24 14 10 14 4 6 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -464,7 +464,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 18 11 7 11 2 5 0 +TABLE test t1 19 12 7 12 2 5 0 TABLE test t2 26 16 10 16 4 6 0 TABLE test t3 40 25 15 25 6 9 0 execute dump_waits_table_lock; @@ -474,7 +474,7 @@ TABLE test t2 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 18 +TABLE test t1 19 TABLE test t2 26 TABLE test t3 40 connect con3, localhost, user3, , ; @@ -517,16 +517,16 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 84 +wait/io/table/sql/handler 85 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 14 9 5 9 2 3 0 +TABLE test t1 NULL 17 11 6 11 2 4 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t2 NULL 24 14 10 14 4 6 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -537,7 +537,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 18 11 7 11 2 5 0 +TABLE test t1 19 12 7 12 2 5 0 TABLE test t2 26 16 10 16 4 6 0 TABLE test t3 40 25 15 25 6 9 0 execute dump_waits_table_lock; @@ -547,7 +547,7 @@ TABLE test t2 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 18 +TABLE test t1 19 TABLE test t2 26 TABLE test t3 40 connection con3; @@ -632,16 +632,16 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 154 +wait/io/table/sql/handler 155 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 25 16 9 16 3 6 0 +TABLE test t1 NULL 28 18 10 18 3 7 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 6 3 3 3 0 3 0 +TABLE test t1 PRIMARY 4 2 2 2 0 2 0 TABLE test t2 NULL 45 27 18 27 6 12 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -652,7 +652,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 3 3 0 3 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 31 19 12 19 3 9 0 +TABLE test t1 32 20 12 20 3 9 0 TABLE test t2 48 30 18 30 6 12 0 TABLE test t3 75 48 27 48 9 18 0 execute dump_waits_table_lock; @@ -662,7 +662,7 @@ TABLE test t2 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 31 +TABLE test t1 32 TABLE test t2 48 TABLE test t3 75 connect con4, localhost, user4, , ; @@ -710,16 +710,16 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 154 +wait/io/table/sql/handler 155 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 25 16 9 16 3 6 0 +TABLE test t1 NULL 28 18 10 18 3 7 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 6 3 3 3 0 3 0 +TABLE test t1 PRIMARY 4 2 2 2 0 2 0 TABLE test t2 NULL 45 27 18 27 6 12 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -730,7 +730,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 3 3 0 3 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 31 19 12 19 3 9 0 +TABLE test t1 32 20 12 20 3 9 0 TABLE test t2 48 30 18 30 6 12 0 TABLE test t3 75 48 27 48 9 18 0 execute dump_waits_table_lock; @@ -740,7 +740,7 @@ TABLE test t2 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 31 +TABLE test t1 32 TABLE test t2 48 TABLE test t3 75 connection con4; @@ -837,16 +837,16 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 243 +wait/io/table/sql/handler 244 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t2 NULL 72 44 28 44 8 20 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -857,7 +857,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t2 76 48 28 48 8 20 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; @@ -867,7 +867,7 @@ TABLE test t2 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 47 +TABLE test t1 48 TABLE test t2 76 TABLE test t3 120 connection con1; @@ -916,16 +916,16 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 243 +wait/io/table/sql/handler 244 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t2 NULL 72 44 28 44 8 20 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -936,7 +936,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t2 76 48 28 48 8 20 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; @@ -946,7 +946,7 @@ TABLE test t2 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 47 +TABLE test t1 48 TABLE test t2 76 TABLE test t3 120 connection default; @@ -992,16 +992,16 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 243 +wait/io/table/sql/handler 244 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t2 NULL 72 44 28 44 8 20 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -1012,7 +1012,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t2 76 48 28 48 8 20 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; @@ -1022,7 +1022,7 @@ TABLE test t2 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 47 +TABLE test t1 48 TABLE test t2 76 TABLE test t3 120 set global read_only=1; @@ -1068,16 +1068,16 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 243 +wait/io/table/sql/handler 244 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t2 NULL 72 44 28 44 8 20 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -1088,7 +1088,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t2 76 48 28 48 8 20 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; @@ -1098,7 +1098,7 @@ TABLE test t2 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 47 +TABLE test t1 48 TABLE test t2 76 TABLE test t3 120 disconnect con1; @@ -1141,16 +1141,16 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 243 +wait/io/table/sql/handler 244 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t2 NULL 72 44 28 44 8 20 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -1161,7 +1161,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t2 76 48 28 48 8 20 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; @@ -1171,7 +1171,7 @@ TABLE test t2 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 47 +TABLE test t1 48 TABLE test t2 76 TABLE test t3 120 disconnect con2; @@ -1213,16 +1213,16 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 243 +wait/io/table/sql/handler 244 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t2 NULL 72 44 28 44 8 20 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -1233,7 +1233,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t2 76 48 28 48 8 20 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; @@ -1243,7 +1243,7 @@ TABLE test t2 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 47 +TABLE test t1 48 TABLE test t2 76 TABLE test t3 120 disconnect con3; @@ -1284,16 +1284,16 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 243 +wait/io/table/sql/handler 244 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t2 NULL 72 44 28 44 8 20 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -1304,7 +1304,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t2 76 48 28 48 8 20 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; @@ -1314,7 +1314,7 @@ TABLE test t2 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 47 +TABLE test t1 48 TABLE test t2 76 TABLE test t3 120 disconnect con4; @@ -1354,16 +1354,16 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 243 +wait/io/table/sql/handler 244 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t2 NULL 72 44 28 44 8 20 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -1374,7 +1374,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t2 76 48 28 48 8 20 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; @@ -1384,7 +1384,7 @@ TABLE test t2 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 47 +TABLE test t1 48 TABLE test t2 76 TABLE test t3 120 connection default; @@ -1426,16 +1426,16 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 243 +wait/io/table/sql/handler 244 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t2 NULL 72 44 28 44 8 20 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -1446,7 +1446,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t2 76 48 28 48 8 20 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; @@ -1456,7 +1456,7 @@ TABLE test t2 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 47 +TABLE test t1 48 TABLE test t2 76 TABLE test t3 120 truncate performance_schema.events_waits_summary_by_account_by_event_name; @@ -1497,16 +1497,16 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 243 +wait/io/table/sql/handler 244 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t2 NULL 72 44 28 44 8 20 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -1517,7 +1517,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t2 76 48 28 48 8 20 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; @@ -1527,7 +1527,7 @@ TABLE test t2 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 47 +TABLE test t1 48 TABLE test t2 76 TABLE test t3 120 truncate performance_schema.events_waits_summary_by_user_by_event_name; @@ -1568,16 +1568,16 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 243 +wait/io/table/sql/handler 244 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t2 NULL 72 44 28 44 8 20 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -1588,7 +1588,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t2 76 48 28 48 8 20 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; @@ -1598,7 +1598,7 @@ TABLE test t2 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 47 +TABLE test t1 48 TABLE test t2 76 TABLE test t3 120 truncate performance_schema.events_waits_summary_by_host_by_event_name; @@ -1639,16 +1639,16 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 243 +wait/io/table/sql/handler 244 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t2 NULL 72 44 28 44 8 20 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -1659,7 +1659,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t2 76 48 28 48 8 20 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; @@ -1669,7 +1669,7 @@ TABLE test t2 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 47 +TABLE test t1 48 TABLE test t2 76 TABLE test t3 120 truncate performance_schema.events_waits_summary_global_by_event_name; diff --git a/mysql-test/suite/perfschema/r/table_io_aggregate_hist_2u_2t.result b/mysql-test/suite/perfschema/r/table_io_aggregate_hist_2u_2t.result index 1b0ba5e2235..a6bbd488ceb 100644 --- a/mysql-test/suite/perfschema/r/table_io_aggregate_hist_2u_2t.result +++ b/mysql-test/suite/perfschema/r/table_io_aggregate_hist_2u_2t.result @@ -178,7 +178,7 @@ connection default; "================== Step 3-A ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 0 username status user2 not found @@ -188,37 +188,37 @@ username status user4 not found execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 23 +user1 localhost wait/io/table/sql/handler 24 user1 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 23 +localhost wait/io/table/sql/handler 24 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 23 +wait/io/table/sql/handler 24 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 8 TABLE test t1 +wait/io/table/sql/handler 9 TABLE test t1 wait/io/table/sql/handler 15 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 6 4 2 4 1 1 0 +TABLE test t1 NULL 9 6 3 6 1 2 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 2 1 1 1 0 1 0 +TABLE test t1 PRIMARY 0 0 0 0 0 0 0 TABLE test t3 NULL 13 7 6 7 3 3 0 TABLE test t3 index_b 1 1 0 1 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 1 1 0 1 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 8 5 3 5 1 2 0 +TABLE test t1 9 6 3 6 1 2 0 TABLE test t3 15 9 6 9 3 3 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -226,7 +226,7 @@ TABLE test t1 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 8 +TABLE test t1 9 TABLE test t2 0 TABLE test t3 15 connection con1; @@ -236,7 +236,7 @@ connection default; "================== Step 3-B ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 0 username status user2 not found @@ -246,37 +246,37 @@ username status user4 not found execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 23 +user1 localhost wait/io/table/sql/handler 24 user1 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 23 +localhost wait/io/table/sql/handler 24 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 23 +wait/io/table/sql/handler 24 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 8 TABLE test t1 +wait/io/table/sql/handler 9 TABLE test t1 wait/io/table/sql/handler 15 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 6 4 2 4 1 1 0 +TABLE test t1 NULL 9 6 3 6 1 2 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 2 1 1 1 0 1 0 +TABLE test t1 PRIMARY 0 0 0 0 0 0 0 TABLE test t3 NULL 13 7 6 7 3 3 0 TABLE test t3 index_b 1 1 0 1 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 1 1 0 1 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 8 5 3 5 1 2 0 +TABLE test t1 9 6 3 6 1 2 0 TABLE test t3 15 9 6 9 3 3 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -284,7 +284,7 @@ TABLE test t1 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 8 +TABLE test t1 9 TABLE test t2 0 TABLE test t3 15 connect con2, localhost, user2, , ; @@ -295,7 +295,7 @@ connection default; "================== Step 4 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 0 username event_name count_star user2 wait/io/table/sql/handler 0 @@ -306,41 +306,41 @@ username status user4 not found execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 23 +user1 localhost wait/io/table/sql/handler 24 user1 localhost wait/lock/table/sql/handler 0 user2 localhost wait/io/table/sql/handler 0 user2 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 0 user2 wait/io/table/sql/handler 0 user2 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 23 +localhost wait/io/table/sql/handler 24 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 23 +wait/io/table/sql/handler 24 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 8 TABLE test t1 +wait/io/table/sql/handler 9 TABLE test t1 wait/io/table/sql/handler 15 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 6 4 2 4 1 1 0 +TABLE test t1 NULL 9 6 3 6 1 2 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 2 1 1 1 0 1 0 +TABLE test t1 PRIMARY 0 0 0 0 0 0 0 TABLE test t3 NULL 13 7 6 7 3 3 0 TABLE test t3 index_b 1 1 0 1 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 1 1 0 1 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 8 5 3 5 1 2 0 +TABLE test t1 9 6 3 6 1 2 0 TABLE test t3 15 9 6 9 3 3 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -348,7 +348,7 @@ TABLE test t1 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 8 +TABLE test t1 9 TABLE test t2 0 TABLE test t3 15 connection con2; @@ -394,7 +394,7 @@ connection default; "================== Step 5 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 0 username event_name count_star user2 wait/io/table/sql/handler 0 @@ -405,41 +405,41 @@ username status user4 not found execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 23 +user1 localhost wait/io/table/sql/handler 24 user1 localhost wait/lock/table/sql/handler 0 user2 localhost wait/io/table/sql/handler 0 user2 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 0 user2 wait/io/table/sql/handler 0 user2 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 23 +localhost wait/io/table/sql/handler 24 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 23 +wait/io/table/sql/handler 24 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 8 TABLE test t1 +wait/io/table/sql/handler 9 TABLE test t1 wait/io/table/sql/handler 15 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 6 4 2 4 1 1 0 +TABLE test t1 NULL 9 6 3 6 1 2 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 2 1 1 1 0 1 0 +TABLE test t1 PRIMARY 0 0 0 0 0 0 0 TABLE test t3 NULL 13 7 6 7 3 3 0 TABLE test t3 index_b 1 1 0 1 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 1 1 0 1 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 8 5 3 5 1 2 0 +TABLE test t1 9 6 3 6 1 2 0 TABLE test t3 15 9 6 9 3 3 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -447,7 +447,7 @@ TABLE test t1 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 8 +TABLE test t1 9 TABLE test t2 0 TABLE test t3 15 connect con3, localhost, user3, , ; @@ -458,7 +458,7 @@ connection default; "================== Step 6 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 0 username event_name count_star user2 wait/io/table/sql/handler 0 @@ -470,7 +470,7 @@ username status user4 not found execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 23 +user1 localhost wait/io/table/sql/handler 24 user1 localhost wait/lock/table/sql/handler 0 user2 localhost wait/io/table/sql/handler 0 user2 localhost wait/lock/table/sql/handler 0 @@ -478,7 +478,7 @@ user3 localhost wait/io/table/sql/handler 0 user3 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 0 user2 wait/io/table/sql/handler 0 user2 wait/lock/table/sql/handler 0 @@ -486,29 +486,29 @@ user3 wait/io/table/sql/handler 0 user3 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 23 +localhost wait/io/table/sql/handler 24 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 23 +wait/io/table/sql/handler 24 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 8 TABLE test t1 +wait/io/table/sql/handler 9 TABLE test t1 wait/io/table/sql/handler 15 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 6 4 2 4 1 1 0 +TABLE test t1 NULL 9 6 3 6 1 2 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 2 1 1 1 0 1 0 +TABLE test t1 PRIMARY 0 0 0 0 0 0 0 TABLE test t3 NULL 13 7 6 7 3 3 0 TABLE test t3 index_b 1 1 0 1 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 1 1 0 1 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 8 5 3 5 1 2 0 +TABLE test t1 9 6 3 6 1 2 0 TABLE test t3 15 9 6 9 3 3 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -516,7 +516,7 @@ TABLE test t1 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 8 +TABLE test t1 9 TABLE test t2 0 TABLE test t3 15 connection con3; @@ -569,7 +569,7 @@ connection default; "================== Step 7 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 0 username event_name count_star user2 wait/io/table/sql/handler 0 @@ -581,7 +581,7 @@ username status user4 not found execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 23 +user1 localhost wait/io/table/sql/handler 24 user1 localhost wait/lock/table/sql/handler 0 user2 localhost wait/io/table/sql/handler 0 user2 localhost wait/lock/table/sql/handler 0 @@ -589,7 +589,7 @@ user3 localhost wait/io/table/sql/handler 48 user3 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 0 user2 wait/io/table/sql/handler 0 user2 wait/lock/table/sql/handler 0 @@ -597,29 +597,29 @@ user3 wait/io/table/sql/handler 48 user3 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 71 +localhost wait/io/table/sql/handler 72 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 71 +wait/io/table/sql/handler 72 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 21 TABLE test t1 +wait/io/table/sql/handler 22 TABLE test t1 wait/io/table/sql/handler 50 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 17 11 6 11 2 4 0 +TABLE test t1 NULL 20 13 7 13 2 5 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t3 NULL 44 26 18 26 6 12 0 TABLE test t3 index_b 4 4 0 4 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 21 13 8 13 2 6 0 +TABLE test t1 22 14 8 14 2 6 0 TABLE test t3 50 32 18 32 6 12 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -627,7 +627,7 @@ TABLE test t1 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 21 +TABLE test t1 22 TABLE test t2 0 TABLE test t3 50 connect con4, localhost, user4, , ; @@ -638,7 +638,7 @@ connection default; "================== Step 8 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 0 username event_name count_star user2 wait/io/table/sql/handler 0 @@ -651,7 +651,7 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 23 +user1 localhost wait/io/table/sql/handler 24 user1 localhost wait/lock/table/sql/handler 0 user2 localhost wait/io/table/sql/handler 0 user2 localhost wait/lock/table/sql/handler 0 @@ -661,7 +661,7 @@ user4 localhost wait/io/table/sql/handler 0 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 0 user2 wait/io/table/sql/handler 0 user2 wait/lock/table/sql/handler 0 @@ -671,29 +671,29 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 71 +localhost wait/io/table/sql/handler 72 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 71 +wait/io/table/sql/handler 72 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 21 TABLE test t1 +wait/io/table/sql/handler 22 TABLE test t1 wait/io/table/sql/handler 50 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 17 11 6 11 2 4 0 +TABLE test t1 NULL 20 13 7 13 2 5 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t3 NULL 44 26 18 26 6 12 0 TABLE test t3 index_b 4 4 0 4 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 21 13 8 13 2 6 0 +TABLE test t1 22 14 8 14 2 6 0 TABLE test t3 50 32 18 32 6 12 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -701,7 +701,7 @@ TABLE test t1 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 21 +TABLE test t1 22 TABLE test t2 0 TABLE test t3 50 connection con4; @@ -761,7 +761,7 @@ connection default; "================== Step 9 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 0 username event_name count_star user2 wait/io/table/sql/handler 0 @@ -774,7 +774,7 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 23 +user1 localhost wait/io/table/sql/handler 24 user1 localhost wait/lock/table/sql/handler 0 user2 localhost wait/io/table/sql/handler 0 user2 localhost wait/lock/table/sql/handler 0 @@ -784,7 +784,7 @@ user4 localhost wait/io/table/sql/handler 0 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 0 user2 wait/io/table/sql/handler 0 user2 wait/lock/table/sql/handler 0 @@ -794,29 +794,29 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 71 +localhost wait/io/table/sql/handler 72 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 71 +wait/io/table/sql/handler 72 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 21 TABLE test t1 +wait/io/table/sql/handler 22 TABLE test t1 wait/io/table/sql/handler 50 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 17 11 6 11 2 4 0 +TABLE test t1 NULL 20 13 7 13 2 5 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t3 NULL 44 26 18 26 6 12 0 TABLE test t3 index_b 4 4 0 4 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 21 13 8 13 2 6 0 +TABLE test t1 22 14 8 14 2 6 0 TABLE test t3 50 32 18 32 6 12 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -824,7 +824,7 @@ TABLE test t1 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 21 +TABLE test t1 22 TABLE test t2 0 TABLE test t3 50 connection con1; @@ -836,7 +836,7 @@ connection default; "================== Step 10 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 0 username event_name count_star user2 wait/io/table/sql/handler 0 @@ -849,7 +849,7 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 23 +user1 localhost wait/io/table/sql/handler 24 user1 localhost wait/lock/table/sql/handler 0 user2 localhost wait/io/table/sql/handler 0 user2 localhost wait/lock/table/sql/handler 0 @@ -859,7 +859,7 @@ user4 localhost wait/io/table/sql/handler 0 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 0 user2 wait/io/table/sql/handler 0 user2 wait/lock/table/sql/handler 0 @@ -869,29 +869,29 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 71 +localhost wait/io/table/sql/handler 72 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 71 +wait/io/table/sql/handler 72 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 21 TABLE test t1 +wait/io/table/sql/handler 22 TABLE test t1 wait/io/table/sql/handler 50 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 17 11 6 11 2 4 0 +TABLE test t1 NULL 20 13 7 13 2 5 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t3 NULL 44 26 18 26 6 12 0 TABLE test t3 index_b 4 4 0 4 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 21 13 8 13 2 6 0 +TABLE test t1 22 14 8 14 2 6 0 TABLE test t3 50 32 18 32 6 12 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -899,7 +899,7 @@ TABLE test t1 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 21 +TABLE test t1 22 TABLE test t2 0 TABLE test t3 50 connection default; @@ -908,7 +908,7 @@ flush tables; "================== Step 11 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 0 username event_name count_star user2 wait/io/table/sql/handler 0 @@ -921,7 +921,7 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 23 +user1 localhost wait/io/table/sql/handler 24 user1 localhost wait/lock/table/sql/handler 0 user2 localhost wait/io/table/sql/handler 0 user2 localhost wait/lock/table/sql/handler 0 @@ -931,7 +931,7 @@ user4 localhost wait/io/table/sql/handler 0 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 0 user2 wait/io/table/sql/handler 0 user2 wait/lock/table/sql/handler 0 @@ -941,29 +941,29 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 71 +localhost wait/io/table/sql/handler 72 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 71 +wait/io/table/sql/handler 72 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 21 TABLE test t1 +wait/io/table/sql/handler 22 TABLE test t1 wait/io/table/sql/handler 50 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 17 11 6 11 2 4 0 +TABLE test t1 NULL 20 13 7 13 2 5 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t3 NULL 44 26 18 26 6 12 0 TABLE test t3 index_b 4 4 0 4 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 21 13 8 13 2 6 0 +TABLE test t1 22 14 8 14 2 6 0 TABLE test t3 50 32 18 32 6 12 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -971,7 +971,7 @@ TABLE test t1 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 21 +TABLE test t1 22 TABLE test t2 0 TABLE test t3 50 set global read_only=1; @@ -980,7 +980,7 @@ set global read_only=0; "================== Step 12 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 0 username event_name count_star user2 wait/io/table/sql/handler 0 @@ -993,7 +993,7 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 23 +user1 localhost wait/io/table/sql/handler 24 user1 localhost wait/lock/table/sql/handler 0 user2 localhost wait/io/table/sql/handler 0 user2 localhost wait/lock/table/sql/handler 0 @@ -1003,7 +1003,7 @@ user4 localhost wait/io/table/sql/handler 0 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 0 user2 wait/io/table/sql/handler 0 user2 wait/lock/table/sql/handler 0 @@ -1013,29 +1013,29 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 71 +localhost wait/io/table/sql/handler 72 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 71 +wait/io/table/sql/handler 72 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 21 TABLE test t1 +wait/io/table/sql/handler 22 TABLE test t1 wait/io/table/sql/handler 50 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 17 11 6 11 2 4 0 +TABLE test t1 NULL 20 13 7 13 2 5 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t3 NULL 44 26 18 26 6 12 0 TABLE test t3 index_b 4 4 0 4 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 21 13 8 13 2 6 0 +TABLE test t1 22 14 8 14 2 6 0 TABLE test t3 50 32 18 32 6 12 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -1043,7 +1043,7 @@ TABLE test t1 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 21 +TABLE test t1 22 TABLE test t2 0 TABLE test t3 50 disconnect con1; @@ -1062,7 +1062,7 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 23 +user1 localhost wait/io/table/sql/handler 24 user1 localhost wait/lock/table/sql/handler 0 user2 localhost wait/io/table/sql/handler 0 user2 localhost wait/lock/table/sql/handler 0 @@ -1072,7 +1072,7 @@ user4 localhost wait/io/table/sql/handler 0 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 0 user2 wait/io/table/sql/handler 0 user2 wait/lock/table/sql/handler 0 @@ -1082,29 +1082,29 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 71 +localhost wait/io/table/sql/handler 72 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 71 +wait/io/table/sql/handler 72 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 21 TABLE test t1 +wait/io/table/sql/handler 22 TABLE test t1 wait/io/table/sql/handler 50 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 17 11 6 11 2 4 0 +TABLE test t1 NULL 20 13 7 13 2 5 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t3 NULL 44 26 18 26 6 12 0 TABLE test t3 index_b 4 4 0 4 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 21 13 8 13 2 6 0 +TABLE test t1 22 14 8 14 2 6 0 TABLE test t3 50 32 18 32 6 12 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -1112,7 +1112,7 @@ TABLE test t1 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 21 +TABLE test t1 22 TABLE test t2 0 TABLE test t3 50 disconnect con2; @@ -1130,7 +1130,7 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 23 +user1 localhost wait/io/table/sql/handler 24 user1 localhost wait/lock/table/sql/handler 0 user2 localhost wait/io/table/sql/handler 0 user2 localhost wait/lock/table/sql/handler 0 @@ -1140,7 +1140,7 @@ user4 localhost wait/io/table/sql/handler 0 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 0 user2 wait/io/table/sql/handler 0 user2 wait/lock/table/sql/handler 0 @@ -1150,29 +1150,29 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 71 +localhost wait/io/table/sql/handler 72 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 71 +wait/io/table/sql/handler 72 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 21 TABLE test t1 +wait/io/table/sql/handler 22 TABLE test t1 wait/io/table/sql/handler 50 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 17 11 6 11 2 4 0 +TABLE test t1 NULL 20 13 7 13 2 5 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t3 NULL 44 26 18 26 6 12 0 TABLE test t3 index_b 4 4 0 4 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 21 13 8 13 2 6 0 +TABLE test t1 22 14 8 14 2 6 0 TABLE test t3 50 32 18 32 6 12 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -1180,7 +1180,7 @@ TABLE test t1 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 21 +TABLE test t1 22 TABLE test t2 0 TABLE test t3 50 disconnect con3; @@ -1197,7 +1197,7 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 23 +user1 localhost wait/io/table/sql/handler 24 user1 localhost wait/lock/table/sql/handler 0 user2 localhost wait/io/table/sql/handler 0 user2 localhost wait/lock/table/sql/handler 0 @@ -1207,7 +1207,7 @@ user4 localhost wait/io/table/sql/handler 0 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 0 user2 wait/io/table/sql/handler 0 user2 wait/lock/table/sql/handler 0 @@ -1217,29 +1217,29 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 71 +localhost wait/io/table/sql/handler 72 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 71 +wait/io/table/sql/handler 72 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 21 TABLE test t1 +wait/io/table/sql/handler 22 TABLE test t1 wait/io/table/sql/handler 50 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 17 11 6 11 2 4 0 +TABLE test t1 NULL 20 13 7 13 2 5 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t3 NULL 44 26 18 26 6 12 0 TABLE test t3 index_b 4 4 0 4 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 21 13 8 13 2 6 0 +TABLE test t1 22 14 8 14 2 6 0 TABLE test t3 50 32 18 32 6 12 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -1247,7 +1247,7 @@ TABLE test t1 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 21 +TABLE test t1 22 TABLE test t2 0 TABLE test t3 50 disconnect con4; @@ -1263,7 +1263,7 @@ username status user4 not found execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 23 +user1 localhost wait/io/table/sql/handler 24 user1 localhost wait/lock/table/sql/handler 0 user2 localhost wait/io/table/sql/handler 0 user2 localhost wait/lock/table/sql/handler 0 @@ -1273,7 +1273,7 @@ user4 localhost wait/io/table/sql/handler 0 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 0 user2 wait/io/table/sql/handler 0 user2 wait/lock/table/sql/handler 0 @@ -1283,29 +1283,29 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 71 +localhost wait/io/table/sql/handler 72 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 71 +wait/io/table/sql/handler 72 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 21 TABLE test t1 +wait/io/table/sql/handler 22 TABLE test t1 wait/io/table/sql/handler 50 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 17 11 6 11 2 4 0 +TABLE test t1 NULL 20 13 7 13 2 5 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t3 NULL 44 26 18 26 6 12 0 TABLE test t3 index_b 4 4 0 4 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 21 13 8 13 2 6 0 +TABLE test t1 22 14 8 14 2 6 0 TABLE test t3 50 32 18 32 6 12 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -1313,7 +1313,7 @@ TABLE test t1 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 21 +TABLE test t1 22 TABLE test t2 0 TABLE test t3 50 connection default; @@ -1331,7 +1331,7 @@ username status user4 not found execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 23 +user1 localhost wait/io/table/sql/handler 24 user1 localhost wait/lock/table/sql/handler 0 user2 localhost wait/io/table/sql/handler 0 user2 localhost wait/lock/table/sql/handler 0 @@ -1341,7 +1341,7 @@ user4 localhost wait/io/table/sql/handler 0 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 0 user2 wait/io/table/sql/handler 0 user2 wait/lock/table/sql/handler 0 @@ -1351,29 +1351,29 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 71 +localhost wait/io/table/sql/handler 72 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 71 +wait/io/table/sql/handler 72 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 21 TABLE test t1 +wait/io/table/sql/handler 22 TABLE test t1 wait/io/table/sql/handler 50 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 17 11 6 11 2 4 0 +TABLE test t1 NULL 20 13 7 13 2 5 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t3 NULL 44 26 18 26 6 12 0 TABLE test t3 index_b 4 4 0 4 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 21 13 8 13 2 6 0 +TABLE test t1 22 14 8 14 2 6 0 TABLE test t3 50 32 18 32 6 12 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -1381,7 +1381,7 @@ TABLE test t1 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 21 +TABLE test t1 22 TABLE test t2 0 TABLE test t3 50 truncate performance_schema.events_waits_summary_by_account_by_event_name; @@ -1408,7 +1408,7 @@ user4 localhost wait/io/table/sql/handler 0 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 0 user2 wait/io/table/sql/handler 0 user2 wait/lock/table/sql/handler 0 @@ -1418,29 +1418,29 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 71 +localhost wait/io/table/sql/handler 72 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 71 +wait/io/table/sql/handler 72 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 21 TABLE test t1 +wait/io/table/sql/handler 22 TABLE test t1 wait/io/table/sql/handler 50 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 17 11 6 11 2 4 0 +TABLE test t1 NULL 20 13 7 13 2 5 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t3 NULL 44 26 18 26 6 12 0 TABLE test t3 index_b 4 4 0 4 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 21 13 8 13 2 6 0 +TABLE test t1 22 14 8 14 2 6 0 TABLE test t3 50 32 18 32 6 12 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -1448,7 +1448,7 @@ TABLE test t1 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 21 +TABLE test t1 22 TABLE test t2 0 TABLE test t3 50 truncate performance_schema.events_waits_summary_by_user_by_event_name; @@ -1485,29 +1485,29 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 71 +localhost wait/io/table/sql/handler 72 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 71 +wait/io/table/sql/handler 72 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 21 TABLE test t1 +wait/io/table/sql/handler 22 TABLE test t1 wait/io/table/sql/handler 50 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 17 11 6 11 2 4 0 +TABLE test t1 NULL 20 13 7 13 2 5 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t3 NULL 44 26 18 26 6 12 0 TABLE test t3 index_b 4 4 0 4 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 21 13 8 13 2 6 0 +TABLE test t1 22 14 8 14 2 6 0 TABLE test t3 50 32 18 32 6 12 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -1515,7 +1515,7 @@ TABLE test t1 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 21 +TABLE test t1 22 TABLE test t2 0 TABLE test t3 50 truncate performance_schema.events_waits_summary_by_host_by_event_name; @@ -1556,25 +1556,25 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 71 +wait/io/table/sql/handler 72 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 21 TABLE test t1 +wait/io/table/sql/handler 22 TABLE test t1 wait/io/table/sql/handler 50 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 17 11 6 11 2 4 0 +TABLE test t1 NULL 20 13 7 13 2 5 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t3 NULL 44 26 18 26 6 12 0 TABLE test t3 index_b 4 4 0 4 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 21 13 8 13 2 6 0 +TABLE test t1 22 14 8 14 2 6 0 TABLE test t3 50 32 18 32 6 12 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -1582,7 +1582,7 @@ TABLE test t1 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 21 +TABLE test t1 22 TABLE test t2 0 TABLE test t3 50 truncate performance_schema.events_waits_summary_global_by_event_name; @@ -1627,7 +1627,7 @@ wait/io/table/sql/handler 0 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 21 TABLE test t1 +wait/io/table/sql/handler 22 TABLE test t1 wait/io/table/sql/handler 50 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete diff --git a/mysql-test/suite/perfschema/r/table_io_aggregate_hist_2u_3t.result b/mysql-test/suite/perfschema/r/table_io_aggregate_hist_2u_3t.result index b1813a1616e..78e3b720792 100644 --- a/mysql-test/suite/perfschema/r/table_io_aggregate_hist_2u_3t.result +++ b/mysql-test/suite/perfschema/r/table_io_aggregate_hist_2u_3t.result @@ -187,7 +187,7 @@ connection default; "================== Step 3-A ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 0 username status user2 not found @@ -197,31 +197,31 @@ username status user4 not found execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 33 +user1 localhost wait/io/table/sql/handler 34 user1 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 33 +localhost wait/io/table/sql/handler 34 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 33 +wait/io/table/sql/handler 34 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 8 TABLE test t1 +wait/io/table/sql/handler 9 TABLE test t1 wait/io/table/sql/handler 10 TABLE test t2 wait/io/table/sql/handler 15 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 6 4 2 4 1 1 0 +TABLE test t1 NULL 9 6 3 6 1 2 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 2 1 1 1 0 1 0 +TABLE test t1 PRIMARY 0 0 0 0 0 0 0 TABLE test t2 NULL 9 5 4 5 2 2 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -232,7 +232,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 1 1 0 1 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 8 5 3 5 1 2 0 +TABLE test t1 9 6 3 6 1 2 0 TABLE test t2 10 6 4 6 2 2 0 TABLE test t3 15 9 6 9 3 3 0 execute dump_waits_table_lock; @@ -242,7 +242,7 @@ TABLE test t2 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 8 +TABLE test t1 9 TABLE test t2 10 TABLE test t3 15 connection con1; @@ -252,7 +252,7 @@ connection default; "================== Step 3-B ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 0 username status user2 not found @@ -262,31 +262,31 @@ username status user4 not found execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 33 +user1 localhost wait/io/table/sql/handler 34 user1 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 33 +localhost wait/io/table/sql/handler 34 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 33 +wait/io/table/sql/handler 34 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 8 TABLE test t1 +wait/io/table/sql/handler 9 TABLE test t1 wait/io/table/sql/handler 10 TABLE test t2 wait/io/table/sql/handler 15 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 6 4 2 4 1 1 0 +TABLE test t1 NULL 9 6 3 6 1 2 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 2 1 1 1 0 1 0 +TABLE test t1 PRIMARY 0 0 0 0 0 0 0 TABLE test t2 NULL 9 5 4 5 2 2 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -297,7 +297,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 1 1 0 1 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 8 5 3 5 1 2 0 +TABLE test t1 9 6 3 6 1 2 0 TABLE test t2 10 6 4 6 2 2 0 TABLE test t3 15 9 6 9 3 3 0 execute dump_waits_table_lock; @@ -307,7 +307,7 @@ TABLE test t2 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 8 +TABLE test t1 9 TABLE test t2 10 TABLE test t3 15 connect con2, localhost, user2, , ; @@ -318,7 +318,7 @@ connection default; "================== Step 4 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 0 username event_name count_star user2 wait/io/table/sql/handler 0 @@ -329,35 +329,35 @@ username status user4 not found execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 33 +user1 localhost wait/io/table/sql/handler 34 user1 localhost wait/lock/table/sql/handler 0 user2 localhost wait/io/table/sql/handler 0 user2 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 0 user2 wait/io/table/sql/handler 0 user2 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 33 +localhost wait/io/table/sql/handler 34 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 33 +wait/io/table/sql/handler 34 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 8 TABLE test t1 +wait/io/table/sql/handler 9 TABLE test t1 wait/io/table/sql/handler 10 TABLE test t2 wait/io/table/sql/handler 15 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 6 4 2 4 1 1 0 +TABLE test t1 NULL 9 6 3 6 1 2 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 2 1 1 1 0 1 0 +TABLE test t1 PRIMARY 0 0 0 0 0 0 0 TABLE test t2 NULL 9 5 4 5 2 2 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -368,7 +368,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 1 1 0 1 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 8 5 3 5 1 2 0 +TABLE test t1 9 6 3 6 1 2 0 TABLE test t2 10 6 4 6 2 2 0 TABLE test t3 15 9 6 9 3 3 0 execute dump_waits_table_lock; @@ -378,7 +378,7 @@ TABLE test t2 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 8 +TABLE test t1 9 TABLE test t2 10 TABLE test t3 15 connection con2; @@ -424,7 +424,7 @@ connection default; "================== Step 5 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 0 username event_name count_star user2 wait/io/table/sql/handler 0 @@ -435,35 +435,35 @@ username status user4 not found execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 33 +user1 localhost wait/io/table/sql/handler 34 user1 localhost wait/lock/table/sql/handler 0 user2 localhost wait/io/table/sql/handler 0 user2 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 0 user2 wait/io/table/sql/handler 0 user2 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 33 +localhost wait/io/table/sql/handler 34 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 33 +wait/io/table/sql/handler 34 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 8 TABLE test t1 +wait/io/table/sql/handler 9 TABLE test t1 wait/io/table/sql/handler 10 TABLE test t2 wait/io/table/sql/handler 15 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 6 4 2 4 1 1 0 +TABLE test t1 NULL 9 6 3 6 1 2 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 2 1 1 1 0 1 0 +TABLE test t1 PRIMARY 0 0 0 0 0 0 0 TABLE test t2 NULL 9 5 4 5 2 2 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -474,7 +474,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 1 1 0 1 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 8 5 3 5 1 2 0 +TABLE test t1 9 6 3 6 1 2 0 TABLE test t2 10 6 4 6 2 2 0 TABLE test t3 15 9 6 9 3 3 0 execute dump_waits_table_lock; @@ -484,7 +484,7 @@ TABLE test t2 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 8 +TABLE test t1 9 TABLE test t2 10 TABLE test t3 15 connect con3, localhost, user3, , ; @@ -495,7 +495,7 @@ connection default; "================== Step 6 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 0 username event_name count_star user2 wait/io/table/sql/handler 0 @@ -507,7 +507,7 @@ username status user4 not found execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 33 +user1 localhost wait/io/table/sql/handler 34 user1 localhost wait/lock/table/sql/handler 0 user2 localhost wait/io/table/sql/handler 0 user2 localhost wait/lock/table/sql/handler 0 @@ -515,7 +515,7 @@ user3 localhost wait/io/table/sql/handler 0 user3 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 0 user2 wait/io/table/sql/handler 0 user2 wait/lock/table/sql/handler 0 @@ -523,23 +523,23 @@ user3 wait/io/table/sql/handler 0 user3 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 33 +localhost wait/io/table/sql/handler 34 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 33 +wait/io/table/sql/handler 34 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 8 TABLE test t1 +wait/io/table/sql/handler 9 TABLE test t1 wait/io/table/sql/handler 10 TABLE test t2 wait/io/table/sql/handler 15 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 6 4 2 4 1 1 0 +TABLE test t1 NULL 9 6 3 6 1 2 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 2 1 1 1 0 1 0 +TABLE test t1 PRIMARY 0 0 0 0 0 0 0 TABLE test t2 NULL 9 5 4 5 2 2 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -550,7 +550,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 1 1 0 1 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 8 5 3 5 1 2 0 +TABLE test t1 9 6 3 6 1 2 0 TABLE test t2 10 6 4 6 2 2 0 TABLE test t3 15 9 6 9 3 3 0 execute dump_waits_table_lock; @@ -560,7 +560,7 @@ TABLE test t2 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 8 +TABLE test t1 9 TABLE test t2 10 TABLE test t3 15 connection con3; @@ -613,7 +613,7 @@ connection default; "================== Step 7 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 0 username event_name count_star user2 wait/io/table/sql/handler 0 @@ -625,7 +625,7 @@ username status user4 not found execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 33 +user1 localhost wait/io/table/sql/handler 34 user1 localhost wait/lock/table/sql/handler 0 user2 localhost wait/io/table/sql/handler 0 user2 localhost wait/lock/table/sql/handler 0 @@ -633,7 +633,7 @@ user3 localhost wait/io/table/sql/handler 70 user3 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 0 user2 wait/io/table/sql/handler 0 user2 wait/lock/table/sql/handler 0 @@ -641,23 +641,23 @@ user3 wait/io/table/sql/handler 70 user3 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 103 +localhost wait/io/table/sql/handler 104 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 103 +wait/io/table/sql/handler 104 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 21 TABLE test t1 +wait/io/table/sql/handler 22 TABLE test t1 wait/io/table/sql/handler 32 TABLE test t2 wait/io/table/sql/handler 50 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 17 11 6 11 2 4 0 +TABLE test t1 NULL 20 13 7 13 2 5 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t2 NULL 30 18 12 18 4 8 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -668,7 +668,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 21 13 8 13 2 6 0 +TABLE test t1 22 14 8 14 2 6 0 TABLE test t2 32 20 12 20 4 8 0 TABLE test t3 50 32 18 32 6 12 0 execute dump_waits_table_lock; @@ -678,7 +678,7 @@ TABLE test t2 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 21 +TABLE test t1 22 TABLE test t2 32 TABLE test t3 50 connect con4, localhost, user4, , ; @@ -689,7 +689,7 @@ connection default; "================== Step 8 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 0 username event_name count_star user2 wait/io/table/sql/handler 0 @@ -702,7 +702,7 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 33 +user1 localhost wait/io/table/sql/handler 34 user1 localhost wait/lock/table/sql/handler 0 user2 localhost wait/io/table/sql/handler 0 user2 localhost wait/lock/table/sql/handler 0 @@ -712,7 +712,7 @@ user4 localhost wait/io/table/sql/handler 0 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 0 user2 wait/io/table/sql/handler 0 user2 wait/lock/table/sql/handler 0 @@ -722,23 +722,23 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 103 +localhost wait/io/table/sql/handler 104 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 103 +wait/io/table/sql/handler 104 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 21 TABLE test t1 +wait/io/table/sql/handler 22 TABLE test t1 wait/io/table/sql/handler 32 TABLE test t2 wait/io/table/sql/handler 50 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 17 11 6 11 2 4 0 +TABLE test t1 NULL 20 13 7 13 2 5 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t2 NULL 30 18 12 18 4 8 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -749,7 +749,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 21 13 8 13 2 6 0 +TABLE test t1 22 14 8 14 2 6 0 TABLE test t2 32 20 12 20 4 8 0 TABLE test t3 50 32 18 32 6 12 0 execute dump_waits_table_lock; @@ -759,7 +759,7 @@ TABLE test t2 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 21 +TABLE test t1 22 TABLE test t2 32 TABLE test t3 50 connection con4; @@ -819,7 +819,7 @@ connection default; "================== Step 9 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 0 username event_name count_star user2 wait/io/table/sql/handler 0 @@ -832,7 +832,7 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 33 +user1 localhost wait/io/table/sql/handler 34 user1 localhost wait/lock/table/sql/handler 0 user2 localhost wait/io/table/sql/handler 0 user2 localhost wait/lock/table/sql/handler 0 @@ -842,7 +842,7 @@ user4 localhost wait/io/table/sql/handler 0 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 0 user2 wait/io/table/sql/handler 0 user2 wait/lock/table/sql/handler 0 @@ -852,23 +852,23 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 103 +localhost wait/io/table/sql/handler 104 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 103 +wait/io/table/sql/handler 104 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 21 TABLE test t1 +wait/io/table/sql/handler 22 TABLE test t1 wait/io/table/sql/handler 32 TABLE test t2 wait/io/table/sql/handler 50 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 17 11 6 11 2 4 0 +TABLE test t1 NULL 20 13 7 13 2 5 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t2 NULL 30 18 12 18 4 8 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -879,7 +879,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 21 13 8 13 2 6 0 +TABLE test t1 22 14 8 14 2 6 0 TABLE test t2 32 20 12 20 4 8 0 TABLE test t3 50 32 18 32 6 12 0 execute dump_waits_table_lock; @@ -889,7 +889,7 @@ TABLE test t2 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 21 +TABLE test t1 22 TABLE test t2 32 TABLE test t3 50 connection con1; @@ -901,7 +901,7 @@ connection default; "================== Step 10 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 0 username event_name count_star user2 wait/io/table/sql/handler 0 @@ -914,7 +914,7 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 33 +user1 localhost wait/io/table/sql/handler 34 user1 localhost wait/lock/table/sql/handler 0 user2 localhost wait/io/table/sql/handler 0 user2 localhost wait/lock/table/sql/handler 0 @@ -924,7 +924,7 @@ user4 localhost wait/io/table/sql/handler 0 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 0 user2 wait/io/table/sql/handler 0 user2 wait/lock/table/sql/handler 0 @@ -934,23 +934,23 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 103 +localhost wait/io/table/sql/handler 104 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 103 +wait/io/table/sql/handler 104 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 21 TABLE test t1 +wait/io/table/sql/handler 22 TABLE test t1 wait/io/table/sql/handler 32 TABLE test t2 wait/io/table/sql/handler 50 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 17 11 6 11 2 4 0 +TABLE test t1 NULL 20 13 7 13 2 5 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t2 NULL 30 18 12 18 4 8 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -961,7 +961,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 21 13 8 13 2 6 0 +TABLE test t1 22 14 8 14 2 6 0 TABLE test t2 32 20 12 20 4 8 0 TABLE test t3 50 32 18 32 6 12 0 execute dump_waits_table_lock; @@ -971,7 +971,7 @@ TABLE test t2 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 21 +TABLE test t1 22 TABLE test t2 32 TABLE test t3 50 connection default; @@ -980,7 +980,7 @@ flush tables; "================== Step 11 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 0 username event_name count_star user2 wait/io/table/sql/handler 0 @@ -993,7 +993,7 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 33 +user1 localhost wait/io/table/sql/handler 34 user1 localhost wait/lock/table/sql/handler 0 user2 localhost wait/io/table/sql/handler 0 user2 localhost wait/lock/table/sql/handler 0 @@ -1003,7 +1003,7 @@ user4 localhost wait/io/table/sql/handler 0 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 0 user2 wait/io/table/sql/handler 0 user2 wait/lock/table/sql/handler 0 @@ -1013,23 +1013,23 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 103 +localhost wait/io/table/sql/handler 104 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 103 +wait/io/table/sql/handler 104 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 21 TABLE test t1 +wait/io/table/sql/handler 22 TABLE test t1 wait/io/table/sql/handler 32 TABLE test t2 wait/io/table/sql/handler 50 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 17 11 6 11 2 4 0 +TABLE test t1 NULL 20 13 7 13 2 5 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t2 NULL 30 18 12 18 4 8 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -1040,7 +1040,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 21 13 8 13 2 6 0 +TABLE test t1 22 14 8 14 2 6 0 TABLE test t2 32 20 12 20 4 8 0 TABLE test t3 50 32 18 32 6 12 0 execute dump_waits_table_lock; @@ -1050,7 +1050,7 @@ TABLE test t2 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 21 +TABLE test t1 22 TABLE test t2 32 TABLE test t3 50 set global read_only=1; @@ -1059,7 +1059,7 @@ set global read_only=0; "================== Step 12 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 0 username event_name count_star user2 wait/io/table/sql/handler 0 @@ -1072,7 +1072,7 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 33 +user1 localhost wait/io/table/sql/handler 34 user1 localhost wait/lock/table/sql/handler 0 user2 localhost wait/io/table/sql/handler 0 user2 localhost wait/lock/table/sql/handler 0 @@ -1082,7 +1082,7 @@ user4 localhost wait/io/table/sql/handler 0 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 0 user2 wait/io/table/sql/handler 0 user2 wait/lock/table/sql/handler 0 @@ -1092,23 +1092,23 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 103 +localhost wait/io/table/sql/handler 104 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 103 +wait/io/table/sql/handler 104 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 21 TABLE test t1 +wait/io/table/sql/handler 22 TABLE test t1 wait/io/table/sql/handler 32 TABLE test t2 wait/io/table/sql/handler 50 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 17 11 6 11 2 4 0 +TABLE test t1 NULL 20 13 7 13 2 5 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t2 NULL 30 18 12 18 4 8 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -1119,7 +1119,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 21 13 8 13 2 6 0 +TABLE test t1 22 14 8 14 2 6 0 TABLE test t2 32 20 12 20 4 8 0 TABLE test t3 50 32 18 32 6 12 0 execute dump_waits_table_lock; @@ -1129,7 +1129,7 @@ TABLE test t2 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 21 +TABLE test t1 22 TABLE test t2 32 TABLE test t3 50 disconnect con1; @@ -1148,7 +1148,7 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 33 +user1 localhost wait/io/table/sql/handler 34 user1 localhost wait/lock/table/sql/handler 0 user2 localhost wait/io/table/sql/handler 0 user2 localhost wait/lock/table/sql/handler 0 @@ -1158,7 +1158,7 @@ user4 localhost wait/io/table/sql/handler 0 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 0 user2 wait/io/table/sql/handler 0 user2 wait/lock/table/sql/handler 0 @@ -1168,23 +1168,23 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 103 +localhost wait/io/table/sql/handler 104 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 103 +wait/io/table/sql/handler 104 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 21 TABLE test t1 +wait/io/table/sql/handler 22 TABLE test t1 wait/io/table/sql/handler 32 TABLE test t2 wait/io/table/sql/handler 50 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 17 11 6 11 2 4 0 +TABLE test t1 NULL 20 13 7 13 2 5 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t2 NULL 30 18 12 18 4 8 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -1195,7 +1195,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 21 13 8 13 2 6 0 +TABLE test t1 22 14 8 14 2 6 0 TABLE test t2 32 20 12 20 4 8 0 TABLE test t3 50 32 18 32 6 12 0 execute dump_waits_table_lock; @@ -1205,7 +1205,7 @@ TABLE test t2 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 21 +TABLE test t1 22 TABLE test t2 32 TABLE test t3 50 disconnect con2; @@ -1223,7 +1223,7 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 33 +user1 localhost wait/io/table/sql/handler 34 user1 localhost wait/lock/table/sql/handler 0 user2 localhost wait/io/table/sql/handler 0 user2 localhost wait/lock/table/sql/handler 0 @@ -1233,7 +1233,7 @@ user4 localhost wait/io/table/sql/handler 0 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 0 user2 wait/io/table/sql/handler 0 user2 wait/lock/table/sql/handler 0 @@ -1243,23 +1243,23 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 103 +localhost wait/io/table/sql/handler 104 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 103 +wait/io/table/sql/handler 104 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 21 TABLE test t1 +wait/io/table/sql/handler 22 TABLE test t1 wait/io/table/sql/handler 32 TABLE test t2 wait/io/table/sql/handler 50 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 17 11 6 11 2 4 0 +TABLE test t1 NULL 20 13 7 13 2 5 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t2 NULL 30 18 12 18 4 8 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -1270,7 +1270,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 21 13 8 13 2 6 0 +TABLE test t1 22 14 8 14 2 6 0 TABLE test t2 32 20 12 20 4 8 0 TABLE test t3 50 32 18 32 6 12 0 execute dump_waits_table_lock; @@ -1280,7 +1280,7 @@ TABLE test t2 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 21 +TABLE test t1 22 TABLE test t2 32 TABLE test t3 50 disconnect con3; @@ -1297,7 +1297,7 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 33 +user1 localhost wait/io/table/sql/handler 34 user1 localhost wait/lock/table/sql/handler 0 user2 localhost wait/io/table/sql/handler 0 user2 localhost wait/lock/table/sql/handler 0 @@ -1307,7 +1307,7 @@ user4 localhost wait/io/table/sql/handler 0 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 0 user2 wait/io/table/sql/handler 0 user2 wait/lock/table/sql/handler 0 @@ -1317,23 +1317,23 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 103 +localhost wait/io/table/sql/handler 104 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 103 +wait/io/table/sql/handler 104 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 21 TABLE test t1 +wait/io/table/sql/handler 22 TABLE test t1 wait/io/table/sql/handler 32 TABLE test t2 wait/io/table/sql/handler 50 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 17 11 6 11 2 4 0 +TABLE test t1 NULL 20 13 7 13 2 5 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t2 NULL 30 18 12 18 4 8 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -1344,7 +1344,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 21 13 8 13 2 6 0 +TABLE test t1 22 14 8 14 2 6 0 TABLE test t2 32 20 12 20 4 8 0 TABLE test t3 50 32 18 32 6 12 0 execute dump_waits_table_lock; @@ -1354,7 +1354,7 @@ TABLE test t2 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 21 +TABLE test t1 22 TABLE test t2 32 TABLE test t3 50 disconnect con4; @@ -1370,7 +1370,7 @@ username status user4 not found execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 33 +user1 localhost wait/io/table/sql/handler 34 user1 localhost wait/lock/table/sql/handler 0 user2 localhost wait/io/table/sql/handler 0 user2 localhost wait/lock/table/sql/handler 0 @@ -1380,7 +1380,7 @@ user4 localhost wait/io/table/sql/handler 0 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 0 user2 wait/io/table/sql/handler 0 user2 wait/lock/table/sql/handler 0 @@ -1390,23 +1390,23 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 103 +localhost wait/io/table/sql/handler 104 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 103 +wait/io/table/sql/handler 104 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 21 TABLE test t1 +wait/io/table/sql/handler 22 TABLE test t1 wait/io/table/sql/handler 32 TABLE test t2 wait/io/table/sql/handler 50 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 17 11 6 11 2 4 0 +TABLE test t1 NULL 20 13 7 13 2 5 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t2 NULL 30 18 12 18 4 8 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -1417,7 +1417,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 21 13 8 13 2 6 0 +TABLE test t1 22 14 8 14 2 6 0 TABLE test t2 32 20 12 20 4 8 0 TABLE test t3 50 32 18 32 6 12 0 execute dump_waits_table_lock; @@ -1427,7 +1427,7 @@ TABLE test t2 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 21 +TABLE test t1 22 TABLE test t2 32 TABLE test t3 50 connection default; @@ -1445,7 +1445,7 @@ username status user4 not found execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 33 +user1 localhost wait/io/table/sql/handler 34 user1 localhost wait/lock/table/sql/handler 0 user2 localhost wait/io/table/sql/handler 0 user2 localhost wait/lock/table/sql/handler 0 @@ -1455,7 +1455,7 @@ user4 localhost wait/io/table/sql/handler 0 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 0 user2 wait/io/table/sql/handler 0 user2 wait/lock/table/sql/handler 0 @@ -1465,23 +1465,23 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 103 +localhost wait/io/table/sql/handler 104 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 103 +wait/io/table/sql/handler 104 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 21 TABLE test t1 +wait/io/table/sql/handler 22 TABLE test t1 wait/io/table/sql/handler 32 TABLE test t2 wait/io/table/sql/handler 50 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 17 11 6 11 2 4 0 +TABLE test t1 NULL 20 13 7 13 2 5 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t2 NULL 30 18 12 18 4 8 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -1492,7 +1492,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 21 13 8 13 2 6 0 +TABLE test t1 22 14 8 14 2 6 0 TABLE test t2 32 20 12 20 4 8 0 TABLE test t3 50 32 18 32 6 12 0 execute dump_waits_table_lock; @@ -1502,7 +1502,7 @@ TABLE test t2 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 21 +TABLE test t1 22 TABLE test t2 32 TABLE test t3 50 truncate performance_schema.events_waits_summary_by_account_by_event_name; @@ -1529,7 +1529,7 @@ user4 localhost wait/io/table/sql/handler 0 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 0 user2 wait/io/table/sql/handler 0 user2 wait/lock/table/sql/handler 0 @@ -1539,23 +1539,23 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 103 +localhost wait/io/table/sql/handler 104 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 103 +wait/io/table/sql/handler 104 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 21 TABLE test t1 +wait/io/table/sql/handler 22 TABLE test t1 wait/io/table/sql/handler 32 TABLE test t2 wait/io/table/sql/handler 50 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 17 11 6 11 2 4 0 +TABLE test t1 NULL 20 13 7 13 2 5 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t2 NULL 30 18 12 18 4 8 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -1566,7 +1566,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 21 13 8 13 2 6 0 +TABLE test t1 22 14 8 14 2 6 0 TABLE test t2 32 20 12 20 4 8 0 TABLE test t3 50 32 18 32 6 12 0 execute dump_waits_table_lock; @@ -1576,7 +1576,7 @@ TABLE test t2 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 21 +TABLE test t1 22 TABLE test t2 32 TABLE test t3 50 truncate performance_schema.events_waits_summary_by_user_by_event_name; @@ -1613,23 +1613,23 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 103 +localhost wait/io/table/sql/handler 104 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 103 +wait/io/table/sql/handler 104 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 21 TABLE test t1 +wait/io/table/sql/handler 22 TABLE test t1 wait/io/table/sql/handler 32 TABLE test t2 wait/io/table/sql/handler 50 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 17 11 6 11 2 4 0 +TABLE test t1 NULL 20 13 7 13 2 5 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t2 NULL 30 18 12 18 4 8 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -1640,7 +1640,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 21 13 8 13 2 6 0 +TABLE test t1 22 14 8 14 2 6 0 TABLE test t2 32 20 12 20 4 8 0 TABLE test t3 50 32 18 32 6 12 0 execute dump_waits_table_lock; @@ -1650,7 +1650,7 @@ TABLE test t2 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 21 +TABLE test t1 22 TABLE test t2 32 TABLE test t3 50 truncate performance_schema.events_waits_summary_by_host_by_event_name; @@ -1691,19 +1691,19 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 103 +wait/io/table/sql/handler 104 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 21 TABLE test t1 +wait/io/table/sql/handler 22 TABLE test t1 wait/io/table/sql/handler 32 TABLE test t2 wait/io/table/sql/handler 50 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 17 11 6 11 2 4 0 +TABLE test t1 NULL 20 13 7 13 2 5 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t2 NULL 30 18 12 18 4 8 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -1714,7 +1714,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 21 13 8 13 2 6 0 +TABLE test t1 22 14 8 14 2 6 0 TABLE test t2 32 20 12 20 4 8 0 TABLE test t3 50 32 18 32 6 12 0 execute dump_waits_table_lock; @@ -1724,7 +1724,7 @@ TABLE test t2 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 21 +TABLE test t1 22 TABLE test t2 32 TABLE test t3 50 truncate performance_schema.events_waits_summary_global_by_event_name; @@ -1769,7 +1769,7 @@ wait/io/table/sql/handler 0 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 21 TABLE test t1 +wait/io/table/sql/handler 22 TABLE test t1 wait/io/table/sql/handler 32 TABLE test t2 wait/io/table/sql/handler 50 TABLE test t3 execute dump_waits_index_io; diff --git a/mysql-test/suite/perfschema/r/table_io_aggregate_hist_4u_2t.result b/mysql-test/suite/perfschema/r/table_io_aggregate_hist_4u_2t.result index a19d3798e8b..e8b5fdaba5b 100644 --- a/mysql-test/suite/perfschema/r/table_io_aggregate_hist_4u_2t.result +++ b/mysql-test/suite/perfschema/r/table_io_aggregate_hist_4u_2t.result @@ -178,7 +178,7 @@ connection default; "================== Step 3-A ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 0 username status user2 not found @@ -188,37 +188,37 @@ username status user4 not found execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 23 +user1 localhost wait/io/table/sql/handler 24 user1 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 23 +localhost wait/io/table/sql/handler 24 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 23 +wait/io/table/sql/handler 24 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 8 TABLE test t1 +wait/io/table/sql/handler 9 TABLE test t1 wait/io/table/sql/handler 15 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 6 4 2 4 1 1 0 +TABLE test t1 NULL 9 6 3 6 1 2 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 2 1 1 1 0 1 0 +TABLE test t1 PRIMARY 0 0 0 0 0 0 0 TABLE test t3 NULL 13 7 6 7 3 3 0 TABLE test t3 index_b 1 1 0 1 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 1 1 0 1 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 8 5 3 5 1 2 0 +TABLE test t1 9 6 3 6 1 2 0 TABLE test t3 15 9 6 9 3 3 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -226,7 +226,7 @@ TABLE test t1 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 8 +TABLE test t1 9 TABLE test t2 0 TABLE test t3 15 connection con1; @@ -236,7 +236,7 @@ connection default; "================== Step 3-B ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 0 username status user2 not found @@ -246,37 +246,37 @@ username status user4 not found execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 23 +user1 localhost wait/io/table/sql/handler 24 user1 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 23 +localhost wait/io/table/sql/handler 24 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 23 +wait/io/table/sql/handler 24 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 8 TABLE test t1 +wait/io/table/sql/handler 9 TABLE test t1 wait/io/table/sql/handler 15 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 6 4 2 4 1 1 0 +TABLE test t1 NULL 9 6 3 6 1 2 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 2 1 1 1 0 1 0 +TABLE test t1 PRIMARY 0 0 0 0 0 0 0 TABLE test t3 NULL 13 7 6 7 3 3 0 TABLE test t3 index_b 1 1 0 1 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 1 1 0 1 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 8 5 3 5 1 2 0 +TABLE test t1 9 6 3 6 1 2 0 TABLE test t3 15 9 6 9 3 3 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -284,7 +284,7 @@ TABLE test t1 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 8 +TABLE test t1 9 TABLE test t2 0 TABLE test t3 15 connect con2, localhost, user2, , ; @@ -295,7 +295,7 @@ connection default; "================== Step 4 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 0 username event_name count_star user2 wait/io/table/sql/handler 0 @@ -306,41 +306,41 @@ username status user4 not found execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 23 +user1 localhost wait/io/table/sql/handler 24 user1 localhost wait/lock/table/sql/handler 0 user2 localhost wait/io/table/sql/handler 0 user2 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 0 user2 wait/io/table/sql/handler 0 user2 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 23 +localhost wait/io/table/sql/handler 24 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 23 +wait/io/table/sql/handler 24 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 8 TABLE test t1 +wait/io/table/sql/handler 9 TABLE test t1 wait/io/table/sql/handler 15 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 6 4 2 4 1 1 0 +TABLE test t1 NULL 9 6 3 6 1 2 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 2 1 1 1 0 1 0 +TABLE test t1 PRIMARY 0 0 0 0 0 0 0 TABLE test t3 NULL 13 7 6 7 3 3 0 TABLE test t3 index_b 1 1 0 1 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 1 1 0 1 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 8 5 3 5 1 2 0 +TABLE test t1 9 6 3 6 1 2 0 TABLE test t3 15 9 6 9 3 3 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -348,7 +348,7 @@ TABLE test t1 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 8 +TABLE test t1 9 TABLE test t2 0 TABLE test t3 15 connection con2; @@ -394,7 +394,7 @@ connection default; "================== Step 5 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 0 username event_name count_star user2 wait/io/table/sql/handler 35 @@ -405,41 +405,41 @@ username status user4 not found execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 23 +user1 localhost wait/io/table/sql/handler 24 user1 localhost wait/lock/table/sql/handler 0 user2 localhost wait/io/table/sql/handler 35 user2 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 0 user2 wait/io/table/sql/handler 35 user2 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 58 +localhost wait/io/table/sql/handler 59 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 58 +wait/io/table/sql/handler 59 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 18 TABLE test t1 +wait/io/table/sql/handler 19 TABLE test t1 wait/io/table/sql/handler 40 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 14 9 5 9 2 3 0 +TABLE test t1 NULL 17 11 6 11 2 4 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t3 NULL 35 20 15 20 6 9 0 TABLE test t3 index_b 3 3 0 3 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 18 11 7 11 2 5 0 +TABLE test t1 19 12 7 12 2 5 0 TABLE test t3 40 25 15 25 6 9 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -447,7 +447,7 @@ TABLE test t1 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 18 +TABLE test t1 19 TABLE test t2 0 TABLE test t3 40 connect con3, localhost, user3, , ; @@ -458,7 +458,7 @@ connection default; "================== Step 6 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 0 username event_name count_star user2 wait/io/table/sql/handler 35 @@ -470,7 +470,7 @@ username status user4 not found execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 23 +user1 localhost wait/io/table/sql/handler 24 user1 localhost wait/lock/table/sql/handler 0 user2 localhost wait/io/table/sql/handler 35 user2 localhost wait/lock/table/sql/handler 0 @@ -478,7 +478,7 @@ user3 localhost wait/io/table/sql/handler 0 user3 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 0 user2 wait/io/table/sql/handler 35 user2 wait/lock/table/sql/handler 0 @@ -486,29 +486,29 @@ user3 wait/io/table/sql/handler 0 user3 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 58 +localhost wait/io/table/sql/handler 59 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 58 +wait/io/table/sql/handler 59 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 18 TABLE test t1 +wait/io/table/sql/handler 19 TABLE test t1 wait/io/table/sql/handler 40 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 14 9 5 9 2 3 0 +TABLE test t1 NULL 17 11 6 11 2 4 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t3 NULL 35 20 15 20 6 9 0 TABLE test t3 index_b 3 3 0 3 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 18 11 7 11 2 5 0 +TABLE test t1 19 12 7 12 2 5 0 TABLE test t3 40 25 15 25 6 9 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -516,7 +516,7 @@ TABLE test t1 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 18 +TABLE test t1 19 TABLE test t2 0 TABLE test t3 40 connection con3; @@ -569,7 +569,7 @@ connection default; "================== Step 7 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 0 username event_name count_star user2 wait/io/table/sql/handler 35 @@ -581,7 +581,7 @@ username status user4 not found execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 23 +user1 localhost wait/io/table/sql/handler 24 user1 localhost wait/lock/table/sql/handler 0 user2 localhost wait/io/table/sql/handler 35 user2 localhost wait/lock/table/sql/handler 0 @@ -589,7 +589,7 @@ user3 localhost wait/io/table/sql/handler 48 user3 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 0 user2 wait/io/table/sql/handler 35 user2 wait/lock/table/sql/handler 0 @@ -597,29 +597,29 @@ user3 wait/io/table/sql/handler 48 user3 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 106 +localhost wait/io/table/sql/handler 107 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 106 +wait/io/table/sql/handler 107 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 31 TABLE test t1 +wait/io/table/sql/handler 32 TABLE test t1 wait/io/table/sql/handler 75 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 25 16 9 16 3 6 0 +TABLE test t1 NULL 28 18 10 18 3 7 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 6 3 3 3 0 3 0 +TABLE test t1 PRIMARY 4 2 2 2 0 2 0 TABLE test t3 NULL 66 39 27 39 9 18 0 TABLE test t3 index_b 6 6 0 6 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 3 3 0 3 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 31 19 12 19 3 9 0 +TABLE test t1 32 20 12 20 3 9 0 TABLE test t3 75 48 27 48 9 18 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -627,7 +627,7 @@ TABLE test t1 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 31 +TABLE test t1 32 TABLE test t2 0 TABLE test t3 75 connect con4, localhost, user4, , ; @@ -638,7 +638,7 @@ connection default; "================== Step 8 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 0 username event_name count_star user2 wait/io/table/sql/handler 35 @@ -651,7 +651,7 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 23 +user1 localhost wait/io/table/sql/handler 24 user1 localhost wait/lock/table/sql/handler 0 user2 localhost wait/io/table/sql/handler 35 user2 localhost wait/lock/table/sql/handler 0 @@ -661,7 +661,7 @@ user4 localhost wait/io/table/sql/handler 0 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 0 user2 wait/io/table/sql/handler 35 user2 wait/lock/table/sql/handler 0 @@ -671,29 +671,29 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 106 +localhost wait/io/table/sql/handler 107 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 106 +wait/io/table/sql/handler 107 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 31 TABLE test t1 +wait/io/table/sql/handler 32 TABLE test t1 wait/io/table/sql/handler 75 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 25 16 9 16 3 6 0 +TABLE test t1 NULL 28 18 10 18 3 7 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 6 3 3 3 0 3 0 +TABLE test t1 PRIMARY 4 2 2 2 0 2 0 TABLE test t3 NULL 66 39 27 39 9 18 0 TABLE test t3 index_b 6 6 0 6 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 3 3 0 3 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 31 19 12 19 3 9 0 +TABLE test t1 32 20 12 20 3 9 0 TABLE test t3 75 48 27 48 9 18 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -701,7 +701,7 @@ TABLE test t1 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 31 +TABLE test t1 32 TABLE test t2 0 TABLE test t3 75 connection con4; @@ -761,7 +761,7 @@ connection default; "================== Step 9 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 0 username event_name count_star user2 wait/io/table/sql/handler 35 @@ -774,7 +774,7 @@ user4 wait/io/table/sql/handler 61 user4 wait/lock/table/sql/handler 0 execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 23 +user1 localhost wait/io/table/sql/handler 24 user1 localhost wait/lock/table/sql/handler 0 user2 localhost wait/io/table/sql/handler 35 user2 localhost wait/lock/table/sql/handler 0 @@ -784,7 +784,7 @@ user4 localhost wait/io/table/sql/handler 61 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 0 user2 wait/io/table/sql/handler 35 user2 wait/lock/table/sql/handler 0 @@ -794,29 +794,29 @@ user4 wait/io/table/sql/handler 61 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 167 +localhost wait/io/table/sql/handler 168 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 167 +wait/io/table/sql/handler 168 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 47 TABLE test t1 +wait/io/table/sql/handler 48 TABLE test t1 wait/io/table/sql/handler 120 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t3 NULL 106 64 42 64 12 30 0 TABLE test t3 index_b 10 10 0 10 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -824,7 +824,7 @@ TABLE test t1 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 47 +TABLE test t1 48 TABLE test t2 0 TABLE test t3 120 connection con1; @@ -836,7 +836,7 @@ connection default; "================== Step 10 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 0 username event_name count_star user2 wait/io/table/sql/handler 35 @@ -849,7 +849,7 @@ user4 wait/io/table/sql/handler 61 user4 wait/lock/table/sql/handler 0 execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 23 +user1 localhost wait/io/table/sql/handler 24 user1 localhost wait/lock/table/sql/handler 0 user2 localhost wait/io/table/sql/handler 35 user2 localhost wait/lock/table/sql/handler 0 @@ -859,7 +859,7 @@ user4 localhost wait/io/table/sql/handler 61 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 0 user2 wait/io/table/sql/handler 35 user2 wait/lock/table/sql/handler 0 @@ -869,29 +869,29 @@ user4 wait/io/table/sql/handler 61 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 167 +localhost wait/io/table/sql/handler 168 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 167 +wait/io/table/sql/handler 168 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 47 TABLE test t1 +wait/io/table/sql/handler 48 TABLE test t1 wait/io/table/sql/handler 120 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t3 NULL 106 64 42 64 12 30 0 TABLE test t3 index_b 10 10 0 10 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -899,7 +899,7 @@ TABLE test t1 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 47 +TABLE test t1 48 TABLE test t2 0 TABLE test t3 120 connection default; @@ -908,7 +908,7 @@ flush tables; "================== Step 11 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 0 username event_name count_star user2 wait/io/table/sql/handler 35 @@ -921,7 +921,7 @@ user4 wait/io/table/sql/handler 61 user4 wait/lock/table/sql/handler 0 execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 23 +user1 localhost wait/io/table/sql/handler 24 user1 localhost wait/lock/table/sql/handler 0 user2 localhost wait/io/table/sql/handler 35 user2 localhost wait/lock/table/sql/handler 0 @@ -931,7 +931,7 @@ user4 localhost wait/io/table/sql/handler 61 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 0 user2 wait/io/table/sql/handler 35 user2 wait/lock/table/sql/handler 0 @@ -941,29 +941,29 @@ user4 wait/io/table/sql/handler 61 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 167 +localhost wait/io/table/sql/handler 168 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 167 +wait/io/table/sql/handler 168 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 47 TABLE test t1 +wait/io/table/sql/handler 48 TABLE test t1 wait/io/table/sql/handler 120 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t3 NULL 106 64 42 64 12 30 0 TABLE test t3 index_b 10 10 0 10 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -971,7 +971,7 @@ TABLE test t1 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 47 +TABLE test t1 48 TABLE test t2 0 TABLE test t3 120 set global read_only=1; @@ -980,7 +980,7 @@ set global read_only=0; "================== Step 12 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 0 username event_name count_star user2 wait/io/table/sql/handler 35 @@ -993,7 +993,7 @@ user4 wait/io/table/sql/handler 61 user4 wait/lock/table/sql/handler 0 execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 23 +user1 localhost wait/io/table/sql/handler 24 user1 localhost wait/lock/table/sql/handler 0 user2 localhost wait/io/table/sql/handler 35 user2 localhost wait/lock/table/sql/handler 0 @@ -1003,7 +1003,7 @@ user4 localhost wait/io/table/sql/handler 61 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 0 user2 wait/io/table/sql/handler 35 user2 wait/lock/table/sql/handler 0 @@ -1013,29 +1013,29 @@ user4 wait/io/table/sql/handler 61 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 167 +localhost wait/io/table/sql/handler 168 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 167 +wait/io/table/sql/handler 168 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 47 TABLE test t1 +wait/io/table/sql/handler 48 TABLE test t1 wait/io/table/sql/handler 120 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t3 NULL 106 64 42 64 12 30 0 TABLE test t3 index_b 10 10 0 10 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -1043,7 +1043,7 @@ TABLE test t1 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 47 +TABLE test t1 48 TABLE test t2 0 TABLE test t3 120 disconnect con1; @@ -1062,7 +1062,7 @@ user4 wait/io/table/sql/handler 61 user4 wait/lock/table/sql/handler 0 execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 23 +user1 localhost wait/io/table/sql/handler 24 user1 localhost wait/lock/table/sql/handler 0 user2 localhost wait/io/table/sql/handler 35 user2 localhost wait/lock/table/sql/handler 0 @@ -1072,7 +1072,7 @@ user4 localhost wait/io/table/sql/handler 61 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 0 user2 wait/io/table/sql/handler 35 user2 wait/lock/table/sql/handler 0 @@ -1082,29 +1082,29 @@ user4 wait/io/table/sql/handler 61 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 167 +localhost wait/io/table/sql/handler 168 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 167 +wait/io/table/sql/handler 168 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 47 TABLE test t1 +wait/io/table/sql/handler 48 TABLE test t1 wait/io/table/sql/handler 120 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t3 NULL 106 64 42 64 12 30 0 TABLE test t3 index_b 10 10 0 10 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -1112,7 +1112,7 @@ TABLE test t1 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 47 +TABLE test t1 48 TABLE test t2 0 TABLE test t3 120 disconnect con2; @@ -1130,7 +1130,7 @@ user4 wait/io/table/sql/handler 61 user4 wait/lock/table/sql/handler 0 execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 23 +user1 localhost wait/io/table/sql/handler 24 user1 localhost wait/lock/table/sql/handler 0 user2 localhost wait/io/table/sql/handler 35 user2 localhost wait/lock/table/sql/handler 0 @@ -1140,7 +1140,7 @@ user4 localhost wait/io/table/sql/handler 61 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 0 user2 wait/io/table/sql/handler 35 user2 wait/lock/table/sql/handler 0 @@ -1150,29 +1150,29 @@ user4 wait/io/table/sql/handler 61 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 167 +localhost wait/io/table/sql/handler 168 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 167 +wait/io/table/sql/handler 168 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 47 TABLE test t1 +wait/io/table/sql/handler 48 TABLE test t1 wait/io/table/sql/handler 120 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t3 NULL 106 64 42 64 12 30 0 TABLE test t3 index_b 10 10 0 10 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -1180,7 +1180,7 @@ TABLE test t1 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 47 +TABLE test t1 48 TABLE test t2 0 TABLE test t3 120 disconnect con3; @@ -1197,7 +1197,7 @@ user4 wait/io/table/sql/handler 61 user4 wait/lock/table/sql/handler 0 execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 23 +user1 localhost wait/io/table/sql/handler 24 user1 localhost wait/lock/table/sql/handler 0 user2 localhost wait/io/table/sql/handler 35 user2 localhost wait/lock/table/sql/handler 0 @@ -1207,7 +1207,7 @@ user4 localhost wait/io/table/sql/handler 61 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 0 user2 wait/io/table/sql/handler 35 user2 wait/lock/table/sql/handler 0 @@ -1217,29 +1217,29 @@ user4 wait/io/table/sql/handler 61 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 167 +localhost wait/io/table/sql/handler 168 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 167 +wait/io/table/sql/handler 168 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 47 TABLE test t1 +wait/io/table/sql/handler 48 TABLE test t1 wait/io/table/sql/handler 120 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t3 NULL 106 64 42 64 12 30 0 TABLE test t3 index_b 10 10 0 10 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -1247,7 +1247,7 @@ TABLE test t1 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 47 +TABLE test t1 48 TABLE test t2 0 TABLE test t3 120 disconnect con4; @@ -1263,7 +1263,7 @@ username status user4 not found execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 23 +user1 localhost wait/io/table/sql/handler 24 user1 localhost wait/lock/table/sql/handler 0 user2 localhost wait/io/table/sql/handler 35 user2 localhost wait/lock/table/sql/handler 0 @@ -1273,7 +1273,7 @@ user4 localhost wait/io/table/sql/handler 61 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 0 user2 wait/io/table/sql/handler 35 user2 wait/lock/table/sql/handler 0 @@ -1283,29 +1283,29 @@ user4 wait/io/table/sql/handler 61 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 167 +localhost wait/io/table/sql/handler 168 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 167 +wait/io/table/sql/handler 168 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 47 TABLE test t1 +wait/io/table/sql/handler 48 TABLE test t1 wait/io/table/sql/handler 120 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t3 NULL 106 64 42 64 12 30 0 TABLE test t3 index_b 10 10 0 10 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -1313,7 +1313,7 @@ TABLE test t1 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 47 +TABLE test t1 48 TABLE test t2 0 TABLE test t3 120 connection default; @@ -1331,7 +1331,7 @@ username status user4 not found execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 23 +user1 localhost wait/io/table/sql/handler 24 user1 localhost wait/lock/table/sql/handler 0 user2 localhost wait/io/table/sql/handler 35 user2 localhost wait/lock/table/sql/handler 0 @@ -1341,7 +1341,7 @@ user4 localhost wait/io/table/sql/handler 61 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 0 user2 wait/io/table/sql/handler 35 user2 wait/lock/table/sql/handler 0 @@ -1351,29 +1351,29 @@ user4 wait/io/table/sql/handler 61 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 167 +localhost wait/io/table/sql/handler 168 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 167 +wait/io/table/sql/handler 168 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 47 TABLE test t1 +wait/io/table/sql/handler 48 TABLE test t1 wait/io/table/sql/handler 120 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t3 NULL 106 64 42 64 12 30 0 TABLE test t3 index_b 10 10 0 10 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -1381,7 +1381,7 @@ TABLE test t1 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 47 +TABLE test t1 48 TABLE test t2 0 TABLE test t3 120 truncate performance_schema.events_waits_summary_by_account_by_event_name; @@ -1408,7 +1408,7 @@ user4 localhost wait/io/table/sql/handler 0 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 0 user2 wait/io/table/sql/handler 35 user2 wait/lock/table/sql/handler 0 @@ -1418,29 +1418,29 @@ user4 wait/io/table/sql/handler 61 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 167 +localhost wait/io/table/sql/handler 168 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 167 +wait/io/table/sql/handler 168 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 47 TABLE test t1 +wait/io/table/sql/handler 48 TABLE test t1 wait/io/table/sql/handler 120 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t3 NULL 106 64 42 64 12 30 0 TABLE test t3 index_b 10 10 0 10 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -1448,7 +1448,7 @@ TABLE test t1 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 47 +TABLE test t1 48 TABLE test t2 0 TABLE test t3 120 truncate performance_schema.events_waits_summary_by_user_by_event_name; @@ -1485,29 +1485,29 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 167 +localhost wait/io/table/sql/handler 168 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 167 +wait/io/table/sql/handler 168 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 47 TABLE test t1 +wait/io/table/sql/handler 48 TABLE test t1 wait/io/table/sql/handler 120 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t3 NULL 106 64 42 64 12 30 0 TABLE test t3 index_b 10 10 0 10 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -1515,7 +1515,7 @@ TABLE test t1 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 47 +TABLE test t1 48 TABLE test t2 0 TABLE test t3 120 truncate performance_schema.events_waits_summary_by_host_by_event_name; @@ -1556,25 +1556,25 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 167 +wait/io/table/sql/handler 168 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 47 TABLE test t1 +wait/io/table/sql/handler 48 TABLE test t1 wait/io/table/sql/handler 120 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t3 NULL 106 64 42 64 12 30 0 TABLE test t3 index_b 10 10 0 10 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -1582,7 +1582,7 @@ TABLE test t1 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 47 +TABLE test t1 48 TABLE test t2 0 TABLE test t3 120 truncate performance_schema.events_waits_summary_global_by_event_name; @@ -1627,7 +1627,7 @@ wait/io/table/sql/handler 0 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 47 TABLE test t1 +wait/io/table/sql/handler 48 TABLE test t1 wait/io/table/sql/handler 120 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete diff --git a/mysql-test/suite/perfschema/r/table_io_aggregate_hist_4u_3t.result b/mysql-test/suite/perfschema/r/table_io_aggregate_hist_4u_3t.result index 6266fce73ad..b3fa01a0b14 100644 --- a/mysql-test/suite/perfschema/r/table_io_aggregate_hist_4u_3t.result +++ b/mysql-test/suite/perfschema/r/table_io_aggregate_hist_4u_3t.result @@ -187,7 +187,7 @@ connection default; "================== Step 3-A ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 0 username status user2 not found @@ -197,31 +197,31 @@ username status user4 not found execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 33 +user1 localhost wait/io/table/sql/handler 34 user1 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 33 +localhost wait/io/table/sql/handler 34 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 33 +wait/io/table/sql/handler 34 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 8 TABLE test t1 +wait/io/table/sql/handler 9 TABLE test t1 wait/io/table/sql/handler 10 TABLE test t2 wait/io/table/sql/handler 15 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 6 4 2 4 1 1 0 +TABLE test t1 NULL 9 6 3 6 1 2 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 2 1 1 1 0 1 0 +TABLE test t1 PRIMARY 0 0 0 0 0 0 0 TABLE test t2 NULL 9 5 4 5 2 2 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -232,7 +232,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 1 1 0 1 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 8 5 3 5 1 2 0 +TABLE test t1 9 6 3 6 1 2 0 TABLE test t2 10 6 4 6 2 2 0 TABLE test t3 15 9 6 9 3 3 0 execute dump_waits_table_lock; @@ -242,7 +242,7 @@ TABLE test t2 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 8 +TABLE test t1 9 TABLE test t2 10 TABLE test t3 15 connection con1; @@ -252,7 +252,7 @@ connection default; "================== Step 3-B ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 0 username status user2 not found @@ -262,31 +262,31 @@ username status user4 not found execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 33 +user1 localhost wait/io/table/sql/handler 34 user1 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 33 +localhost wait/io/table/sql/handler 34 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 33 +wait/io/table/sql/handler 34 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 8 TABLE test t1 +wait/io/table/sql/handler 9 TABLE test t1 wait/io/table/sql/handler 10 TABLE test t2 wait/io/table/sql/handler 15 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 6 4 2 4 1 1 0 +TABLE test t1 NULL 9 6 3 6 1 2 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 2 1 1 1 0 1 0 +TABLE test t1 PRIMARY 0 0 0 0 0 0 0 TABLE test t2 NULL 9 5 4 5 2 2 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -297,7 +297,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 1 1 0 1 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 8 5 3 5 1 2 0 +TABLE test t1 9 6 3 6 1 2 0 TABLE test t2 10 6 4 6 2 2 0 TABLE test t3 15 9 6 9 3 3 0 execute dump_waits_table_lock; @@ -307,7 +307,7 @@ TABLE test t2 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 8 +TABLE test t1 9 TABLE test t2 10 TABLE test t3 15 connect con2, localhost, user2, , ; @@ -318,7 +318,7 @@ connection default; "================== Step 4 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 0 username event_name count_star user2 wait/io/table/sql/handler 0 @@ -329,35 +329,35 @@ username status user4 not found execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 33 +user1 localhost wait/io/table/sql/handler 34 user1 localhost wait/lock/table/sql/handler 0 user2 localhost wait/io/table/sql/handler 0 user2 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 0 user2 wait/io/table/sql/handler 0 user2 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 33 +localhost wait/io/table/sql/handler 34 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 33 +wait/io/table/sql/handler 34 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 8 TABLE test t1 +wait/io/table/sql/handler 9 TABLE test t1 wait/io/table/sql/handler 10 TABLE test t2 wait/io/table/sql/handler 15 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 6 4 2 4 1 1 0 +TABLE test t1 NULL 9 6 3 6 1 2 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 2 1 1 1 0 1 0 +TABLE test t1 PRIMARY 0 0 0 0 0 0 0 TABLE test t2 NULL 9 5 4 5 2 2 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -368,7 +368,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 1 1 0 1 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 8 5 3 5 1 2 0 +TABLE test t1 9 6 3 6 1 2 0 TABLE test t2 10 6 4 6 2 2 0 TABLE test t3 15 9 6 9 3 3 0 execute dump_waits_table_lock; @@ -378,7 +378,7 @@ TABLE test t2 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 8 +TABLE test t1 9 TABLE test t2 10 TABLE test t3 15 connection con2; @@ -424,7 +424,7 @@ connection default; "================== Step 5 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 0 username event_name count_star user2 wait/io/table/sql/handler 51 @@ -435,35 +435,35 @@ username status user4 not found execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 33 +user1 localhost wait/io/table/sql/handler 34 user1 localhost wait/lock/table/sql/handler 0 user2 localhost wait/io/table/sql/handler 51 user2 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 0 user2 wait/io/table/sql/handler 51 user2 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 84 +localhost wait/io/table/sql/handler 85 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 84 +wait/io/table/sql/handler 85 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 18 TABLE test t1 +wait/io/table/sql/handler 19 TABLE test t1 wait/io/table/sql/handler 26 TABLE test t2 wait/io/table/sql/handler 40 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 14 9 5 9 2 3 0 +TABLE test t1 NULL 17 11 6 11 2 4 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t2 NULL 24 14 10 14 4 6 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -474,7 +474,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 18 11 7 11 2 5 0 +TABLE test t1 19 12 7 12 2 5 0 TABLE test t2 26 16 10 16 4 6 0 TABLE test t3 40 25 15 25 6 9 0 execute dump_waits_table_lock; @@ -484,7 +484,7 @@ TABLE test t2 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 18 +TABLE test t1 19 TABLE test t2 26 TABLE test t3 40 connect con3, localhost, user3, , ; @@ -495,7 +495,7 @@ connection default; "================== Step 6 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 0 username event_name count_star user2 wait/io/table/sql/handler 51 @@ -507,7 +507,7 @@ username status user4 not found execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 33 +user1 localhost wait/io/table/sql/handler 34 user1 localhost wait/lock/table/sql/handler 0 user2 localhost wait/io/table/sql/handler 51 user2 localhost wait/lock/table/sql/handler 0 @@ -515,7 +515,7 @@ user3 localhost wait/io/table/sql/handler 0 user3 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 0 user2 wait/io/table/sql/handler 51 user2 wait/lock/table/sql/handler 0 @@ -523,23 +523,23 @@ user3 wait/io/table/sql/handler 0 user3 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 84 +localhost wait/io/table/sql/handler 85 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 84 +wait/io/table/sql/handler 85 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 18 TABLE test t1 +wait/io/table/sql/handler 19 TABLE test t1 wait/io/table/sql/handler 26 TABLE test t2 wait/io/table/sql/handler 40 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 14 9 5 9 2 3 0 +TABLE test t1 NULL 17 11 6 11 2 4 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t2 NULL 24 14 10 14 4 6 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -550,7 +550,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 18 11 7 11 2 5 0 +TABLE test t1 19 12 7 12 2 5 0 TABLE test t2 26 16 10 16 4 6 0 TABLE test t3 40 25 15 25 6 9 0 execute dump_waits_table_lock; @@ -560,7 +560,7 @@ TABLE test t2 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 18 +TABLE test t1 19 TABLE test t2 26 TABLE test t3 40 connection con3; @@ -613,7 +613,7 @@ connection default; "================== Step 7 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 0 username event_name count_star user2 wait/io/table/sql/handler 51 @@ -625,7 +625,7 @@ username status user4 not found execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 33 +user1 localhost wait/io/table/sql/handler 34 user1 localhost wait/lock/table/sql/handler 0 user2 localhost wait/io/table/sql/handler 51 user2 localhost wait/lock/table/sql/handler 0 @@ -633,7 +633,7 @@ user3 localhost wait/io/table/sql/handler 70 user3 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 0 user2 wait/io/table/sql/handler 51 user2 wait/lock/table/sql/handler 0 @@ -641,23 +641,23 @@ user3 wait/io/table/sql/handler 70 user3 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 154 +localhost wait/io/table/sql/handler 155 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 154 +wait/io/table/sql/handler 155 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 31 TABLE test t1 +wait/io/table/sql/handler 32 TABLE test t1 wait/io/table/sql/handler 48 TABLE test t2 wait/io/table/sql/handler 75 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 25 16 9 16 3 6 0 +TABLE test t1 NULL 28 18 10 18 3 7 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 6 3 3 3 0 3 0 +TABLE test t1 PRIMARY 4 2 2 2 0 2 0 TABLE test t2 NULL 45 27 18 27 6 12 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -668,7 +668,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 3 3 0 3 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 31 19 12 19 3 9 0 +TABLE test t1 32 20 12 20 3 9 0 TABLE test t2 48 30 18 30 6 12 0 TABLE test t3 75 48 27 48 9 18 0 execute dump_waits_table_lock; @@ -678,7 +678,7 @@ TABLE test t2 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 31 +TABLE test t1 32 TABLE test t2 48 TABLE test t3 75 connect con4, localhost, user4, , ; @@ -689,7 +689,7 @@ connection default; "================== Step 8 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 0 username event_name count_star user2 wait/io/table/sql/handler 51 @@ -702,7 +702,7 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 33 +user1 localhost wait/io/table/sql/handler 34 user1 localhost wait/lock/table/sql/handler 0 user2 localhost wait/io/table/sql/handler 51 user2 localhost wait/lock/table/sql/handler 0 @@ -712,7 +712,7 @@ user4 localhost wait/io/table/sql/handler 0 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 0 user2 wait/io/table/sql/handler 51 user2 wait/lock/table/sql/handler 0 @@ -722,23 +722,23 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 154 +localhost wait/io/table/sql/handler 155 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 154 +wait/io/table/sql/handler 155 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 31 TABLE test t1 +wait/io/table/sql/handler 32 TABLE test t1 wait/io/table/sql/handler 48 TABLE test t2 wait/io/table/sql/handler 75 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 25 16 9 16 3 6 0 +TABLE test t1 NULL 28 18 10 18 3 7 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 6 3 3 3 0 3 0 +TABLE test t1 PRIMARY 4 2 2 2 0 2 0 TABLE test t2 NULL 45 27 18 27 6 12 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -749,7 +749,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 3 3 0 3 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 31 19 12 19 3 9 0 +TABLE test t1 32 20 12 20 3 9 0 TABLE test t2 48 30 18 30 6 12 0 TABLE test t3 75 48 27 48 9 18 0 execute dump_waits_table_lock; @@ -759,7 +759,7 @@ TABLE test t2 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 31 +TABLE test t1 32 TABLE test t2 48 TABLE test t3 75 connection con4; @@ -819,7 +819,7 @@ connection default; "================== Step 9 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 0 username event_name count_star user2 wait/io/table/sql/handler 51 @@ -832,7 +832,7 @@ user4 wait/io/table/sql/handler 89 user4 wait/lock/table/sql/handler 0 execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 33 +user1 localhost wait/io/table/sql/handler 34 user1 localhost wait/lock/table/sql/handler 0 user2 localhost wait/io/table/sql/handler 51 user2 localhost wait/lock/table/sql/handler 0 @@ -842,7 +842,7 @@ user4 localhost wait/io/table/sql/handler 89 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 0 user2 wait/io/table/sql/handler 51 user2 wait/lock/table/sql/handler 0 @@ -852,23 +852,23 @@ user4 wait/io/table/sql/handler 89 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 243 +localhost wait/io/table/sql/handler 244 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 243 +wait/io/table/sql/handler 244 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 47 TABLE test t1 +wait/io/table/sql/handler 48 TABLE test t1 wait/io/table/sql/handler 76 TABLE test t2 wait/io/table/sql/handler 120 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t2 NULL 72 44 28 44 8 20 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -879,7 +879,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t2 76 48 28 48 8 20 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; @@ -889,7 +889,7 @@ TABLE test t2 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 47 +TABLE test t1 48 TABLE test t2 76 TABLE test t3 120 connection con1; @@ -901,7 +901,7 @@ connection default; "================== Step 10 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 0 username event_name count_star user2 wait/io/table/sql/handler 51 @@ -914,7 +914,7 @@ user4 wait/io/table/sql/handler 89 user4 wait/lock/table/sql/handler 0 execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 33 +user1 localhost wait/io/table/sql/handler 34 user1 localhost wait/lock/table/sql/handler 0 user2 localhost wait/io/table/sql/handler 51 user2 localhost wait/lock/table/sql/handler 0 @@ -924,7 +924,7 @@ user4 localhost wait/io/table/sql/handler 89 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 0 user2 wait/io/table/sql/handler 51 user2 wait/lock/table/sql/handler 0 @@ -934,23 +934,23 @@ user4 wait/io/table/sql/handler 89 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 243 +localhost wait/io/table/sql/handler 244 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 243 +wait/io/table/sql/handler 244 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 47 TABLE test t1 +wait/io/table/sql/handler 48 TABLE test t1 wait/io/table/sql/handler 76 TABLE test t2 wait/io/table/sql/handler 120 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t2 NULL 72 44 28 44 8 20 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -961,7 +961,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t2 76 48 28 48 8 20 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; @@ -971,7 +971,7 @@ TABLE test t2 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 47 +TABLE test t1 48 TABLE test t2 76 TABLE test t3 120 connection default; @@ -980,7 +980,7 @@ flush tables; "================== Step 11 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 0 username event_name count_star user2 wait/io/table/sql/handler 51 @@ -993,7 +993,7 @@ user4 wait/io/table/sql/handler 89 user4 wait/lock/table/sql/handler 0 execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 33 +user1 localhost wait/io/table/sql/handler 34 user1 localhost wait/lock/table/sql/handler 0 user2 localhost wait/io/table/sql/handler 51 user2 localhost wait/lock/table/sql/handler 0 @@ -1003,7 +1003,7 @@ user4 localhost wait/io/table/sql/handler 89 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 0 user2 wait/io/table/sql/handler 51 user2 wait/lock/table/sql/handler 0 @@ -1013,23 +1013,23 @@ user4 wait/io/table/sql/handler 89 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 243 +localhost wait/io/table/sql/handler 244 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 243 +wait/io/table/sql/handler 244 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 47 TABLE test t1 +wait/io/table/sql/handler 48 TABLE test t1 wait/io/table/sql/handler 76 TABLE test t2 wait/io/table/sql/handler 120 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t2 NULL 72 44 28 44 8 20 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -1040,7 +1040,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t2 76 48 28 48 8 20 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; @@ -1050,7 +1050,7 @@ TABLE test t2 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 47 +TABLE test t1 48 TABLE test t2 76 TABLE test t3 120 set global read_only=1; @@ -1059,7 +1059,7 @@ set global read_only=0; "================== Step 12 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 0 username event_name count_star user2 wait/io/table/sql/handler 51 @@ -1072,7 +1072,7 @@ user4 wait/io/table/sql/handler 89 user4 wait/lock/table/sql/handler 0 execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 33 +user1 localhost wait/io/table/sql/handler 34 user1 localhost wait/lock/table/sql/handler 0 user2 localhost wait/io/table/sql/handler 51 user2 localhost wait/lock/table/sql/handler 0 @@ -1082,7 +1082,7 @@ user4 localhost wait/io/table/sql/handler 89 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 0 user2 wait/io/table/sql/handler 51 user2 wait/lock/table/sql/handler 0 @@ -1092,23 +1092,23 @@ user4 wait/io/table/sql/handler 89 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 243 +localhost wait/io/table/sql/handler 244 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 243 +wait/io/table/sql/handler 244 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 47 TABLE test t1 +wait/io/table/sql/handler 48 TABLE test t1 wait/io/table/sql/handler 76 TABLE test t2 wait/io/table/sql/handler 120 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t2 NULL 72 44 28 44 8 20 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -1119,7 +1119,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t2 76 48 28 48 8 20 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; @@ -1129,7 +1129,7 @@ TABLE test t2 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 47 +TABLE test t1 48 TABLE test t2 76 TABLE test t3 120 disconnect con1; @@ -1148,7 +1148,7 @@ user4 wait/io/table/sql/handler 89 user4 wait/lock/table/sql/handler 0 execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 33 +user1 localhost wait/io/table/sql/handler 34 user1 localhost wait/lock/table/sql/handler 0 user2 localhost wait/io/table/sql/handler 51 user2 localhost wait/lock/table/sql/handler 0 @@ -1158,7 +1158,7 @@ user4 localhost wait/io/table/sql/handler 89 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 0 user2 wait/io/table/sql/handler 51 user2 wait/lock/table/sql/handler 0 @@ -1168,23 +1168,23 @@ user4 wait/io/table/sql/handler 89 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 243 +localhost wait/io/table/sql/handler 244 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 243 +wait/io/table/sql/handler 244 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 47 TABLE test t1 +wait/io/table/sql/handler 48 TABLE test t1 wait/io/table/sql/handler 76 TABLE test t2 wait/io/table/sql/handler 120 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t2 NULL 72 44 28 44 8 20 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -1195,7 +1195,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t2 76 48 28 48 8 20 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; @@ -1205,7 +1205,7 @@ TABLE test t2 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 47 +TABLE test t1 48 TABLE test t2 76 TABLE test t3 120 disconnect con2; @@ -1223,7 +1223,7 @@ user4 wait/io/table/sql/handler 89 user4 wait/lock/table/sql/handler 0 execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 33 +user1 localhost wait/io/table/sql/handler 34 user1 localhost wait/lock/table/sql/handler 0 user2 localhost wait/io/table/sql/handler 51 user2 localhost wait/lock/table/sql/handler 0 @@ -1233,7 +1233,7 @@ user4 localhost wait/io/table/sql/handler 89 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 0 user2 wait/io/table/sql/handler 51 user2 wait/lock/table/sql/handler 0 @@ -1243,23 +1243,23 @@ user4 wait/io/table/sql/handler 89 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 243 +localhost wait/io/table/sql/handler 244 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 243 +wait/io/table/sql/handler 244 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 47 TABLE test t1 +wait/io/table/sql/handler 48 TABLE test t1 wait/io/table/sql/handler 76 TABLE test t2 wait/io/table/sql/handler 120 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t2 NULL 72 44 28 44 8 20 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -1270,7 +1270,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t2 76 48 28 48 8 20 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; @@ -1280,7 +1280,7 @@ TABLE test t2 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 47 +TABLE test t1 48 TABLE test t2 76 TABLE test t3 120 disconnect con3; @@ -1297,7 +1297,7 @@ user4 wait/io/table/sql/handler 89 user4 wait/lock/table/sql/handler 0 execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 33 +user1 localhost wait/io/table/sql/handler 34 user1 localhost wait/lock/table/sql/handler 0 user2 localhost wait/io/table/sql/handler 51 user2 localhost wait/lock/table/sql/handler 0 @@ -1307,7 +1307,7 @@ user4 localhost wait/io/table/sql/handler 89 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 0 user2 wait/io/table/sql/handler 51 user2 wait/lock/table/sql/handler 0 @@ -1317,23 +1317,23 @@ user4 wait/io/table/sql/handler 89 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 243 +localhost wait/io/table/sql/handler 244 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 243 +wait/io/table/sql/handler 244 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 47 TABLE test t1 +wait/io/table/sql/handler 48 TABLE test t1 wait/io/table/sql/handler 76 TABLE test t2 wait/io/table/sql/handler 120 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t2 NULL 72 44 28 44 8 20 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -1344,7 +1344,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t2 76 48 28 48 8 20 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; @@ -1354,7 +1354,7 @@ TABLE test t2 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 47 +TABLE test t1 48 TABLE test t2 76 TABLE test t3 120 disconnect con4; @@ -1370,7 +1370,7 @@ username status user4 not found execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 33 +user1 localhost wait/io/table/sql/handler 34 user1 localhost wait/lock/table/sql/handler 0 user2 localhost wait/io/table/sql/handler 51 user2 localhost wait/lock/table/sql/handler 0 @@ -1380,7 +1380,7 @@ user4 localhost wait/io/table/sql/handler 89 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 0 user2 wait/io/table/sql/handler 51 user2 wait/lock/table/sql/handler 0 @@ -1390,23 +1390,23 @@ user4 wait/io/table/sql/handler 89 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 243 +localhost wait/io/table/sql/handler 244 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 243 +wait/io/table/sql/handler 244 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 47 TABLE test t1 +wait/io/table/sql/handler 48 TABLE test t1 wait/io/table/sql/handler 76 TABLE test t2 wait/io/table/sql/handler 120 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t2 NULL 72 44 28 44 8 20 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -1417,7 +1417,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t2 76 48 28 48 8 20 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; @@ -1427,7 +1427,7 @@ TABLE test t2 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 47 +TABLE test t1 48 TABLE test t2 76 TABLE test t3 120 connection default; @@ -1445,7 +1445,7 @@ username status user4 not found execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 33 +user1 localhost wait/io/table/sql/handler 34 user1 localhost wait/lock/table/sql/handler 0 user2 localhost wait/io/table/sql/handler 51 user2 localhost wait/lock/table/sql/handler 0 @@ -1455,7 +1455,7 @@ user4 localhost wait/io/table/sql/handler 89 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 0 user2 wait/io/table/sql/handler 51 user2 wait/lock/table/sql/handler 0 @@ -1465,23 +1465,23 @@ user4 wait/io/table/sql/handler 89 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 243 +localhost wait/io/table/sql/handler 244 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 243 +wait/io/table/sql/handler 244 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 47 TABLE test t1 +wait/io/table/sql/handler 48 TABLE test t1 wait/io/table/sql/handler 76 TABLE test t2 wait/io/table/sql/handler 120 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t2 NULL 72 44 28 44 8 20 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -1492,7 +1492,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t2 76 48 28 48 8 20 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; @@ -1502,7 +1502,7 @@ TABLE test t2 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 47 +TABLE test t1 48 TABLE test t2 76 TABLE test t3 120 truncate performance_schema.events_waits_summary_by_account_by_event_name; @@ -1529,7 +1529,7 @@ user4 localhost wait/io/table/sql/handler 0 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 0 user2 wait/io/table/sql/handler 51 user2 wait/lock/table/sql/handler 0 @@ -1539,23 +1539,23 @@ user4 wait/io/table/sql/handler 89 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 243 +localhost wait/io/table/sql/handler 244 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 243 +wait/io/table/sql/handler 244 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 47 TABLE test t1 +wait/io/table/sql/handler 48 TABLE test t1 wait/io/table/sql/handler 76 TABLE test t2 wait/io/table/sql/handler 120 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t2 NULL 72 44 28 44 8 20 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -1566,7 +1566,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t2 76 48 28 48 8 20 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; @@ -1576,7 +1576,7 @@ TABLE test t2 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 47 +TABLE test t1 48 TABLE test t2 76 TABLE test t3 120 truncate performance_schema.events_waits_summary_by_user_by_event_name; @@ -1613,23 +1613,23 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 243 +localhost wait/io/table/sql/handler 244 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 243 +wait/io/table/sql/handler 244 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 47 TABLE test t1 +wait/io/table/sql/handler 48 TABLE test t1 wait/io/table/sql/handler 76 TABLE test t2 wait/io/table/sql/handler 120 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t2 NULL 72 44 28 44 8 20 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -1640,7 +1640,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t2 76 48 28 48 8 20 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; @@ -1650,7 +1650,7 @@ TABLE test t2 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 47 +TABLE test t1 48 TABLE test t2 76 TABLE test t3 120 truncate performance_schema.events_waits_summary_by_host_by_event_name; @@ -1691,19 +1691,19 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 243 +wait/io/table/sql/handler 244 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 47 TABLE test t1 +wait/io/table/sql/handler 48 TABLE test t1 wait/io/table/sql/handler 76 TABLE test t2 wait/io/table/sql/handler 120 TABLE test t3 execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t2 NULL 72 44 28 44 8 20 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -1714,7 +1714,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t2 76 48 28 48 8 20 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; @@ -1724,7 +1724,7 @@ TABLE test t2 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 47 +TABLE test t1 48 TABLE test t2 76 TABLE test t3 120 truncate performance_schema.events_waits_summary_global_by_event_name; @@ -1769,7 +1769,7 @@ wait/io/table/sql/handler 0 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name -wait/io/table/sql/handler 47 TABLE test t1 +wait/io/table/sql/handler 48 TABLE test t1 wait/io/table/sql/handler 76 TABLE test t2 wait/io/table/sql/handler 120 TABLE test t3 execute dump_waits_index_io; diff --git a/mysql-test/suite/perfschema/r/table_io_aggregate_thread_2u_2t.result b/mysql-test/suite/perfschema/r/table_io_aggregate_thread_2u_2t.result index 563793465c1..3791e0e7273 100644 --- a/mysql-test/suite/perfschema/r/table_io_aggregate_thread_2u_2t.result +++ b/mysql-test/suite/perfschema/r/table_io_aggregate_thread_2u_2t.result @@ -180,7 +180,7 @@ connection default; "================== Step 3-A ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 0 username status user2 not found @@ -190,35 +190,35 @@ username status user4 not found execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 23 +user1 localhost wait/io/table/sql/handler 24 user1 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 23 +localhost wait/io/table/sql/handler 24 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 23 +wait/io/table/sql/handler 24 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 6 4 2 4 1 1 0 +TABLE test t1 NULL 9 6 3 6 1 2 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 2 1 1 1 0 1 0 +TABLE test t1 PRIMARY 0 0 0 0 0 0 0 TABLE test t3 NULL 13 7 6 7 3 3 0 TABLE test t3 index_b 1 1 0 1 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 1 1 0 1 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 8 5 3 5 1 2 0 +TABLE test t1 9 6 3 6 1 2 0 TABLE test t3 15 9 6 9 3 3 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -226,7 +226,7 @@ TABLE test t1 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 8 +TABLE test t1 9 TABLE test t2 0 TABLE test t3 15 connection con1; @@ -236,7 +236,7 @@ connection default; "================== Step 3-B ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 0 username status user2 not found @@ -246,35 +246,35 @@ username status user4 not found execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 23 +user1 localhost wait/io/table/sql/handler 24 user1 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 23 +localhost wait/io/table/sql/handler 24 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 23 +wait/io/table/sql/handler 24 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 6 4 2 4 1 1 0 +TABLE test t1 NULL 9 6 3 6 1 2 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 2 1 1 1 0 1 0 +TABLE test t1 PRIMARY 0 0 0 0 0 0 0 TABLE test t3 NULL 13 7 6 7 3 3 0 TABLE test t3 index_b 1 1 0 1 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 1 1 0 1 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 8 5 3 5 1 2 0 +TABLE test t1 9 6 3 6 1 2 0 TABLE test t3 15 9 6 9 3 3 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -282,7 +282,7 @@ TABLE test t1 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 8 +TABLE test t1 9 TABLE test t2 0 TABLE test t3 15 connect con2, localhost, user2, , ; @@ -293,7 +293,7 @@ connection default; "================== Step 4 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 0 username event_name count_star user2 wait/io/table/sql/handler 0 @@ -304,39 +304,39 @@ username status user4 not found execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 23 +user1 localhost wait/io/table/sql/handler 24 user1 localhost wait/lock/table/sql/handler 0 user2 localhost wait/io/table/sql/handler 0 user2 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 0 user2 wait/io/table/sql/handler 0 user2 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 23 +localhost wait/io/table/sql/handler 24 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 23 +wait/io/table/sql/handler 24 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 6 4 2 4 1 1 0 +TABLE test t1 NULL 9 6 3 6 1 2 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 2 1 1 1 0 1 0 +TABLE test t1 PRIMARY 0 0 0 0 0 0 0 TABLE test t3 NULL 13 7 6 7 3 3 0 TABLE test t3 index_b 1 1 0 1 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 1 1 0 1 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 8 5 3 5 1 2 0 +TABLE test t1 9 6 3 6 1 2 0 TABLE test t3 15 9 6 9 3 3 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -344,7 +344,7 @@ TABLE test t1 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 8 +TABLE test t1 9 TABLE test t2 0 TABLE test t3 15 connection con2; @@ -390,7 +390,7 @@ connection default; "================== Step 5 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 0 username event_name count_star user2 wait/io/table/sql/handler 0 @@ -401,39 +401,39 @@ username status user4 not found execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 23 +user1 localhost wait/io/table/sql/handler 24 user1 localhost wait/lock/table/sql/handler 0 user2 localhost wait/io/table/sql/handler 0 user2 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 0 user2 wait/io/table/sql/handler 0 user2 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 23 +localhost wait/io/table/sql/handler 24 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 23 +wait/io/table/sql/handler 24 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 6 4 2 4 1 1 0 +TABLE test t1 NULL 9 6 3 6 1 2 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 2 1 1 1 0 1 0 +TABLE test t1 PRIMARY 0 0 0 0 0 0 0 TABLE test t3 NULL 13 7 6 7 3 3 0 TABLE test t3 index_b 1 1 0 1 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 1 1 0 1 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 8 5 3 5 1 2 0 +TABLE test t1 9 6 3 6 1 2 0 TABLE test t3 15 9 6 9 3 3 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -441,7 +441,7 @@ TABLE test t1 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 8 +TABLE test t1 9 TABLE test t2 0 TABLE test t3 15 connect con3, localhost, user3, , ; @@ -452,7 +452,7 @@ connection default; "================== Step 6 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 0 username event_name count_star user2 wait/io/table/sql/handler 0 @@ -464,7 +464,7 @@ username status user4 not found execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 23 +user1 localhost wait/io/table/sql/handler 24 user1 localhost wait/lock/table/sql/handler 0 user2 localhost wait/io/table/sql/handler 0 user2 localhost wait/lock/table/sql/handler 0 @@ -472,7 +472,7 @@ user3 localhost wait/io/table/sql/handler 0 user3 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 0 user2 wait/io/table/sql/handler 0 user2 wait/lock/table/sql/handler 0 @@ -480,27 +480,27 @@ user3 wait/io/table/sql/handler 0 user3 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 23 +localhost wait/io/table/sql/handler 24 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 23 +wait/io/table/sql/handler 24 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 6 4 2 4 1 1 0 +TABLE test t1 NULL 9 6 3 6 1 2 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 2 1 1 1 0 1 0 +TABLE test t1 PRIMARY 0 0 0 0 0 0 0 TABLE test t3 NULL 13 7 6 7 3 3 0 TABLE test t3 index_b 1 1 0 1 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 1 1 0 1 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 8 5 3 5 1 2 0 +TABLE test t1 9 6 3 6 1 2 0 TABLE test t3 15 9 6 9 3 3 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -508,7 +508,7 @@ TABLE test t1 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 8 +TABLE test t1 9 TABLE test t2 0 TABLE test t3 15 connection con3; @@ -561,7 +561,7 @@ connection default; "================== Step 7 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 0 username event_name count_star user2 wait/io/table/sql/handler 0 @@ -573,7 +573,7 @@ username status user4 not found execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 23 +user1 localhost wait/io/table/sql/handler 24 user1 localhost wait/lock/table/sql/handler 0 user2 localhost wait/io/table/sql/handler 0 user2 localhost wait/lock/table/sql/handler 0 @@ -581,7 +581,7 @@ user3 localhost wait/io/table/sql/handler 48 user3 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 0 user2 wait/io/table/sql/handler 0 user2 wait/lock/table/sql/handler 0 @@ -589,27 +589,27 @@ user3 wait/io/table/sql/handler 48 user3 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 71 +localhost wait/io/table/sql/handler 72 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 71 +wait/io/table/sql/handler 72 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 17 11 6 11 2 4 0 +TABLE test t1 NULL 20 13 7 13 2 5 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t3 NULL 44 26 18 26 6 12 0 TABLE test t3 index_b 4 4 0 4 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 21 13 8 13 2 6 0 +TABLE test t1 22 14 8 14 2 6 0 TABLE test t3 50 32 18 32 6 12 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -617,7 +617,7 @@ TABLE test t1 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 21 +TABLE test t1 22 TABLE test t2 0 TABLE test t3 50 connect con4, localhost, user4, , ; @@ -628,7 +628,7 @@ connection default; "================== Step 8 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 0 username event_name count_star user2 wait/io/table/sql/handler 0 @@ -641,7 +641,7 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 23 +user1 localhost wait/io/table/sql/handler 24 user1 localhost wait/lock/table/sql/handler 0 user2 localhost wait/io/table/sql/handler 0 user2 localhost wait/lock/table/sql/handler 0 @@ -651,7 +651,7 @@ user4 localhost wait/io/table/sql/handler 0 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 0 user2 wait/io/table/sql/handler 0 user2 wait/lock/table/sql/handler 0 @@ -661,27 +661,27 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 71 +localhost wait/io/table/sql/handler 72 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 71 +wait/io/table/sql/handler 72 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 17 11 6 11 2 4 0 +TABLE test t1 NULL 20 13 7 13 2 5 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t3 NULL 44 26 18 26 6 12 0 TABLE test t3 index_b 4 4 0 4 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 21 13 8 13 2 6 0 +TABLE test t1 22 14 8 14 2 6 0 TABLE test t3 50 32 18 32 6 12 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -689,7 +689,7 @@ TABLE test t1 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 21 +TABLE test t1 22 TABLE test t2 0 TABLE test t3 50 connection con4; @@ -749,7 +749,7 @@ connection default; "================== Step 9 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 0 username event_name count_star user2 wait/io/table/sql/handler 0 @@ -762,7 +762,7 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 23 +user1 localhost wait/io/table/sql/handler 24 user1 localhost wait/lock/table/sql/handler 0 user2 localhost wait/io/table/sql/handler 0 user2 localhost wait/lock/table/sql/handler 0 @@ -772,7 +772,7 @@ user4 localhost wait/io/table/sql/handler 0 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 0 user2 wait/io/table/sql/handler 0 user2 wait/lock/table/sql/handler 0 @@ -782,27 +782,27 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 71 +localhost wait/io/table/sql/handler 72 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 71 +wait/io/table/sql/handler 72 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 17 11 6 11 2 4 0 +TABLE test t1 NULL 20 13 7 13 2 5 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t3 NULL 44 26 18 26 6 12 0 TABLE test t3 index_b 4 4 0 4 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 21 13 8 13 2 6 0 +TABLE test t1 22 14 8 14 2 6 0 TABLE test t3 50 32 18 32 6 12 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -810,7 +810,7 @@ TABLE test t1 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 21 +TABLE test t1 22 TABLE test t2 0 TABLE test t3 50 connection con1; @@ -822,7 +822,7 @@ connection default; "================== Step 10 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 0 username event_name count_star user2 wait/io/table/sql/handler 0 @@ -835,7 +835,7 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 23 +user1 localhost wait/io/table/sql/handler 24 user1 localhost wait/lock/table/sql/handler 0 user2 localhost wait/io/table/sql/handler 0 user2 localhost wait/lock/table/sql/handler 0 @@ -845,7 +845,7 @@ user4 localhost wait/io/table/sql/handler 0 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 0 user2 wait/io/table/sql/handler 0 user2 wait/lock/table/sql/handler 0 @@ -855,27 +855,27 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 71 +localhost wait/io/table/sql/handler 72 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 71 +wait/io/table/sql/handler 72 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 17 11 6 11 2 4 0 +TABLE test t1 NULL 20 13 7 13 2 5 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t3 NULL 44 26 18 26 6 12 0 TABLE test t3 index_b 4 4 0 4 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 21 13 8 13 2 6 0 +TABLE test t1 22 14 8 14 2 6 0 TABLE test t3 50 32 18 32 6 12 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -883,7 +883,7 @@ TABLE test t1 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 21 +TABLE test t1 22 TABLE test t2 0 TABLE test t3 50 connection default; @@ -892,7 +892,7 @@ flush tables; "================== Step 11 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 0 username event_name count_star user2 wait/io/table/sql/handler 0 @@ -905,7 +905,7 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 23 +user1 localhost wait/io/table/sql/handler 24 user1 localhost wait/lock/table/sql/handler 0 user2 localhost wait/io/table/sql/handler 0 user2 localhost wait/lock/table/sql/handler 0 @@ -915,7 +915,7 @@ user4 localhost wait/io/table/sql/handler 0 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 0 user2 wait/io/table/sql/handler 0 user2 wait/lock/table/sql/handler 0 @@ -925,27 +925,27 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 71 +localhost wait/io/table/sql/handler 72 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 71 +wait/io/table/sql/handler 72 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 17 11 6 11 2 4 0 +TABLE test t1 NULL 20 13 7 13 2 5 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t3 NULL 44 26 18 26 6 12 0 TABLE test t3 index_b 4 4 0 4 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 21 13 8 13 2 6 0 +TABLE test t1 22 14 8 14 2 6 0 TABLE test t3 50 32 18 32 6 12 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -953,7 +953,7 @@ TABLE test t1 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 21 +TABLE test t1 22 TABLE test t2 0 TABLE test t3 50 set global read_only=1; @@ -962,7 +962,7 @@ set global read_only=0; "================== Step 12 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 0 username event_name count_star user2 wait/io/table/sql/handler 0 @@ -975,7 +975,7 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 23 +user1 localhost wait/io/table/sql/handler 24 user1 localhost wait/lock/table/sql/handler 0 user2 localhost wait/io/table/sql/handler 0 user2 localhost wait/lock/table/sql/handler 0 @@ -985,7 +985,7 @@ user4 localhost wait/io/table/sql/handler 0 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 0 user2 wait/io/table/sql/handler 0 user2 wait/lock/table/sql/handler 0 @@ -995,27 +995,27 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 71 +localhost wait/io/table/sql/handler 72 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 71 +wait/io/table/sql/handler 72 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 17 11 6 11 2 4 0 +TABLE test t1 NULL 20 13 7 13 2 5 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t3 NULL 44 26 18 26 6 12 0 TABLE test t3 index_b 4 4 0 4 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 21 13 8 13 2 6 0 +TABLE test t1 22 14 8 14 2 6 0 TABLE test t3 50 32 18 32 6 12 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -1023,7 +1023,7 @@ TABLE test t1 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 21 +TABLE test t1 22 TABLE test t2 0 TABLE test t3 50 disconnect con1; @@ -1042,7 +1042,7 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 23 +user1 localhost wait/io/table/sql/handler 24 user1 localhost wait/lock/table/sql/handler 0 user2 localhost wait/io/table/sql/handler 0 user2 localhost wait/lock/table/sql/handler 0 @@ -1052,7 +1052,7 @@ user4 localhost wait/io/table/sql/handler 0 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 0 user2 wait/io/table/sql/handler 0 user2 wait/lock/table/sql/handler 0 @@ -1062,27 +1062,27 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 71 +localhost wait/io/table/sql/handler 72 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 71 +wait/io/table/sql/handler 72 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 17 11 6 11 2 4 0 +TABLE test t1 NULL 20 13 7 13 2 5 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t3 NULL 44 26 18 26 6 12 0 TABLE test t3 index_b 4 4 0 4 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 21 13 8 13 2 6 0 +TABLE test t1 22 14 8 14 2 6 0 TABLE test t3 50 32 18 32 6 12 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -1090,7 +1090,7 @@ TABLE test t1 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 21 +TABLE test t1 22 TABLE test t2 0 TABLE test t3 50 disconnect con2; @@ -1108,7 +1108,7 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 23 +user1 localhost wait/io/table/sql/handler 24 user1 localhost wait/lock/table/sql/handler 0 user2 localhost wait/io/table/sql/handler 0 user2 localhost wait/lock/table/sql/handler 0 @@ -1118,7 +1118,7 @@ user4 localhost wait/io/table/sql/handler 0 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 0 user2 wait/io/table/sql/handler 0 user2 wait/lock/table/sql/handler 0 @@ -1128,27 +1128,27 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 71 +localhost wait/io/table/sql/handler 72 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 71 +wait/io/table/sql/handler 72 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 17 11 6 11 2 4 0 +TABLE test t1 NULL 20 13 7 13 2 5 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t3 NULL 44 26 18 26 6 12 0 TABLE test t3 index_b 4 4 0 4 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 21 13 8 13 2 6 0 +TABLE test t1 22 14 8 14 2 6 0 TABLE test t3 50 32 18 32 6 12 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -1156,7 +1156,7 @@ TABLE test t1 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 21 +TABLE test t1 22 TABLE test t2 0 TABLE test t3 50 disconnect con3; @@ -1173,7 +1173,7 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 23 +user1 localhost wait/io/table/sql/handler 24 user1 localhost wait/lock/table/sql/handler 0 user2 localhost wait/io/table/sql/handler 0 user2 localhost wait/lock/table/sql/handler 0 @@ -1183,7 +1183,7 @@ user4 localhost wait/io/table/sql/handler 0 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 0 user2 wait/io/table/sql/handler 0 user2 wait/lock/table/sql/handler 0 @@ -1193,27 +1193,27 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 71 +localhost wait/io/table/sql/handler 72 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 71 +wait/io/table/sql/handler 72 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 17 11 6 11 2 4 0 +TABLE test t1 NULL 20 13 7 13 2 5 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t3 NULL 44 26 18 26 6 12 0 TABLE test t3 index_b 4 4 0 4 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 21 13 8 13 2 6 0 +TABLE test t1 22 14 8 14 2 6 0 TABLE test t3 50 32 18 32 6 12 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -1221,7 +1221,7 @@ TABLE test t1 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 21 +TABLE test t1 22 TABLE test t2 0 TABLE test t3 50 disconnect con4; @@ -1237,7 +1237,7 @@ username status user4 not found execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 23 +user1 localhost wait/io/table/sql/handler 24 user1 localhost wait/lock/table/sql/handler 0 user2 localhost wait/io/table/sql/handler 0 user2 localhost wait/lock/table/sql/handler 0 @@ -1247,7 +1247,7 @@ user4 localhost wait/io/table/sql/handler 0 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 0 user2 wait/io/table/sql/handler 0 user2 wait/lock/table/sql/handler 0 @@ -1257,27 +1257,27 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 71 +localhost wait/io/table/sql/handler 72 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 71 +wait/io/table/sql/handler 72 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 17 11 6 11 2 4 0 +TABLE test t1 NULL 20 13 7 13 2 5 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t3 NULL 44 26 18 26 6 12 0 TABLE test t3 index_b 4 4 0 4 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 21 13 8 13 2 6 0 +TABLE test t1 22 14 8 14 2 6 0 TABLE test t3 50 32 18 32 6 12 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -1285,7 +1285,7 @@ TABLE test t1 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 21 +TABLE test t1 22 TABLE test t2 0 TABLE test t3 50 connection default; @@ -1303,7 +1303,7 @@ username status user4 not found execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 23 +user1 localhost wait/io/table/sql/handler 24 user1 localhost wait/lock/table/sql/handler 0 user2 localhost wait/io/table/sql/handler 0 user2 localhost wait/lock/table/sql/handler 0 @@ -1313,7 +1313,7 @@ user4 localhost wait/io/table/sql/handler 0 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 0 user2 wait/io/table/sql/handler 0 user2 wait/lock/table/sql/handler 0 @@ -1323,27 +1323,27 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 71 +localhost wait/io/table/sql/handler 72 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 71 +wait/io/table/sql/handler 72 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 17 11 6 11 2 4 0 +TABLE test t1 NULL 20 13 7 13 2 5 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t3 NULL 44 26 18 26 6 12 0 TABLE test t3 index_b 4 4 0 4 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 21 13 8 13 2 6 0 +TABLE test t1 22 14 8 14 2 6 0 TABLE test t3 50 32 18 32 6 12 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -1351,7 +1351,7 @@ TABLE test t1 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 21 +TABLE test t1 22 TABLE test t2 0 TABLE test t3 50 truncate performance_schema.events_waits_summary_by_account_by_event_name; @@ -1378,7 +1378,7 @@ user4 localhost wait/io/table/sql/handler 0 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 0 user2 wait/io/table/sql/handler 0 user2 wait/lock/table/sql/handler 0 @@ -1388,27 +1388,27 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 71 +localhost wait/io/table/sql/handler 72 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 71 +wait/io/table/sql/handler 72 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 17 11 6 11 2 4 0 +TABLE test t1 NULL 20 13 7 13 2 5 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t3 NULL 44 26 18 26 6 12 0 TABLE test t3 index_b 4 4 0 4 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 21 13 8 13 2 6 0 +TABLE test t1 22 14 8 14 2 6 0 TABLE test t3 50 32 18 32 6 12 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -1416,7 +1416,7 @@ TABLE test t1 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 21 +TABLE test t1 22 TABLE test t2 0 TABLE test t3 50 truncate performance_schema.events_waits_summary_by_user_by_event_name; @@ -1453,27 +1453,27 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 71 +localhost wait/io/table/sql/handler 72 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 71 +wait/io/table/sql/handler 72 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 17 11 6 11 2 4 0 +TABLE test t1 NULL 20 13 7 13 2 5 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t3 NULL 44 26 18 26 6 12 0 TABLE test t3 index_b 4 4 0 4 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 21 13 8 13 2 6 0 +TABLE test t1 22 14 8 14 2 6 0 TABLE test t3 50 32 18 32 6 12 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -1481,7 +1481,7 @@ TABLE test t1 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 21 +TABLE test t1 22 TABLE test t2 0 TABLE test t3 50 truncate performance_schema.events_waits_summary_by_host_by_event_name; @@ -1522,23 +1522,23 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 71 +wait/io/table/sql/handler 72 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 17 11 6 11 2 4 0 +TABLE test t1 NULL 20 13 7 13 2 5 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t3 NULL 44 26 18 26 6 12 0 TABLE test t3 index_b 4 4 0 4 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 21 13 8 13 2 6 0 +TABLE test t1 22 14 8 14 2 6 0 TABLE test t3 50 32 18 32 6 12 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -1546,7 +1546,7 @@ TABLE test t1 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 21 +TABLE test t1 22 TABLE test t2 0 TABLE test t3 50 truncate performance_schema.events_waits_summary_global_by_event_name; diff --git a/mysql-test/suite/perfschema/r/table_io_aggregate_thread_2u_3t.result b/mysql-test/suite/perfschema/r/table_io_aggregate_thread_2u_3t.result index 8cf139c412c..54c9bf03bcd 100644 --- a/mysql-test/suite/perfschema/r/table_io_aggregate_thread_2u_3t.result +++ b/mysql-test/suite/perfschema/r/table_io_aggregate_thread_2u_3t.result @@ -189,7 +189,7 @@ connection default; "================== Step 3-A ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 0 username status user2 not found @@ -199,28 +199,28 @@ username status user4 not found execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 33 +user1 localhost wait/io/table/sql/handler 34 user1 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 33 +localhost wait/io/table/sql/handler 34 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 33 +wait/io/table/sql/handler 34 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 6 4 2 4 1 1 0 +TABLE test t1 NULL 9 6 3 6 1 2 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 2 1 1 1 0 1 0 +TABLE test t1 PRIMARY 0 0 0 0 0 0 0 TABLE test t2 NULL 9 5 4 5 2 2 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -231,7 +231,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 1 1 0 1 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 8 5 3 5 1 2 0 +TABLE test t1 9 6 3 6 1 2 0 TABLE test t2 10 6 4 6 2 2 0 TABLE test t3 15 9 6 9 3 3 0 execute dump_waits_table_lock; @@ -241,7 +241,7 @@ TABLE test t2 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 8 +TABLE test t1 9 TABLE test t2 10 TABLE test t3 15 connection con1; @@ -251,7 +251,7 @@ connection default; "================== Step 3-B ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 0 username status user2 not found @@ -261,28 +261,28 @@ username status user4 not found execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 33 +user1 localhost wait/io/table/sql/handler 34 user1 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 33 +localhost wait/io/table/sql/handler 34 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 33 +wait/io/table/sql/handler 34 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 6 4 2 4 1 1 0 +TABLE test t1 NULL 9 6 3 6 1 2 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 2 1 1 1 0 1 0 +TABLE test t1 PRIMARY 0 0 0 0 0 0 0 TABLE test t2 NULL 9 5 4 5 2 2 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -293,7 +293,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 1 1 0 1 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 8 5 3 5 1 2 0 +TABLE test t1 9 6 3 6 1 2 0 TABLE test t2 10 6 4 6 2 2 0 TABLE test t3 15 9 6 9 3 3 0 execute dump_waits_table_lock; @@ -303,7 +303,7 @@ TABLE test t2 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 8 +TABLE test t1 9 TABLE test t2 10 TABLE test t3 15 connect con2, localhost, user2, , ; @@ -314,7 +314,7 @@ connection default; "================== Step 4 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 0 username event_name count_star user2 wait/io/table/sql/handler 0 @@ -325,32 +325,32 @@ username status user4 not found execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 33 +user1 localhost wait/io/table/sql/handler 34 user1 localhost wait/lock/table/sql/handler 0 user2 localhost wait/io/table/sql/handler 0 user2 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 0 user2 wait/io/table/sql/handler 0 user2 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 33 +localhost wait/io/table/sql/handler 34 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 33 +wait/io/table/sql/handler 34 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 6 4 2 4 1 1 0 +TABLE test t1 NULL 9 6 3 6 1 2 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 2 1 1 1 0 1 0 +TABLE test t1 PRIMARY 0 0 0 0 0 0 0 TABLE test t2 NULL 9 5 4 5 2 2 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -361,7 +361,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 1 1 0 1 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 8 5 3 5 1 2 0 +TABLE test t1 9 6 3 6 1 2 0 TABLE test t2 10 6 4 6 2 2 0 TABLE test t3 15 9 6 9 3 3 0 execute dump_waits_table_lock; @@ -371,7 +371,7 @@ TABLE test t2 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 8 +TABLE test t1 9 TABLE test t2 10 TABLE test t3 15 connection con2; @@ -417,7 +417,7 @@ connection default; "================== Step 5 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 0 username event_name count_star user2 wait/io/table/sql/handler 0 @@ -428,32 +428,32 @@ username status user4 not found execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 33 +user1 localhost wait/io/table/sql/handler 34 user1 localhost wait/lock/table/sql/handler 0 user2 localhost wait/io/table/sql/handler 0 user2 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 0 user2 wait/io/table/sql/handler 0 user2 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 33 +localhost wait/io/table/sql/handler 34 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 33 +wait/io/table/sql/handler 34 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 6 4 2 4 1 1 0 +TABLE test t1 NULL 9 6 3 6 1 2 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 2 1 1 1 0 1 0 +TABLE test t1 PRIMARY 0 0 0 0 0 0 0 TABLE test t2 NULL 9 5 4 5 2 2 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -464,7 +464,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 1 1 0 1 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 8 5 3 5 1 2 0 +TABLE test t1 9 6 3 6 1 2 0 TABLE test t2 10 6 4 6 2 2 0 TABLE test t3 15 9 6 9 3 3 0 execute dump_waits_table_lock; @@ -474,7 +474,7 @@ TABLE test t2 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 8 +TABLE test t1 9 TABLE test t2 10 TABLE test t3 15 connect con3, localhost, user3, , ; @@ -485,7 +485,7 @@ connection default; "================== Step 6 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 0 username event_name count_star user2 wait/io/table/sql/handler 0 @@ -497,7 +497,7 @@ username status user4 not found execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 33 +user1 localhost wait/io/table/sql/handler 34 user1 localhost wait/lock/table/sql/handler 0 user2 localhost wait/io/table/sql/handler 0 user2 localhost wait/lock/table/sql/handler 0 @@ -505,7 +505,7 @@ user3 localhost wait/io/table/sql/handler 0 user3 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 0 user2 wait/io/table/sql/handler 0 user2 wait/lock/table/sql/handler 0 @@ -513,20 +513,20 @@ user3 wait/io/table/sql/handler 0 user3 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 33 +localhost wait/io/table/sql/handler 34 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 33 +wait/io/table/sql/handler 34 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 6 4 2 4 1 1 0 +TABLE test t1 NULL 9 6 3 6 1 2 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 2 1 1 1 0 1 0 +TABLE test t1 PRIMARY 0 0 0 0 0 0 0 TABLE test t2 NULL 9 5 4 5 2 2 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -537,7 +537,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 1 1 0 1 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 8 5 3 5 1 2 0 +TABLE test t1 9 6 3 6 1 2 0 TABLE test t2 10 6 4 6 2 2 0 TABLE test t3 15 9 6 9 3 3 0 execute dump_waits_table_lock; @@ -547,7 +547,7 @@ TABLE test t2 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 8 +TABLE test t1 9 TABLE test t2 10 TABLE test t3 15 connection con3; @@ -600,7 +600,7 @@ connection default; "================== Step 7 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 0 username event_name count_star user2 wait/io/table/sql/handler 0 @@ -612,7 +612,7 @@ username status user4 not found execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 33 +user1 localhost wait/io/table/sql/handler 34 user1 localhost wait/lock/table/sql/handler 0 user2 localhost wait/io/table/sql/handler 0 user2 localhost wait/lock/table/sql/handler 0 @@ -620,7 +620,7 @@ user3 localhost wait/io/table/sql/handler 70 user3 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 0 user2 wait/io/table/sql/handler 0 user2 wait/lock/table/sql/handler 0 @@ -628,20 +628,20 @@ user3 wait/io/table/sql/handler 70 user3 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 103 +localhost wait/io/table/sql/handler 104 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 103 +wait/io/table/sql/handler 104 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 17 11 6 11 2 4 0 +TABLE test t1 NULL 20 13 7 13 2 5 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t2 NULL 30 18 12 18 4 8 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -652,7 +652,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 21 13 8 13 2 6 0 +TABLE test t1 22 14 8 14 2 6 0 TABLE test t2 32 20 12 20 4 8 0 TABLE test t3 50 32 18 32 6 12 0 execute dump_waits_table_lock; @@ -662,7 +662,7 @@ TABLE test t2 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 21 +TABLE test t1 22 TABLE test t2 32 TABLE test t3 50 connect con4, localhost, user4, , ; @@ -673,7 +673,7 @@ connection default; "================== Step 8 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 0 username event_name count_star user2 wait/io/table/sql/handler 0 @@ -686,7 +686,7 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 33 +user1 localhost wait/io/table/sql/handler 34 user1 localhost wait/lock/table/sql/handler 0 user2 localhost wait/io/table/sql/handler 0 user2 localhost wait/lock/table/sql/handler 0 @@ -696,7 +696,7 @@ user4 localhost wait/io/table/sql/handler 0 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 0 user2 wait/io/table/sql/handler 0 user2 wait/lock/table/sql/handler 0 @@ -706,20 +706,20 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 103 +localhost wait/io/table/sql/handler 104 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 103 +wait/io/table/sql/handler 104 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 17 11 6 11 2 4 0 +TABLE test t1 NULL 20 13 7 13 2 5 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t2 NULL 30 18 12 18 4 8 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -730,7 +730,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 21 13 8 13 2 6 0 +TABLE test t1 22 14 8 14 2 6 0 TABLE test t2 32 20 12 20 4 8 0 TABLE test t3 50 32 18 32 6 12 0 execute dump_waits_table_lock; @@ -740,7 +740,7 @@ TABLE test t2 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 21 +TABLE test t1 22 TABLE test t2 32 TABLE test t3 50 connection con4; @@ -800,7 +800,7 @@ connection default; "================== Step 9 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 0 username event_name count_star user2 wait/io/table/sql/handler 0 @@ -813,7 +813,7 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 33 +user1 localhost wait/io/table/sql/handler 34 user1 localhost wait/lock/table/sql/handler 0 user2 localhost wait/io/table/sql/handler 0 user2 localhost wait/lock/table/sql/handler 0 @@ -823,7 +823,7 @@ user4 localhost wait/io/table/sql/handler 0 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 0 user2 wait/io/table/sql/handler 0 user2 wait/lock/table/sql/handler 0 @@ -833,20 +833,20 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 103 +localhost wait/io/table/sql/handler 104 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 103 +wait/io/table/sql/handler 104 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 17 11 6 11 2 4 0 +TABLE test t1 NULL 20 13 7 13 2 5 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t2 NULL 30 18 12 18 4 8 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -857,7 +857,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 21 13 8 13 2 6 0 +TABLE test t1 22 14 8 14 2 6 0 TABLE test t2 32 20 12 20 4 8 0 TABLE test t3 50 32 18 32 6 12 0 execute dump_waits_table_lock; @@ -867,7 +867,7 @@ TABLE test t2 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 21 +TABLE test t1 22 TABLE test t2 32 TABLE test t3 50 connection con1; @@ -879,7 +879,7 @@ connection default; "================== Step 10 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 0 username event_name count_star user2 wait/io/table/sql/handler 0 @@ -892,7 +892,7 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 33 +user1 localhost wait/io/table/sql/handler 34 user1 localhost wait/lock/table/sql/handler 0 user2 localhost wait/io/table/sql/handler 0 user2 localhost wait/lock/table/sql/handler 0 @@ -902,7 +902,7 @@ user4 localhost wait/io/table/sql/handler 0 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 0 user2 wait/io/table/sql/handler 0 user2 wait/lock/table/sql/handler 0 @@ -912,20 +912,20 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 103 +localhost wait/io/table/sql/handler 104 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 103 +wait/io/table/sql/handler 104 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 17 11 6 11 2 4 0 +TABLE test t1 NULL 20 13 7 13 2 5 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t2 NULL 30 18 12 18 4 8 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -936,7 +936,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 21 13 8 13 2 6 0 +TABLE test t1 22 14 8 14 2 6 0 TABLE test t2 32 20 12 20 4 8 0 TABLE test t3 50 32 18 32 6 12 0 execute dump_waits_table_lock; @@ -946,7 +946,7 @@ TABLE test t2 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 21 +TABLE test t1 22 TABLE test t2 32 TABLE test t3 50 connection default; @@ -955,7 +955,7 @@ flush tables; "================== Step 11 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 0 username event_name count_star user2 wait/io/table/sql/handler 0 @@ -968,7 +968,7 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 33 +user1 localhost wait/io/table/sql/handler 34 user1 localhost wait/lock/table/sql/handler 0 user2 localhost wait/io/table/sql/handler 0 user2 localhost wait/lock/table/sql/handler 0 @@ -978,7 +978,7 @@ user4 localhost wait/io/table/sql/handler 0 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 0 user2 wait/io/table/sql/handler 0 user2 wait/lock/table/sql/handler 0 @@ -988,20 +988,20 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 103 +localhost wait/io/table/sql/handler 104 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 103 +wait/io/table/sql/handler 104 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 17 11 6 11 2 4 0 +TABLE test t1 NULL 20 13 7 13 2 5 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t2 NULL 30 18 12 18 4 8 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -1012,7 +1012,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 21 13 8 13 2 6 0 +TABLE test t1 22 14 8 14 2 6 0 TABLE test t2 32 20 12 20 4 8 0 TABLE test t3 50 32 18 32 6 12 0 execute dump_waits_table_lock; @@ -1022,7 +1022,7 @@ TABLE test t2 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 21 +TABLE test t1 22 TABLE test t2 32 TABLE test t3 50 set global read_only=1; @@ -1031,7 +1031,7 @@ set global read_only=0; "================== Step 12 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 0 username event_name count_star user2 wait/io/table/sql/handler 0 @@ -1044,7 +1044,7 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 33 +user1 localhost wait/io/table/sql/handler 34 user1 localhost wait/lock/table/sql/handler 0 user2 localhost wait/io/table/sql/handler 0 user2 localhost wait/lock/table/sql/handler 0 @@ -1054,7 +1054,7 @@ user4 localhost wait/io/table/sql/handler 0 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 0 user2 wait/io/table/sql/handler 0 user2 wait/lock/table/sql/handler 0 @@ -1064,20 +1064,20 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 103 +localhost wait/io/table/sql/handler 104 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 103 +wait/io/table/sql/handler 104 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 17 11 6 11 2 4 0 +TABLE test t1 NULL 20 13 7 13 2 5 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t2 NULL 30 18 12 18 4 8 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -1088,7 +1088,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 21 13 8 13 2 6 0 +TABLE test t1 22 14 8 14 2 6 0 TABLE test t2 32 20 12 20 4 8 0 TABLE test t3 50 32 18 32 6 12 0 execute dump_waits_table_lock; @@ -1098,7 +1098,7 @@ TABLE test t2 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 21 +TABLE test t1 22 TABLE test t2 32 TABLE test t3 50 disconnect con1; @@ -1117,7 +1117,7 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 33 +user1 localhost wait/io/table/sql/handler 34 user1 localhost wait/lock/table/sql/handler 0 user2 localhost wait/io/table/sql/handler 0 user2 localhost wait/lock/table/sql/handler 0 @@ -1127,7 +1127,7 @@ user4 localhost wait/io/table/sql/handler 0 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 0 user2 wait/io/table/sql/handler 0 user2 wait/lock/table/sql/handler 0 @@ -1137,20 +1137,20 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 103 +localhost wait/io/table/sql/handler 104 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 103 +wait/io/table/sql/handler 104 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 17 11 6 11 2 4 0 +TABLE test t1 NULL 20 13 7 13 2 5 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t2 NULL 30 18 12 18 4 8 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -1161,7 +1161,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 21 13 8 13 2 6 0 +TABLE test t1 22 14 8 14 2 6 0 TABLE test t2 32 20 12 20 4 8 0 TABLE test t3 50 32 18 32 6 12 0 execute dump_waits_table_lock; @@ -1171,7 +1171,7 @@ TABLE test t2 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 21 +TABLE test t1 22 TABLE test t2 32 TABLE test t3 50 disconnect con2; @@ -1189,7 +1189,7 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 33 +user1 localhost wait/io/table/sql/handler 34 user1 localhost wait/lock/table/sql/handler 0 user2 localhost wait/io/table/sql/handler 0 user2 localhost wait/lock/table/sql/handler 0 @@ -1199,7 +1199,7 @@ user4 localhost wait/io/table/sql/handler 0 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 0 user2 wait/io/table/sql/handler 0 user2 wait/lock/table/sql/handler 0 @@ -1209,20 +1209,20 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 103 +localhost wait/io/table/sql/handler 104 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 103 +wait/io/table/sql/handler 104 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 17 11 6 11 2 4 0 +TABLE test t1 NULL 20 13 7 13 2 5 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t2 NULL 30 18 12 18 4 8 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -1233,7 +1233,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 21 13 8 13 2 6 0 +TABLE test t1 22 14 8 14 2 6 0 TABLE test t2 32 20 12 20 4 8 0 TABLE test t3 50 32 18 32 6 12 0 execute dump_waits_table_lock; @@ -1243,7 +1243,7 @@ TABLE test t2 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 21 +TABLE test t1 22 TABLE test t2 32 TABLE test t3 50 disconnect con3; @@ -1260,7 +1260,7 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 33 +user1 localhost wait/io/table/sql/handler 34 user1 localhost wait/lock/table/sql/handler 0 user2 localhost wait/io/table/sql/handler 0 user2 localhost wait/lock/table/sql/handler 0 @@ -1270,7 +1270,7 @@ user4 localhost wait/io/table/sql/handler 0 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 0 user2 wait/io/table/sql/handler 0 user2 wait/lock/table/sql/handler 0 @@ -1280,20 +1280,20 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 103 +localhost wait/io/table/sql/handler 104 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 103 +wait/io/table/sql/handler 104 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 17 11 6 11 2 4 0 +TABLE test t1 NULL 20 13 7 13 2 5 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t2 NULL 30 18 12 18 4 8 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -1304,7 +1304,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 21 13 8 13 2 6 0 +TABLE test t1 22 14 8 14 2 6 0 TABLE test t2 32 20 12 20 4 8 0 TABLE test t3 50 32 18 32 6 12 0 execute dump_waits_table_lock; @@ -1314,7 +1314,7 @@ TABLE test t2 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 21 +TABLE test t1 22 TABLE test t2 32 TABLE test t3 50 disconnect con4; @@ -1330,7 +1330,7 @@ username status user4 not found execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 33 +user1 localhost wait/io/table/sql/handler 34 user1 localhost wait/lock/table/sql/handler 0 user2 localhost wait/io/table/sql/handler 0 user2 localhost wait/lock/table/sql/handler 0 @@ -1340,7 +1340,7 @@ user4 localhost wait/io/table/sql/handler 0 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 0 user2 wait/io/table/sql/handler 0 user2 wait/lock/table/sql/handler 0 @@ -1350,20 +1350,20 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 103 +localhost wait/io/table/sql/handler 104 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 103 +wait/io/table/sql/handler 104 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 17 11 6 11 2 4 0 +TABLE test t1 NULL 20 13 7 13 2 5 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t2 NULL 30 18 12 18 4 8 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -1374,7 +1374,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 21 13 8 13 2 6 0 +TABLE test t1 22 14 8 14 2 6 0 TABLE test t2 32 20 12 20 4 8 0 TABLE test t3 50 32 18 32 6 12 0 execute dump_waits_table_lock; @@ -1384,7 +1384,7 @@ TABLE test t2 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 21 +TABLE test t1 22 TABLE test t2 32 TABLE test t3 50 connection default; @@ -1402,7 +1402,7 @@ username status user4 not found execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 33 +user1 localhost wait/io/table/sql/handler 34 user1 localhost wait/lock/table/sql/handler 0 user2 localhost wait/io/table/sql/handler 0 user2 localhost wait/lock/table/sql/handler 0 @@ -1412,7 +1412,7 @@ user4 localhost wait/io/table/sql/handler 0 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 0 user2 wait/io/table/sql/handler 0 user2 wait/lock/table/sql/handler 0 @@ -1422,20 +1422,20 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 103 +localhost wait/io/table/sql/handler 104 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 103 +wait/io/table/sql/handler 104 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 17 11 6 11 2 4 0 +TABLE test t1 NULL 20 13 7 13 2 5 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t2 NULL 30 18 12 18 4 8 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -1446,7 +1446,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 21 13 8 13 2 6 0 +TABLE test t1 22 14 8 14 2 6 0 TABLE test t2 32 20 12 20 4 8 0 TABLE test t3 50 32 18 32 6 12 0 execute dump_waits_table_lock; @@ -1456,7 +1456,7 @@ TABLE test t2 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 21 +TABLE test t1 22 TABLE test t2 32 TABLE test t3 50 truncate performance_schema.events_waits_summary_by_account_by_event_name; @@ -1483,7 +1483,7 @@ user4 localhost wait/io/table/sql/handler 0 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 0 user2 wait/io/table/sql/handler 0 user2 wait/lock/table/sql/handler 0 @@ -1493,20 +1493,20 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 103 +localhost wait/io/table/sql/handler 104 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 103 +wait/io/table/sql/handler 104 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 17 11 6 11 2 4 0 +TABLE test t1 NULL 20 13 7 13 2 5 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t2 NULL 30 18 12 18 4 8 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -1517,7 +1517,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 21 13 8 13 2 6 0 +TABLE test t1 22 14 8 14 2 6 0 TABLE test t2 32 20 12 20 4 8 0 TABLE test t3 50 32 18 32 6 12 0 execute dump_waits_table_lock; @@ -1527,7 +1527,7 @@ TABLE test t2 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 21 +TABLE test t1 22 TABLE test t2 32 TABLE test t3 50 truncate performance_schema.events_waits_summary_by_user_by_event_name; @@ -1564,20 +1564,20 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 103 +localhost wait/io/table/sql/handler 104 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 103 +wait/io/table/sql/handler 104 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 17 11 6 11 2 4 0 +TABLE test t1 NULL 20 13 7 13 2 5 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t2 NULL 30 18 12 18 4 8 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -1588,7 +1588,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 21 13 8 13 2 6 0 +TABLE test t1 22 14 8 14 2 6 0 TABLE test t2 32 20 12 20 4 8 0 TABLE test t3 50 32 18 32 6 12 0 execute dump_waits_table_lock; @@ -1598,7 +1598,7 @@ TABLE test t2 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 21 +TABLE test t1 22 TABLE test t2 32 TABLE test t3 50 truncate performance_schema.events_waits_summary_by_host_by_event_name; @@ -1639,16 +1639,16 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 103 +wait/io/table/sql/handler 104 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 17 11 6 11 2 4 0 +TABLE test t1 NULL 20 13 7 13 2 5 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t2 NULL 30 18 12 18 4 8 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -1659,7 +1659,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 21 13 8 13 2 6 0 +TABLE test t1 22 14 8 14 2 6 0 TABLE test t2 32 20 12 20 4 8 0 TABLE test t3 50 32 18 32 6 12 0 execute dump_waits_table_lock; @@ -1669,7 +1669,7 @@ TABLE test t2 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 21 +TABLE test t1 22 TABLE test t2 32 TABLE test t3 50 truncate performance_schema.events_waits_summary_global_by_event_name; diff --git a/mysql-test/suite/perfschema/r/table_io_aggregate_thread_4u_2t.result b/mysql-test/suite/perfschema/r/table_io_aggregate_thread_4u_2t.result index 4f97cd6be4b..a1bde119be3 100644 --- a/mysql-test/suite/perfschema/r/table_io_aggregate_thread_4u_2t.result +++ b/mysql-test/suite/perfschema/r/table_io_aggregate_thread_4u_2t.result @@ -180,7 +180,7 @@ connection default; "================== Step 3-A ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 0 username status user2 not found @@ -190,35 +190,35 @@ username status user4 not found execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 23 +user1 localhost wait/io/table/sql/handler 24 user1 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 23 +localhost wait/io/table/sql/handler 24 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 23 +wait/io/table/sql/handler 24 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 6 4 2 4 1 1 0 +TABLE test t1 NULL 9 6 3 6 1 2 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 2 1 1 1 0 1 0 +TABLE test t1 PRIMARY 0 0 0 0 0 0 0 TABLE test t3 NULL 13 7 6 7 3 3 0 TABLE test t3 index_b 1 1 0 1 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 1 1 0 1 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 8 5 3 5 1 2 0 +TABLE test t1 9 6 3 6 1 2 0 TABLE test t3 15 9 6 9 3 3 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -226,7 +226,7 @@ TABLE test t1 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 8 +TABLE test t1 9 TABLE test t2 0 TABLE test t3 15 connection con1; @@ -236,7 +236,7 @@ connection default; "================== Step 3-B ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 0 username status user2 not found @@ -246,35 +246,35 @@ username status user4 not found execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 23 +user1 localhost wait/io/table/sql/handler 24 user1 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 23 +localhost wait/io/table/sql/handler 24 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 23 +wait/io/table/sql/handler 24 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 6 4 2 4 1 1 0 +TABLE test t1 NULL 9 6 3 6 1 2 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 2 1 1 1 0 1 0 +TABLE test t1 PRIMARY 0 0 0 0 0 0 0 TABLE test t3 NULL 13 7 6 7 3 3 0 TABLE test t3 index_b 1 1 0 1 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 1 1 0 1 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 8 5 3 5 1 2 0 +TABLE test t1 9 6 3 6 1 2 0 TABLE test t3 15 9 6 9 3 3 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -282,7 +282,7 @@ TABLE test t1 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 8 +TABLE test t1 9 TABLE test t2 0 TABLE test t3 15 connect con2, localhost, user2, , ; @@ -293,7 +293,7 @@ connection default; "================== Step 4 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 0 username event_name count_star user2 wait/io/table/sql/handler 0 @@ -304,39 +304,39 @@ username status user4 not found execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 23 +user1 localhost wait/io/table/sql/handler 24 user1 localhost wait/lock/table/sql/handler 0 user2 localhost wait/io/table/sql/handler 0 user2 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 0 user2 wait/io/table/sql/handler 0 user2 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 23 +localhost wait/io/table/sql/handler 24 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 23 +wait/io/table/sql/handler 24 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 6 4 2 4 1 1 0 +TABLE test t1 NULL 9 6 3 6 1 2 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 2 1 1 1 0 1 0 +TABLE test t1 PRIMARY 0 0 0 0 0 0 0 TABLE test t3 NULL 13 7 6 7 3 3 0 TABLE test t3 index_b 1 1 0 1 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 1 1 0 1 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 8 5 3 5 1 2 0 +TABLE test t1 9 6 3 6 1 2 0 TABLE test t3 15 9 6 9 3 3 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -344,7 +344,7 @@ TABLE test t1 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 8 +TABLE test t1 9 TABLE test t2 0 TABLE test t3 15 connection con2; @@ -390,7 +390,7 @@ connection default; "================== Step 5 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 0 username event_name count_star user2 wait/io/table/sql/handler 35 @@ -401,39 +401,39 @@ username status user4 not found execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 23 +user1 localhost wait/io/table/sql/handler 24 user1 localhost wait/lock/table/sql/handler 0 user2 localhost wait/io/table/sql/handler 35 user2 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 0 user2 wait/io/table/sql/handler 35 user2 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 58 +localhost wait/io/table/sql/handler 59 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 58 +wait/io/table/sql/handler 59 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 14 9 5 9 2 3 0 +TABLE test t1 NULL 17 11 6 11 2 4 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t3 NULL 35 20 15 20 6 9 0 TABLE test t3 index_b 3 3 0 3 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 18 11 7 11 2 5 0 +TABLE test t1 19 12 7 12 2 5 0 TABLE test t3 40 25 15 25 6 9 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -441,7 +441,7 @@ TABLE test t1 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 18 +TABLE test t1 19 TABLE test t2 0 TABLE test t3 40 connect con3, localhost, user3, , ; @@ -452,7 +452,7 @@ connection default; "================== Step 6 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 0 username event_name count_star user2 wait/io/table/sql/handler 35 @@ -464,7 +464,7 @@ username status user4 not found execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 23 +user1 localhost wait/io/table/sql/handler 24 user1 localhost wait/lock/table/sql/handler 0 user2 localhost wait/io/table/sql/handler 35 user2 localhost wait/lock/table/sql/handler 0 @@ -472,7 +472,7 @@ user3 localhost wait/io/table/sql/handler 0 user3 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 0 user2 wait/io/table/sql/handler 35 user2 wait/lock/table/sql/handler 0 @@ -480,27 +480,27 @@ user3 wait/io/table/sql/handler 0 user3 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 58 +localhost wait/io/table/sql/handler 59 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 58 +wait/io/table/sql/handler 59 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 14 9 5 9 2 3 0 +TABLE test t1 NULL 17 11 6 11 2 4 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t3 NULL 35 20 15 20 6 9 0 TABLE test t3 index_b 3 3 0 3 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 18 11 7 11 2 5 0 +TABLE test t1 19 12 7 12 2 5 0 TABLE test t3 40 25 15 25 6 9 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -508,7 +508,7 @@ TABLE test t1 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 18 +TABLE test t1 19 TABLE test t2 0 TABLE test t3 40 connection con3; @@ -561,7 +561,7 @@ connection default; "================== Step 7 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 0 username event_name count_star user2 wait/io/table/sql/handler 35 @@ -573,7 +573,7 @@ username status user4 not found execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 23 +user1 localhost wait/io/table/sql/handler 24 user1 localhost wait/lock/table/sql/handler 0 user2 localhost wait/io/table/sql/handler 35 user2 localhost wait/lock/table/sql/handler 0 @@ -581,7 +581,7 @@ user3 localhost wait/io/table/sql/handler 48 user3 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 0 user2 wait/io/table/sql/handler 35 user2 wait/lock/table/sql/handler 0 @@ -589,27 +589,27 @@ user3 wait/io/table/sql/handler 48 user3 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 106 +localhost wait/io/table/sql/handler 107 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 106 +wait/io/table/sql/handler 107 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 25 16 9 16 3 6 0 +TABLE test t1 NULL 28 18 10 18 3 7 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 6 3 3 3 0 3 0 +TABLE test t1 PRIMARY 4 2 2 2 0 2 0 TABLE test t3 NULL 66 39 27 39 9 18 0 TABLE test t3 index_b 6 6 0 6 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 3 3 0 3 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 31 19 12 19 3 9 0 +TABLE test t1 32 20 12 20 3 9 0 TABLE test t3 75 48 27 48 9 18 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -617,7 +617,7 @@ TABLE test t1 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 31 +TABLE test t1 32 TABLE test t2 0 TABLE test t3 75 connect con4, localhost, user4, , ; @@ -628,7 +628,7 @@ connection default; "================== Step 8 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 0 username event_name count_star user2 wait/io/table/sql/handler 35 @@ -641,7 +641,7 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 23 +user1 localhost wait/io/table/sql/handler 24 user1 localhost wait/lock/table/sql/handler 0 user2 localhost wait/io/table/sql/handler 35 user2 localhost wait/lock/table/sql/handler 0 @@ -651,7 +651,7 @@ user4 localhost wait/io/table/sql/handler 0 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 0 user2 wait/io/table/sql/handler 35 user2 wait/lock/table/sql/handler 0 @@ -661,27 +661,27 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 106 +localhost wait/io/table/sql/handler 107 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 106 +wait/io/table/sql/handler 107 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 25 16 9 16 3 6 0 +TABLE test t1 NULL 28 18 10 18 3 7 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 6 3 3 3 0 3 0 +TABLE test t1 PRIMARY 4 2 2 2 0 2 0 TABLE test t3 NULL 66 39 27 39 9 18 0 TABLE test t3 index_b 6 6 0 6 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 3 3 0 3 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 31 19 12 19 3 9 0 +TABLE test t1 32 20 12 20 3 9 0 TABLE test t3 75 48 27 48 9 18 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -689,7 +689,7 @@ TABLE test t1 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 31 +TABLE test t1 32 TABLE test t2 0 TABLE test t3 75 connection con4; @@ -749,7 +749,7 @@ connection default; "================== Step 9 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 0 username event_name count_star user2 wait/io/table/sql/handler 35 @@ -762,7 +762,7 @@ user4 wait/io/table/sql/handler 61 user4 wait/lock/table/sql/handler 0 execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 23 +user1 localhost wait/io/table/sql/handler 24 user1 localhost wait/lock/table/sql/handler 0 user2 localhost wait/io/table/sql/handler 35 user2 localhost wait/lock/table/sql/handler 0 @@ -772,7 +772,7 @@ user4 localhost wait/io/table/sql/handler 61 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 0 user2 wait/io/table/sql/handler 35 user2 wait/lock/table/sql/handler 0 @@ -782,27 +782,27 @@ user4 wait/io/table/sql/handler 61 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 167 +localhost wait/io/table/sql/handler 168 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 167 +wait/io/table/sql/handler 168 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t3 NULL 106 64 42 64 12 30 0 TABLE test t3 index_b 10 10 0 10 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -810,7 +810,7 @@ TABLE test t1 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 47 +TABLE test t1 48 TABLE test t2 0 TABLE test t3 120 connection con1; @@ -822,7 +822,7 @@ connection default; "================== Step 10 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 0 username event_name count_star user2 wait/io/table/sql/handler 35 @@ -835,7 +835,7 @@ user4 wait/io/table/sql/handler 61 user4 wait/lock/table/sql/handler 0 execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 23 +user1 localhost wait/io/table/sql/handler 24 user1 localhost wait/lock/table/sql/handler 0 user2 localhost wait/io/table/sql/handler 35 user2 localhost wait/lock/table/sql/handler 0 @@ -845,7 +845,7 @@ user4 localhost wait/io/table/sql/handler 61 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 0 user2 wait/io/table/sql/handler 35 user2 wait/lock/table/sql/handler 0 @@ -855,27 +855,27 @@ user4 wait/io/table/sql/handler 61 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 167 +localhost wait/io/table/sql/handler 168 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 167 +wait/io/table/sql/handler 168 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t3 NULL 106 64 42 64 12 30 0 TABLE test t3 index_b 10 10 0 10 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -883,7 +883,7 @@ TABLE test t1 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 47 +TABLE test t1 48 TABLE test t2 0 TABLE test t3 120 connection default; @@ -892,7 +892,7 @@ flush tables; "================== Step 11 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 0 username event_name count_star user2 wait/io/table/sql/handler 35 @@ -905,7 +905,7 @@ user4 wait/io/table/sql/handler 61 user4 wait/lock/table/sql/handler 0 execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 23 +user1 localhost wait/io/table/sql/handler 24 user1 localhost wait/lock/table/sql/handler 0 user2 localhost wait/io/table/sql/handler 35 user2 localhost wait/lock/table/sql/handler 0 @@ -915,7 +915,7 @@ user4 localhost wait/io/table/sql/handler 61 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 0 user2 wait/io/table/sql/handler 35 user2 wait/lock/table/sql/handler 0 @@ -925,27 +925,27 @@ user4 wait/io/table/sql/handler 61 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 167 +localhost wait/io/table/sql/handler 168 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 167 +wait/io/table/sql/handler 168 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t3 NULL 106 64 42 64 12 30 0 TABLE test t3 index_b 10 10 0 10 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -953,7 +953,7 @@ TABLE test t1 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 47 +TABLE test t1 48 TABLE test t2 0 TABLE test t3 120 set global read_only=1; @@ -962,7 +962,7 @@ set global read_only=0; "================== Step 12 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 0 username event_name count_star user2 wait/io/table/sql/handler 35 @@ -975,7 +975,7 @@ user4 wait/io/table/sql/handler 61 user4 wait/lock/table/sql/handler 0 execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 23 +user1 localhost wait/io/table/sql/handler 24 user1 localhost wait/lock/table/sql/handler 0 user2 localhost wait/io/table/sql/handler 35 user2 localhost wait/lock/table/sql/handler 0 @@ -985,7 +985,7 @@ user4 localhost wait/io/table/sql/handler 61 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 0 user2 wait/io/table/sql/handler 35 user2 wait/lock/table/sql/handler 0 @@ -995,27 +995,27 @@ user4 wait/io/table/sql/handler 61 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 167 +localhost wait/io/table/sql/handler 168 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 167 +wait/io/table/sql/handler 168 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t3 NULL 106 64 42 64 12 30 0 TABLE test t3 index_b 10 10 0 10 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -1023,7 +1023,7 @@ TABLE test t1 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 47 +TABLE test t1 48 TABLE test t2 0 TABLE test t3 120 disconnect con1; @@ -1042,7 +1042,7 @@ user4 wait/io/table/sql/handler 61 user4 wait/lock/table/sql/handler 0 execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 23 +user1 localhost wait/io/table/sql/handler 24 user1 localhost wait/lock/table/sql/handler 0 user2 localhost wait/io/table/sql/handler 35 user2 localhost wait/lock/table/sql/handler 0 @@ -1052,7 +1052,7 @@ user4 localhost wait/io/table/sql/handler 61 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 0 user2 wait/io/table/sql/handler 35 user2 wait/lock/table/sql/handler 0 @@ -1062,27 +1062,27 @@ user4 wait/io/table/sql/handler 61 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 167 +localhost wait/io/table/sql/handler 168 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 167 +wait/io/table/sql/handler 168 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t3 NULL 106 64 42 64 12 30 0 TABLE test t3 index_b 10 10 0 10 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -1090,7 +1090,7 @@ TABLE test t1 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 47 +TABLE test t1 48 TABLE test t2 0 TABLE test t3 120 disconnect con2; @@ -1108,7 +1108,7 @@ user4 wait/io/table/sql/handler 61 user4 wait/lock/table/sql/handler 0 execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 23 +user1 localhost wait/io/table/sql/handler 24 user1 localhost wait/lock/table/sql/handler 0 user2 localhost wait/io/table/sql/handler 35 user2 localhost wait/lock/table/sql/handler 0 @@ -1118,7 +1118,7 @@ user4 localhost wait/io/table/sql/handler 61 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 0 user2 wait/io/table/sql/handler 35 user2 wait/lock/table/sql/handler 0 @@ -1128,27 +1128,27 @@ user4 wait/io/table/sql/handler 61 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 167 +localhost wait/io/table/sql/handler 168 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 167 +wait/io/table/sql/handler 168 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t3 NULL 106 64 42 64 12 30 0 TABLE test t3 index_b 10 10 0 10 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -1156,7 +1156,7 @@ TABLE test t1 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 47 +TABLE test t1 48 TABLE test t2 0 TABLE test t3 120 disconnect con3; @@ -1173,7 +1173,7 @@ user4 wait/io/table/sql/handler 61 user4 wait/lock/table/sql/handler 0 execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 23 +user1 localhost wait/io/table/sql/handler 24 user1 localhost wait/lock/table/sql/handler 0 user2 localhost wait/io/table/sql/handler 35 user2 localhost wait/lock/table/sql/handler 0 @@ -1183,7 +1183,7 @@ user4 localhost wait/io/table/sql/handler 61 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 0 user2 wait/io/table/sql/handler 35 user2 wait/lock/table/sql/handler 0 @@ -1193,27 +1193,27 @@ user4 wait/io/table/sql/handler 61 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 167 +localhost wait/io/table/sql/handler 168 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 167 +wait/io/table/sql/handler 168 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t3 NULL 106 64 42 64 12 30 0 TABLE test t3 index_b 10 10 0 10 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -1221,7 +1221,7 @@ TABLE test t1 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 47 +TABLE test t1 48 TABLE test t2 0 TABLE test t3 120 disconnect con4; @@ -1237,7 +1237,7 @@ username status user4 not found execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 23 +user1 localhost wait/io/table/sql/handler 24 user1 localhost wait/lock/table/sql/handler 0 user2 localhost wait/io/table/sql/handler 35 user2 localhost wait/lock/table/sql/handler 0 @@ -1247,7 +1247,7 @@ user4 localhost wait/io/table/sql/handler 61 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 0 user2 wait/io/table/sql/handler 35 user2 wait/lock/table/sql/handler 0 @@ -1257,27 +1257,27 @@ user4 wait/io/table/sql/handler 61 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 167 +localhost wait/io/table/sql/handler 168 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 167 +wait/io/table/sql/handler 168 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t3 NULL 106 64 42 64 12 30 0 TABLE test t3 index_b 10 10 0 10 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -1285,7 +1285,7 @@ TABLE test t1 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 47 +TABLE test t1 48 TABLE test t2 0 TABLE test t3 120 connection default; @@ -1303,7 +1303,7 @@ username status user4 not found execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 23 +user1 localhost wait/io/table/sql/handler 24 user1 localhost wait/lock/table/sql/handler 0 user2 localhost wait/io/table/sql/handler 35 user2 localhost wait/lock/table/sql/handler 0 @@ -1313,7 +1313,7 @@ user4 localhost wait/io/table/sql/handler 61 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 0 user2 wait/io/table/sql/handler 35 user2 wait/lock/table/sql/handler 0 @@ -1323,27 +1323,27 @@ user4 wait/io/table/sql/handler 61 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 167 +localhost wait/io/table/sql/handler 168 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 167 +wait/io/table/sql/handler 168 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t3 NULL 106 64 42 64 12 30 0 TABLE test t3 index_b 10 10 0 10 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -1351,7 +1351,7 @@ TABLE test t1 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 47 +TABLE test t1 48 TABLE test t2 0 TABLE test t3 120 truncate performance_schema.events_waits_summary_by_account_by_event_name; @@ -1378,7 +1378,7 @@ user4 localhost wait/io/table/sql/handler 0 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 23 +user1 wait/io/table/sql/handler 24 user1 wait/lock/table/sql/handler 0 user2 wait/io/table/sql/handler 35 user2 wait/lock/table/sql/handler 0 @@ -1388,27 +1388,27 @@ user4 wait/io/table/sql/handler 61 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 167 +localhost wait/io/table/sql/handler 168 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 167 +wait/io/table/sql/handler 168 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t3 NULL 106 64 42 64 12 30 0 TABLE test t3 index_b 10 10 0 10 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -1416,7 +1416,7 @@ TABLE test t1 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 47 +TABLE test t1 48 TABLE test t2 0 TABLE test t3 120 truncate performance_schema.events_waits_summary_by_user_by_event_name; @@ -1453,27 +1453,27 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 167 +localhost wait/io/table/sql/handler 168 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 167 +wait/io/table/sql/handler 168 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t3 NULL 106 64 42 64 12 30 0 TABLE test t3 index_b 10 10 0 10 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -1481,7 +1481,7 @@ TABLE test t1 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 47 +TABLE test t1 48 TABLE test t2 0 TABLE test t3 120 truncate performance_schema.events_waits_summary_by_host_by_event_name; @@ -1522,23 +1522,23 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 167 +wait/io/table/sql/handler 168 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t3 NULL 106 64 42 64 12 30 0 TABLE test t3 index_b 10 10 0 10 0 0 0 TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; object_type object_schema object_name count_star count_read count_write count_read_normal count_read_with_shared_locks count_read_high_priority count_read_no_insert count_read_external count_write_low_priority count_write_external @@ -1546,7 +1546,7 @@ TABLE test t1 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 47 +TABLE test t1 48 TABLE test t2 0 TABLE test t3 120 truncate performance_schema.events_waits_summary_global_by_event_name; diff --git a/mysql-test/suite/perfschema/r/table_io_aggregate_thread_4u_3t.result b/mysql-test/suite/perfschema/r/table_io_aggregate_thread_4u_3t.result index 7fed2e31955..f80b6da32cc 100644 --- a/mysql-test/suite/perfschema/r/table_io_aggregate_thread_4u_3t.result +++ b/mysql-test/suite/perfschema/r/table_io_aggregate_thread_4u_3t.result @@ -189,7 +189,7 @@ connection default; "================== Step 3-A ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 0 username status user2 not found @@ -199,28 +199,28 @@ username status user4 not found execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 33 +user1 localhost wait/io/table/sql/handler 34 user1 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 33 +localhost wait/io/table/sql/handler 34 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 33 +wait/io/table/sql/handler 34 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 6 4 2 4 1 1 0 +TABLE test t1 NULL 9 6 3 6 1 2 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 2 1 1 1 0 1 0 +TABLE test t1 PRIMARY 0 0 0 0 0 0 0 TABLE test t2 NULL 9 5 4 5 2 2 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -231,7 +231,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 1 1 0 1 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 8 5 3 5 1 2 0 +TABLE test t1 9 6 3 6 1 2 0 TABLE test t2 10 6 4 6 2 2 0 TABLE test t3 15 9 6 9 3 3 0 execute dump_waits_table_lock; @@ -241,7 +241,7 @@ TABLE test t2 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 8 +TABLE test t1 9 TABLE test t2 10 TABLE test t3 15 connection con1; @@ -251,7 +251,7 @@ connection default; "================== Step 3-B ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 0 username status user2 not found @@ -261,28 +261,28 @@ username status user4 not found execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 33 +user1 localhost wait/io/table/sql/handler 34 user1 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 33 +localhost wait/io/table/sql/handler 34 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 33 +wait/io/table/sql/handler 34 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 6 4 2 4 1 1 0 +TABLE test t1 NULL 9 6 3 6 1 2 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 2 1 1 1 0 1 0 +TABLE test t1 PRIMARY 0 0 0 0 0 0 0 TABLE test t2 NULL 9 5 4 5 2 2 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -293,7 +293,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 1 1 0 1 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 8 5 3 5 1 2 0 +TABLE test t1 9 6 3 6 1 2 0 TABLE test t2 10 6 4 6 2 2 0 TABLE test t3 15 9 6 9 3 3 0 execute dump_waits_table_lock; @@ -303,7 +303,7 @@ TABLE test t2 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 8 +TABLE test t1 9 TABLE test t2 10 TABLE test t3 15 connect con2, localhost, user2, , ; @@ -314,7 +314,7 @@ connection default; "================== Step 4 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 0 username event_name count_star user2 wait/io/table/sql/handler 0 @@ -325,32 +325,32 @@ username status user4 not found execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 33 +user1 localhost wait/io/table/sql/handler 34 user1 localhost wait/lock/table/sql/handler 0 user2 localhost wait/io/table/sql/handler 0 user2 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 0 user2 wait/io/table/sql/handler 0 user2 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 33 +localhost wait/io/table/sql/handler 34 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 33 +wait/io/table/sql/handler 34 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 6 4 2 4 1 1 0 +TABLE test t1 NULL 9 6 3 6 1 2 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 2 1 1 1 0 1 0 +TABLE test t1 PRIMARY 0 0 0 0 0 0 0 TABLE test t2 NULL 9 5 4 5 2 2 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -361,7 +361,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 1 1 0 1 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 8 5 3 5 1 2 0 +TABLE test t1 9 6 3 6 1 2 0 TABLE test t2 10 6 4 6 2 2 0 TABLE test t3 15 9 6 9 3 3 0 execute dump_waits_table_lock; @@ -371,7 +371,7 @@ TABLE test t2 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 8 +TABLE test t1 9 TABLE test t2 10 TABLE test t3 15 connection con2; @@ -417,7 +417,7 @@ connection default; "================== Step 5 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 0 username event_name count_star user2 wait/io/table/sql/handler 51 @@ -428,32 +428,32 @@ username status user4 not found execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 33 +user1 localhost wait/io/table/sql/handler 34 user1 localhost wait/lock/table/sql/handler 0 user2 localhost wait/io/table/sql/handler 51 user2 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 0 user2 wait/io/table/sql/handler 51 user2 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 84 +localhost wait/io/table/sql/handler 85 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 84 +wait/io/table/sql/handler 85 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 14 9 5 9 2 3 0 +TABLE test t1 NULL 17 11 6 11 2 4 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t2 NULL 24 14 10 14 4 6 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -464,7 +464,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 18 11 7 11 2 5 0 +TABLE test t1 19 12 7 12 2 5 0 TABLE test t2 26 16 10 16 4 6 0 TABLE test t3 40 25 15 25 6 9 0 execute dump_waits_table_lock; @@ -474,7 +474,7 @@ TABLE test t2 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 18 +TABLE test t1 19 TABLE test t2 26 TABLE test t3 40 connect con3, localhost, user3, , ; @@ -485,7 +485,7 @@ connection default; "================== Step 6 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 0 username event_name count_star user2 wait/io/table/sql/handler 51 @@ -497,7 +497,7 @@ username status user4 not found execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 33 +user1 localhost wait/io/table/sql/handler 34 user1 localhost wait/lock/table/sql/handler 0 user2 localhost wait/io/table/sql/handler 51 user2 localhost wait/lock/table/sql/handler 0 @@ -505,7 +505,7 @@ user3 localhost wait/io/table/sql/handler 0 user3 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 0 user2 wait/io/table/sql/handler 51 user2 wait/lock/table/sql/handler 0 @@ -513,20 +513,20 @@ user3 wait/io/table/sql/handler 0 user3 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 84 +localhost wait/io/table/sql/handler 85 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 84 +wait/io/table/sql/handler 85 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 14 9 5 9 2 3 0 +TABLE test t1 NULL 17 11 6 11 2 4 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 4 2 2 2 0 2 0 +TABLE test t1 PRIMARY 2 1 1 1 0 1 0 TABLE test t2 NULL 24 14 10 14 4 6 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -537,7 +537,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 2 2 0 2 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 18 11 7 11 2 5 0 +TABLE test t1 19 12 7 12 2 5 0 TABLE test t2 26 16 10 16 4 6 0 TABLE test t3 40 25 15 25 6 9 0 execute dump_waits_table_lock; @@ -547,7 +547,7 @@ TABLE test t2 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 18 +TABLE test t1 19 TABLE test t2 26 TABLE test t3 40 connection con3; @@ -600,7 +600,7 @@ connection default; "================== Step 7 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 0 username event_name count_star user2 wait/io/table/sql/handler 51 @@ -612,7 +612,7 @@ username status user4 not found execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 33 +user1 localhost wait/io/table/sql/handler 34 user1 localhost wait/lock/table/sql/handler 0 user2 localhost wait/io/table/sql/handler 51 user2 localhost wait/lock/table/sql/handler 0 @@ -620,7 +620,7 @@ user3 localhost wait/io/table/sql/handler 70 user3 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 0 user2 wait/io/table/sql/handler 51 user2 wait/lock/table/sql/handler 0 @@ -628,20 +628,20 @@ user3 wait/io/table/sql/handler 70 user3 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 154 +localhost wait/io/table/sql/handler 155 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 154 +wait/io/table/sql/handler 155 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 25 16 9 16 3 6 0 +TABLE test t1 NULL 28 18 10 18 3 7 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 6 3 3 3 0 3 0 +TABLE test t1 PRIMARY 4 2 2 2 0 2 0 TABLE test t2 NULL 45 27 18 27 6 12 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -652,7 +652,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 3 3 0 3 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 31 19 12 19 3 9 0 +TABLE test t1 32 20 12 20 3 9 0 TABLE test t2 48 30 18 30 6 12 0 TABLE test t3 75 48 27 48 9 18 0 execute dump_waits_table_lock; @@ -662,7 +662,7 @@ TABLE test t2 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 31 +TABLE test t1 32 TABLE test t2 48 TABLE test t3 75 connect con4, localhost, user4, , ; @@ -673,7 +673,7 @@ connection default; "================== Step 8 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 0 username event_name count_star user2 wait/io/table/sql/handler 51 @@ -686,7 +686,7 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 33 +user1 localhost wait/io/table/sql/handler 34 user1 localhost wait/lock/table/sql/handler 0 user2 localhost wait/io/table/sql/handler 51 user2 localhost wait/lock/table/sql/handler 0 @@ -696,7 +696,7 @@ user4 localhost wait/io/table/sql/handler 0 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 0 user2 wait/io/table/sql/handler 51 user2 wait/lock/table/sql/handler 0 @@ -706,20 +706,20 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 154 +localhost wait/io/table/sql/handler 155 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 154 +wait/io/table/sql/handler 155 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 25 16 9 16 3 6 0 +TABLE test t1 NULL 28 18 10 18 3 7 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 6 3 3 3 0 3 0 +TABLE test t1 PRIMARY 4 2 2 2 0 2 0 TABLE test t2 NULL 45 27 18 27 6 12 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -730,7 +730,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 3 3 0 3 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 31 19 12 19 3 9 0 +TABLE test t1 32 20 12 20 3 9 0 TABLE test t2 48 30 18 30 6 12 0 TABLE test t3 75 48 27 48 9 18 0 execute dump_waits_table_lock; @@ -740,7 +740,7 @@ TABLE test t2 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 31 +TABLE test t1 32 TABLE test t2 48 TABLE test t3 75 connection con4; @@ -800,7 +800,7 @@ connection default; "================== Step 9 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 0 username event_name count_star user2 wait/io/table/sql/handler 51 @@ -813,7 +813,7 @@ user4 wait/io/table/sql/handler 89 user4 wait/lock/table/sql/handler 0 execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 33 +user1 localhost wait/io/table/sql/handler 34 user1 localhost wait/lock/table/sql/handler 0 user2 localhost wait/io/table/sql/handler 51 user2 localhost wait/lock/table/sql/handler 0 @@ -823,7 +823,7 @@ user4 localhost wait/io/table/sql/handler 89 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 0 user2 wait/io/table/sql/handler 51 user2 wait/lock/table/sql/handler 0 @@ -833,20 +833,20 @@ user4 wait/io/table/sql/handler 89 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 243 +localhost wait/io/table/sql/handler 244 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 243 +wait/io/table/sql/handler 244 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t2 NULL 72 44 28 44 8 20 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -857,7 +857,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t2 76 48 28 48 8 20 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; @@ -867,7 +867,7 @@ TABLE test t2 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 47 +TABLE test t1 48 TABLE test t2 76 TABLE test t3 120 connection con1; @@ -879,7 +879,7 @@ connection default; "================== Step 10 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 0 username event_name count_star user2 wait/io/table/sql/handler 51 @@ -892,7 +892,7 @@ user4 wait/io/table/sql/handler 89 user4 wait/lock/table/sql/handler 0 execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 33 +user1 localhost wait/io/table/sql/handler 34 user1 localhost wait/lock/table/sql/handler 0 user2 localhost wait/io/table/sql/handler 51 user2 localhost wait/lock/table/sql/handler 0 @@ -902,7 +902,7 @@ user4 localhost wait/io/table/sql/handler 89 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 0 user2 wait/io/table/sql/handler 51 user2 wait/lock/table/sql/handler 0 @@ -912,20 +912,20 @@ user4 wait/io/table/sql/handler 89 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 243 +localhost wait/io/table/sql/handler 244 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 243 +wait/io/table/sql/handler 244 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t2 NULL 72 44 28 44 8 20 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -936,7 +936,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t2 76 48 28 48 8 20 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; @@ -946,7 +946,7 @@ TABLE test t2 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 47 +TABLE test t1 48 TABLE test t2 76 TABLE test t3 120 connection default; @@ -955,7 +955,7 @@ flush tables; "================== Step 11 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 0 username event_name count_star user2 wait/io/table/sql/handler 51 @@ -968,7 +968,7 @@ user4 wait/io/table/sql/handler 89 user4 wait/lock/table/sql/handler 0 execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 33 +user1 localhost wait/io/table/sql/handler 34 user1 localhost wait/lock/table/sql/handler 0 user2 localhost wait/io/table/sql/handler 51 user2 localhost wait/lock/table/sql/handler 0 @@ -978,7 +978,7 @@ user4 localhost wait/io/table/sql/handler 89 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 0 user2 wait/io/table/sql/handler 51 user2 wait/lock/table/sql/handler 0 @@ -988,20 +988,20 @@ user4 wait/io/table/sql/handler 89 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 243 +localhost wait/io/table/sql/handler 244 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 243 +wait/io/table/sql/handler 244 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t2 NULL 72 44 28 44 8 20 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -1012,7 +1012,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t2 76 48 28 48 8 20 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; @@ -1022,7 +1022,7 @@ TABLE test t2 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 47 +TABLE test t1 48 TABLE test t2 76 TABLE test t3 120 set global read_only=1; @@ -1031,7 +1031,7 @@ set global read_only=0; "================== Step 12 ==================" call dump_thread(); username event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 0 username event_name count_star user2 wait/io/table/sql/handler 51 @@ -1044,7 +1044,7 @@ user4 wait/io/table/sql/handler 89 user4 wait/lock/table/sql/handler 0 execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 33 +user1 localhost wait/io/table/sql/handler 34 user1 localhost wait/lock/table/sql/handler 0 user2 localhost wait/io/table/sql/handler 51 user2 localhost wait/lock/table/sql/handler 0 @@ -1054,7 +1054,7 @@ user4 localhost wait/io/table/sql/handler 89 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 0 user2 wait/io/table/sql/handler 51 user2 wait/lock/table/sql/handler 0 @@ -1064,20 +1064,20 @@ user4 wait/io/table/sql/handler 89 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 243 +localhost wait/io/table/sql/handler 244 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 243 +wait/io/table/sql/handler 244 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t2 NULL 72 44 28 44 8 20 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -1088,7 +1088,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t2 76 48 28 48 8 20 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; @@ -1098,7 +1098,7 @@ TABLE test t2 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 47 +TABLE test t1 48 TABLE test t2 76 TABLE test t3 120 disconnect con1; @@ -1117,7 +1117,7 @@ user4 wait/io/table/sql/handler 89 user4 wait/lock/table/sql/handler 0 execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 33 +user1 localhost wait/io/table/sql/handler 34 user1 localhost wait/lock/table/sql/handler 0 user2 localhost wait/io/table/sql/handler 51 user2 localhost wait/lock/table/sql/handler 0 @@ -1127,7 +1127,7 @@ user4 localhost wait/io/table/sql/handler 89 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 0 user2 wait/io/table/sql/handler 51 user2 wait/lock/table/sql/handler 0 @@ -1137,20 +1137,20 @@ user4 wait/io/table/sql/handler 89 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 243 +localhost wait/io/table/sql/handler 244 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 243 +wait/io/table/sql/handler 244 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t2 NULL 72 44 28 44 8 20 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -1161,7 +1161,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t2 76 48 28 48 8 20 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; @@ -1171,7 +1171,7 @@ TABLE test t2 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 47 +TABLE test t1 48 TABLE test t2 76 TABLE test t3 120 disconnect con2; @@ -1189,7 +1189,7 @@ user4 wait/io/table/sql/handler 89 user4 wait/lock/table/sql/handler 0 execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 33 +user1 localhost wait/io/table/sql/handler 34 user1 localhost wait/lock/table/sql/handler 0 user2 localhost wait/io/table/sql/handler 51 user2 localhost wait/lock/table/sql/handler 0 @@ -1199,7 +1199,7 @@ user4 localhost wait/io/table/sql/handler 89 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 0 user2 wait/io/table/sql/handler 51 user2 wait/lock/table/sql/handler 0 @@ -1209,20 +1209,20 @@ user4 wait/io/table/sql/handler 89 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 243 +localhost wait/io/table/sql/handler 244 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 243 +wait/io/table/sql/handler 244 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t2 NULL 72 44 28 44 8 20 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -1233,7 +1233,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t2 76 48 28 48 8 20 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; @@ -1243,7 +1243,7 @@ TABLE test t2 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 47 +TABLE test t1 48 TABLE test t2 76 TABLE test t3 120 disconnect con3; @@ -1260,7 +1260,7 @@ user4 wait/io/table/sql/handler 89 user4 wait/lock/table/sql/handler 0 execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 33 +user1 localhost wait/io/table/sql/handler 34 user1 localhost wait/lock/table/sql/handler 0 user2 localhost wait/io/table/sql/handler 51 user2 localhost wait/lock/table/sql/handler 0 @@ -1270,7 +1270,7 @@ user4 localhost wait/io/table/sql/handler 89 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 0 user2 wait/io/table/sql/handler 51 user2 wait/lock/table/sql/handler 0 @@ -1280,20 +1280,20 @@ user4 wait/io/table/sql/handler 89 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 243 +localhost wait/io/table/sql/handler 244 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 243 +wait/io/table/sql/handler 244 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t2 NULL 72 44 28 44 8 20 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -1304,7 +1304,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t2 76 48 28 48 8 20 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; @@ -1314,7 +1314,7 @@ TABLE test t2 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 47 +TABLE test t1 48 TABLE test t2 76 TABLE test t3 120 disconnect con4; @@ -1330,7 +1330,7 @@ username status user4 not found execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 33 +user1 localhost wait/io/table/sql/handler 34 user1 localhost wait/lock/table/sql/handler 0 user2 localhost wait/io/table/sql/handler 51 user2 localhost wait/lock/table/sql/handler 0 @@ -1340,7 +1340,7 @@ user4 localhost wait/io/table/sql/handler 89 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 0 user2 wait/io/table/sql/handler 51 user2 wait/lock/table/sql/handler 0 @@ -1350,20 +1350,20 @@ user4 wait/io/table/sql/handler 89 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 243 +localhost wait/io/table/sql/handler 244 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 243 +wait/io/table/sql/handler 244 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t2 NULL 72 44 28 44 8 20 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -1374,7 +1374,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t2 76 48 28 48 8 20 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; @@ -1384,7 +1384,7 @@ TABLE test t2 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 47 +TABLE test t1 48 TABLE test t2 76 TABLE test t3 120 connection default; @@ -1402,7 +1402,7 @@ username status user4 not found execute dump_waits_account; user host event_name count_star -user1 localhost wait/io/table/sql/handler 33 +user1 localhost wait/io/table/sql/handler 34 user1 localhost wait/lock/table/sql/handler 0 user2 localhost wait/io/table/sql/handler 51 user2 localhost wait/lock/table/sql/handler 0 @@ -1412,7 +1412,7 @@ user4 localhost wait/io/table/sql/handler 89 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 0 user2 wait/io/table/sql/handler 51 user2 wait/lock/table/sql/handler 0 @@ -1422,20 +1422,20 @@ user4 wait/io/table/sql/handler 89 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 243 +localhost wait/io/table/sql/handler 244 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 243 +wait/io/table/sql/handler 244 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t2 NULL 72 44 28 44 8 20 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -1446,7 +1446,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t2 76 48 28 48 8 20 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; @@ -1456,7 +1456,7 @@ TABLE test t2 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 47 +TABLE test t1 48 TABLE test t2 76 TABLE test t3 120 truncate performance_schema.events_waits_summary_by_account_by_event_name; @@ -1483,7 +1483,7 @@ user4 localhost wait/io/table/sql/handler 0 user4 localhost wait/lock/table/sql/handler 0 execute dump_waits_user; user event_name count_star -user1 wait/io/table/sql/handler 33 +user1 wait/io/table/sql/handler 34 user1 wait/lock/table/sql/handler 0 user2 wait/io/table/sql/handler 51 user2 wait/lock/table/sql/handler 0 @@ -1493,20 +1493,20 @@ user4 wait/io/table/sql/handler 89 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 243 +localhost wait/io/table/sql/handler 244 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 243 +wait/io/table/sql/handler 244 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t2 NULL 72 44 28 44 8 20 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -1517,7 +1517,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t2 76 48 28 48 8 20 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; @@ -1527,7 +1527,7 @@ TABLE test t2 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 47 +TABLE test t1 48 TABLE test t2 76 TABLE test t3 120 truncate performance_schema.events_waits_summary_by_user_by_event_name; @@ -1564,20 +1564,20 @@ user4 wait/io/table/sql/handler 0 user4 wait/lock/table/sql/handler 0 execute dump_waits_host; host event_name count_star -localhost wait/io/table/sql/handler 243 +localhost wait/io/table/sql/handler 244 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 243 +wait/io/table/sql/handler 244 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t2 NULL 72 44 28 44 8 20 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -1588,7 +1588,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t2 76 48 28 48 8 20 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; @@ -1598,7 +1598,7 @@ TABLE test t2 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 47 +TABLE test t1 48 TABLE test t2 76 TABLE test t3 120 truncate performance_schema.events_waits_summary_by_host_by_event_name; @@ -1639,16 +1639,16 @@ localhost wait/io/table/sql/handler 0 localhost wait/lock/table/sql/handler 0 execute dump_waits_global; event_name count_star -wait/io/table/sql/handler 243 +wait/io/table/sql/handler 244 wait/lock/table/sql/handler 0 execute dump_waits_history; event_name count(event_name) object_type object_schema object_name execute dump_waits_index_io; object_type object_schema object_name index_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 NULL 39 25 14 25 4 10 0 +TABLE test t1 NULL 42 27 15 27 4 11 0 TABLE test t1 index_b 0 0 0 0 0 0 0 TABLE test t1 index_cb 0 0 0 0 0 0 0 -TABLE test t1 PRIMARY 8 4 4 4 0 4 0 +TABLE test t1 PRIMARY 6 3 3 3 0 3 0 TABLE test t2 NULL 72 44 28 44 8 20 0 TABLE test t2 index_b 0 0 0 0 0 0 0 TABLE test t2 index_cb 0 0 0 0 0 0 0 @@ -1659,7 +1659,7 @@ TABLE test t3 index_cb 0 0 0 0 0 0 0 TABLE test t3 PRIMARY 4 4 0 4 0 0 0 execute dump_waits_table_io; object_type object_schema object_name count_star count_read count_write count_fetch count_insert count_update count_delete -TABLE test t1 47 29 18 29 4 14 0 +TABLE test t1 48 30 18 30 4 14 0 TABLE test t2 76 48 28 48 8 20 0 TABLE test t3 120 78 42 78 12 30 0 execute dump_waits_table_lock; @@ -1669,7 +1669,7 @@ TABLE test t2 0 0 0 0 0 0 0 0 0 0 TABLE test t3 0 0 0 0 0 0 0 0 0 0 execute dump_objects_summary; object_type object_schema object_name count_star -TABLE test t1 47 +TABLE test t1 48 TABLE test t2 76 TABLE test t3 120 truncate performance_schema.events_waits_summary_global_by_event_name; diff --git a/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result b/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result index 7b811a011ff..87c6f4893cd 100644 --- a/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result +++ b/mysql-test/suite/sys_vars/r/sysvars_server_notembedded.result @@ -2402,6 +2402,16 @@ NUMERIC_BLOCK_SIZE 1 ENUM_VALUE_LIST NULL READ_ONLY YES COMMAND_LINE_ARGUMENT REQUIRED +VARIABLE_NAME OPTIMIZER_CACHE_HIT_RATIO +VARIABLE_SCOPE SESSION +VARIABLE_TYPE INT UNSIGNED +VARIABLE_COMMENT Expected hit rate of the row and index cache in storage engines. The value should be an integer between 0 and 99, where 0 means cache is empty and 99 means that value is almost always in the cache +NUMERIC_MIN_VALUE 0 +NUMERIC_MAX_VALUE 99 +NUMERIC_BLOCK_SIZE 1 +ENUM_VALUE_LIST NULL +READ_ONLY NO +COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME OPTIMIZER_MAX_SEL_ARG_WEIGHT VARIABLE_SCOPE SESSION VARIABLE_TYPE BIGINT UNSIGNED diff --git a/mysql-test/suite/sysschema/r/pr_statement_performance_analyzer.result b/mysql-test/suite/sysschema/r/pr_statement_performance_analyzer.result index c7bb029da39..171b5bd4ac8 100644 --- a/mysql-test/suite/sysschema/r/pr_statement_performance_analyzer.result +++ b/mysql-test/suite/sysschema/r/pr_statement_performance_analyzer.result @@ -45,7 +45,7 @@ CALL sys.statement_performance_analyzer('delta', 'test.tmp_digests_ini', 'with_r CALL sys.statement_performance_analyzer('overall', NULL, 'analysis'); Next Output QUERY_INSERT test 2 0 0 LATENCY LATENCY LATENCY LATENCY 0 0 0 0 2 1 0 0 0 0 DIGEST_INSERT FIRST_SEEN LAST_SEEN -QUERY_SELECT test * 2 0 0 LATENCY LATENCY LATENCY LATENCY 3 2 9 5 0 0 0 0 2 0 DIGEST_SELECT FIRST_SEEN LAST_SEEN +QUERY_SELECT test * 2 0 0 LATENCY LATENCY LATENCY LATENCY 3 2 10 5 0 0 0 0 2 0 DIGEST_SELECT FIRST_SEEN LAST_SEEN QUERY_UPDATE test 2 0 0 LATENCY LATENCY LATENCY LATENCY 0 0 2 1 2 1 0 0 0 0 DIGEST_UPDATE FIRST_SEEN LAST_SEEN Top 100 Queries Ordered by Total Latency query db full_scan exec_count err_count warn_count total_latency max_latency avg_latency lock_latency rows_sent rows_sent_avg rows_examined rows_examined_avg rows_affected rows_affected_avg tmp_tables tmp_disk_tables rows_sorted sort_merge_passes digest first_seen last_seen @@ -68,7 +68,7 @@ CALL sys.statement_performance_analyzer('overall', NULL, 'with_full_table_scans' Next Output Top 100 Queries with Full Table Scan query db exec_count total_latency no_index_used_count no_good_index_used_count no_index_used_pct rows_sent rows_examined rows_sent_avg rows_examined_avg first_seen last_seen digest -QUERY_SELECT test 2 LATENCY 1 0 50 3 9 2 5 FIRST_SEEN LAST_SEEN DIGEST_SELECT +QUERY_SELECT test 2 LATENCY 2 0 100 3 10 2 5 FIRST_SEEN LAST_SEEN DIGEST_SELECT CALL sys.statement_performance_analyzer('delta', 'test.tmp_digests_ini', 'with_full_table_scans'); Next Output Top 100 Queries with Full Table Scan diff --git a/mysql-test/suite/vcol/r/vcol_select_myisam.result b/mysql-test/suite/vcol/r/vcol_select_myisam.result index 16e4e9f1ce1..fd32dcd6789 100644 --- a/mysql-test/suite/vcol/r/vcol_select_myisam.result +++ b/mysql-test/suite/vcol/r/vcol_select_myisam.result @@ -73,8 +73,8 @@ a b c 1 -1 -1 explain select * from t1 where c in (select c from t3 where c between -2 and -1); id select_type table type possible_keys key key_len ref rows Extra -1 PRIMARY t1 range c c 5 NULL 3 Using index condition -1 PRIMARY t3 eq_ref c c 5 test.t1.c 1 Using index +1 PRIMARY t3 range c c 5 NULL 2 Using where; Using index +1 PRIMARY t1 ALL c NULL NULL NULL 5 Using where; Using join buffer (flat, BNL join) # select_type=UNION, type=system # select_type=UNION RESULT, type=<union1,2> select * from t1 union select * from t2; diff --git a/sql/filesort.cc b/sql/filesort.cc index 07194cb2e4f..988df356348 100644 --- a/sql/filesort.cc +++ b/sql/filesort.cc @@ -1584,6 +1584,10 @@ static bool check_if_pq_applicable(Sort_param *param, // Can we fit all the keys in memory? if (param->max_keys_per_buffer < num_available_keys) { + /* + Get cost of merge sort. Note that this does not include + scanning the table and comparing the rows with the where clause! + */ const double sort_merge_cost= get_merge_many_buffs_cost_fast(num_rows, num_available_keys, @@ -1591,17 +1595,12 @@ static bool check_if_pq_applicable(Sort_param *param, /* PQ has cost: (insert + qsort) * log(queue size) / TIME_FOR_COMPARE_ROWID + - cost of file lookup afterwards. - The lookup cost is a bit pessimistic: we take scan_time and assume - that on average we find the row after scanning half of the file. - A better estimate would be lookup cost, but note that we are doing - random lookups here, rather than sequential scan. + cost of rowid lookup of the original row to find the addon fields. */ const double pq_cpu_cost= (PQ_slowness * num_rows + param->max_keys_per_buffer) * log((double) param->max_keys_per_buffer) / TIME_FOR_COMPARE_ROWID; - const double pq_io_cost= - param->max_rows * table->file->scan_time() / 2.0; + const double pq_io_cost= table->file->ha_read_with_rowid(param->max_rows); const double pq_cost= pq_cpu_cost + pq_io_cost; if (sort_merge_cost < pq_cost) diff --git a/sql/ha_partition.cc b/sql/ha_partition.cc index f17abed82ff..46793c2b119 100644 --- a/sql/ha_partition.cc +++ b/sql/ha_partition.cc @@ -9636,6 +9636,15 @@ double ha_partition::scan_time() i < m_tot_parts; i= bitmap_get_next_set(&m_part_info->read_partitions, i)) scan_time+= m_file[i]->scan_time(); + if (m_tot_parts) + { + /* + Add TABLE_SCAN_SETUP_COST for partitions to make cost similar to + in ha_scan_time() + */ + scan_time+= (TABLE_SCAN_SETUP_COST * avg_io_cost() * (m_tot_parts - 1) / + optimizer_cache_cost); + } DBUG_RETURN(scan_time); } diff --git a/sql/handler.cc b/sql/handler.cc index 4d53c3e8424..02753f24812 100644 --- a/sql/handler.cc +++ b/sql/handler.cc @@ -3208,20 +3208,45 @@ LEX_CSTRING *handler::engine_name() by index 'keyno' of one range containing 'rows' key entries. If ranges == 0 then the function returns only the cost of copying those key entries into the engine buffers. + + This function doesn't take in account into copying the key to record + (INDEX_COPY_COST) or comparing the key to the where clause (TIME_FOR_COMPARE) */ double handler::keyread_time(uint index, uint ranges, ha_rows rows) { + size_t len; + double cost; DBUG_ASSERT(ranges == 0 || ranges == 1); - size_t len= table->key_info[index].key_length + ref_length; + len= table->key_info[index].key_length + ref_length; if (table->file->is_clustering_key(index)) len= table->s->stored_rec_length; - double cost= (double)rows*len/(stats.block_size+1)*IDX_BLOCK_COPY_COST; + + cost= ((double)rows*len/(stats.block_size+1)*INDEX_BLOCK_COPY_COST); + /* + We divide the cost with optimizer_cache_cost as ha_keyread_time() + and ha_key_scan_time() will multiply the result value with + optimizer_cache_cost and we want to keep the above 'memory operation' + cost unaffected by this multiplication. + */ + cost/= optimizer_cache_cost; if (ranges) { uint keys_per_block= (uint) (stats.block_size*3/4/len+1); - ulonglong blocks= (rows+ keys_per_block- 1)/keys_per_block; - cost+= blocks; + /* + We let the cost grow slowly in proportion to number of rows to + promote indexes with less rows. + We do not calculate exact number of block reads as then index + only reads will be more costly than normal reads, especially + compared to InnoDB clustered keys. + + INDEX_LOOKUP_COST is the cost of finding the first key in the + range. Finding the next key is usually a fast operation so we + don't count it here, it is taken into account in + ha_keyread_and_copy_time() + */ + cost+= (((double) (rows / keys_per_block) + INDEX_LOOKUP_COST) * + avg_io_cost()); } return cost; } diff --git a/sql/handler.h b/sql/handler.h index d41b14d82c0..c9707185b45 100644 --- a/sql/handler.h +++ b/sql/handler.h @@ -2850,10 +2850,11 @@ public: double avg_io_cost; /* cost of an average I/O oper. to fetch records */ double idx_io_count; /* number of I/O to read keys */ double idx_avg_io_cost; /* cost of an average I/O oper. to fetch records */ - double cpu_cost; /* total cost of operations in CPU */ - double idx_cpu_cost; /* cost of operations in CPU for index */ + double cpu_cost; /* Cost of reading the rows based on a key */ + double idx_cpu_cost; /* Cost of reading the key from the index tree */ double import_cost; /* cost of remote operations */ double comp_cost; /* Cost of comparing found rows with WHERE clause */ + double copy_cost; /* Copying the data to 'record' */ double mem_cost; /* cost of used memory */ static constexpr double IO_COEFF= 1; @@ -2866,16 +2867,24 @@ public: reset(); } + /* + Total cost for the range + Note that find_cost() + compare_cost() + data_copy_cost() == total_cost() + */ + double total_cost() const { return IO_COEFF*io_count*avg_io_cost + IO_COEFF*idx_io_count*idx_avg_io_cost + - CPU_COEFF*(cpu_cost + idx_cpu_cost + comp_cost) + + CPU_COEFF*(cpu_cost + idx_cpu_cost + comp_cost + copy_cost) + MEM_COEFF*mem_cost + IMPORT_COEFF*import_cost; } - /* Cost of fetching a row */ - double fetch_cost() const + /* + Cost of fetching a key and use the key to find a row (if not clustered or + covering key). Does not include row copy or compare with WHERE clause. + */ + double find_cost() const { return IO_COEFF*io_count*avg_io_cost + IO_COEFF*idx_io_count*idx_avg_io_cost + @@ -2885,37 +2894,33 @@ public: /* Cost of comparing the row with the WHERE clause - Note that fetch_cost() + compare_cost() == total_cost() */ - double compare_cost() const + inline double compare_cost() const { return CPU_COEFF*comp_cost; } + /* + Cost of copying the row or key to 'record' + */ + inline double data_copy_cost() const + { + return CPU_COEFF*copy_cost; + } + /* Cost of finding an index entry, without copying or comparing it */ double index_only_cost() { return IO_COEFF*idx_io_count*idx_avg_io_cost + CPU_COEFF*idx_cpu_cost; } - /** - Whether or not all costs in the object are zero - - @return true if all costs are zero, false otherwise - */ - bool is_zero() const - { - return io_count == 0.0 && idx_io_count == 0.0 && cpu_cost == 0.0 && - import_cost == 0.0 && mem_cost == 0.0 && comp_cost; - } - - void reset() + inline void reset() { avg_io_cost= 1.0; idx_avg_io_cost= 1.0; io_count= idx_io_count= cpu_cost= idx_cpu_cost= mem_cost= import_cost= - comp_cost= 0.0; + comp_cost= copy_cost= 0.0; } void multiply(double m) @@ -3287,6 +3292,11 @@ public: ulonglong rows_changed; /* One bigger than needed to avoid to test if key == MAX_KEY */ ulonglong index_rows_read[MAX_KEY+1]; + /* + Cost of using key/record cache: (100-cache_hit_ratio)/100 + Updated from THD in open_tables() + */ + double optimizer_cache_cost; ha_copy_info copy_info; private: @@ -3419,6 +3429,7 @@ public: ref_length(sizeof(my_off_t)), ft_handler(0), inited(NONE), pre_inited(NONE), pushed_cond(0), next_insert_id(0), insert_id_for_cur_row(0), + optimizer_cache_cost((100-CACHE_HIT_RATIO)/100.0), tracker(NULL), pushed_idx_cond(NULL), pushed_idx_cond_keyno(MAX_KEY), @@ -3538,14 +3549,15 @@ public: int ha_delete_row(const uchar * buf); void ha_release_auto_increment(); - bool keyread_enabled() { return keyread < MAX_KEY; } - int ha_start_keyread(uint idx) + inline bool keyread_enabled() { return keyread < MAX_KEY; } + inline int ha_start_keyread(uint idx) { - int res= keyread_enabled() ? 0 : extra_opt(HA_EXTRA_KEYREAD, idx); + if (keyread_enabled()) + return 0; keyread= idx; - return res; + return extra_opt(HA_EXTRA_KEYREAD, idx); } - int ha_end_keyread() + inline int ha_end_keyread() { if (!keyread_enabled()) return 0; @@ -3643,17 +3655,48 @@ public: } /* - Time for a full table scan of data file + Time for a full table data scan. To be overrided by engines, should not + be used by the sql level. */ +protected: virtual double scan_time() { - return ((ulonglong2double(stats.data_file_length) / stats.block_size + 2) * + return (((ulonglong2double(stats.data_file_length) / stats.block_size)) * avg_io_cost()); } +public: - virtual double key_scan_time(uint index) + inline double ha_scan_time() { - return keyread_time(index, 1, records()); + return (scan_time() * optimizer_cache_cost + + TABLE_SCAN_SETUP_COST * avg_io_cost()); + } + + /* + Time for a full table scan + fetching the rows from the table + + @param records Number of records from the engine or records from + status tables stored by ANALYZE TABLE. + + The TABLE_SCAN_SETUP_COST is there to prefer range scans to full + table scans. This is mainly to make the test suite happy as + many tests has very few rows. In real life tables has more than + a few rows and the extra cost has no practical effect. + */ + + inline double ha_scan_and_copy_time(ha_rows records) + { + return (ha_scan_time() + (double) records * RECORD_COPY_COST); + } + + /* + Time for a full table scan, fetching the rows from the table and comparing + the row with the where clause + */ + inline double ha_scan_and_compare_time(ha_rows records) + { + return (ha_scan_time() + + (double) records * (RECORD_COPY_COST + 1/TIME_FOR_COMPARE)); } virtual double avg_io_cost() @@ -3661,6 +3704,11 @@ public: return 1.0; } + virtual void set_optimizer_cache_cost(double cost) + { + optimizer_cache_cost= cost; + } + /** The cost of reading a set of ranges from the table using an index to access it. @@ -3672,18 +3720,114 @@ public: This method can be used to calculate the total cost of scanning a table using an index by calling it using read_time(index, 1, table_size). + + This function is to be reimplemented by engines (if needed). The sql_level + should call ha_read_time(), ha_read_and_copy_time() or + ha_read_and_compare_time(). */ +protected: virtual double read_time(uint index, uint ranges, ha_rows rows) - { return rows2double(ranges+rows); } + { + return ((rows2double(rows) * ROW_LOOKUP_COST + + rows2double(ranges) * INDEX_LOOKUP_COST) * avg_io_cost()); + } +public: + + /* Same as above, but take into account CACHE_COST */ + inline double ha_read_time(uint index, uint ranges, ha_rows rows) + { + return read_time(index, ranges, rows) * optimizer_cache_cost; + } + + /* Same as above, but take into account also copying of the row to 'record' */ + inline double ha_read_and_copy_time(uint index, uint ranges, ha_rows rows) + { + return (ha_read_time(index, ranges, rows) + + rows2double(rows) * RECORD_COPY_COST); + } + + /* Same as above, but take into account also copying and comparing the row */ + inline double ha_read_and_compare_time(uint index, uint ranges, ha_rows rows) + { + return (ha_read_time(index, ranges, rows) + + rows2double(rows) * (RECORD_COPY_COST + 1/TIME_FOR_COMPARE)); + } + + /* Cost of reading a row with rowid */ +protected: + virtual double read_with_rowid(ha_rows rows) + { + return rows2double(rows) * ROW_LOOKUP_COST * avg_io_cost(); + } +public: + /* + Same as above, but take into account cache_cost and copying of the row + to 'record'. + Note that this should normally be same as ha_read_time(some_key, 0, rows) + */ + inline double ha_read_with_rowid(ha_rows rows) + { + return (read_with_rowid(rows) * optimizer_cache_cost + + rows2double(rows) * RECORD_COPY_COST); + } /** - Calculate cost of 'keyread' scan for given index and number of records. + Calculate cost of 'index_only' scan for given index and number of records. + + @param index Index to read + @param flag If flag == 1 then the function returns the cost of + index only scan by index 'index' of one range containing + 'rows' key entries. + If flag == 0 then function returns only the cost of copying + those key entries into the engine buffers. + @param rows #of records to read + */ +protected: + virtual double keyread_time(uint index, uint flag, ha_rows rows); +public: + + /* + Calculate cost of 'keyread' scan for given index and number of records + including fetching the key to the 'record' buffer. + */ + + inline double ha_keyread_time(uint index, uint flag, ha_rows rows) + { + return (keyread_time(index, flag, rows) * optimizer_cache_cost); + } + + /* Same as above, but take into account copying the key the the SQL layer */ + inline double ha_keyread_and_copy_time(uint index, uint flag, ha_rows rows) + { + return ha_keyread_time(index, flag, rows) + (double) rows * INDEX_COPY_COST; + } - @param index index to read - @param ranges #of ranges to read - @param rows #of records to read + /* + Time for a full table index scan (without copy or compare cost). + To be overrided by engines, sql level should use ha_key_scan_time(). */ - virtual double keyread_time(uint index, uint ranges, ha_rows rows); +protected: + virtual double key_scan_time(uint index) + { + return keyread_time(index, 1, records()); + } +public: + + /* Cost of doing a full index scan */ + inline double ha_key_scan_time(uint index) + { + return (key_scan_time(index) * optimizer_cache_cost); + } + + /* + Cost of doing a full index scan with record copy and compare + @param rows Rows from stat tables + */ + inline double ha_key_scan_and_compare_time(uint index, ha_rows rows) + { + return (ha_key_scan_time(index) + + (double) rows * (INDEX_COPY_COST + 1/TIME_FOR_COMPARE)); + } virtual const key_map *keys_to_use_for_scanning() { return &key_map_empty; } @@ -4832,7 +4976,6 @@ private: } } -private: void mark_trx_read_write_internal(); bool check_table_binlog_row_based_internal(); @@ -5192,6 +5335,12 @@ protected: void set_ha_share_ptr(Handler_share *arg_ha_share); void lock_shared_ha_data(); void unlock_shared_ha_data(); + + /* + Mroonga needs to call read_time() directly for it's internal handler + methods + */ + friend class ha_mroonga; }; #include "multi_range_read.h" diff --git a/sql/multi_range_read.cc b/sql/multi_range_read.cc index 3f8f2aea742..6c8a8bba7c1 100644 --- a/sql/multi_range_read.cc +++ b/sql/multi_range_read.cc @@ -300,20 +300,33 @@ handler::multi_range_read_info_const(uint keyno, RANGE_SEQ_IF *seq, if (total_rows != HA_POS_ERROR) { + double io_cost= avg_io_cost(); + double range_lookup_cost= (io_cost * INDEX_LOOKUP_COST * + optimizer_cache_cost); set_if_smaller(total_rows, max_rows); /* The following calculation is the same as in multi_range_read_info(): */ *flags |= HA_MRR_USE_DEFAULT_IMPL; cost->reset(); - cost->avg_io_cost= cost->idx_avg_io_cost= avg_io_cost(); + cost->avg_io_cost= cost->idx_avg_io_cost= io_cost; if (!is_clustering_key(keyno)) { cost->idx_io_count= (double) io_blocks; - cost->idx_cpu_cost= (keyread_time(keyno, 0, total_rows) + - n_ranges * IDX_LOOKUP_COST); if (!(*flags & HA_MRR_INDEX_ONLY)) - cost->cpu_cost= read_time(keyno, 0, total_rows); + { + cost->idx_cpu_cost= (ha_keyread_time(keyno, 1, total_rows) + + (n_ranges-1) * range_lookup_cost); + cost->cpu_cost= ha_read_time(keyno, 0, total_rows); + cost->copy_cost= rows2double(total_rows) * RECORD_COPY_COST; + } + else + { + /* Index only read */ + cost->idx_cpu_cost= (ha_keyread_time(keyno, 1, total_rows) + + (n_ranges-1) * range_lookup_cost); + cost->copy_cost= rows2double(total_rows) * INDEX_COPY_COST; + } } else { @@ -323,9 +336,10 @@ handler::multi_range_read_info_const(uint keyno, RANGE_SEQ_IF *seq, ranges used by read_time to the number of dives. */ io_blocks+= unassigned_single_point_ranges; - cost->idx_cpu_cost= n_ranges * IDX_LOOKUP_COST; uint limited_ranges= (uint) MY_MIN((ulonglong) n_ranges, io_blocks); - cost->cpu_cost= read_time(keyno, limited_ranges, total_rows); + cost->idx_cpu_cost= limited_ranges * range_lookup_cost; + cost->cpu_cost= ha_read_time(keyno, 0, total_rows); + cost->copy_cost= rows2double(total_rows) * RECORD_COPY_COST; } cost->comp_cost= (rows2double(total_rows) / TIME_FOR_COMPARE + MULTI_RANGE_READ_SETUP_COST); @@ -394,21 +408,35 @@ ha_rows handler::multi_range_read_info(uint keyno, uint n_ranges, uint n_rows, /* Produce the same cost as non-MRR code does */ if (!is_clustering_key(keyno)) { + double range_lookup_cost= (avg_io_cost() * INDEX_LOOKUP_COST * + optimizer_cache_cost); /* idx_io_count could potentially be increased with the number of index leaf blocks we have to read for finding n_rows. */ cost->idx_io_count= n_ranges; - cost->idx_cpu_cost= (keyread_time(keyno, 0, n_rows) + - n_ranges * IDX_LOOKUP_COST); if (!(*flags & HA_MRR_INDEX_ONLY)) { + cost->idx_cpu_cost= (keyread_time(keyno, 1, n_rows) + + (n_ranges-1) * range_lookup_cost); cost->cpu_cost= read_time(keyno, 0, n_rows); + cost->copy_cost= rows2double(n_rows) * RECORD_COPY_COST; + } + else + { + /* + Same as above, but take into account copying the key to the upper level. + */ + cost->idx_cpu_cost= (keyread_time(keyno, 1, n_rows) + + (n_ranges-1) * range_lookup_cost); + cost->copy_cost= rows2double(n_rows) * INDEX_COPY_COST; } } else { - cost->cpu_cost= read_time(keyno, n_ranges, (uint)n_rows); + /* Clustering key */ + cost->cpu_cost= read_time(keyno, n_ranges, n_rows); + cost->copy_cost= rows2double(n_rows) * RECORD_COPY_COST; } cost->comp_cost= rows2double(n_rows) / TIME_FOR_COMPARE; return 0; @@ -2012,7 +2040,7 @@ bool DsMrr_impl::get_disk_sweep_mrr_cost(uint keynr, ha_rows rows, uint flags, cost->mem_cost= (double)rows_in_last_step * elem_size; /* Total cost of all index accesses */ - index_read_cost= primary_file->keyread_time(keynr, 1, rows); + index_read_cost= primary_file->ha_keyread_and_copy_time(keynr, 1, rows); cost->add_io(index_read_cost, 1 /* Random seeks */); return FALSE; } @@ -2099,10 +2127,14 @@ void get_sweep_read_cost(TABLE *table, ha_rows nrows, bool interrupted, DBUG_ENTER("get_sweep_read_cost"); cost->reset(); +#ifndef OLD_SWEEP_COST + cost->cpu_cost= table->file->ha_read_with_rowid(nrows); + cost->avg_io_cost= table->file->avg_io_cost(); +#else if (table->file->pk_is_clustering_key(table->s->primary_key)) { - cost->cpu_cost= table->file->read_time(table->s->primary_key, - (uint) nrows, nrows); + cost->cpu_cost= table->file->ha_read_and_copy_time(table->s->primary_key, + (uint) nrows, nrows); } else if ((cost->avg_io_cost= table->file->avg_io_cost()) >= 0.999) { @@ -2124,7 +2156,9 @@ void get_sweep_read_cost(TABLE *table, ha_rows nrows, bool interrupted, DISK_SEEK_PROP_COST*n_blocks/busy_blocks); } } - DBUG_PRINT("info",("returning cost=%g", cost->total_cost())); + cost->cpu_cost+= rows2double(n_rows) * RECORD_COPY_COST; +#endif + DBUG_PRINT("info",("returning cost: %g", cost->total_cost())); DBUG_VOID_RETURN; } diff --git a/sql/my_json_writer.h b/sql/my_json_writer.h index d82313f996f..f651edc196c 100644 --- a/sql/my_json_writer.h +++ b/sql/my_json_writer.h @@ -341,7 +341,7 @@ public: #endif } - bool trace_started() const + inline bool trace_started() const { return my_writer != 0; } diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 93a548b476e..178bb7fdb25 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -753,8 +753,6 @@ char *opt_relay_logname = 0, *opt_relaylog_index_name=0; char *opt_logname, *opt_slow_logname, *opt_bin_logname; char *opt_binlog_index_name=0; - - /* Static variables */ my_bool opt_stack_trace; @@ -4322,7 +4320,6 @@ static int init_common_variables() return 1; } - #ifdef WITH_WSREP /* We need to initialize auxiliary variables, that will be @@ -8984,7 +8981,7 @@ void refresh_status(THD *thd) /* Add thread's status variabes to global status */ add_to_status(&global_status_var, &thd->status_var); - /* Reset thread's status variables */ + /* Reset thread's status vajoinriables */ thd->set_status_var_init(); thd->status_var.global_memory_used= 0; bzero((uchar*) &thd->org_status_var, sizeof(thd->org_status_var)); diff --git a/sql/opt_range.cc b/sql/opt_range.cc index e9560debe3e..dbb8a743ef7 100644 --- a/sql/opt_range.cc +++ b/sql/opt_range.cc @@ -412,7 +412,6 @@ static bool eq_tree(SEL_ARG* a,SEL_ARG *b); SEL_ARG null_element(SEL_ARG::IMPOSSIBLE); static bool null_part_in_key(KEY_PART *key_part, const uchar *key, uint length); -static bool is_key_scan_ror(PARAM *param, uint keynr, uint8 nparts); static SEL_ARG *enforce_sel_arg_weight_limit(RANGE_OPT_PARAM *param, uint keyno, @@ -2320,6 +2319,7 @@ public: struct st_ror_scan_info *cpk_scan; /* Clustered PK scan, if there is one */ bool is_covering; /* TRUE if no row retrieval phase is necessary */ double index_scan_costs; /* SUM(cost(index_scan)) */ + double cmp_cost; // Cost of out rows with WHERE clause void trace_basic_info(PARAM *param, Json_writer_object *trace_object) const; }; @@ -2679,7 +2679,6 @@ int SQL_SELECT::test_quick_select(THD *thd, key_map keys_to_use, bool only_single_index_range_scan) { uint idx; - double scan_time; Item *notnull_cond= NULL; TABLE_READ_PLAN *best_trp= NULL; SEL_ARG **backup_keys= 0; @@ -2707,20 +2706,23 @@ int SQL_SELECT::test_quick_select(THD *thd, key_map keys_to_use, only_single_index_range_scan= 1; if (head->force_index || force_quick_range) - scan_time= read_time= DBL_MAX; + read_time= DBL_MAX; else { - scan_time= rows2double(records) / TIME_FOR_COMPARE; + read_time= head->file->ha_scan_and_compare_time(records); + /* - The 2 is there to prefer range scans to full table scans. - This is mainly to make the test suite happy as many tests has - very few rows. In real life tables has more than a few rows and the - +2 has no practical effect. + Force the detection of range access if LIMIT is used. + The idea is that we want to store all possible range + accesses to see if we can use them to resolve an ORDER BY. + Ranges with too high costs will be pruned in best_access_path(). + + The test for read_time is there only to not modify read_time if + ha_scan_and_copy_time() returned a really big value */ - read_time= (double) head->file->scan_time() + scan_time + 2; - if (limit < records && read_time < (double) records + scan_time + 1 ) + if (limit < records && read_time < (double) records * 2) { - read_time= (double) records + scan_time + 1; // Force to use index + read_time= (double) records * 2; // Force to use index notnull_cond= NULL; } } @@ -2863,8 +2865,9 @@ int SQL_SELECT::test_quick_select(THD *thd, key_map keys_to_use, if (!force_quick_range && !head->covering_keys.is_clear_all()) { int key_for_use= find_shortest_key(head, &head->covering_keys); - double key_read_time= (head->file->key_scan_time(key_for_use) + - rows2double(records) / TIME_FOR_COMPARE); + double key_read_time; + key_read_time= head->file->ha_key_scan_and_compare_time(key_for_use, + records); DBUG_PRINT("info", ("'all'+'using index' scan will be using key %d, " "read time %g", key_for_use, key_read_time)); @@ -2972,8 +2975,8 @@ int SQL_SELECT::test_quick_select(THD *thd, key_map keys_to_use, if ((rori_trp= get_best_ror_intersect(¶m, tree, best_read_time, &can_build_covering))) { - best_trp= rori_trp; - best_read_time= best_trp->read_cost; + best_trp= rori_trp; + best_read_time= rori_trp->read_cost; /* Try constructing covering ROR-intersect only if it looks possible and worth doing. @@ -2997,10 +3000,9 @@ int SQL_SELECT::test_quick_select(THD *thd, key_map keys_to_use, if ((intersect_trp= get_best_index_intersect(¶m, tree, best_read_time))) { - best_trp= intersect_trp; - best_read_time= best_trp->read_cost; - set_if_smaller(param.table->opt_range_condition_rows, - intersect_trp->records); + best_trp= intersect_trp; + best_read_time= intersect_trp->read_cost; + param.table->set_opt_range_condition_rows(intersect_trp->records); } } @@ -3019,8 +3021,7 @@ int SQL_SELECT::test_quick_select(THD *thd, key_map keys_to_use, { new_conj_trp= get_best_disjunct_quick(¶m, imerge, best_read_time); if (new_conj_trp) - set_if_smaller(param.table->opt_range_condition_rows, - new_conj_trp->records); + param.table->set_opt_range_condition_rows(new_conj_trp->records); if (new_conj_trp && (!best_conj_trp || new_conj_trp->read_cost < best_conj_trp->read_cost)) @@ -3048,7 +3049,7 @@ int SQL_SELECT::test_quick_select(THD *thd, key_map keys_to_use, { /* mark that we are changing opt_range_condition_rows */ group_by_optimization_used= 1; - set_if_smaller(param.table->opt_range_condition_rows, group_trp->records); + param.table->set_opt_range_condition_rows(group_trp->records); DBUG_PRINT("info", ("table_rows: %llu opt_range_condition_rows: %llu " "group_trp->records: %ull", table_records, param.table->opt_range_condition_rows, @@ -3400,7 +3401,11 @@ bool calculate_cond_selectivity_for_table(THD *thd, TABLE *table, Item **cond) } if (!*cond || table->pos_in_table_list->schema_table) + { + table->set_cond_selectivity(table->opt_range_condition_rows / + table_records); DBUG_RETURN(FALSE); + } /* This should be pre-alloced so that we could use the same bitmap for all @@ -3548,12 +3553,6 @@ end_of_range_loop: table_records); if (original_selectivity < table->cond_selectivity) { - DBUG_ASSERT(quick && - (quick->group_by_optimization_used || - quick->get_type() == QUICK_SELECT_I::QS_TYPE_INDEX_INTERSECT || - quick->get_type() == QUICK_SELECT_I::QS_TYPE_ROR_UNION || - quick->get_type() == QUICK_SELECT_I::QS_TYPE_INDEX_MERGE || - quick->get_type() == QUICK_SELECT_I::QS_TYPE_ROR_INTERSECT)); table->cond_selectivity= original_selectivity; if (unlikely(thd->trace_started())) { @@ -5058,17 +5057,24 @@ static void dbug_print_singlepoint_range(SEL_ARG **start, uint num) Get cost of 'sweep' full records retrieval. SYNOPSIS get_sweep_read_cost() - param Parameter from test_quick_select - records # of records to be retrieved + param Parameter from test_quick_select + records # of records to be retrieved + add_time_for_compare If set, add cost of WHERE clause (TIME_FOR_COMPARE) RETURN cost of sweep */ -double get_sweep_read_cost(const PARAM *param, ha_rows records) +static double get_sweep_read_cost(const PARAM *param, ha_rows records, + bool add_time_for_compare) { + DBUG_ENTER("get_sweep_read_cost"); +#ifndef OLD_SWEEP_COST + DBUG_RETURN(param->table->file->ha_read_with_rowid(records) + + (add_time_for_compare ? records / TIME_FOR_COMPARE : 0)); +#else double result; uint pk= param->table->s->primary_key; - DBUG_ENTER("get_sweep_read_cost"); + if (param->table->file->pk_is_clustering_key(pk) || param->table->file->stats.block_size == 0 /* HEAP */) { @@ -5076,12 +5082,12 @@ double get_sweep_read_cost(const PARAM *param, ha_rows records) We are using the primary key to find the rows. Calculate the cost for this. */ - result= param->table->file->read_time(pk, (uint)records, records); + result= table->file->ha_read_with_rowid(records); } else { /* - Rows will be retreived with rnd_pos(). Caluclate the expected + Rows will be retreived with rnd_pos(). Calculate the expected cost for this. */ double n_blocks= @@ -5114,9 +5120,11 @@ double get_sweep_read_cost(const PARAM *param, ha_rows records) */ result= busy_blocks; } + result+= rows2double(n_rows) * RECORD_COPY_COST; } DBUG_PRINT("return",("cost: %g", result)); DBUG_RETURN(result); +#endif /* OLD_SWEEP_COST */ } @@ -5269,7 +5277,7 @@ TABLE_READ_PLAN *get_best_disjunct_quick(PARAM *param, SEL_IMERGE *imerge, imerge_cost += (*cur_child)->read_cost; all_scans_ror_able &= ((*ptree)->n_ror_scans > 0); all_scans_rors &= (*cur_child)->is_ror; - if (param->table->file->is_clustering_key(param->real_keynr[(*cur_child)->key_idx])) + if (param->table->file->is_clustering_key(keynr_in_table)) { cpk_scan= cur_child; cpk_scan_records= (*cur_child)->records; @@ -5333,7 +5341,8 @@ TABLE_READ_PLAN *get_best_disjunct_quick(PARAM *param, SEL_IMERGE *imerge, /* Calculate cost(rowid_to_row_scan) */ { - double sweep_cost= get_sweep_read_cost(param, non_cpk_scan_records); + /* imerge_cost already includes TIME_FOR_COMPARE */ + double sweep_cost= get_sweep_read_cost(param, non_cpk_scan_records, 0); imerge_cost+= sweep_cost; trace_best_disjunct. add("records", non_cpk_scan_records). @@ -5442,29 +5451,27 @@ skip_to_ror_scan: { /* Ok, we have index_only cost, now get full rows scan cost */ cost= param->table->file-> - read_time(param->real_keynr[(*cur_child)->key_idx], 1, - (*cur_child)->records) + - rows2double((*cur_child)->records) / TIME_FOR_COMPARE; + ha_read_and_compare_time(param->real_keynr[(*cur_child)->key_idx], 1, + (*cur_child)->records); } else cost= read_time; TABLE_READ_PLAN *prev_plan= *cur_child; - if (!(*cur_roru_plan= get_best_ror_intersect(param, *ptree, cost, - &dummy))) + TRP_ROR_INTERSECT *ror_trp; + if (!(*cur_roru_plan= ror_trp= get_best_ror_intersect(param, *ptree, cost, + &dummy))) { - if (prev_plan->is_ror) - *cur_roru_plan= prev_plan; - else + if (!prev_plan->is_ror) DBUG_RETURN(imerge_trp); + *cur_roru_plan= prev_plan; roru_index_costs += (*cur_roru_plan)->read_cost; } else - roru_index_costs += - ((TRP_ROR_INTERSECT*)(*cur_roru_plan))->index_scan_costs; + roru_index_costs += ror_trp->index_scan_costs; roru_total_records += (*cur_roru_plan)->records; - roru_intersect_part *= (*cur_roru_plan)->records / - param->table->stat_records(); + roru_intersect_part *= ((*cur_roru_plan)->records / + param->table->stat_records()); } trace_analyze_ror.end(); /* @@ -5485,10 +5492,10 @@ skip_to_ror_scan: */ double roru_total_cost; - roru_total_cost= roru_index_costs + - rows2double(roru_total_records)*log((double)n_child_scans) / - (TIME_FOR_COMPARE_ROWID * M_LN2) + - get_sweep_read_cost(param, roru_total_records); + roru_total_cost= (roru_index_costs + + rows2double(roru_total_records)*log((double)n_child_scans) / + (TIME_FOR_COMPARE_ROWID * M_LN2) + + get_sweep_read_cost(param, roru_total_records, 0)); DBUG_PRINT("info", ("ROR-union: cost %g, %zu members", roru_total_cost, n_child_scans)); @@ -5521,7 +5528,7 @@ skip_to_ror_scan: SYNOPSIS merge_same_index_scans() param Context info for the operation - imerge IN/OUT SEL_IMERGE from which imerge_trp has been extracted + imerge IN/OUT SEL_IMERGE from which imerge_trp has been extracted imerge_trp The index merge plan where index scans for the same indexes are to be merges read_time The upper bound for the cost of the plan to be evaluated @@ -5914,11 +5921,11 @@ bool prepare_search_best_index_intersect(PARAM *param, continue; } - cost= table->opt_range[(*index_scan)->keynr].index_only_cost; + cost= table->opt_range[(*index_scan)->keynr].index_only_fetch_cost(); idx_scan.add("cost", cost); - if (cost >= cutoff_cost) + if (cost + COST_EPS >= cutoff_cost) { if (unlikely(idx_scan.trace_started())) idx_scan.add("chosen", false).add("cause", "cost"); @@ -5976,7 +5983,7 @@ bool prepare_search_best_index_intersect(PARAM *param, return TRUE; common->best_uses_cpk= FALSE; - common->best_cost= cutoff_cost + COST_EPS; + common->best_cost= cutoff_cost; common->best_length= 0; if (!(common->best_intersect= @@ -6398,7 +6405,7 @@ bool check_index_intersect_extension(PARTIAL_INDEX_INTERSECT_INFO *curr, if (cost >= cutoff_cost) return FALSE; - cost+= get_sweep_read_cost(common_info->param, records); + cost+= get_sweep_read_cost(common_info->param, records, 1); next->cost= cost; next->length= curr->length+1; @@ -6499,7 +6506,6 @@ TRP_INDEX_INTERSECT *get_best_index_intersect(PARAM *param, SEL_TREE *tree, TRP_INDEX_INTERSECT *intersect_trp= NULL; TABLE *table= param->table; THD *thd= param->thd; - DBUG_ENTER("get_best_index_intersect"); Json_writer_object trace_idx_interect(thd, "analyzing_sort_intersect"); @@ -6567,7 +6573,7 @@ TRP_INDEX_INTERSECT *get_best_index_intersect(PARAM *param, SEL_TREE *tree, { intersect_trp->read_cost= common.best_cost; - intersect_trp->records= common.best_records; + intersect_trp->records= common.best_records; intersect_trp->range_scans= range_scans; intersect_trp->range_scans_end= cur_range; intersect_trp->filtered_scans= common.filtered_scans; @@ -6676,7 +6682,8 @@ ROR_SCAN_INFO *make_ror_scan(const PARAM *param, int idx, SEL_ARG *sel_arg) ror queue. */ ror_scan->index_read_cost= - param->table->file->keyread_time(ror_scan->keynr, 1, ror_scan->records); + param->table->file->ha_keyread_and_copy_time(ror_scan->keynr, 1, + ror_scan->records); DBUG_RETURN(ror_scan); } @@ -7037,8 +7044,8 @@ static bool ror_intersect_add(ROR_INTERSECT_INFO *info, each record of every scan. Assuming 1/TIME_FOR_COMPARE_ROWID per check this gives us: */ - const double idx_cost= rows2double(info->index_records) / - TIME_FOR_COMPARE_ROWID; + const double idx_cost= (rows2double(info->index_records) / + TIME_FOR_COMPARE_ROWID); info->index_scan_costs+= idx_cost; trace_costs->add("index_scan_cost", idx_cost); } @@ -7062,13 +7069,15 @@ static bool ror_intersect_add(ROR_INTERSECT_INFO *info, if (!info->is_covering) { double sweep_cost= get_sweep_read_cost(info->param, - double2rows(info->out_rows)); + double2rows(info->out_rows), 1); info->total_cost+= sweep_cost; trace_costs->add("disk_sweep_cost", sweep_cost); DBUG_PRINT("info", ("info->total_cost= %g", info->total_cost)); } else + { trace_costs->add("disk_sweep_cost", static_cast<longlong>(0)); + } DBUG_PRINT("info", ("New out_rows: %g", info->out_rows)); DBUG_PRINT("info", ("New cost: %g, %scovering", info->total_cost, @@ -7147,7 +7156,7 @@ TRP_ROR_INTERSECT *get_best_ror_intersect(const PARAM *param, SEL_TREE *tree, bool *are_all_covering) { uint idx; - double min_cost= DBL_MAX; + double min_cost= DBL_MAX, cmp_cost; THD *thd= param->thd; DBUG_ENTER("get_best_ror_intersect"); DBUG_PRINT("enter", ("opt_range_condition_rows: %llu cond_selectivity: %g", @@ -7263,12 +7272,18 @@ TRP_ROR_INTERSECT *get_best_ror_intersect(const PARAM *param, SEL_TREE *tree, *(intersect_scans_end++)= *(cur_ror_scan++); + /* + Check if intersect gives a lower cost. + The first ror scan is always accepted. + The next ror scan is only accepted if the total cost went down + (Enough rows where reject to offset the intersect cost) + */ if (intersect->total_cost < min_cost) { /* Local minimum found, save it */ + min_cost= intersect->total_cost; ror_intersect_cpy(intersect_best, intersect); intersect_scans_best= intersect_scans_end; - min_cost = intersect->total_cost; trace_idx.add("chosen", true); } else @@ -7309,10 +7324,11 @@ TRP_ROR_INTERSECT *get_best_ror_intersect(const PARAM *param, SEL_TREE *tree, if (ror_intersect_add(intersect, cpk_scan, &trace_cpk, TRUE) && (intersect->total_cost < min_cost)) { + min_cost= intersect->total_cost; if (trace_cpk.trace_started()) - trace_cpk. - add("clustered_pk_scan_added_to_intersect", true). - add("cumulated_cost", intersect->total_cost); + trace_cpk. + add("clustered_pk_scan_added_to_intersect", true). + add("cumulated_cost", intersect->total_cost); intersect_best= intersect; //just set pointer here } else @@ -7334,12 +7350,20 @@ TRP_ROR_INTERSECT *get_best_ror_intersect(const PARAM *param, SEL_TREE *tree, } trace_cpk.end(); + /* + Adjust row count and add the cost of comparing the final rows to the + WHERE clause + */ + cmp_cost= intersect_best->out_rows/TIME_FOR_COMPARE; + /* Ok, return ROR-intersect plan if we have found one */ TRP_ROR_INTERSECT *trp= NULL; - if (min_cost < read_time && (cpk_scan || best_num > 1)) + if (min_cost + cmp_cost < read_time && (cpk_scan || best_num > 1)) { + double best_rows= double2rows(intersect_best->out_rows); + set_if_bigger(best_rows, 1); if (!(trp= new (param->mem_root) TRP_ROR_INTERSECT)) - DBUG_RETURN(trp); + DBUG_RETURN(NULL); if (!(trp->first_scan= (ROR_SCAN_INFO**)alloc_root(param->mem_root, sizeof(ROR_SCAN_INFO*)*best_num))) @@ -7347,12 +7371,8 @@ TRP_ROR_INTERSECT *get_best_ror_intersect(const PARAM *param, SEL_TREE *tree, memcpy(trp->first_scan, intersect_scans, best_num*sizeof(ROR_SCAN_INFO*)); trp->last_scan= trp->first_scan + best_num; trp->is_covering= intersect_best->is_covering; - trp->read_cost= intersect_best->total_cost; - /* Prevent divisons by zero */ - ha_rows best_rows = double2rows(intersect_best->out_rows); - if (!best_rows) - best_rows= 1; - set_if_smaller(param->table->opt_range_condition_rows, best_rows); + trp->read_cost= min_cost + cmp_cost; + param->table->set_opt_range_condition_rows(best_rows); trp->records= best_rows; trp->index_scan_costs= intersect_best->index_scan_costs; trp->cpk_scan= cpk_scan; @@ -7370,12 +7390,11 @@ TRP_ROR_INTERSECT *get_best_ror_intersect(const PARAM *param, SEL_TREE *tree, { trace_ror. add("chosen", false). - add("cause", (read_time >= min_cost) - ? "too few indexes to merge" - : "cost"); + add("cause", (min_cost + cmp_cost >= read_time) ? + "cost" : "too few indexes to merge"); } - DBUG_PRINT("enter", ("opt_range_condition_rows: %llu", - (ulonglong) param->table->opt_range_condition_rows)); + DBUG_PRINT("exit", ("opt_range_condition_rows: %llu", + (ulonglong) param->table->opt_range_condition_rows)); DBUG_RETURN(trp); } @@ -7447,7 +7466,7 @@ TRP_ROR_INTERSECT *get_best_covering_ror_intersect(PARAM *param, DBUG_RETURN(0); bitmap_clear_all(covered_fields); - double total_cost= 0.0f; + double total_cost= 0.0; ha_rows records=0; bool all_covered; @@ -7509,6 +7528,8 @@ TRP_ROR_INTERSECT *get_best_covering_ror_intersect(PARAM *param, (TIME_FOR_COMPARE_ROWID * M_LN2); DBUG_PRINT("info", ("Covering ROR-intersect full cost: %g", total_cost)); + /* TODO: Add TIME_FOR_COMPARE cost to total_cost */ + if (total_cost > read_time) DBUG_RETURN(NULL); @@ -7526,9 +7547,9 @@ TRP_ROR_INTERSECT *get_best_covering_ror_intersect(PARAM *param, trp->read_cost= total_cost; trp->records= records; trp->cpk_scan= NULL; - set_if_smaller(param->table->opt_range_condition_rows, records); + param->table->set_opt_range_condition_rows(records); - DBUG_PRINT("info", + DBUG_PRINT("exit", ("Returning covering ROR-intersect plan: cost %g, records %lu", trp->read_cost, (ulong) trp->records)); DBUG_RETURN(trp); @@ -7611,19 +7632,19 @@ static TRP_RANGE *get_key_scans_params(PARAM *param, SEL_TREE *tree, for_range_access, &mrr_flags, &buf_size, &cost, &is_ror_scan); - if (!for_range_access && !is_ror_scan && - !optimizer_flag(param->thd,OPTIMIZER_SWITCH_INDEX_MERGE_SORT_UNION)) + if (found_records == HA_POS_ERROR || + (!for_range_access && !is_ror_scan && + !optimizer_flag(param->thd,OPTIMIZER_SWITCH_INDEX_MERGE_SORT_UNION))) { /* The scan is not a ROR-scan, just skip it */ continue; } - - if (found_records != HA_POS_ERROR && tree->index_scans && + found_read_time= cost.total_cost(); + if (tree->index_scans && (index_scan= (INDEX_SCAN_INFO *)alloc_root(param->mem_root, sizeof(INDEX_SCAN_INFO)))) { Json_writer_array trace_range(thd, "ranges"); - const KEY &cur_key= param->table->key_info[keynr]; const KEY_PART_INFO *key_part= cur_key.key_part; @@ -7646,15 +7667,14 @@ static TRP_RANGE *get_key_scans_params(PARAM *param, SEL_TREE *tree, add("using_mrr", !(mrr_flags & HA_MRR_USE_DEFAULT_IMPL)). add("index_only", read_index_only). add("rows", found_records). - add("cost", cost.total_cost()); + add("cost", found_read_time); } - if ((found_records != HA_POS_ERROR) && is_ror_scan) + if (is_ror_scan) { tree->n_ror_scans++; tree->ror_scans_map.set_bit(idx); } - if (found_records != HA_POS_ERROR && - read_time > (found_read_time= cost.total_cost())) + if (read_time > found_read_time) { read_time= found_read_time; best_records= found_records; @@ -11755,16 +11775,28 @@ ha_rows check_quick_select(PARAM *param, uint idx, bool index_only, param->table->opt_range_keys.set_bit(keynr); range->key_parts= param->max_key_parts; range->ranges= param->range_count; - param->table->opt_range_condition_rows= - MY_MIN(param->table->opt_range_condition_rows, rows); + param->table->set_opt_range_condition_rows(rows); + range->selectivity= (rows ? + (param->table->opt_range_condition_rows / + rows) : + 1.0); // ok as rows is 0 range->rows= rows; - range->fetch_cost= cost->fetch_cost(); - /* Same as total cost */ - range->cost= range->fetch_cost + cost->compare_cost(); + /* cost of finding a row without copy or checking the where */ + range->find_cost= cost->find_cost(); + /* cost of finding a row copying it to the row buffer */ + range->fetch_cost= range->find_cost + cost->data_copy_cost(); + /* Add comparing it to the where. Same as cost.total_cost() */ + range->cost= (range->fetch_cost + cost->compare_cost()); + /* Calculate the cost of just finding the key. Used by filtering */ if (param->table->file->is_clustering_key(keynr)) - range->index_only_cost= 0; + range->index_only_cost= range->find_cost; else + { range->index_only_cost= cost->index_only_cost(); + DBUG_ASSERT(!(*mrr_flags & HA_MRR_INDEX_ONLY) || + range->index_only_cost == + range->find_cost); + } range->first_key_part_has_only_one_value= check_if_first_key_part_has_only_one_value(tree); } diff --git a/sql/opt_split.cc b/sql/opt_split.cc index c01f8f3cccf..48eeda0d40a 100644 --- a/sql/opt_split.cc +++ b/sql/opt_split.cc @@ -668,12 +668,13 @@ static double spl_postjoin_oper_cost(THD *thd, double join_record_count, uint rec_len) { double cost; - cost= get_tmp_table_write_cost(thd, join_record_count,rec_len) * - join_record_count; // cost to fill tmp table - cost+= get_tmp_table_lookup_cost(thd, join_record_count,rec_len) * - join_record_count; // cost to perform post join operation used here - cost+= get_tmp_table_lookup_cost(thd, join_record_count, rec_len) + - (join_record_count == 0 ? 0 : + TMPTABLE_COSTS tmp_cost= get_tmp_table_costs(thd, join_record_count, + rec_len, 0); + // cost to fill tmp table + cost= tmp_cost.create + tmp_cost.write * join_record_count; + // cost to perform post join operation used here + cost+= tmp_cost.lookup * join_record_count; + cost+= (join_record_count == 0 ? 0 : join_record_count * log2 (join_record_count)) * SORT_INDEX_CMP_COST; // cost to perform sorting return cost; @@ -1038,12 +1039,11 @@ SplM_plan_info * JOIN_TAB::choose_best_splitting(double record_count, } /* Set the cost of the preferred materialization for this partial join */ - records= (ha_rows)spl_opt_info->unsplit_card; spl_plan= spl_opt_info->last_plan; if (spl_plan) { startup_cost= record_count * spl_plan->cost; - records= (ha_rows) (records * spl_plan->split_sel); + records= (ha_rows) (spl_opt_info->unsplit_card * spl_plan->split_sel); if (unlikely(thd->trace_started())) { @@ -1055,7 +1055,11 @@ SplM_plan_info * JOIN_TAB::choose_best_splitting(double record_count, } } else - startup_cost= spl_opt_info->unsplit_cost; + { + /* Restore original values */ + startup_cost= spl_opt_info->unsplit_cost; + records= (ha_rows) spl_opt_info->unsplit_card; + } return spl_plan; } diff --git a/sql/opt_subselect.cc b/sql/opt_subselect.cc index 9e0d78851e6..9f98404fd07 100644 --- a/sql/opt_subselect.cc +++ b/sql/opt_subselect.cc @@ -448,7 +448,8 @@ static bool convert_subq_to_sj(JOIN *parent_join, Item_in_subselect *subq_pred); static bool convert_subq_to_jtbm(JOIN *parent_join, Item_in_subselect *subq_pred, bool *remove); static TABLE_LIST *alloc_join_nest(THD *thd); -static uint get_tmp_table_rec_length(Ref_ptr_array p_list, uint elements); +static uint get_tmp_table_rec_length(Ref_ptr_array p_list, uint elements, + bool *blobs_used); bool find_eq_ref_candidate(TABLE *table, table_map sj_inner_tables); static SJ_MATERIALIZATION_INFO * at_sjmat_pos(const JOIN *join, table_map remaining_tables, const JOIN_TAB *tab, @@ -1442,9 +1443,9 @@ void get_delayed_table_estimates(TABLE *table, /* Calculate cost of scanning the temptable */ double data_size= COST_MULT(item->jtbm_record_count, hash_sj_engine->tmp_table->s->reclength); - /* Do like in handler::scan_time() */ + /* Do like in handler::ha_scan_and_copy_time() */ *scan_time= ((data_size/table->file->stats.block_size+2) * - table->file->avg_io_cost()); + table->file->avg_io_cost()) + *out_rows * RECORD_COPY_COST; } @@ -2528,27 +2529,28 @@ bool optimize_semijoin_nests(JOIN *join, table_map all_table_map) /* Calculate temporary table parameters and usage costs */ + bool blobs_used; uint rowlen= get_tmp_table_rec_length(subq_select->ref_pointer_array, - subq_select->item_list.elements); - double lookup_cost= get_tmp_table_lookup_cost(join->thd, - subjoin_out_rows, rowlen); - double write_cost= get_tmp_table_write_cost(join->thd, - subjoin_out_rows, rowlen); - + subq_select->item_list.elements, + &blobs_used); + TMPTABLE_COSTS cost= get_tmp_table_costs(join->thd, + subjoin_out_rows, rowlen, + blobs_used); /* Let materialization cost include the cost to write the data into the temporary table: */ - sjm->materialization_cost.add_io(subjoin_out_rows, write_cost); - + sjm->materialization_cost.add_io(subjoin_out_rows, cost.write); + sjm->materialization_cost.copy_cost+= cost.create; + /* Set the cost to do a full scan of the temptable (will need this to consider doing sjm-scan): */ sjm->scan_cost.reset(); - sjm->scan_cost.add_io(sjm->rows, lookup_cost); + sjm->scan_cost.add_io(sjm->rows, cost.lookup); - sjm->lookup_cost.convert_from_cost(lookup_cost); + sjm->lookup_cost.convert_from_cost(cost.lookup); sj_nest->sj_mat_info= sjm; DBUG_EXECUTE("opt", print_sjm(sjm);); } @@ -2576,11 +2578,13 @@ bool optimize_semijoin_nests(JOIN *join, table_map all_table_map) Length of the temptable record, in bytes */ -static uint get_tmp_table_rec_length(Ref_ptr_array p_items, uint elements) +static uint get_tmp_table_rec_length(Ref_ptr_array p_items, uint elements, + bool *blobs_used) { uint len= 0; Item *item; - //List_iterator<Item> it(items); + + *blobs_used= 0; for (uint i= 0; i < elements ; i++) { item = p_items[i]; @@ -2603,6 +2607,8 @@ static uint get_tmp_table_rec_length(Ref_ptr_array p_items, uint elements) len += 8; else len += item->max_length; + if (item->max_length > MAX_FIELD_VARCHARLENGTH) + *blobs_used= 1; break; case DECIMAL_RESULT: len += 10; @@ -2618,46 +2624,48 @@ static uint get_tmp_table_rec_length(Ref_ptr_array p_items, uint elements) /** - The cost of a lookup into a unique hash/btree index on a temporary table - with 'row_count' rows each of size 'row_size'. + The cost of a create, write and read into a unique hash/btree index on + a temporary table with 'row_count' rows each of size 'row_size'. @param thd current query context @param row_count number of rows in the temp table @param row_size average size in bytes of the rows - @return the cost of one lookup + @return The cost of using the temporary table + + TODO: + This is an optimistic estimate. We are not taking into account: + - That we first write into a memory and then overflow to disk. + - If binary trees would be used for heap tables. + - The addition cost of writing a row to memory/disk and possible + index reorganization. */ -double -get_tmp_table_lookup_cost(THD *thd, double row_count, uint row_size) +TMPTABLE_COSTS +get_tmp_table_costs(THD *thd, double row_count, uint row_size, bool blobs_used) { - if (row_count > thd->variables.max_heap_table_size / (double) row_size) - return (double) DISK_TEMPTABLE_LOOKUP_COST; - else - return (double) HEAP_TEMPTABLE_LOOKUP_COST; -} + TMPTABLE_COSTS cost; -/** - The cost of writing a row into a temporary table with 'row_count' unique - rows each of size 'row_size'. + /* From heap_prepare_hp_create_info(), assuming one hash key used */ + row_size+= sizeof(char*)*2; + row_size= MY_ALIGN(MY_MAX(row_size, sizeof(char*)) + 1, sizeof(char*)); - @param thd current query context - @param row_count number of rows in the temp table - @param row_size average size in bytes of the rows - - @return the cost of writing one row -*/ - -double -get_tmp_table_write_cost(THD *thd, double row_count, uint row_size) -{ - double lookup_cost= get_tmp_table_lookup_cost(thd, row_count, row_size); - /* - TODO: - This is an optimistic estimate. Add additional costs resulting from - actually writing the row to memory/disk and possible index reorganization. - */ - return lookup_cost; + if (row_count > thd->variables.max_heap_table_size / (double) row_size || + blobs_used) + { + /* Disk based table */ + cost.lookup= (DISK_TEMPTABLE_LOOKUP_COST * + thd->variables.optimizer_cache_hit_ratio); + cost.write= cost.lookup; + cost.create= DISK_TEMPTABLE_CREATE_COST; + } + else + { + cost.lookup= HEAP_TEMPTABLE_LOOKUP_COST; + cost.write= cost.lookup; + cost.create= HEAP_TEMPTABLE_CREATE_COST; + } + return cost; } @@ -2902,9 +2910,16 @@ void advance_sj_state(JOIN *join, table_map remaining_tables, uint idx, 2. using strategy Z is cheaper, but it only removes fanout from semijoin X. 3. We have no clue what to do about fanount of semi-join Y. + + For the first iteration read_time will always be bigger than + *current_read_time (as the 'strategy' is an addition to the + chosen plan) . If a strategy was picked + (dusp_producing_tables & handled_fanout is true), then + *current_read_time is updated and the cost for the next + strategy can be smaller than *current_read_time. */ if ((dups_producing_tables & handled_fanout) || - (read_time < *current_read_time && + (read_time + COST_EPS < *current_read_time && !(handled_fanout & pos->inner_tables_handled_with_other_sjs))) { DBUG_ASSERT(pos->sj_strategy != sj_strategy); @@ -3158,8 +3173,6 @@ bool Sj_materialization_picker::check_qep(JOIN *join, disable_jbuf, prefix_rec_count, &curpos, &dummy); prefix_rec_count= COST_MULT(prefix_rec_count, curpos.records_read); prefix_cost= COST_ADD(prefix_cost, curpos.read_time); - prefix_cost= COST_ADD(prefix_cost, - prefix_rec_count / TIME_FOR_COMPARE); //TODO: take into account join condition selectivity here } @@ -3184,8 +3197,9 @@ bool Sj_materialization_picker::check_qep(JOIN *join, *handled_fanout= mat_nest->sj_inner_tables; if (unlikely(trace.trace_started())) { - trace.add("records", *record_count); - trace.add("read_time", *read_time); + trace. + add("records", *record_count). + add("cost", *read_time); } return TRUE; } @@ -3286,7 +3300,7 @@ bool LooseScan_picker::check_qep(JOIN *join, { trace. add("records", *record_count). - add("read_time", *read_time); + add("cost", *read_time); } return TRUE; } @@ -3403,8 +3417,9 @@ bool Firstmatch_picker::check_qep(JOIN *join, *strategy= SJ_OPT_FIRST_MATCH; if (unlikely(trace.trace_started())) { - trace.add("records", *record_count); - trace.add("read_time", *read_time); + trace. + add("records", *record_count). + add("cost", *read_time); } return TRUE; } @@ -3416,6 +3431,56 @@ bool Firstmatch_picker::check_qep(JOIN *join, } +/* + Duplicate_weedout strategy is described at + https://mariadb.com/kb/en/duplicateweedout-strategy/ + + The idea is that if one has a subquery of type: + + select * + from Country + where + Country.code IN (select City.Country + from City + where + ...) + + Before semi join optimization it was executed this way: + - Scan rows in Country + - For each accepted row, execute the sub query with + 'Country.code = City.Country' added to the WHERE clause and with + LIMIT 1 + + With semi join optimization it can be converted to the following semi join. + + select * from Country semi-join City + where Country.code = City.Country and ... + + This is executed as: + + - Scan rows in Country + - Scan rows in City with 'Country.code = City.Country' added to the + subquery WHERE clause. Stop scanning after the first match. + + or + + - Create temporary table to store City.Country (with a unique key) + - Scan rows in City (according to plan for City) and put them into the + temporary table + - Scan the temporary table + - Do index lookup in Country table with City.Country + +With Duplicate_weedout we would try to instead do: + + - Create temporary table to hold unique rowid's for the Country + - Scan rows in City (according to plan for City) + - Scan rows in Country (according to plan for Country) + - Write Country.id rowid to temporary table. If there was no + conflicting row in the temporary table, accept the row combination. + - Delete temporary table +*/ + + void Duplicate_weedout_picker::set_from_prev(POSITION *prev) { if (prev->dups_weedout_picker.is_used) @@ -3484,8 +3549,6 @@ bool Duplicate_weedout_picker::check_qep(JOIN *join, double sj_inner_fanout= 1.0; double sj_outer_fanout= 1.0; uint temptable_rec_size; - Json_writer_object trace(join->thd); - trace.add("strategy", "DuplicateWeedout"); if (first_tab == join->const_tables) { @@ -3501,14 +3564,11 @@ bool Duplicate_weedout_picker::check_qep(JOIN *join, } table_map dups_removed_fanout= 0; - double current_fanout= prefix_rec_count; for (uint j= first_dupsweedout_table; j <= idx; j++) { POSITION *p= join->positions + j; - current_fanout= COST_MULT(current_fanout, p->records_read); - dups_cost= COST_ADD(dups_cost, - COST_ADD(p->read_time, - current_fanout / TIME_FOR_COMPARE)); + dups_cost= COST_ADD(dups_cost, p->read_time); + if (p->table->emb_sj_nest) { sj_inner_fanout= COST_MULT(sj_inner_fanout, p->records_read); @@ -3527,29 +3587,33 @@ bool Duplicate_weedout_picker::check_qep(JOIN *join, - sj_outer_fanout table writes - sj_inner_fanout*sj_outer_fanout lookups. */ - double one_lookup_cost= get_tmp_table_lookup_cost(join->thd, - sj_outer_fanout, - temptable_rec_size); - double one_write_cost= get_tmp_table_write_cost(join->thd, - sj_outer_fanout, - temptable_rec_size); - - double write_cost= COST_MULT(join->positions[first_tab].prefix_record_count, - sj_outer_fanout * one_write_cost); + TMPTABLE_COSTS one_cost= get_tmp_table_costs(join->thd, + sj_outer_fanout, + temptable_rec_size, + 0); + double write_cost= + COST_ADD(one_cost.create, + COST_MULT(join->positions[first_tab].prefix_record_count, + sj_outer_fanout * one_cost.write)); double full_lookup_cost= - COST_MULT(join->positions[first_tab].prefix_record_count, - COST_MULT(sj_outer_fanout, - sj_inner_fanout * one_lookup_cost)); - dups_cost= COST_ADD(dups_cost, COST_ADD(write_cost, full_lookup_cost)); + COST_MULT(join->positions[first_tab].prefix_record_count, + COST_MULT(sj_outer_fanout, + sj_inner_fanout * one_cost.lookup)); + *read_time= COST_ADD(dups_cost, COST_ADD(write_cost, full_lookup_cost)); - *read_time= dups_cost; *record_count= prefix_rec_count * sj_outer_fanout; *handled_fanout= dups_removed_fanout; *strategy= SJ_OPT_DUPS_WEEDOUT; - if (unlikely(trace.trace_started())) + if (unlikely(join->thd->trace_started())) { - trace.add("records", *record_count); - trace.add("read_time", *read_time); + Json_writer_object trace(join->thd); + trace. + add("strategy", "DuplicateWeedout"). + add("records", *record_count). + add("dups_cost", dups_cost). + add("write_cost", write_cost). + add("full_lookup_cost", full_lookup_cost). + add("total_cost", *read_time); } return TRUE; } @@ -3686,6 +3750,8 @@ at_sjmat_pos(const JOIN *join, table_map remaining_tables, const JOIN_TAB *tab, static void recalculate_prefix_record_count(JOIN *join, uint start, uint end) { + DBUG_ASSERT(start >= join->const_tables); + for (uint j= start; j < end ;j++) { double prefix_count; @@ -3857,7 +3923,7 @@ void fix_semijoin_strategies_for_picked_join_order(JOIN *join) join->best_positions[first].n_sj_tables= tablenr - first + 1; POSITION dummy; // For loose scan paths double record_count= (first== join->const_tables)? 1.0: - join->best_positions[tablenr - 1].prefix_record_count; + join->best_positions[first - 1].prefix_record_count; table_map rem_tables= remaining_tables; uint idx; @@ -3898,7 +3964,7 @@ void fix_semijoin_strategies_for_picked_join_order(JOIN *join) POSITION *first_pos= join->best_positions + first; POSITION loose_scan_pos; // For loose scan paths double record_count= (first== join->const_tables)? 1.0: - join->best_positions[tablenr - 1].prefix_record_count; + join->best_positions[first - 1].prefix_record_count; table_map rem_tables= remaining_tables; uint idx; @@ -6422,18 +6488,14 @@ bool JOIN::choose_subquery_plan(table_map join_tables) IN/ALL/ANY optimizations are not applicable for so called fake select (this select exists only to filter results of union if it is needed). */ - if (select_lex == select_lex->master_unit()->fake_select_lex) - return 0; - - if (is_in_subquery()) - { - in_subs= unit->item->get_IN_subquery(); - if (in_subs->create_in_to_exists_cond(this)) - return true; - } - else + if (select_lex == select_lex->master_unit()->fake_select_lex || + likely(!is_in_subquery())) return false; + in_subs= unit->item->get_IN_subquery(); + if (in_subs->create_in_to_exists_cond(this)) + return true; + /* A strategy must be chosen earlier. */ DBUG_ASSERT(in_subs->has_strategy()); DBUG_ASSERT(in_to_exists_where || in_to_exists_having); @@ -6464,6 +6526,7 @@ bool JOIN::choose_subquery_plan(table_map join_tables) /* The cost of the IN->EXISTS strategy. */ double in_exists_strategy_cost; double dummy; + const char *strategy; /* A. Estimate the number of rows of the outer table that will be filtered @@ -6536,39 +6599,56 @@ bool JOIN::choose_subquery_plan(table_map join_tables) C. Compute execution costs. */ /* C.1 Compute the cost of the materialization strategy. */ - //uint rowlen= get_tmp_table_rec_length(unit->first_select()->item_list); - uint rowlen= get_tmp_table_rec_length(ref_ptrs, - select_lex->item_list.elements); - /* The cost of writing one row into the temporary table. */ - double write_cost= get_tmp_table_write_cost(thd, inner_record_count_1, - rowlen); - /* The cost of a lookup into the unique index of the materialized table. */ - double lookup_cost= get_tmp_table_lookup_cost(thd, inner_record_count_1, - rowlen); + bool blobs_used; + uint rowlen= get_tmp_table_rec_length(ref_ptrs, + select_lex->item_list.elements, + &blobs_used); + /* The cost of using the temp table */ + TMPTABLE_COSTS cost= get_tmp_table_costs(thd, inner_record_count_1, + rowlen, blobs_used); /* The cost of executing the subquery and storing its result in an indexed temporary table. */ - double materialization_cost= COST_ADD(inner_read_time_1, - COST_MULT(write_cost, - inner_record_count_1)); + double materialization_cost= + COST_ADD(cost.create, + COST_ADD(inner_read_time_1, + COST_MULT(cost.write, inner_record_count_1))); - materialize_strategy_cost= COST_ADD(materialization_cost, - COST_MULT(outer_lookup_keys, - lookup_cost)); + materialize_strategy_cost= + COST_ADD(materialization_cost, + COST_MULT(outer_lookup_keys, cost.lookup)); /* C.2 Compute the cost of the IN=>EXISTS strategy. */ - in_exists_strategy_cost= COST_MULT(outer_lookup_keys, inner_read_time_2); + in_exists_strategy_cost= + COST_MULT(outer_lookup_keys, inner_read_time_2); /* C.3 Compare the costs and choose the cheaper strategy. */ if (materialize_strategy_cost >= in_exists_strategy_cost) + { in_subs->set_strategy(SUBS_IN_TO_EXISTS); + strategy= "in_to_exists"; + } else + { in_subs->set_strategy(SUBS_MATERIALIZATION); + strategy= "materialization"; + } + if (unlikely(thd->trace_started())) + { + Json_writer_object trace_subquery(thd, "subquery_plan"); + trace_subquery. + add("records", inner_record_count_1). + add("materialization_cost", materialize_strategy_cost). + add("in_exist_cost", in_exists_strategy_cost). + add("choosen", strategy); + } DBUG_PRINT("info", - ("mat_strategy_cost: %.2f, mat_cost: %.2f, write_cost: %.2f, lookup_cost: %.2f", - materialize_strategy_cost, materialization_cost, write_cost, lookup_cost)); + ("mat_strategy_cost: %.2f mat_cost: %.2f write_cost: %.2f " + "lookup_cost: %.2f", + materialize_strategy_cost, materialization_cost, cost.write, + cost.lookup)); DBUG_PRINT("info", ("inx_strategy_cost: %.2f, inner_read_time_2: %.2f", in_exists_strategy_cost, inner_read_time_2)); @@ -6594,6 +6674,12 @@ bool JOIN::choose_subquery_plan(table_map join_tables) implementation, fall back to IN-TO-EXISTS. */ in_subs->set_strategy(SUBS_IN_TO_EXISTS); + + if (unlikely(thd->trace_started())) + { + Json_writer_object trace_subquery(thd, "subquery_plan_revert"); + trace_subquery.add("choosen", "in_to_exists"); + } } if (in_subs->test_strategy(SUBS_MATERIALIZATION)) diff --git a/sql/opt_subselect.h b/sql/opt_subselect.h index abd37f1e98e..45ea3eea6c2 100644 --- a/sql/opt_subselect.h +++ b/sql/opt_subselect.h @@ -233,8 +233,8 @@ public: double records= rows2double(s->table->file->stats.records); /* The cost is entire index scan cost (divided by 2) */ - double read_time= s->table->file->keyread_time(key, 1, - (ha_rows) records); + double read_time= s->table->file->ha_keyread_and_copy_time(key, 1, + (ha_rows) records); /* Now find out how many different keys we will get (for now we diff --git a/sql/opt_trace.cc b/sql/opt_trace.cc index afa4ae5951d..3d89d2c6298 100644 --- a/sql/opt_trace.cc +++ b/sql/opt_trace.cc @@ -618,7 +618,8 @@ void add_table_scan_values_to_trace(THD *thd, JOIN_TAB *tab) Json_writer_object table_rec(thd, "table_scan"); table_rec. add("rows", tab->found_records). - add("cost", tab->read_time); + add("read_cost", tab->read_time). + add("read_and_compare_cost", tab->cached_scan_and_compare_time); } @@ -678,7 +679,7 @@ void print_final_join_order(JOIN *join) /* Write information about the resulting join */ Json_writer_object obj(join->thd, "best_access_method"); - obj.add("cost", join->best_read); + obj.add("rows", join->join_record_count).add("cost", join->best_read); } diff --git a/sql/rowid_filter.cc b/sql/rowid_filter.cc index 3ed9a989345..b992c90f5d7 100644 --- a/sql/rowid_filter.cc +++ b/sql/rowid_filter.cc @@ -22,14 +22,17 @@ #include "sql_select.h" #include "opt_trace.h" +/* + INDEX_NEXT_FIND_COST below is the cost of finding the next possible key + and calling handler_rowid_filter_check() to check it against the filter +*/ double Range_rowid_filter_cost_info:: lookup_cost(Rowid_filter_container_type cont_type) { switch (cont_type) { case SORTED_ARRAY_CONTAINER: - /* The addition is here to take care of arrays with 1 element */ - return log(est_elements)*0.01+0.001; + return log(est_elements)*0.01+INDEX_NEXT_FIND_COST; default: DBUG_ASSERT(0); return 0; @@ -45,9 +48,10 @@ lookup_cost(Rowid_filter_container_type cont_type) inline double Range_rowid_filter_cost_info:: -avg_access_and_eval_gain_per_row(Rowid_filter_container_type cont_type) +avg_access_and_eval_gain_per_row(Rowid_filter_container_type cont_type, + double cost_of_row_fetch) { - return (1+1.0/TIME_FOR_COMPARE) * (1 - selectivity) - + return (cost_of_row_fetch+1.0/TIME_FOR_COMPARE) * (1 - selectivity) - lookup_cost(cont_type); } @@ -122,7 +126,8 @@ void Range_rowid_filter_cost_info::init(Rowid_filter_container_type cont_type, est_elements= (ulonglong) table->opt_range[key_no].rows; cost_of_building_range_filter= build_cost(container_type); selectivity= est_elements/((double) table->stat_records()); - gain= avg_access_and_eval_gain_per_row(container_type); + gain= avg_access_and_eval_gain_per_row(container_type, + tab->file->optimizer_cache_cost); if (gain > 0) cross_x= cost_of_building_range_filter/gain; else @@ -139,10 +144,10 @@ void Range_rowid_filter_cost_info::init(Rowid_filter_container_type cont_type, double Range_rowid_filter_cost_info::build_cost(Rowid_filter_container_type cont_type) { - double cost= 0; + double cost; DBUG_ASSERT(table->opt_range_keys.is_set(key_no)); - cost+= table->opt_range[key_no].index_only_cost; + cost= table->opt_range[key_no].index_only_fetch_cost(); switch (cont_type) { @@ -461,14 +466,6 @@ void Range_rowid_filter_cost_info::trace_info(THD *thd) The function looks through the array of cost info for range filters and chooses the element for the range filter that promise the greatest gain with the the ref or range access of the table by access_key_no. - As the array is sorted by cross_x in ascending order the function stops - the look through as soon as it reaches the first element with - cross_x_adj > records because the range filter for this element and the - range filters for all remaining elements do not promise positive gains. - - @note - It is easy to see that if cross_x[i] > cross_x[j] then - cross_x_adj[i] > cross_x_adj[j] @retval Pointer to the cost info for the range filter that promises the greatest gain, NULL if there is no such range filter @@ -477,20 +474,13 @@ void Range_rowid_filter_cost_info::trace_info(THD *thd) Range_rowid_filter_cost_info * TABLE::best_range_rowid_filter_for_partial_join(uint access_key_no, double records, - double access_cost_factor) + double fetch_cost, + double index_only_cost, + double prev_records) { if (range_rowid_filter_cost_info_elems == 0 || covering_keys.is_set(access_key_no)) return 0; - - // Disallow use of range filter if the key contains partially-covered - // columns. - for (uint i= 0; i < key_info[access_key_no].usable_key_parts; i++) - { - if (key_info[access_key_no].key_part[i].field->type() == MYSQL_TYPE_BLOB) - return 0; - } - /* Currently we do not support usage of range filters if the table is accessed by the clustered primary key. It does not make sense @@ -501,36 +491,44 @@ TABLE::best_range_rowid_filter_for_partial_join(uint access_key_no, if (file->is_clustering_key(access_key_no)) return 0; + // Disallow use of range filter if the key contains partially-covered + // columns. + for (uint i= 0; i < key_info[access_key_no].usable_key_parts; i++) + { + if (key_info[access_key_no].key_part[i].field->type() == MYSQL_TYPE_BLOB) + return 0; + } + Range_rowid_filter_cost_info *best_filter= 0; - double best_filter_gain= 0; + double best_filter_gain= DBL_MAX; key_map no_filter_usage= key_info[access_key_no].overlapped; no_filter_usage.merge(key_info[access_key_no].constraint_correlated); + no_filter_usage.set_bit(access_key_no); for (uint i= 0; i < range_rowid_filter_cost_info_elems ; i++) { - double curr_gain = 0; + double new_cost, new_total_cost, new_records; + double cost_of_accepted_rows, cost_of_rejected_rows; Range_rowid_filter_cost_info *filter= range_rowid_filter_cost_info_ptr[i]; /* Do not use a range filter that uses an in index correlated with the index by which the table is accessed */ - if ((filter->key_no == access_key_no) || - no_filter_usage.is_set(filter->key_no)) + if (no_filter_usage.is_set(filter->key_no)) continue; - filter->set_adjusted_gain_param(access_cost_factor); - - if (records < filter->cross_x_adj) - { - /* Does not make sense to look through the remaining filters */ - break; - } + new_records= records * filter->selectivity; + cost_of_accepted_rows= fetch_cost * filter->selectivity; + cost_of_rejected_rows= index_only_cost * (1 - filter->selectivity); + new_cost= (cost_of_accepted_rows + cost_of_rejected_rows + + records * filter->lookup_cost()); + new_total_cost= ((new_cost + new_records/TIME_FOR_COMPARE) * prev_records + + filter->get_setup_cost()); - curr_gain= filter->get_adjusted_gain(records); - if (best_filter_gain < curr_gain) + if (best_filter_gain > new_total_cost) { - best_filter_gain= curr_gain; + best_filter_gain= new_total_cost; best_filter= filter; } } diff --git a/sql/rowid_filter.h b/sql/rowid_filter.h index 660f8ce3a09..ff252a4a196 100644 --- a/sql/rowid_filter.h +++ b/sql/rowid_filter.h @@ -143,12 +143,19 @@ class SQL_SELECT; class Rowid_filter_container; class Range_rowid_filter_cost_info; -/* Cost to write rowid into array */ -#define ARRAY_WRITE_COST 0.005 -/* Factor used to calculate cost of sorting rowids in array */ -#define ARRAY_SORT_C 0.01 -/* Cost to evaluate condition */ -#define COST_COND_EVAL 0.2 +/* + Cost to write rowid into array. Assume inserting 1000 row id's into the + array has same cost as a 'disk io' or key fetch +*/ +#define ARRAY_WRITE_COST 0.001 +/* + Factor used to calculate cost of sorting rowids in array + This is multiplied by 'elements * log(elements)', so this factor + has a very high cost weight! + A value of 0.001 will have 200 rows have a cost of 1.05 and + 1000 rows a cost of 6.90. +*/ +#define ARRAY_SORT_C 0.001 typedef enum { @@ -423,7 +430,8 @@ public: inline double lookup_cost() { return lookup_cost(container_type); } inline double - avg_access_and_eval_gain_per_row(Rowid_filter_container_type cont_type); + avg_access_and_eval_gain_per_row(Rowid_filter_container_type cont_type, + double cost_of_row_fetch); inline double avg_adjusted_gain_per_row(double access_cost_factor); @@ -469,7 +477,13 @@ public: Range_rowid_filter_cost_info * TABLE::best_range_rowid_filter_for_partial_join(uint access_key_no, double records, - double access_cost_factor); + double fetch_cost, + double index_only_cost, + double prev_records); + Range_rowid_filter_cost_info * + apply_filter(THD *thd, TABLE *table, double *cost, double *records_arg, + double *startup_cost, double fetch_cost, + double index_only_cost, uint ranges, double record_count); }; #endif /* ROWID_FILTER_INCLUDED */ diff --git a/sql/set_var.cc b/sql/set_var.cc index 4b3e23b06c0..103b7ca02ec 100644 --- a/sql/set_var.cc +++ b/sql/set_var.cc @@ -1548,4 +1548,3 @@ ulonglong get_system_variable_hash_version(void) { return system_variable_hash_version; } - diff --git a/sql/set_var.h b/sql/set_var.h index 2d538624825..f1f186b9bef 100644 --- a/sql/set_var.h +++ b/sql/set_var.h @@ -484,5 +484,4 @@ void free_engine_list(plugin_ref *list); plugin_ref *copy_engine_list(plugin_ref *list); plugin_ref *temp_copy_engine_list(THD *thd, plugin_ref *list); char *pretty_print_engine_list(THD *thd, plugin_ref *list); - #endif diff --git a/sql/sql_base.cc b/sql/sql_base.cc index d983fe9a332..f510e4aeec8 100644 --- a/sql/sql_base.cc +++ b/sql/sql_base.cc @@ -4449,6 +4449,7 @@ restart: tbl->reginfo.lock_type= tables->lock_type; tbl->reginfo.skip_locked= tables->skip_locked; } + #ifdef WITH_WSREP /* At this point we have SE associated with table so we can check wsrep_mode diff --git a/sql/sql_class.h b/sql/sql_class.h index cd11c4d465f..491471d33f4 100644 --- a/sql/sql_class.h +++ b/sql/sql_class.h @@ -653,7 +653,7 @@ typedef struct system_variables char* dynamic_variables_ptr; uint dynamic_variables_head; /* largest valid variable offset */ uint dynamic_variables_size; /* how many bytes are in use */ - + ulonglong max_heap_table_size; ulonglong tmp_memory_table_size; ulonglong tmp_disk_table_size; @@ -699,7 +699,6 @@ typedef struct system_variables ulong saved_lock_wait_timeout; ulonglong wsrep_gtid_seq_no; #endif /* WITH_WSREP */ - uint eq_range_index_dive_limit; ulong column_compression_zlib_strategy; ulong lock_wait_timeout; ulong join_cache_level; @@ -752,7 +751,6 @@ typedef struct system_variables ulong tx_isolation; ulong updatable_views_with_limit; ulong alter_algorithm; - int max_user_connections; ulong server_id; /** In slave thread we need to know in behalf of which @@ -763,10 +761,13 @@ typedef struct system_variables When replicating an event group with GTID, keep these values around so slave binlog can receive the same GTID as the original. */ - uint32 gtid_domain_id; uint64 gtid_seq_no; + uint32 gtid_domain_id; uint group_concat_max_len; + uint eq_range_index_dive_limit; + uint optimizer_cache_hit_ratio; + int max_user_connections; /** Default transaction access mode. READ ONLY (true) or READ WRITE (false). diff --git a/sql/sql_const.h b/sql/sql_const.h index bcc556e61f9..f73dce2ce5c 100644 --- a/sql/sql_const.h +++ b/sql/sql_const.h @@ -200,16 +200,82 @@ #define MIN_ROWS_TO_USE_BULK_INSERT 100 /** - The following is used to decide if MySQL should use table scanning + The following is used to decide if MariaDB should use table scanning instead of reading with keys. The number says how many evaluation of the WHERE clause is comparable to reading one extra row from a table. */ #define TIME_FOR_COMPARE 5.0 // 5 WHERE compares == one read #define TIME_FOR_COMPARE_IDX 20.0 -#define IDX_BLOCK_COPY_COST ((double) 1 / TIME_FOR_COMPARE) -#define IDX_LOOKUP_COST ((double) 1 / 8) -#define MULTI_RANGE_READ_SETUP_COST (IDX_BLOCK_COPY_COST/10) +/* + The table/index cache hit ratio in %. 0 means that a searched for key or row + will never be in the cache while 100 means it always in the cache. + + According to folklore, one need at least 80 % hit rate in the cache for + MariaDB to run very well. We set CACHE_HIT_RATIO to a bit smaller + as there is still a cost involved in finding the row in the B tree, hash + or other seek structure. + + Increasing CACHE_HIT_RATIO will make MariaDB prefer key lookups over + table scans as the impact of RECORD_COPY_COST and INDEX_COPY cost will + have a larger impact when more rows are exmined.. + + Note that avg_io_cost() is multipled with this constant! +*/ +#define CACHE_HIT_RATIO 50 + +/* + Cost of finding and copying keys of a total length of 'blocksize' + used in handler::keyread_time() + */ +#define INDEX_BLOCK_COPY_COST ((double) 1 / 5.0) +/* Cost for finding the first key in a key scan */ +#define INDEX_LOOKUP_COST ((double) 1.0) +/* Cost of finding a key from a row_ID (not used for clustered keys) */ +#define ROW_LOOKUP_COST ((double) 1.0) +/* + Cost of finding the next row during table scan and copying it to + 'table->record'. + If this is too small, then table scans will be prefered over 'ref' + as with table scans there are no key read (INDEX_LOOKUP_COST), fewer + disk reads but more record copying and row comparisions. If it's + too big then MariaDB will used key lookup even when table scan is + better. +*/ +#define RECORD_COPY_COST ((double) 1.0 / 20.0) +/* + Cost of finding the next key during index scan and copying it to + 'table->record' + + If this is too small, then index scans will be prefered over 'ref' + as with table scans there are no key read (INDEX_LOOKUP_COST) and + fewer disk reads. +*/ +#define INDEX_COPY_COST ((double) 1.0 / 40.0) +/* + Cost of finding the next index entry and checking it against filter + This cost is very low as it's done inside the storage engine. + Should be smaller than INDEX_COPY_COST. + */ +#define INDEX_NEXT_FIND_COST ((double) 1.0 / 80.0) + +/* Extra cost for doing a range scan. Used to prefer 'ref' over range */ +#define MULTI_RANGE_READ_SETUP_COST (double) (1.0 / 50.0) + +/* + These costs are mainly to handle small tables, like the one we have in the + mtr test suite +*/ +/* Extra cost for full table scan. Used to prefer range over table scans */ +#define TABLE_SCAN_SETUP_COST 1.0 +/* Extra cost for full index scan. Used to prefer range over index scans */ +#define INDEX_SCAN_SETUP_COST 1.0 + +/* + The lower bound of accepted rows when using filter. + This is used to ensure that filters are not too agressive. +*/ +#define MIN_ROWS_AFTER_FILTERING 1.0 /** Number of comparisons of table rowids equivalent to reading one row from a @@ -217,8 +283,14 @@ */ #define TIME_FOR_COMPARE_ROWID (TIME_FOR_COMPARE*100) -/* cost1 is better that cost2 only if cost1 + COST_EPS < cost2 */ -#define COST_EPS 0.001 +/* + cost1 is better that cost2 only if cost1 + COST_EPS < cost2 + The main purpose of this is to ensure we use the first index or plan + when there are identical plans. Without COST_EPS some plans in the + test suite would vary depending on floating point calculations done + in different paths. + */ +#define COST_EPS 0.0001 /* For sequential disk seeks the cost formula is: @@ -244,11 +316,13 @@ /* Subquery materialization-related constants */ +/* This should match ha_heap::read_time() */ #define HEAP_TEMPTABLE_LOOKUP_COST 0.05 +#define HEAP_TEMPTABLE_CREATE_COST 1.0 #define DISK_TEMPTABLE_LOOKUP_COST 1.0 +#define DISK_TEMPTABLE_CREATE_COST 4.0 /* Creating and deleting 2 temp tables */ #define SORT_INDEX_CMP_COST 0.02 - #define COST_MAX (DBL_MAX * (1.0 - DBL_EPSILON)) #define COST_ADD(c,d) (COST_MAX - (d) > (c) ? (c) + (d) : COST_MAX) diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 172fbff6b72..b3bf0557941 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -88,6 +88,13 @@ */ #define HASH_FANOUT 0.1 +/* Cost for reading a row trough an index */ +struct INDEX_READ_COST +{ + double read_cost; + double index_only_cost; +}; + const char *join_type_str[]={ "UNKNOWN","system","const","eq_ref","ref", "MAYBE_REF","ALL","range","index","fulltext", "ref_or_null","unique_subquery","index_subquery", @@ -5504,7 +5511,8 @@ make_join_statistics(JOIN *join, List<TABLE_LIST> &tables_list, s->type=JT_SYSTEM; join->const_table_map|=table->map; set_position(join,const_count++,s,(KEYUSE*) 0); - if ((tmp= join_read_const_table(join->thd, s, join->positions+const_count-1))) + if ((tmp= join_read_const_table(join->thd, s, + join->positions+const_count-1))) { if (tmp > 0) goto error; // Fatal error @@ -5710,17 +5718,11 @@ make_join_statistics(JOIN *join, List<TABLE_LIST> &tables_list, "system"); continue; } - /* Approximate found rows and time to read them */ - if (s->table->is_filled_at_execution()) - { - get_delayed_table_estimates(s->table, &s->records, &s->read_time, - &s->startup_cost); - s->found_records= s->records; - s->table->opt_range_condition_rows= s->records; - s->table->used_stat_records= s->records; - } - else - s->scan_time(); + /* + Approximate found rows and time to read them + Update found_records, records, read_time and other scan related variables + */ + s->estimate_scan_time(); if (s->table->is_splittable()) s->add_keyuses_for_splitting(); @@ -5730,10 +5732,15 @@ make_join_statistics(JOIN *join, List<TABLE_LIST> &tables_list, This is can't be to high as otherwise we are likely to use table scan. */ +#ifdef OLD_CODE_LIMITED_SEEKS s->worst_seeks= MY_MIN((double) s->found_records / 10, - (double) s->read_time*3); + (double) s->read_time*3); + s->worst_seeks= s->found_records; // Disable worst seeks if (s->worst_seeks < 2.0) // Fix for small tables s->worst_seeks=2.0; +#else + s->worst_seeks= DBL_MAX; +#endif /* Add to stat->const_keys those indexes for which all group fields or @@ -7610,7 +7617,7 @@ static double matching_candidates_in_table(JOIN_TAB *s, 0.0 is returned only if it is guaranteed there are no matching rows (for example if the table is empty). */ - return dbl_records ? MY_MAX(dbl_records, 1.0) : 0.0; + return dbl_records ? MY_MAX(dbl_records, MIN_ROWS_AFTER_FILTERING) : 0.0; } @@ -7623,33 +7630,165 @@ static double matching_candidates_in_table(JOIN_TAB *s, One main difference between the functions is that multi_range_read_info_const() adds a very small cost per range - (IDX_LOOKUP_COST) and also MULTI_RANGE_READ_SETUP_COST, to ensure that - 'ref' is preferred slightly over ranges. + MULTI_RANGE_READ_SETUP_COST, to ensure that 'ref' is preferred + over ranges. + + Note that this function assumes that index_only_cost is only to be + used with filtering (as cost.read_cost takes into account both + clustering and covered keys). index_only_cost does not include + INDEX_COPY_COST as for filtering there is no copying of not accepted + keys. + + TIME_FOR_COMPARE cost is not added to any result. */ -double cost_for_index_read(const THD *thd, const TABLE *table, uint key, - ha_rows records, ha_rows worst_seeks) +INDEX_READ_COST cost_for_index_read(const THD *thd, const TABLE *table, + uint key, + ha_rows records, ha_rows worst_seeks) { - DBUG_ENTER("cost_for_index_read"); - double cost; + INDEX_READ_COST cost; handler *file= table->file; + double rows_adjusted; + DBUG_ENTER("cost_for_index_read"); - set_if_smaller(records, (ha_rows) thd->variables.max_seeks_for_key); + rows_adjusted= MY_MIN(records, (ha_rows) thd->variables.max_seeks_for_key); +#ifdef OLD_CODE_LIMITED_SEEKS + set_if_smaller(rows_adjusted, worst_seeks); +#endif if (file->is_clustering_key(key)) - cost= file->read_time(key, 1, records); - else - if (table->covering_keys.is_set(key)) - cost= file->keyread_time(key, 1, records); + { + cost.index_only_cost= file->ha_read_time(key, 1, rows_adjusted); + /* + Same computation as in ha_read_and_copy_time() + We do it explicitely here as we want to use the original value of + records to compute the record copy cost. + */ + cost.read_cost= (cost.index_only_cost + + rows2double(records) * RECORD_COPY_COST); + } + else if (table->covering_keys.is_set(key) && !table->no_keyread) + { + cost.index_only_cost= file->ha_keyread_time(key, 1, rows_adjusted); + /* Same computation as in ha_keyread_and_copy_time() */ + cost.read_cost= (cost.index_only_cost + + rows2double(records) * INDEX_COPY_COST); + } else - cost= ((file->keyread_time(key, 0, records) + - file->read_time(key, 1, MY_MIN(records, worst_seeks)))); - - DBUG_PRINT("statistics", ("cost: %.3f", cost)); + { + cost.index_only_cost= file->ha_keyread_time(key, 1, records); + /* + Note that ha_read_time() + ..RECORD_COPY_COST should be same + as ha_read_with_rowid(). + */ + cost.read_cost= (cost.index_only_cost + + file->ha_read_time(key, 0, rows_adjusted) + + rows2double(records) * RECORD_COPY_COST); + } + DBUG_PRINT("statistics", ("index_cost: %.3f full_cost: %.3f", + cost.index_only_cost, cost.read_cost)); DBUG_RETURN(cost); } /** + Apply filter if the filter is better than the current cost + + @param thd Thread handler + @param table Table + @param cost Pointer to cost for *records_arg rows, not including + TIME_FOR_COMPARE cost. + Will be updated to new cost if filter is used. + @param records_arg Pointer to number of records for the current key. + Will be updated to records after filter, if filter is + used. + @param startup_cost Startup cost. Will be updated if filter is used. + @param fetch_cost Cost of finding the row, without copy or compare cost + @param index_only_cost Cost if fetching '*records_arg' key values + @param prev_records Number of record combinations in previous tables + + @return 'this' Filter is used (and variables are updated) + @return 0 Filter is worse than old plan +*/ + +Range_rowid_filter_cost_info* Range_rowid_filter_cost_info:: +apply_filter(THD *thd, TABLE *table, double *cost, double *records_arg, + double *startup_cost, double fetch_cost, double index_only_cost, + uint ranges, double prev_records) +{ + bool use_filter; + double new_cost, new_total_cost, records= *records_arg, new_records; + double cost_of_accepted_rows, cost_of_rejected_rows; + double filter_startup_cost= get_setup_cost(); + double io_cost= table->file->avg_io_cost(); + double filter_lookup_cost= records * lookup_cost(); + + /* + Calculate number of resulting rows after filtering + Here we trust selectivity and do not adjust rows up even if + the end result is low. This means that new_records is allowed to be + be < 1.0 + */ + new_records= records * selectivity; + + /* + Calculate the cost of the filter based on that we had originally + 'records' rows and after the filter only 'new_records' accepted + rows. + Note that the rejected rows, we have only done a key read. We only + fetch the row and compare the where if the filter accepts the + row id. + In case of index only read, fetch_cost == index_only_cost. Even in this + the filter can give a better plan as we have to do less comparisons + with the WHERE clause. + + The io_cost is used to take into account that we have to do 1 key + lookup to find the first matching key in each range. + */ + cost_of_accepted_rows= fetch_cost * selectivity; + cost_of_rejected_rows= index_only_cost * (1-selectivity); + /* + The MAX() is used below to ensure that we take into account the index + read even if selectivity (and thus new_records) would be very low. + */ + new_cost= (MY_MAX(cost_of_accepted_rows, + ranges * INDEX_LOOKUP_COST * io_cost * + table->file->optimizer_cache_cost) + + cost_of_rejected_rows + filter_lookup_cost); + new_total_cost= ((new_cost + new_records/TIME_FOR_COMPARE) * prev_records + + filter_startup_cost); + + DBUG_ASSERT(new_cost >= 0 && new_records >= 0); + use_filter= ((*cost + records/TIME_FOR_COMPARE) * prev_records > + new_total_cost); + + if (unlikely(thd->trace_started())) + { + Json_writer_object trace_filter(thd, "filter"); + trace_filter.add("rowid_filter_key", + table->key_info[get_key_no()].name). + add("index_only_cost", index_only_cost). + add("filter_startup_cost", filter_startup_cost). + add("find_key_and_filter_lookup_cost", filter_lookup_cost). + add("filter_selectivity", selectivity). + add("orginal_rows", records). + add("new_rows", new_records). + add("original_found_rows_cost", fetch_cost). + add("new_found_rows_cost", new_cost). + add("cost", new_total_cost). + add("filter_used", use_filter); + } + if (use_filter) + { + *cost= new_cost; + *records_arg= new_records; + (*startup_cost)+= filter_startup_cost; + return this; + } + return 0; +} + + +/** Find the best access path for an extension of a partial execution plan and add this path to the plan. @@ -7696,7 +7835,6 @@ best_access_path(JOIN *join, my_bool found_constraint= 0; double best_cost= DBL_MAX; double records= DBL_MAX; - double best_filter_cmp_gain; table_map best_ref_depends_map= 0; Range_rowid_filter_cost_info *best_filter= 0; double tmp; @@ -7706,28 +7844,32 @@ best_access_path(JOIN *join, KEYUSE *hj_start_key= 0; SplM_plan_info *spl_plan= 0; enum join_type best_type= JT_UNKNOWN, type= JT_UNKNOWN; - - disable_jbuf= disable_jbuf || idx == join->const_tables; - Loose_scan_opt loose_scan_opt; + TABLE *table= s->table; + Json_writer_object trace_wrapper(thd, "best_access_path"); DBUG_ENTER("best_access_path"); - Json_writer_object trace_wrapper(thd, "best_access_path"); + disable_jbuf= disable_jbuf || idx == join->const_tables; bitmap_clear_all(eq_join_set); loose_scan_opt.init(join, s, remaining_tables); - if (s->table->is_splittable()) + if (table->is_splittable()) spl_plan= s->choose_best_splitting(record_count, remaining_tables); + + if (unlikely(thd->trace_started())) + { + Json_writer_object info(thd, "plan_details"); + info.add("record_count", record_count); + } Json_writer_array trace_paths(thd, "considered_access_paths"); if (s->keyuse) { /* Use key if possible */ KEYUSE *keyuse; KEYUSE *start_key=0; - TABLE *table= s->table; - double best_records= DBL_MAX; + double best_records= DBL_MAX, index_only_cost= DBL_MAX; uint max_key_part=0; /* Test how we can use keys */ @@ -7853,7 +7995,10 @@ best_access_path(JOIN *join, Calculate an adjusted cost based on how many records are read This will be later multipled by record_count. */ - tmp= prev_record_reads(join_positions, idx, found_ref)/record_count; + tmp= (prev_record_reads(join_positions, idx, found_ref) / + record_count); + set_if_smaller(tmp, 1.0); + index_only_cost= tmp; /* Really, there should be records=0.0 (yes!) but 1.0 would be probably safer @@ -7880,28 +8025,39 @@ best_access_path(JOIN *join, - equalities we are using reject NULLs (3) then the estimate is rows=1. */ - if ((key_flags & (HA_NOSAME | HA_EXT_NOSAME)) && // (1) + if ((key_flags & (HA_NOSAME | HA_EXT_NOSAME)) && // (1) (!(key_flags & HA_NULL_PART_KEY) || // (2) all_key_parts == notnull_part)) // (3) { - - /* TODO: Adjust cost for covering and clustering key */ + double adjusted_cost; type= JT_EQ_REF; if (unlikely(trace_access_idx.trace_started())) trace_access_idx. add("access_type", join_type_str[type]). add("index", keyinfo->name); if (!found_ref && table->opt_range_keys.is_set(key)) + { + /* Ensure that the cost is identical to the range cost */ tmp= table->opt_range[key].fetch_cost; + index_only_cost= table->opt_range[key].index_only_cost; + } else - tmp= table->file->avg_io_cost(); + { + INDEX_READ_COST cost= cost_for_index_read(thd, table, key, + 1,1); + tmp= cost.read_cost; + index_only_cost= cost.index_only_cost; + } /* Calculate an adjusted cost based on how many records are read This will be later multipled by record_count. */ - tmp*= (prev_record_reads(join_positions, idx, found_ref) / - record_count); - records=1.0; + adjusted_cost= (prev_record_reads(join_positions, idx, found_ref) / + record_count); + set_if_smaller(adjusted_cost, 1.0); + tmp*= adjusted_cost; + index_only_cost*= adjusted_cost; + records= 1.0; } else { @@ -7931,9 +8087,11 @@ best_access_path(JOIN *join, */ if (table->opt_range_keys.is_set(key)) { + /* Ensure that the cost is identical to the range cost */ records= (double) table->opt_range[key].rows; trace_access_idx.add("used_range_estimates", true); tmp= table->opt_range[key].fetch_cost; + index_only_cost= table->opt_range[key].index_only_cost; goto got_cost2; } /* quick_range couldn't use key! */ @@ -7992,9 +8150,12 @@ best_access_path(JOIN *join, } } } - /* Limit the number of matched rows */ - tmp= cost_for_index_read(thd, table, key, (ha_rows) records, - (ha_rows) s->worst_seeks); + /* Calculate the cost of the index access */ + INDEX_READ_COST cost= cost_for_index_read(thd, table, key, + (ha_rows) records, + (ha_rows) s->worst_seeks); + tmp= cost.read_cost; + index_only_cost= cost.index_only_cost; } } else @@ -8060,6 +8221,11 @@ best_access_path(JOIN *join, { records= (double) table->opt_range[key].rows; tmp= table->opt_range[key].fetch_cost; + index_only_cost= table->opt_range[key].index_only_cost; + /* + TODO: Disable opt_range testing below for this range as we can + always use this ref instead. + */ trace_access_idx.add("used_range_estimates", true); goto got_cost2; } @@ -8134,7 +8300,7 @@ best_access_path(JOIN *join, (keyinfo->user_defined_key_parts-1); else records= a; - set_if_bigger(records, 1.0); + set_if_bigger(records, MIN_ROWS_AFTER_FILTERING); } } @@ -8173,8 +8339,11 @@ best_access_path(JOIN *join, /* Limit the number of matched rows */ tmp= records; set_if_smaller(tmp, (double) thd->variables.max_seeks_for_key); - tmp= cost_for_index_read(thd, table, key, (ha_rows) tmp, - (ha_rows) s->worst_seeks); + INDEX_READ_COST cost= cost_for_index_read(thd, table, key, + (ha_rows) tmp, + (ha_rows) s->worst_seeks); + tmp= cost.read_cost; + index_only_cost= cost.index_only_cost; } else { @@ -8196,75 +8365,56 @@ best_access_path(JOIN *join, if (records == DBL_MAX) // Key not usable continue; - startup_cost= s->startup_cost; records_after_filter= records; - /* Check that start_key->key can be used for index access */ - if (found_part & 1) + /* + Check that start_key->key can be used for index access + Records can be 0 in case of empty tables. + */ + if ((found_part & 1) && records) { - double rows= record_count * records; - double access_cost_factor= MY_MIN(tmp / records, 1.0); + /* + Cost difference between fetch row with key and index only read. + The following formula can be > 1.0 in when range optimizer is used + as the range optimizer assumes that the needed key pages are + already in memory (because of records_in_range() calls) and + sets the io_cost for future index lookup calls is 0. + */ filter= - table->best_range_rowid_filter_for_partial_join(start_key->key, rows, - access_cost_factor); + table->best_range_rowid_filter_for_partial_join(start_key->key, + records, + tmp, + index_only_cost, + record_count); if (filter) - { - double new_cost, new_records; - bool use_filter; - double filter_startup_cost= filter->get_setup_cost(); - double filter_lookup_cost= records * filter->lookup_cost(); - - /* Add cost of checking found rows against filter */ - new_cost= COST_ADD(tmp, filter_lookup_cost); - /* Calculate number of resulting rows after filtering */ - new_records= records * filter->selectivity; - DBUG_ASSERT(new_cost >= 0 && new_records >= 0); - use_filter= ((tmp + records/TIME_FOR_COMPARE) * record_count >= - (new_cost + new_records/TIME_FOR_COMPARE)*record_count + - filter_startup_cost); - - if (thd->trace_started()) - { - Json_writer_object trace_filter(thd, "filter"); - trace_filter.add("rowid_filter_key", - table->key_info[filter->get_key_no()].name). - add("original_found_rows_cost", tmp). - add("new_found_rows_cost", new_cost). - add("orginal_rows", records). - add("new_rows", new_records). - add("filter_startup_cost", filter_startup_cost). - add("filter_lookup_cost", filter_lookup_cost). - add("filter_selectivity", filter->selectivity). - add("filter_used", use_filter); - } - if (use_filter) - { - tmp= new_cost; - records_after_filter= new_records; - startup_cost+= filter_startup_cost; - } - else - filter= 0; - } + filter= filter->apply_filter(thd, table, &tmp, &records_after_filter, + &startup_cost, + tmp, index_only_cost, + 1, record_count); } tmp= COST_ADD(tmp, records_after_filter/TIME_FOR_COMPARE); - if (unlikely(trace_access_idx.trace_started())) - trace_access_idx. - add("rows", records). - add("found_matching_rows_cost",tmp). - add("startup_cost", startup_cost); - tmp= COST_MULT(tmp, record_count); tmp= COST_ADD(tmp, startup_cost); - if (unlikely(trace_access_idx.trace_started())) - trace_access_idx.add("rows", records_after_filter).add("cost", tmp); + { + trace_access_idx. + add("rows", records_after_filter). + add("cost", tmp); + } - if (tmp + 0.0001 < best_cost) + /* + The COST_EPS is here to ensure we use the first key if there are + two 'identical keys' that could be used. + */ + if (tmp + COST_EPS < best_cost) { trace_access_idx.add("chosen", true); best_cost= tmp; - best_records= records; + /* + We use 'records' instead of 'records_after_filter' here as we want + to have EXPLAIN print the number of rows found by the key access. + */ + best_records= records; // Records before filter! best_key= start_key; best_max_key_part= max_key_part; best_ref_depends_map= found_ref; @@ -8296,7 +8446,7 @@ best_access_path(JOIN *join, !bitmap_is_clear_all(eq_join_set) && !disable_jbuf && (!s->emb_sj_nest || join->allowed_semijoin_with_cache) && // (1) - (!(s->table->map & join->outer_join) || + (!(table->map & join->outer_join) || join->allowed_outer_join_with_cache)) // (2) { Json_writer_object trace_access_hash(thd); @@ -8317,14 +8467,7 @@ best_access_path(JOIN *join, tmp= s->quick->read_time; } else - { - tmp= s->scan_time(); - /* - Cost of comparing the found row with the attached WHERE - This is not part of scan_time()! - */ - tmp= COST_ADD(tmp, s->records / TIME_FOR_COMPARE); - } + tmp= s->cached_scan_and_compare_time; /* We read the table as many times as join buffer becomes full. */ refills= (1.0 + floor((double) cache_record_length(join,idx) * @@ -8399,16 +8542,16 @@ best_access_path(JOIN *join, !(s->quick && s->quick->get_type() != QUICK_SELECT_I::QS_TYPE_GROUP_MIN_MAX && // (2) best_key && s->quick->index == best_key->key && // (2) - best_max_key_part >= s->table->opt_range[best_key->key].key_parts) &&// (2) - !((s->table->file->ha_table_flags() & HA_TABLE_SCAN_ON_INDEX) && // (3) - ! s->table->covering_keys.is_clear_all() && best_key && !s->quick) &&// (3) - !(s->table->force_index && best_key && !s->quick) && // (4) - !(best_key && s->table->pos_in_table_list->jtbm_subselect)) // (5) + best_max_key_part >= table->opt_range[best_key->key].key_parts) &&// (2) + !((table->file->ha_table_flags() & HA_TABLE_SCAN_ON_INDEX) && // (3) + ! table->covering_keys.is_clear_all() && best_key && !s->quick) &&// (3) + !(table->force_index && best_key && !s->quick) && // (4) + !(best_key && table->pos_in_table_list->jtbm_subselect)) // (5) { // Check full join - double rnd_records= matching_candidates_in_table(s, found_constraint, - use_cond_selectivity); + double rnd_records, records_after_filter, org_records; Range_rowid_filter_cost_info *filter= 0; - DBUG_ASSERT(rnd_records <= s->records); + double startup_cost= s->startup_cost; + const char *scan_type= ""; /* Range optimizer never proposes a RANGE if it isn't better @@ -8433,79 +8576,123 @@ best_access_path(JOIN *join, */ tmp= COST_MULT(s->quick->read_time, record_count); - if ( s->quick->get_type() == QUICK_SELECT_I::QS_TYPE_RANGE) + /* + Use record count from range optimizer. + This is done to make records found comparable to what we get with + 'ref' access. + */ + org_records= records_after_filter= rnd_records= s->found_records; + + if (s->quick->get_type() == QUICK_SELECT_I::QS_TYPE_RANGE) { - double rows= record_count * s->found_records; - double access_cost_factor= MY_MIN(tmp / rows, 1.0); uint key_no= s->quick->index; + TABLE::OPT_RANGE *range= &table->opt_range[key_no]; + + /* + Ensure that 'range' and 's' are comming from the same source + The complex 'double' comparison is there because floating point + registers complications when costs are calculated. + */ + DBUG_ASSERT(range->rows == s->found_records); + DBUG_ASSERT((range->cost == 0.0 && s->quick->read_time == 0.0) || + (range->cost / s->quick->read_time <= 1.0000001 && + range->cost / s->quick->read_time >= 0.9999999)); + filter= - s->table->best_range_rowid_filter_for_partial_join(key_no, rows, - access_cost_factor); + table->best_range_rowid_filter_for_partial_join(key_no, range->rows, + range->find_cost, + range->index_only_cost, + record_count); if (filter) { - tmp-= filter->get_adjusted_gain(rows); - DBUG_ASSERT(tmp >= 0); + double filter_cost= range->fetch_cost; + filter= filter->apply_filter(thd, table, &filter_cost, + &records_after_filter, + &startup_cost, + range->fetch_cost, + range->index_only_cost, + range->ranges, + record_count); + if (filter) + { + tmp= filter_cost; + /* Filter returns cost without TIME_FOR_COMPARE */ + tmp= COST_ADD(tmp, records_after_filter / TIME_FOR_COMPARE); + tmp= COST_MULT(tmp, record_count); + tmp= COST_ADD(tmp, startup_cost); + startup_cost= 0; // Avoid adding it later + table->opt_range[key_no].selectivity= filter->selectivity; + } } type= JT_RANGE; } else { type= JT_INDEX_MERGE; - best_filter= 0; } loose_scan_opt.check_range_access(join, idx, s->quick); } else { + /* We will now calculate cost of scan, with or without join buffer */ + rnd_records= matching_candidates_in_table(s, found_constraint, + use_cond_selectivity); + records_after_filter= rnd_records; + org_records= s->records; + DBUG_ASSERT(rnd_records <= s->records); + /* Estimate cost of reading table. */ - if (s->table->force_index && !best_key) // index scan + if (table->force_index && !best_key) { + INDEX_READ_COST cost= cost_for_index_read(thd, table, s->ref.key, + s->records, + s->worst_seeks); + /* + The query is using 'force_index' and we did not find a usable key. + Caclulcate cost of a table scan with the forced index. + */ type= JT_NEXT; - tmp= s->table->file->read_time(s->ref.key, 1, s->records); + tmp= cost.read_cost; } else // table scan { - tmp= s->scan_time(); + tmp= s->cached_scan_time; type= JT_ALL; } - if ((s->table->map & join->outer_join) || disable_jbuf) + if ((table->map & join->outer_join) || disable_jbuf) { - double cmp_time; /* Simple scan For each record we have to: - - Read the whole table record - - Compare with the current where clause with only fields for the - table - - Compare with the full where and skip rows which does not satisfy - the join condition + - Read the table record + - Compare with the current WHERE clause + We estmate that 'rnd_records' will survive this check. */ /* Calculate cost of checking the attached WHERE */ - cmp_time= s->records/TIME_FOR_COMPARE; - tmp= COST_ADD(tmp, cmp_time); + tmp= s->cached_scan_and_compare_time; + scan_type= "scan"; + /* If this is not the first table we have to compare the rows against all previous row combinations */ if (idx != join->const_tables) - { - /* Calculate cost of checking matched rows against the join cache */ - cmp_time= rnd_records/TIME_FOR_COMPARE; - tmp= COST_ADD(tmp, cmp_time); - /* We do the above for every row in the cache */ tmp= COST_MULT(tmp, record_count); - } } else { /* Scan trough join cache */ double cmp_time, refills; - /* Calculate cost of checking the attached WHERE */ - cmp_time= s->records / TIME_FOR_COMPARE; - tmp= COST_ADD(tmp, cmp_time); + /* + Calculate cost of checking the the WHERE for this table. + This is done before we check the TABLE rows aginst the rows + in the join cache. + */ + tmp= s->cached_scan_and_compare_time; + scan_type= "scan_with_join_cache"; /* Calculate cost of refills */ refills= (1.0 + floor((double) cache_record_length(join,idx) * @@ -8513,34 +8700,41 @@ best_access_path(JOIN *join, (double) thd->variables.join_buff_size))); tmp= COST_MULT(tmp, refills); - /* Cost of compare matching rows against the rows in the join cache */ - cmp_time= (rnd_records * record_count / TIME_FOR_COMPARE); + /* We come here only if there are already rows in the join cache */ + DBUG_ASSERT(idx != join->const_tables); + /* + Cost of moving each row from each previous table from the join cache + to it's table record and comparing it with the found and accepted row. + */ + cmp_time= (rnd_records * record_count * + (RECORD_COPY_COST * (idx - join->const_tables) + + 1 / TIME_FOR_COMPARE)); tmp= COST_ADD(tmp, cmp_time); } } - trace_access_scan.add("access_type", type == JT_ALL ? - "scan" : - join_type_str[type]); /* Splitting technique cannot be used with join cache */ - if (s->table->is_splittable()) - tmp+= s->table->get_materialization_cost(); - else - tmp+= s->startup_cost; + if (table->is_splittable()) + startup_cost= table->get_materialization_cost(); + tmp+= startup_cost; - best_filter_cmp_gain= (best_filter ? - best_filter->get_cmp_gain(record_count * records) : - 0); if (unlikely(trace_access_scan.trace_started())) + { trace_access_scan. - add("resulting_rows", rnd_records). + add("access_type", + type == JT_ALL ? scan_type : join_type_str[type]). + add("rows", org_records). + add("rows_after_scan", rnd_records). + add("rows_after_filter", records_after_filter). add("cost", tmp); + if (type == JT_ALL) + { + trace_access_scan.add("index_only", + (s->cached_covering_key != MAX_KEY)); + } + } - /* TODO: Document the following if */ - if (best_cost == DBL_MAX || - tmp < - (best_key->is_for_hash_join() ? best_cost : - COST_ADD(best_cost,-best_filter_cmp_gain))) + if (tmp + COST_EPS < best_cost) { /* If the table has a range (s->quick is set) make_join_select() @@ -8556,12 +8750,14 @@ best_access_path(JOIN *join, best_filter= filter; /* range/index_merge/ALL/index access method are "independent", so: */ best_ref_depends_map= 0; - best_uses_jbuf= MY_TEST(!disable_jbuf && !((s->table->map & + best_uses_jbuf= MY_TEST(!disable_jbuf && !((table->map & join->outer_join))); spl_plan= 0; best_type= type; + trace_access_scan.add("chosen", true); } - trace_access_scan.add("chosen", best_key == NULL); + else + trace_access_scan.add("chosen", false); } else { @@ -8587,7 +8783,7 @@ best_access_path(JOIN *join, if (!best_key && idx == join->const_tables && - s->table == join->sort_by_table && + table == join->sort_by_table && join->unit->lim.get_select_limit() >= records) { trace_access_scan.add("use_tmp_table", true); @@ -9091,12 +9287,7 @@ optimize_straight_join(JOIN *join, table_map join_tables) /* compute the cost of the new plan extended with 's' */ record_count= COST_MULT(record_count, position->records_read); - const double filter_cmp_gain= position->range_rowid_filter_info - ? position->range_rowid_filter_info->get_cmp_gain(record_count) - : 0; - read_time+= COST_ADD(read_time - filter_cmp_gain, - COST_ADD(position->read_time, - record_count / TIME_FOR_COMPARE)); + read_time+= COST_ADD(read_time, position->read_time); advance_sj_state(join, join_tables, idx, &record_count, &read_time, &loose_scan_pos); @@ -9115,7 +9306,7 @@ optimize_straight_join(JOIN *join, table_map join_tables) memcpy((uchar*) join->best_positions, (uchar*) join->positions, sizeof(POSITION)*idx); join->join_record_count= record_count; - join->best_read= read_time - 0.001; + join->best_read= read_time; } @@ -9287,9 +9478,7 @@ greedy_search(JOIN *join, /* compute the cost of the new plan extended with 'best_table' */ record_count= COST_MULT(record_count, join->positions[idx].records_read); - read_time= COST_ADD(read_time, - COST_ADD(join->positions[idx].read_time, - record_count / TIME_FOR_COMPARE)); + read_time= COST_ADD(read_time, join->positions[idx].read_time); remaining_tables&= ~(best_table->table->map); --size_remain; @@ -9397,9 +9586,7 @@ void JOIN::get_partial_cost_and_fanout(int end_tab_idx, if (tab->records_read && (cur_table_map & filter_map)) { record_count= COST_MULT(record_count, tab->records_read); - read_time= COST_ADD(read_time, - COST_ADD(tab->read_time, - record_count / TIME_FOR_COMPARE)); + read_time= COST_ADD(read_time, tab->read_time); if (tab->emb_sj_nest) sj_inner_fanout= COST_MULT(sj_inner_fanout, tab->records_read); } @@ -9414,7 +9601,7 @@ void JOIN::get_partial_cost_and_fanout(int end_tab_idx, if (tab == end_tab) break; } - *read_time_arg= read_time;// + record_count / TIME_FOR_COMPARE; + *read_time_arg= read_time; *record_count_arg= record_count; } @@ -9443,9 +9630,8 @@ void JOIN::get_prefix_cost_and_fanout(uint n_tables, record_count= COST_MULT(record_count, best_positions[i].records_read); read_time= COST_ADD(read_time, best_positions[i].read_time); } - /* TODO: Take into account condition selectivities here */ } - *read_time_arg= read_time;// + record_count / TIME_FOR_COMPARE; + *read_time_arg= read_time; *record_count_arg= record_count; } @@ -9640,7 +9826,7 @@ double table_cond_selectivity(JOIN *join, uint idx, JOIN_TAB *s, Field *field; TABLE *table= s->table; MY_BITMAP *read_set= table->read_set; - double sel= s->table->cond_selectivity; + double sel= table->cond_selectivity; POSITION *pos= &join->positions[idx]; uint keyparts= 0; uint found_part_ref_or_null= 0; @@ -10044,7 +10230,6 @@ best_extension_by_limited_search(JOIN *join, { double current_record_count, current_read_time; double partial_join_cardinality; - double filter_cmp_gain; double pushdown_cond_selectivity; POSITION loose_scan_pos, *position= join->positions + idx; @@ -10061,14 +10246,7 @@ best_extension_by_limited_search(JOIN *join, /* Compute the cost of extending the plan with 's' */ current_record_count= COST_MULT(record_count, position->records_read); - filter_cmp_gain= position->range_rowid_filter_info ? - position->range_rowid_filter_info->get_cmp_gain(current_record_count) : - 0; - current_read_time=COST_ADD(read_time, - COST_ADD(position->read_time - - filter_cmp_gain, - current_record_count / - TIME_FOR_COMPARE)); + current_read_time= COST_ADD(read_time, position->read_time); if (unlikely(trace_one_table.trace_started())) { @@ -10080,7 +10258,7 @@ best_extension_by_limited_search(JOIN *join, ¤t_read_time, &loose_scan_pos); /* Expand only partial plans with lower cost than the best QEP so far */ - if (current_read_time >= join->best_read) + if (current_read_time + COST_EPS >= join->best_read) { DBUG_EXECUTE("opt", print_plan(join, idx+1, current_record_count, @@ -10187,7 +10365,7 @@ best_extension_by_limited_search(JOIN *join, memcpy((uchar*) join->best_positions, (uchar*) join->positions, sizeof(POSITION) * (idx + 1)); join->join_record_count= partial_join_cardinality; - join->best_read= current_read_time - 0.001; + join->best_read= current_read_time; } DBUG_EXECUTE("opt", print_plan(join, idx+1, current_record_count, @@ -12177,7 +12355,9 @@ make_join_select(JOIN *join,SQL_SELECT *select,COND *cond) } tab->quick=0; } - uint ref_key= sel->head? (uint) sel->head->reginfo.join_tab->ref.key+1 : 0; + uint ref_key= (sel->head ? + (uint) sel->head->reginfo.join_tab->ref.key+1 : + 0); if (i == join->const_tables && ref_key) { if (!tab->const_keys.is_clear_all() && @@ -12286,9 +12466,9 @@ make_join_select(JOIN *join,SQL_SELECT *select,COND *cond) (sel->quick_keys.is_clear_all() || (sel->quick && sel->quick->read_time > - tab->table->file->scan_time() + - tab->table->file->stats.records/TIME_FOR_COMPARE - ))) ? + tab->table->file-> + ha_scan_and_compare_time(tab->table->file-> + stats.records)))) ? 2 : 1; sel->read_tables= used_tables & ~current_map; sel->quick_keys.clear_all(); @@ -13773,7 +13953,10 @@ make_join_readinfo(JOIN *join, ulonglong options, uint no_jbuf_after) tab->index= table->s->primary_key; else #endif + { tab->index=find_shortest_key(table, & table->covering_keys); + DBUG_ASSERT(tab->index == tab->cached_covering_key); + } } tab->read_first_record= join_read_first; /* Read with index_first / index_next */ @@ -13999,7 +14182,7 @@ void JOIN_TAB::cleanup() end_read_record(&read_record); tmp->jtbm_subselect->cleanup(); /* - The above call freed the materializedd temptable. Set it to NULL so + The above call freed the materialized temptable. Set it to NULL so that we don't attempt to touch it if JOIN_TAB::cleanup() is invoked multiple times (it may be) */ @@ -14023,47 +14206,60 @@ void JOIN_TAB::cleanup() /** Estimate the time to get rows of the joined table - Note that this doesn't take into account of checking the WHERE clause - for all found rows (TIME_FOR_COMPARE) + Updates found_records, records, cached_scan_time, cached_covering_key, + read_time and cache_scan_and_compare_time */ -double JOIN_TAB::scan_time() +void JOIN_TAB::estimate_scan_time() { - double res; + double copy_cost= RECORD_COPY_COST; + + cached_covering_key= MAX_KEY; if (table->is_created()) { if (table->is_filled_at_execution()) { get_delayed_table_estimates(table, &records, &read_time, &startup_cost); - found_records= records; table->opt_range_condition_rows= records; + table->used_stat_records= records; } else { - found_records= records= table->stat_records(); - read_time= table->file->scan_time(); + records= table->stat_records(); /* table->opt_range_condition_rows has already been set to table->file->stats.records */ + DBUG_ASSERT(table->opt_range_condition_rows == records); + + if (!table->covering_keys.is_clear_all() && ! table->no_keyread) + { + cached_covering_key= find_shortest_key(table, &table->covering_keys); + read_time= table->file->ha_key_scan_time(cached_covering_key); + copy_cost= INDEX_COPY_COST; + } + else + read_time= table->file->ha_scan_and_copy_time(records); } - res= read_time; } else { - found_records= records=table->stat_records(); - read_time= found_records ? (double)found_records: 10.0;// TODO:fix this stub - res= read_time; + records= table->stat_records(); + DBUG_ASSERT(table->opt_range_condition_rows == records); + read_time= records ? (double) records: 10.0;// TODO:fix this stub } - return res; + found_records= records; + cached_scan_time= read_time; + cached_scan_and_compare_time= (read_time + records * + (copy_cost + 1/TIME_FOR_COMPARE)); } /** - Estimate the number of rows that a an access method will read from a table. + Estimate the number of rows that an access method will read from a table. - @todo: why not use JOIN_TAB::found_records + @todo: why not use JOIN_TAB::found_records or JOIN_TAB::records_read */ ha_rows JOIN_TAB::get_examined_rows() @@ -15966,7 +16162,7 @@ static COND *build_equal_items(JOIN *join, COND *cond, table->on_expr= build_equal_items(join, table->on_expr, inherited, nested_join_list, ignore_on_conds, &table->cond_equal); - if (unlikely(join->thd->trace_started())) + if (unlikely(thd->trace_started())) { const char *table_name; if (table->nested_join) @@ -17558,7 +17754,6 @@ void optimize_wo_join_buffering(JOIN *join, uint first_tab, uint last_tab, reopt_remaining_tables &= ~rs->table->map; rec_count= COST_MULT(rec_count, pos.records_read); cost= COST_ADD(cost, pos.read_time); - cost= COST_ADD(cost, rec_count / TIME_FOR_COMPARE); //TODO: take into account join condition selectivity here double pushdown_cond_selectivity= 1.0; table_map real_table_bit= rs->table->map; @@ -21704,15 +21899,7 @@ join_read_const_table(THD *thd, JOIN_TAB *tab, POSITION *pos) } else { - if (/*!table->file->key_read && */ - table->covering_keys.is_set(tab->ref.key) && !table->no_keyread && - (int) table->reginfo.lock_type <= (int) TL_READ_HIGH_PRIORITY) - { - table->file->ha_start_keyread(tab->ref.key); - tab->index= tab->ref.key; - } error=join_read_const(tab); - table->file->ha_end_keyread(); if (unlikely(error)) { tab->info= ET_UNIQUE_ROW_NOT_FOUND; @@ -21833,10 +22020,20 @@ join_read_const(JOIN_TAB *tab) error=HA_ERR_KEY_NOT_FOUND; else { - error= table->file->ha_index_read_idx_map(table->record[0],tab->ref.key, - (uchar*) tab->ref.key_buff, - make_prev_keypart_map(tab->ref.key_parts), - HA_READ_KEY_EXACT); + handler *file= table->file; + if (table->covering_keys.is_set(tab->ref.key) && !table->no_keyread && + (int) table->reginfo.lock_type <= (int) TL_READ_HIGH_PRIORITY) + { + file->ha_start_keyread(tab->ref.key); + /* This is probably needed for analyze table */ + tab->index= tab->ref.key; + } + error= file-> + ha_index_read_idx_map(table->record[0],tab->ref.key, + (uchar*) tab->ref.key_buff, + make_prev_keypart_map(tab->ref.key_parts), + HA_READ_KEY_EXACT); + file->ha_end_keyread(); } if (unlikely(error)) { @@ -23684,7 +23881,7 @@ uint find_shortest_key(TABLE *table, const key_map *usable_keys) { if (usable_keys->is_set(nr)) { - double cost= table->file->keyread_time(nr, 1, table->file->records()); + double cost= table->file->ha_key_scan_time(nr); if (cost < min_cost) { min_cost= cost; @@ -27164,7 +27361,7 @@ bool JOIN_TAB::save_explain_data(Explain_table_access *eta, my_bool key_read; char table_name_buffer[SAFE_NAME_LEN]; KEY *key_info= 0; - uint key_len= 0; + uint key_len= 0, used_index= MAX_KEY; #ifdef NOT_YET /* @@ -27316,11 +27513,13 @@ bool JOIN_TAB::save_explain_data(Explain_table_access *eta, if (tab_type == JT_NEXT) { + used_index= index; key_info= table->key_info+index; key_len= key_info->key_length; } else if (ref.key_parts) { + used_index= ref.key; key_info= get_keyinfo_by_key_no(ref.key); key_len= ref.key_length; } @@ -27370,6 +27569,7 @@ bool JOIN_TAB::save_explain_data(Explain_table_access *eta, if (tab_type == JT_HASH_NEXT) /* full index scan + hash join */ { + used_index= index; eta->hash_next_key.set(thd->mem_root, & table->key_info[index], table->key_info[index].key_length); @@ -27430,10 +27630,12 @@ bool JOIN_TAB::save_explain_data(Explain_table_access *eta, if (examined_rows) { double pushdown_cond_selectivity= cond_selectivity; - if (pushdown_cond_selectivity == 1.0) - f= (float) (100.0 * records_read / examined_rows); - else + if (pushdown_cond_selectivity != 1.0) f= (float) (100.0 * pushdown_cond_selectivity); + else if (range_rowid_filter_info) + f= (float) (100.0 * range_rowid_filter_info->selectivity); + else + f= (float) (100.0 * records_read / examined_rows); } set_if_smaller(f, 100.0); eta->filtered_set= true; @@ -27442,8 +27644,8 @@ bool JOIN_TAB::save_explain_data(Explain_table_access *eta, /* Build "Extra" field and save it */ key_read= table->file->keyread_enabled(); - if ((tab_type == JT_NEXT || tab_type == JT_CONST) && - table->covering_keys.is_set(index)) + if ((tab_type == JT_NEXT || tab_type == JT_CONST) && used_index != MAX_KEY && + table->covering_keys.is_set(used_index)) key_read=1; if (quick_type == QUICK_SELECT_I::QS_TYPE_ROR_INTERSECT && !((QUICK_ROR_INTERSECT_SELECT*)cur_quick)->need_to_fetch_row) @@ -28875,22 +29077,23 @@ void JOIN::cache_const_exprs() @param read_time OUT Cost of reading using quick or ref(const) access. - @return + @return true There was a possible quick or ref access, its cost is in the OUT parameters. - false No quick or ref(const) possible (and so, the caller will attempt + false No quick or ref(const) possible (and so, the caller will attempt to use a full index scan on this index). */ -static bool get_range_limit_read_cost(const JOIN_TAB *tab, - const TABLE *table, +static bool get_range_limit_read_cost(const JOIN_TAB *tab, + const TABLE *table, ha_rows table_records, uint keynr, ha_rows rows_limit, - double *read_time) + double *read_time, + double *read_rows) { bool res= false; - /* + /* We need to adjust the estimates if we had a quick select (or ref(const)) on index keynr. */ @@ -28901,10 +29104,10 @@ static bool get_range_limit_read_cost(const JOIN_TAB *tab, full index scan/cost. */ double best_rows= (double) table->opt_range[keynr].rows; - double best_cost= (double) table->opt_range[keynr].cost; - + double best_cost= (double) table->opt_range[keynr].fetch_cost; + /* - Check if ref(const) access was possible on this index. + Check if ref(const) access was possible on this index. */ if (tab) { @@ -28916,13 +29119,13 @@ static bool get_range_limit_read_cost(const JOIN_TAB *tab, if (!(table->const_key_parts[keynr] & map)) break; } - + if (kp > 0) { ha_rows ref_rows; /* Two possible cases: - 1. ref(const) uses the same #key parts as range access. + 1. ref(const) uses the same #key parts as range access. 2. ref(const) uses fewer key parts, becasue there is a range_cond(key_part+1). */ @@ -28933,12 +29136,13 @@ static bool get_range_limit_read_cost(const JOIN_TAB *tab, if (ref_rows > 0) { - double tmp= cost_for_index_read(tab->join->thd, table, keynr, - ref_rows, - (ha_rows) tab->worst_seeks); - if (tmp < best_cost) + INDEX_READ_COST cost= cost_for_index_read(tab->join->thd, table, + keynr, + ref_rows, + (ha_rows) tab->worst_seeks); + if (cost.read_cost < best_cost) { - best_cost= tmp; + best_cost= cost.read_cost; best_rows= (double)ref_rows; } } @@ -28974,13 +29178,15 @@ static bool get_range_limit_read_cost(const JOIN_TAB *tab, /* LIMIT clause specifies that we will need to read fewer records than quick select will return. Assume that quick select's cost is - proportional to the number of records we need to return (e.g. if we + proportional to the number of records we need to return (e.g. if we only need 1/3rd of records, it will cost us 1/3rd of quick select's read time) */ best_cost *= rows_limit_for_quick / best_rows; + best_rows = rows_limit_for_quick; } - *read_time= best_cost; + *read_time= best_cost + best_rows/TIME_FOR_COMPARE; + *read_rows= best_rows; res= true; } return res; @@ -28988,7 +29194,7 @@ static bool get_range_limit_read_cost(const JOIN_TAB *tab, /** - Find a cheaper access key than a given @a key + Find a cheaper access key than a given key @param tab NULL or JOIN_TAB of the accessed table @param order Linked list of ORDER BY arguments @@ -29092,13 +29298,12 @@ test_if_cheaper_ordering(const JOIN_TAB *tab, ORDER *order, TABLE *table, } } else - read_time= table->file->scan_time(); // TODO: Add TIME_FOR_COMPARE - + read_time= table->file->ha_scan_and_compare_time(table_records); + trace_cheaper_ordering.add("fanout", fanout); /* TODO: add cost of sorting here. */ - read_time += COST_EPS; trace_cheaper_ordering.add("read_time", read_time); /* Calculate the selectivity of the ref_key for REF_ACCESS. For @@ -29284,6 +29489,17 @@ test_if_cheaper_ordering(const JOIN_TAB *tab, ORDER *order, TABLE *table, possible_key.add("updated_limit", select_limit); rec_per_key= keyinfo->actual_rec_per_key(keyinfo->user_defined_key_parts-1); set_if_bigger(rec_per_key, 1); +#ifndef OLD_CODE + { + INDEX_READ_COST cost= cost_for_index_read(table->in_use, table, nr, + select_limit, + tab ? + (ha_rows) tab->worst_seeks : + HA_ROWS_MAX); + index_scan_time= (cost.read_cost + + select_limit / TIME_FOR_COMPARE); + } +#else /* Here we take into account the fact that rows are accessed in sequences rec_per_key records in each. @@ -29291,28 +29507,21 @@ test_if_cheaper_ordering(const JOIN_TAB *tab, ORDER *order, TABLE *table, by rowid/primary key. When reading the data in a sequence we'll touch not more pages than the table file contains. - TODO. Use the formula for a disk sweep sequential access - to calculate the cost of accessing data rows for one - index entry. */ -#ifdef NEED_TESTING - index_scan_time= (cost_for_index_read(table->in_use, table, nr, - select_limit, - (ha_rows) tab->worst_seeks) + - select_limit / TIME_FOR_COMPARE); -#else index_scan_time= (select_limit/rec_per_key * - MY_MIN(rec_per_key, table->file->scan_time())); + MY_MIN(rec_per_key, table->file->ha_scan_time())); #endif - double range_scan_time; + possible_key.add("index_scan_cost", index_scan_time); + double range_scan_time, range_rows; if (get_range_limit_read_cost(tab, table, table_records, nr, - select_limit, &range_scan_time)) + select_limit, + &range_scan_time, + &range_rows)) { - possible_key.add("range_scan_time", range_scan_time); + possible_key.add("range_scan_cost", range_scan_time); if (range_scan_time < index_scan_time) index_scan_time= range_scan_time; } - possible_key.add("index_scan_time", index_scan_time); if ((ref_key < 0 && (group || table->force_index || is_covering)) || index_scan_time < read_time) @@ -29342,7 +29551,7 @@ test_if_cheaper_ordering(const JOIN_TAB *tab, ORDER *order, TABLE *table, } if (table->opt_range_keys.is_set(nr)) quick_records= table->opt_range[nr].rows; - possible_key.add("records", quick_records); + possible_key.add("rows", quick_records); if (best_key < 0 || (select_limit <= MY_MIN(quick_records,best_records) ? keyinfo->user_defined_key_parts < best_key_parts : @@ -29375,21 +29584,21 @@ test_if_cheaper_ordering(const JOIN_TAB *tab, ORDER *order, TABLE *table, possible_key.add("cause", cause); } } - else + else if (unlikely(possible_key.trace_started())) { possible_key. add("usable", false). add("cause", "cost"); } } - else + else if (unlikely(possible_key.trace_started())) { possible_key.add("usable", false); if (!group && select_limit == HA_POS_ERROR) possible_key.add("cause", "order by without limit"); } } - else + else if (unlikely(possible_key.trace_started())) { if (keys.is_set(nr)) { diff --git a/sql/sql_select.h b/sql/sql_select.h index d4e06f42249..3d75aac8ff9 100644 --- a/sql/sql_select.h +++ b/sql/sql_select.h @@ -309,11 +309,6 @@ typedef struct st_join_table { Table_access_tracker *tracker; Table_access_tracker *jbuf_tracker; - /* - Bitmap of TAB_INFO_* bits that encodes special line for EXPLAIN 'Extra' - column, or 0 if there is no info. - */ - uint packed_info; // READ_RECORD::Setup_func materialize_table; READ_RECORD::Setup_func read_first_record; @@ -357,8 +352,17 @@ typedef struct st_join_table { double partial_join_cardinality; + /* set by estimate_scan_time() */ + double cached_scan_time; + double cached_scan_and_compare_time; + table_map dependent,key_dependent; /* + Bitmap of TAB_INFO_* bits that encodes special line for EXPLAIN 'Extra' + column, or 0 if there is no info. + */ + uint packed_info; + /* 1 - use quick select 2 - use "Range checked for each record" */ @@ -370,6 +374,7 @@ typedef struct st_join_table { uint index; uint status; ///< Save status for cache uint used_fields; + uint cached_covering_key; /* Set by estimate_scan_time() */ ulong used_fieldlength; ulong max_used_fieldlength; uint used_blobs; @@ -637,7 +642,7 @@ typedef struct st_join_table { { return (is_hash_join_key_no(key) ? hj_key : table->key_info+key); } - double scan_time(); + void estimate_scan_time(); ha_rows get_examined_rows(); bool preread_init(); @@ -937,7 +942,7 @@ public: /* Cost accessing the table in course of the entire complete join execution, i.e. cost of one access method use (e.g. 'range' or 'ref' scan ) times - number the access method will be invoked. + number the access method will be invoked and checking the WHERE clause. */ double read_time; @@ -2393,12 +2398,20 @@ bool instantiate_tmp_table(TABLE *table, KEY *keyinfo, bool open_tmp_table(TABLE *table); double prev_record_reads(const POSITION *positions, uint idx, table_map found_ref); void fix_list_after_tbl_changes(SELECT_LEX *new_parent, List<TABLE_LIST> *tlist); -double get_tmp_table_lookup_cost(THD *thd, double row_count, uint row_size); -double get_tmp_table_write_cost(THD *thd, double row_count, uint row_size); void optimize_keyuse(JOIN *join, DYNAMIC_ARRAY *keyuse_array); bool sort_and_filter_keyuse(THD *thd, DYNAMIC_ARRAY *keyuse, bool skip_unprefixed_keyparts); +struct TMPTABLE_COSTS +{ + double create; + double lookup; + double write; +}; + +TMPTABLE_COSTS get_tmp_table_costs(THD *thd, double row_count, uint row_size, + bool blobs_used); + struct st_cond_statistic { Item *cond; diff --git a/sql/sys_vars.cc b/sql/sys_vars.cc index e18ca6392d8..1b7cba81223 100644 --- a/sql/sys_vars.cc +++ b/sql/sys_vars.cc @@ -6764,20 +6764,6 @@ static Sys_var_mybool Sys_session_track_user_variables( #endif //EMBEDDED_LIBRARY -static Sys_var_uint Sys_in_subquery_conversion_threshold( - "in_predicate_conversion_threshold", - "The minimum number of scalar elements in the value list of " - "IN predicate that triggers its conversion to IN subquery. Set to " - "0 to disable the conversion.", - SESSION_VAR(in_subquery_conversion_threshold), CMD_LINE(REQUIRED_ARG), - VALID_RANGE(0, UINT_MAX), DEFAULT(IN_SUBQUERY_CONVERSION_THRESHOLD), BLOCK_SIZE(1)); - -static Sys_var_ulong Sys_optimizer_max_sel_arg_weight( - "optimizer_max_sel_arg_weight", - "The maximum weight of the SEL_ARG graph. Set to 0 for no limit", - SESSION_VAR(optimizer_max_sel_arg_weight), CMD_LINE(REQUIRED_ARG), - VALID_RANGE(0, ULONG_MAX), DEFAULT(SEL_ARG::MAX_WEIGHT), BLOCK_SIZE(1)); - static Sys_var_enum Sys_secure_timestamp( "secure_timestamp", "Restricts direct setting of a session " "timestamp. Possible levels are: YES - timestamp cannot deviate from " @@ -6794,3 +6780,34 @@ static Sys_var_ulonglong Sys_max_rowid_filter_size( SESSION_VAR(max_rowid_filter_size), CMD_LINE(REQUIRED_ARG), VALID_RANGE(1024, (ulonglong)~(intptr)0), DEFAULT(128*1024), BLOCK_SIZE(1)); + + +/* Optimizer variables */ + +static Sys_var_uint Sys_in_subquery_conversion_threshold( + "in_predicate_conversion_threshold", + "The minimum number of scalar elements in the value list of " + "IN predicate that triggers its conversion to IN subquery. Set to " + "0 to disable the conversion.", + SESSION_VAR(in_subquery_conversion_threshold), CMD_LINE(REQUIRED_ARG), + VALID_RANGE(0, UINT_MAX), DEFAULT(IN_SUBQUERY_CONVERSION_THRESHOLD), BLOCK_SIZE(1)); + +static Sys_var_ulong Sys_optimizer_max_sel_arg_weight( + "optimizer_max_sel_arg_weight", + "The maximum weight of the SEL_ARG graph. Set to 0 for no limit", + SESSION_VAR(optimizer_max_sel_arg_weight), CMD_LINE(REQUIRED_ARG), + VALID_RANGE(0, ULONG_MAX), DEFAULT(SEL_ARG::MAX_WEIGHT), BLOCK_SIZE(1)); + +/* + We don't allow 100 for optimizer_cache_cost as there is always a small + cost of finding the key, on cached pages, that we have to take into account. +*/ + +static Sys_var_uint Sys_optimizer_cache_cost( + "optimizer_cache_hit_ratio", + "Expected hit rate of the row and index cache in storage engines. " + "The value should be an integer between 0 and 99, where 0 means cache is " + "empty and 99 means that value is almost always in the cache", + SESSION_VAR(optimizer_cache_hit_ratio), CMD_LINE(REQUIRED_ARG), + VALID_RANGE(0, 99), DEFAULT(CACHE_HIT_RATIO), 1, NO_MUTEX_GUARD, + NOT_IN_BINLOG); diff --git a/sql/table.cc b/sql/table.cc index b1a7b6bfe2b..b0e8b11a543 100644 --- a/sql/table.cc +++ b/sql/table.cc @@ -5554,6 +5554,12 @@ void TABLE::init(THD *thd, TABLE_LIST *tl) opt_range_condition_rows=0; no_cache= false; initialize_opt_range_structures(); + /* + Update optimizer_cache_cost to ensure that a SET STATEMENT of + the variable it will work. + */ + file->set_optimizer_cache_cost((100 - thd->variables. + optimizer_cache_hit_ratio)/100.0); #ifdef HAVE_REPLICATION /* used in RBR Triggers */ master_had_triggers= 0; diff --git a/sql/table.h b/sql/table.h index 0caea757eb6..284c4b3073f 100644 --- a/sql/table.h +++ b/sql/table.h @@ -1356,16 +1356,38 @@ public: uint key_parts; uint ranges; ha_rows rows; - /* Cost of fetching and comparing the row aginst the WHERE clause */ + /* + The full cost of a using 'range'. Includes fetching the rows + trough keys, copying them and comparing the rows aginst the + WHERE clause. + */ double cost; - /* Cost of comparing row with WHERE clause. Included in 'cost' */ + /* + Cost of finding finding the key and fetching the row with row id. + In case of clustered keys or covered keys the fetch of the row is + not counted for. + */ + double find_cost; + /* find_cost + cost of copying the rows to record */ double fetch_cost; /* - If there is a range access by i-th index then the cost of - index only access for it is stored in index_only_costs[i] + Cost of fetching the keys, not including copying the keys to + record or comparing them with the WHERE clause. Used only when + working with filters. */ double index_only_cost; + /* Selectivity, in case of filters */ + double selectivity; bool first_key_part_has_only_one_value; + + /* + Cost of fetching a keys with index only read and returning them to the + sql level. + */ + double index_only_fetch_cost() + { + return index_only_cost + (double) rows * INDEX_COPY_COST; + } } *opt_range; /* Bitmaps of key parts that =const for the duration of join execution. If @@ -1712,8 +1734,9 @@ public: Range_rowid_filter_cost_info * best_range_rowid_filter_for_partial_join(uint access_key_no, double records, - double access_cost_factor); - + double fetch_cost, + double index_only_cost, + double prev_records); /** System Versioning support */ @@ -1766,18 +1789,23 @@ public: DBUG_ASSERT(s->period.name); return field[s->period.end_fieldno]; } - void set_cond_selectivity(double selectivity) + inline void set_cond_selectivity(double selectivity) { DBUG_ASSERT(selectivity >= 0.0 and selectivity <= 1.0); cond_selectivity= selectivity; DBUG_PRINT("info", ("cond_selectivity: %g", cond_selectivity)); } - void multiply_cond_selectivity(double selectivity) + inline void multiply_cond_selectivity(double selectivity) { DBUG_ASSERT(selectivity >= 0.0 and selectivity <= 1.0); cond_selectivity*= selectivity; DBUG_PRINT("info", ("cond_selectivity: %g", cond_selectivity)); } + inline void set_opt_range_condition_rows(ha_rows rows) + { + if (opt_range_condition_rows > rows) + opt_range_condition_rows= rows; + } ulonglong vers_start_id() const; ulonglong vers_end_id() const; diff --git a/storage/connect/mysql-test/connect/r/mysql_index.result b/storage/connect/mysql-test/connect/r/mysql_index.result index 54acc7be08d..b6c34add632 100644 --- a/storage/connect/mysql-test/connect/r/mysql_index.result +++ b/storage/connect/mysql-test/connect/r/mysql_index.result @@ -7,7 +7,7 @@ msg char(100) DEFAULT NULL, PRIMARY KEY (id) ) ENGINE=MyISAM DEFAULT CHARSET=latin1; INSERT INTO t1 VALUES(1,'Un'),(3,'Trois'),(5,'Cinq'); -INSERT INTO t1 VALUES(2,'Two'),(4,'Four'),(6,'Six'); +INSERT INTO t1 VALUES(2,'Two'),(4,'Four'),(6,'Six'), (7,'seven'); SELECT * FROM t1; id msg 1 Un @@ -16,6 +16,7 @@ id msg 2 Two 4 Four 6 Six +7 seven # # Make local MYSQL table with indexed id column # @@ -35,6 +36,7 @@ id msg 2 Two 4 Four 6 Six +7 seven SELECT * FROM t2 WHERE id = 3; id msg 3 Trois @@ -49,12 +51,14 @@ SELECT * FROM t2 WHERE id > 4; id msg 5 Cinq 6 Six +7 seven SELECT * FROM t2 WHERE id >= 3; id msg 3 Trois 4 Four 5 Cinq 6 Six +7 seven SELECT * FROM t2 WHERE id < 3; id msg 1 Un @@ -64,6 +68,10 @@ id msg 1 Un 5 Cinq 6 Six +7 seven +explain SELECT * FROM t2 WHERE id <= 3; +id select_type table type possible_keys key key_len ref rows Extra +1 SIMPLE t2 range PRIMARY PRIMARY 4 NULL 2 Using where SELECT * FROM t2 WHERE id <= 3; id msg 1 Un @@ -87,6 +95,7 @@ id msg 4 Four 5 Cinq 6 Six +7 seven UPDATE t2 SET msg = 'Five' WHERE id = 5; Warnings: Note 1105 t1: 1 affected rows @@ -98,6 +107,7 @@ id msg 2 Two 4 Four 6 Six +7 seven DELETE FROM t2 WHERE id = 4; Warnings: Note 1105 t1: 1 affected rows @@ -108,6 +118,7 @@ id msg 5 Five 2 Two 6 Six +7 seven DROP TABLE t2; DROP TABLE t1; # diff --git a/storage/connect/mysql-test/connect/t/mysql_index.test b/storage/connect/mysql-test/connect/t/mysql_index.test index cb4a332cdf8..a70ea3fd6f9 100644 --- a/storage/connect/mysql-test/connect/t/mysql_index.test +++ b/storage/connect/mysql-test/connect/t/mysql_index.test @@ -30,7 +30,7 @@ CREATE TABLE t1 ( PRIMARY KEY (id) ) ENGINE=MyISAM DEFAULT CHARSET=latin1; INSERT INTO t1 VALUES(1,'Un'),(3,'Trois'),(5,'Cinq'); -INSERT INTO t1 VALUES(2,'Two'),(4,'Four'),(6,'Six'); +INSERT INTO t1 VALUES(2,'Two'),(4,'Four'),(6,'Six'), (7,'seven'); SELECT * FROM t1; --echo # @@ -54,6 +54,7 @@ SELECT * FROM t2 WHERE id > 4; SELECT * FROM t2 WHERE id >= 3; SELECT * FROM t2 WHERE id < 3; SELECT * FROM t2 WHERE id < 2 OR id > 4; +explain SELECT * FROM t2 WHERE id <= 3; SELECT * FROM t2 WHERE id <= 3; SELECT * FROM t2 WHERE id BETWEEN 3 AND 5; SELECT * FROM t2 WHERE id > 2 AND id < 6; diff --git a/storage/federated/ha_federated.cc b/storage/federated/ha_federated.cc index faaffa21f6b..76708e80105 100644 --- a/storage/federated/ha_federated.cc +++ b/storage/federated/ha_federated.cc @@ -905,10 +905,18 @@ ha_federated::ha_federated(handlerton *hton, :handler(hton, table_arg), mysql(0), stored_result(0) { + optimizer_cache_cost= 1; trx_next= 0; bzero(&bulk_insert, sizeof(bulk_insert)); } +/* + Federated doesn't need optimizer_cache_cost as everything is one a + remote server and nothing is cached locally +*/ + +void ha_federated::set_optimizer_cache_cost(double cost) +{} /* Convert MySQL result set row to handler internal format @@ -2879,11 +2887,11 @@ int ha_federated::info(uint flag) &error); /* - size of IO operations (This is based on a good guess, no high science - involved) + Size of IO operations. This is used to calculate time to scan a table. + See handler.cc::keyread_time */ if (flag & HA_STATUS_CONST) - stats.block_size= 4096; + stats.block_size= 1500; // Typical size of an TCP packet } diff --git a/storage/federated/ha_federated.h b/storage/federated/ha_federated.h index 0c6285f3ac6..39b78533124 100644 --- a/storage/federated/ha_federated.h +++ b/storage/federated/ha_federated.h @@ -180,22 +180,20 @@ public: The reason for "records * 1000" is that such a large number forces this to use indexes " */ - double scan_time() + virtual double scan_time() { DBUG_PRINT("info", ("records %lu", (ulong) stats.records)); return (double)(stats.records*1000); } - /* - The next method will never be called if you do not implement indexes. - */ - double read_time(uint index, uint ranges, ha_rows rows) + virtual double read_time(uint index, uint ranges, ha_rows rows) + { + return rows2double(rows) + rows2double(ranges); + } + virtual double read_with_rowid(ha_rows rows) { - /* - Per Brian, this number is bugus, but this method must be implemented, - and at a later date, he intends to document this issue for handler code - */ - return (double) rows / 20.0+1; + return rows2double(rows); } + virtual void set_optimizer_cache_cost(double cost); const key_map *keys_to_use_for_scanning() { return &key_map_full; } /* diff --git a/storage/federatedx/ha_federatedx.cc b/storage/federatedx/ha_federatedx.cc index 99513d70950..a6979718124 100644 --- a/storage/federatedx/ha_federatedx.cc +++ b/storage/federatedx/ha_federatedx.cc @@ -841,9 +841,17 @@ ha_federatedx::ha_federatedx(handlerton *hton, :handler(hton, table_arg), txn(0), io(0), stored_result(0) { + optimizer_cache_cost= 1; bzero(&bulk_insert, sizeof(bulk_insert)); } +/* + Federated doesn't need optimizer_cache_cost as everything is one a remote server and + nothing is cached locally +*/ + +void ha_federatedx::set_optimizer_cache_cost(double cost) +{} /* Convert MySQL result set row to handler internal format @@ -3106,11 +3114,11 @@ int ha_federatedx::info(uint flag) if (flag & (HA_STATUS_VARIABLE | HA_STATUS_CONST)) { /* - size of IO operations (This is based on a good guess, no high science - involved) + Size of IO operations. This is used to calculate time to scan a table. + See handler.cc::keyread_time */ if (flag & HA_STATUS_CONST) - stats.block_size= 4096; + stats.block_size= 1500; // Typical size of an TCP packet if ((*iop)->table_metadata(&stats, share->table_name, (uint)share->table_name_length, flag)) diff --git a/storage/federatedx/ha_federatedx.h b/storage/federatedx/ha_federatedx.h index 377af888d79..e1070111585 100644 --- a/storage/federatedx/ha_federatedx.h +++ b/storage/federatedx/ha_federatedx.h @@ -222,7 +222,6 @@ public: virtual int seek_position(FEDERATEDX_IO_RESULT **io_result, const void *ref)=0; virtual void set_thd(void *thd) { } - }; @@ -374,21 +373,19 @@ public: DBUG_PRINT("info", ("records %lu", (ulong) stats.records)); return (double)(stats.records*1000); } - /* - The next method will never be called if you do not implement indexes. - */ double read_time(uint index, uint ranges, ha_rows rows) { - /* - Per Brian, this number is bugus, but this method must be implemented, - and at a later date, he intends to document this issue for handler code - */ - return (double) rows / 20.0+1; + return rows2double(rows) + rows2double(ranges); + } + virtual double read_with_rowid(ha_rows rows) + { + return rows2double(rows); } + virtual void set_optimizer_cache_cost(double cost); const key_map *keys_to_use_for_scanning() { return &key_map_full; } /* - Everything below are methods that we implment in ha_federatedx.cc. + Everything below are methods that we implement in ha_federatedx.cc. Most of these methods are not obligatory, skip them and MySQL will treat them as not implemented diff --git a/storage/heap/ha_heap.cc b/storage/heap/ha_heap.cc index 5f7f0c1efa0..f9b365cf91e 100644 --- a/storage/heap/ha_heap.cc +++ b/storage/heap/ha_heap.cc @@ -73,7 +73,9 @@ static handler *heap_create_handler(handlerton *hton, ha_heap::ha_heap(handlerton *hton, TABLE_SHARE *table_arg) :handler(hton, table_arg), file(0), records_changed(0), key_stat_version(0), internal_table(0) -{} +{ + optimizer_cache_cost= 1.0; +} /* Hash index statistics is updated (copied from HP_KEYDEF::hash_buckets to diff --git a/storage/heap/ha_heap.h b/storage/heap/ha_heap.h index 3a41028c719..fec60ec2dec 100644 --- a/storage/heap/ha_heap.h +++ b/storage/heap/ha_heap.h @@ -68,8 +68,21 @@ public: { return (double) (rows +1)/ 20.0; } double keyread_time(uint index, uint ranges, ha_rows rows) { return (double) (rows + ranges) / 20.0 ; } + double read_with_rowid(ha_rows rows) + { + return (double) rows/ 20.0; + } double avg_io_cost() { return 0.05; } /* 1/20 */ + + /* + Heap doesn't need optimizer_cache_cost as everything is in memory and + it supports all needed _time() functions + */ + void set_optimizer_cache_cost(double cost) + { + optimizer_cache_cost= 1.0; + } int open(const char *name, int mode, uint test_if_locked); int close(void); void set_keys_for_scanning(void); diff --git a/storage/innobase/handler/ha_innodb.cc b/storage/innobase/handler/ha_innodb.cc index 85a4ce90d90..6216d48e4e9 100644 --- a/storage/innobase/handler/ha_innodb.cc +++ b/storage/innobase/handler/ha_innodb.cc @@ -14371,6 +14371,28 @@ ha_innobase::read_time( return(ranges + (double) rows / (double) total_rows * time_for_scan); } +/******************************************************************//** +Calculate the time it takes to read a set of rows with primary key. +*/ + +double +ha_innobase::read_with_rowid(ha_rows rows) +{ + ha_rows total_rows; + + /* Assume that the read time is proportional to the scan time for all + rows + at most one seek per range. */ + + double time_for_scan = scan_time(); + + if ((total_rows = estimate_rows_upper_bound()) < rows) { + + return(time_for_scan); + } + + return((double) rows + (double) rows / (double) total_rows * time_for_scan); +} + /*********************************************************************//** Calculates the key number used inside MySQL for an Innobase index. @return the key number used inside MySQL */ diff --git a/storage/innobase/handler/ha_innodb.h b/storage/innobase/handler/ha_innodb.h index 4185f7a68cd..cd1ee7dd0c7 100644 --- a/storage/innobase/handler/ha_innodb.h +++ b/storage/innobase/handler/ha_innodb.h @@ -109,6 +109,8 @@ public: double read_time(uint index, uint ranges, ha_rows rows) override; + double read_with_rowid(ha_rows rows) override; + int delete_all_rows() override; int write_row(const uchar * buf) override; diff --git a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_index_not_equal.result b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_index_not_equal.result index a1a123e7d5f..199edf9d758 100644 --- a/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_index_not_equal.result +++ b/storage/mroonga/mysql-test/mroonga/storage/r/optimization_count_skip_index_not_equal.result @@ -14,5 +14,5 @@ COUNT(*) 2 SHOW STATUS LIKE 'mroonga_count_skip'; Variable_name Value -Mroonga_count_skip 2 +Mroonga_count_skip 0 DROP TABLE users; diff --git a/storage/spider/mysql-test/spider/r/partition_mrr.result b/storage/spider/mysql-test/spider/r/partition_mrr.result index c7e17698421..215839e1b2d 100644 --- a/storage/spider/mysql-test/spider/r/partition_mrr.result +++ b/storage/spider/mysql-test/spider/r/partition_mrr.result @@ -74,41 +74,43 @@ TRUNCATE TABLE mysql.general_log; connection master_1; SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey; pkey -4 -5 +0 +1 10 11 +12 +13 +14 +15 16 17 +18 +19 +2 +20 +21 22 23 +24 +25 +26 +27 28 29 -0 -1 +3 +4 +5 6 7 -12 -13 -18 -19 -24 -25 -2 -3 8 9 -14 -15 -20 -21 -26 -27 connection child2_1; SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; argument select `pkey` from `auto_test_remote`.`tbl_a` order by `pkey` -select a.id,b.`pkey` from auto_test_remote.tmp_spider_bka_xxxx a,`auto_test_remote`.`tbl_b` b where a.c0 <=> b.`pkey` +select `pkey` from `auto_test_remote`.`tbl_b` order by `pkey` +select `pkey` from `auto_test_remote`.`tbl_b` order by `pkey` +select `pkey` from `auto_test_remote`.`tbl_b` order by `pkey` SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %' SELECT pkey FROM tbl_a ORDER BY pkey ; SELECT pkey FROM tbl_b ORDER BY pkey; @@ -138,7 +140,9 @@ connection child2_2; SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; argument select `pkey` from `auto_test_remote2`.`tbl_a` order by `pkey` -select a.id,b.`pkey` from auto_test_remote2.tmp_spider_bka_xxxx a,`auto_test_remote2`.`tbl_b` b where a.c0 <=> b.`pkey` +select `pkey` from `auto_test_remote2`.`tbl_b` order by `pkey` +select `pkey` from `auto_test_remote2`.`tbl_b` order by `pkey` +select `pkey` from `auto_test_remote2`.`tbl_b` order by `pkey` SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %' SELECT pkey FROM tbl_a ORDER BY pkey ; SELECT pkey FROM tbl_b ORDER BY pkey; @@ -168,7 +172,9 @@ connection child2_3; SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %'; argument select `pkey` from `auto_test_remote3`.`tbl_a` order by `pkey` -select a.id,b.`pkey` from auto_test_remote3.tmp_spider_bka_xxxx a,`auto_test_remote3`.`tbl_b` b where a.c0 <=> b.`pkey` +select `pkey` from `auto_test_remote3`.`tbl_b` order by `pkey` +select `pkey` from `auto_test_remote3`.`tbl_b` order by `pkey` +select `pkey` from `auto_test_remote3`.`tbl_b` order by `pkey` SELECT argument FROM mysql.general_log WHERE command_type != 'Execute' AND argument LIKE '%select %' SELECT pkey FROM tbl_a ORDER BY pkey ; SELECT pkey FROM tbl_b ORDER BY pkey; diff --git a/storage/spider/mysql-test/spider/t/partition_mrr.test b/storage/spider/mysql-test/spider/t/partition_mrr.test index 2816d65cadb..36cf811fa79 100644 --- a/storage/spider/mysql-test/spider/t/partition_mrr.test +++ b/storage/spider/mysql-test/spider/t/partition_mrr.test @@ -168,6 +168,7 @@ if ($USE_CHILD_GROUP2) } } --connection master_1 +--sorted_result SELECT a.pkey FROM tbl_a a, tbl_b b WHERE a.pkey = b.pkey; if ($USE_CHILD_GROUP2) { |