3968 Vasil Dimov 2012-06-06
Followup to WL#6189 Turn InnoDB persistent statistics ON by default
Adjust mtr tests, part 25.
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/mrr_tests.inc
3967 Alexander Barkov 2012-06-05
Fixing C++ comments in C code.
modified:
strings/ctype-uca.c
=== modified file 'mysql-test/include/mrr_tests.inc'
--- a/mysql-test/include/mrr_tests.inc revid:alexander.barkov@stripped
+++ b/mysql-test/include/mrr_tests.inc revid:vasil.dimov@stripped
@@ -91,6 +91,12 @@ insert into t4 (a,b,c,filler)
insert into t4 (a,b,c,filler)
select 'zz-1',NULL,'cc-2', 'filler-data' from t2 order by a limit 500;
+-- disable_query_log
+-- disable_result_log
+ANALYZE TABLE t4;
+-- enable_result_log
+-- enable_query_log
+
explain
select * from t4 where a IS NULL and b IS NULL and (c IS NULL or c='no-such-row1'
or c='no-such-row2');
@@ -166,6 +172,13 @@ CREATE TABLE t2 (
);
INSERT INTO t2 VALUES (1,1),(2,6),(3,0);
+-- disable_query_log
+-- disable_result_log
+ANALYZE TABLE t1;
+ANALYZE TABLE t2;
+-- enable_result_log
+-- enable_query_log
+
EXPLAIN EXTENDED
SELECT MIN(t1.pk)
FROM t1 WHERE EXISTS (
@@ -186,6 +199,12 @@ create table t1 (a int, b char(20), fill
insert into t1 select A.a + 10*(B.a + 10*C.a), 'bbb','filler' from t0 A, t0 B, t0 C;
update t1 set b=repeat(char(65+a), 20) where a < 25;
+-- disable_query_log
+-- disable_result_log
+ANALYZE TABLE t1;
+-- enable_result_log
+-- enable_query_log
+
--echo This must show range + using index condition:
--replace_column 9 x
explain select * from t1 where a < 10 and b = repeat(char(65+a), 20);
@@ -199,6 +218,11 @@ create table t0 (a int);
insert into t0 values (0),(1),(2),(3),(4),(5),(6),(7),(8),(9);
create table t1 (a int, b int, key(a));
insert into t1 select A.a + 10 *(B.a + 10*C.a), A.a + 10 *(B.a + 10*C.a) from t0 A, t0 B, t0 C;
+-- disable_query_log
+-- disable_result_log
+ANALYZE TABLE t1;
+-- enable_result_log
+-- enable_query_log
-- echo This mustn't show "Using MRR":
explain select * from t1 where a < 20 order by a;
drop table t0, t1;
@@ -242,6 +266,11 @@ drop table t2;
create table t2 (a char(100), b char(100), c char(100), d int,
filler char(10), key(d), primary key (a,b,c));
insert into t2 select A.a, B.a, B.a, A.a, 'filler' from t1 A, t1 B;
+-- disable_query_log
+-- disable_result_log
+ANALYZE TABLE t2;
+-- enable_result_log
+-- enable_query_log
--replace_column 9 #
explain select * from t2 force index (d) where d < 10;
drop table t2;
@@ -384,6 +413,13 @@ CREATE TABLE t2 (
INSERT INTO t2 VALUES (3, 9, 1, NULL);
+-- disable_query_log
+-- disable_result_log
+ANALYZE TABLE t1;
+ANALYZE TABLE t2;
+-- enable_result_log
+-- enable_query_log
+
let query=
SELECT i1
FROM t1 LEFT JOIN t2 ON t1.pk = t2.i2
@@ -416,6 +452,13 @@ CREATE TABLE t2 (
INSERT INTO t2 VALUES ('v'), ('c');
+-- disable_query_log
+-- disable_result_log
+ANALYZE TABLE t1;
+ANALYZE TABLE t2;
+-- enable_result_log
+-- enable_query_log
+
let query=
SELECT STRAIGHT_JOIN t1.c1
FROM t1 RIGHT OUTER JOIN t2 ON t1.c1 = t2.c1
@@ -446,6 +489,12 @@ CREATE TABLE t1 (
INSERT INTO t1 VALUES (0,1),(1,2),(2,3);
+-- disable_query_log
+-- disable_result_log
+ANALYZE TABLE t1;
+-- enable_result_log
+-- enable_query_log
+
let query=
SELECT i1
FROM t1
@@ -516,6 +565,16 @@ CREATE TABLE t5 (
INSERT INTO t5
SELECT a, 'MySQL' FROM ten;
+-- disable_query_log
+-- disable_result_log
+ANALYZE TABLE t1;
+ANALYZE TABLE t2;
+ANALYZE TABLE t3;
+ANALYZE TABLE t4;
+ANALYZE TABLE t5;
+-- enable_result_log
+-- enable_query_log
+
let query=
SELECT STRAIGHT_JOIN *
FROM
No bundle (reason: useless for push emails).
| Thread |
|---|
| • bzr push into mysql-trunk branch (vasil.dimov:3967 to 3968) WL#6189 | vasil.dimov | 6 Jun |