3966 Vasil Dimov 2012-06-07
Followup to WL#6189 Turn InnoDB persistent statistics ON by default
Adjust mtr tests, part 28.
Persistent stats use a different sampling algorithm so it is possible
that the stats numbers differ from transient stats.
Also, persistent stats are updated less frequently or with a delay, so
it is possible that persistent stats are not up to date as transient were
even if both algorithms would return the same results.
The order of the returned rows by a SELECT query depends on the stats and
thus, if possible, we fix tests by prepending "-- sorted_result" to SELECTs
that happen to return rows in different order.
If possible, each failing test was fixed by manually running ANALYZE TABLE.
This is doable if both transient and persistent sampling algorithms end up
with the same numbers for the given table and its data.
If persistent stats result in different stats, then test failures were fixed
by forcing the usage of transient stats for the table by using
CREATE TABLE ... STATS_PERSISTENT=0.
Intentionally do not fix the tests by using persistent stats and adjustin
the output of EXPLAIN in .result files because a different execution plan
may cause a different code path to be executed, than the one originally
intended in the test.
modified:
mysql-test/include/icp_tests.inc
3965 Marc Alff 2012-06-07
Improved the test robustness of performance_schema.sizing_growth, adjusted mutex_per_share heuristic
modified:
mysql-test/suite/perfschema/r/sizing_default.result
mysql-test/suite/perfschema/r/sizing_growth.result
mysql-test/suite/perfschema/r/sizing_high.result
mysql-test/suite/perfschema/r/sizing_low.result
mysql-test/suite/perfschema/r/sizing_med.result
mysql-test/suite/perfschema/t/sizing_growth.test
storage/perfschema/pfs_autosize.cc
=== modified file 'mysql-test/include/icp_tests.inc'
--- a/mysql-test/include/icp_tests.inc revid:marc.alff@stripped
+++ b/mysql-test/include/icp_tests.inc revid:vasil.dimov@stripped
@@ -359,6 +359,12 @@ INSERT INTO t1 VALUES
('2008-01-01','c'),
('2038-01-09','d');
+-- disable_query_log
+-- disable_result_log
+ANALYZE TABLE t1;
+-- enable_result_log
+-- enable_query_log
+
--disable_warnings
--echo
@@ -419,6 +425,14 @@ CREATE TABLE t3 (
KEY (c1(6),i1)
);
+-- disable_query_log
+-- disable_result_log
+ANALYZE TABLE t1;
+ANALYZE TABLE t2;
+ANALYZE TABLE t3;
+-- enable_result_log
+-- enable_query_log
+
INSERT INTO t3 SELECT CONCAT('c-',1000+t2.a,'=w'), 1 FROM t2;
let query=SELECT c1 FROM t3 WHERE c1 >= 'c-1004=w' and c1 <= 'c-1006=w' and i1 > 2;
@@ -478,6 +492,12 @@ INSERT INTO t1 VALUES (6,NULL);
INSERT INTO t1 VALUES (7,9);
INSERT INTO t1 VALUES (8,0);
+-- disable_query_log
+-- disable_result_log
+ANALYZE TABLE t1;
+-- enable_result_log
+-- enable_query_log
+
SELECT pk, c1
FROM t1
WHERE (pk BETWEEN 4 AND 5 OR pk < 2) AND c1 < 240
@@ -510,6 +530,12 @@ CREATE TABLE t1 (
INSERT INTO t1 VALUES ('Anastasia', 5);
INSERT INTO t1 VALUES ('Karianne', 4);
+-- disable_query_log
+-- disable_result_log
+ANALYZE TABLE t1;
+-- enable_result_log
+-- enable_query_log
+
SELECT * FROM t1 WHERE (c1 <= '6566-06-15' AND c2 <> 3);
EXPLAIN SELECT * FROM t1 WHERE (c1 <= '6566-06-15' AND c2 <> 3);
@@ -591,6 +617,12 @@ CREATE TABLE t2 (
c1 INTEGER NOT NULL
);
+-- disable_query_log
+-- disable_result_log
+ANALYZE TABLE t1;
+-- enable_result_log
+-- enable_query_log
+
let query=
SELECT t1.c1
FROM t1
@@ -631,6 +663,14 @@ CREATE TABLE t3 (
INSERT INTO t3 VALUES ('v');
+-- disable_query_log
+-- disable_result_log
+ANALYZE TABLE t1;
+ANALYZE TABLE t2;
+ANALYZE TABLE t3;
+-- enable_result_log
+-- enable_query_log
+
let query=
SELECT i1
FROM t1
@@ -692,6 +732,12 @@ CREATE TABLE t1 (
INSERT INTO t1 VALUES (1,9),(2,7),(3,6),(4,3),(5,1);
+-- disable_query_log
+-- disable_result_log
+ANALYZE TABLE t1;
+-- enable_result_log
+-- enable_query_log
+
EXPLAIN SELECT pk, c1 FROM t1 WHERE pk <> 3;
SET SESSION optimizer_switch='index_condition_pushdown=off';
@@ -723,6 +769,13 @@ INSERT INTO t2 VALUES ();
INSERT INTO t1 VALUES ();
--enable_warnings
+-- disable_query_log
+-- disable_result_log
+ANALYZE TABLE t1;
+ANALYZE TABLE t2;
+-- enable_result_log
+-- enable_query_log
+
let $query=
SELECT *
FROM t1 AS t1a
@@ -768,6 +821,13 @@ CREATE TABLE t2 (
INSERT INTO t2 VALUES (6,'y','RPOYT'),(10,'m','JINQE');
+-- disable_query_log
+-- disable_result_log
+ANALYZE TABLE t1;
+ANALYZE TABLE t2;
+-- enable_result_log
+-- enable_query_log
+
let query=
SELECT c2 FROM t1 JOIN t2 ON t1.c1 = t2.c1
WHERE (t2.pk <= 4 AND t1.pk IN (2,1)) OR
@@ -862,6 +922,13 @@ CREATE TABLE t2 (
INSERT INTO t2 VALUES (1,7,'f');
+-- disable_query_log
+-- disable_result_log
+ANALYZE TABLE t1;
+ANALYZE TABLE t2;
+-- enable_result_log
+-- enable_query_log
+
# Bug was specific of IN->EXISTS:
set @old_opt_switch=@@optimizer_switch;
--disable_query_log
@@ -921,6 +988,8 @@ INSERT INTO t3 VALUES (NULL,'w'), (1,NUL
-- disable_query_log
-- disable_result_log
+ANALYZE TABLE t1;
+ANALYZE TABLE t2;
ANALYZE TABLE t3;
-- enable_result_log
-- enable_query_log
@@ -964,6 +1033,12 @@ CREATE TABLE t1 (
INSERT INTO t1 VALUES (23,5,'d');
+-- disable_query_log
+-- disable_result_log
+ANALYZE TABLE t1;
+-- enable_result_log
+-- enable_query_log
+
let query=
SELECT a1.pk
FROM t1 AS a1 JOIN (SELECT * FROM t1 LIMIT 1) AS a2 ON a2.b = a1.b
@@ -1006,6 +1081,12 @@ CREATE TABLE t1 (
INSERT INTO t1 VALUES (1,3,'j'), (20,8,'e');
+-- disable_query_log
+-- disable_result_log
+ANALYZE TABLE t1;
+-- enable_result_log
+-- enable_query_log
+
let query=
SELECT alias2.i1
FROM t1 AS alias1 STRAIGHT_JOIN t1 AS alias2
@@ -1159,6 +1240,13 @@ CREATE TABLE t2 (
INSERT INTO t2 VALUES (1);
+-- disable_query_log
+-- disable_result_log
+ANALYZE TABLE t1;
+ANALYZE TABLE t2;
+-- enable_result_log
+-- enable_query_log
+
CREATE FUNCTION f1() RETURNS INTEGER
RETURN (SELECT MOD(COUNT(DISTINCT pk), 10) FROM t2);
No bundle (reason: useless for push emails).
| Thread |
|---|
| • bzr push into mysql-trunk branch (vasil.dimov:3965 to 3966) WL#6189 | vasil.dimov | 7 Jun |