summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElena Stepanova <elenst@montyprogram.com>2017-01-04 23:05:22 +0200
committerElena Stepanova <elenst@montyprogram.com>2017-01-05 17:32:11 +0200
commitf1ee011a6cbda1069a6ec9b5e2428451a64861fd (patch)
tree4dd002106112ed881a0e770d9d6fe357e00e579f
parentf4d12c1d3fd79db8d30a7de3de3b851d2fa0a397 (diff)
downloadmariadb-git-f1ee011a6cbda1069a6ec9b5e2428451a64861fd.tar.gz
MDEV-11722 main.join_cache fails in buildbot on very slow builders
The guilty part of the test checks for performance degradation on a query with numerous joins on an empty table. The test expects the query to take less than 1 second, and fails if it is not so (which can happen on very slow builders). The solution is to add more JOINs to the query. On a fixed server, it should not have any noticeable impact on the query execution, while on the unfixed version the query would take several times longer (e.g. 6.5 sec vs 1.5 sec). Thus, we can increase the margin for the error, and make the test fail when the query takes longer than 5 seconds.
-rw-r--r--mysql-test/r/join_cache.result16
-rw-r--r--mysql-test/t/join_cache.test10
2 files changed, 20 insertions, 6 deletions
diff --git a/mysql-test/r/join_cache.result b/mysql-test/r/join_cache.result
index 8a2bdcec8a2..cc64393f975 100644
--- a/mysql-test/r/join_cache.result
+++ b/mysql-test/r/join_cache.result
@@ -5702,11 +5702,13 @@ LEFT JOIN t2 c1 ON c1.parent_id = t.id AND c1.col2 = "val"
LEFT JOIN t2 c23 ON c23.parent_id = t.id AND c23.col2 = "val"
LEFT JOIN t2 c24 ON c24.parent_id = t.id AND c24.col2 = "val"
LEFT JOIN t2 c25 ON c25.parent_id = t.id AND c25.col2 = "val"
+ LEFT JOIN t2 c26 ON c26.parent_id = t.id AND c26.col2 = "val"
+ LEFT JOIN t2 c27 ON c27.parent_id = t.id AND c27.col2 = "val"
ORDER BY
col1;
id col1
-select timestampdiff(second, @init_time, now()) <= 1;
-timestampdiff(second, @init_time, now()) <= 1
+select timestampdiff(second, @init_time, now()) <= 5;
+timestampdiff(second, @init_time, now()) <= 5
1
set join_cache_level=2;
set @init_time:=now();
@@ -5738,11 +5740,13 @@ LEFT JOIN t2 c1 ON c1.parent_id = t.id AND c1.col2 = "val"
LEFT JOIN t2 c23 ON c23.parent_id = t.id AND c23.col2 = "val"
LEFT JOIN t2 c24 ON c24.parent_id = t.id AND c24.col2 = "val"
LEFT JOIN t2 c25 ON c25.parent_id = t.id AND c25.col2 = "val"
+ LEFT JOIN t2 c26 ON c26.parent_id = t.id AND c26.col2 = "val"
+ LEFT JOIN t2 c27 ON c27.parent_id = t.id AND c27.col2 = "val"
ORDER BY
col1;
id col1
-select timestampdiff(second, @init_time, now()) <= 1;
-timestampdiff(second, @init_time, now()) <= 1
+select timestampdiff(second, @init_time, now()) <= 5;
+timestampdiff(second, @init_time, now()) <= 5
1
EXPLAIN
SELECT t.*
@@ -5773,6 +5777,8 @@ LEFT JOIN t2 c1 ON c1.parent_id = t.id AND c1.col2 = "val"
LEFT JOIN t2 c23 ON c23.parent_id = t.id AND c23.col2 = "val"
LEFT JOIN t2 c24 ON c24.parent_id = t.id AND c24.col2 = "val"
LEFT JOIN t2 c25 ON c25.parent_id = t.id AND c25.col2 = "val"
+ LEFT JOIN t2 c26 ON c26.parent_id = t.id AND c26.col2 = "val"
+ LEFT JOIN t2 c27 ON c27.parent_id = t.id AND c27.col2 = "val"
ORDER BY
col1;
id select_type table type possible_keys key key_len ref rows Extra
@@ -5802,6 +5808,8 @@ id select_type table type possible_keys key key_len ref rows Extra
1 SIMPLE c23 ALL NULL NULL NULL NULL 1 Using where; Using join buffer (incremental, BNL join)
1 SIMPLE c24 ALL NULL NULL NULL NULL 1 Using where; Using join buffer (incremental, BNL join)
1 SIMPLE c25 ALL NULL NULL NULL NULL 1 Using where; Using join buffer (incremental, BNL join)
+1 SIMPLE c26 ALL NULL NULL NULL NULL 1 Using where; Using join buffer (incremental, BNL join)
+1 SIMPLE c27 ALL NULL NULL NULL NULL 1 Using where; Using join buffer (incremental, BNL join)
set join_buffer_size=default;
set join_cache_level = default;
DROP TABLE t1,t2;
diff --git a/mysql-test/t/join_cache.test b/mysql-test/t/join_cache.test
index 1d22de86799..77e8fce0d27 100644
--- a/mysql-test/t/join_cache.test
+++ b/mysql-test/t/join_cache.test
@@ -3709,9 +3709,11 @@ FROM
LEFT JOIN t2 c23 ON c23.parent_id = t.id AND c23.col2 = "val"
LEFT JOIN t2 c24 ON c24.parent_id = t.id AND c24.col2 = "val"
LEFT JOIN t2 c25 ON c25.parent_id = t.id AND c25.col2 = "val"
+ LEFT JOIN t2 c26 ON c26.parent_id = t.id AND c26.col2 = "val"
+ LEFT JOIN t2 c27 ON c27.parent_id = t.id AND c27.col2 = "val"
ORDER BY
col1;
-select timestampdiff(second, @init_time, now()) <= 1;
+select timestampdiff(second, @init_time, now()) <= 5;
set join_cache_level=2;
@@ -3744,9 +3746,11 @@ FROM
LEFT JOIN t2 c23 ON c23.parent_id = t.id AND c23.col2 = "val"
LEFT JOIN t2 c24 ON c24.parent_id = t.id AND c24.col2 = "val"
LEFT JOIN t2 c25 ON c25.parent_id = t.id AND c25.col2 = "val"
+ LEFT JOIN t2 c26 ON c26.parent_id = t.id AND c26.col2 = "val"
+ LEFT JOIN t2 c27 ON c27.parent_id = t.id AND c27.col2 = "val"
ORDER BY
col1;
-select timestampdiff(second, @init_time, now()) <= 1;
+select timestampdiff(second, @init_time, now()) <= 5;
EXPLAIN
SELECT t.*
@@ -3777,6 +3781,8 @@ FROM
LEFT JOIN t2 c23 ON c23.parent_id = t.id AND c23.col2 = "val"
LEFT JOIN t2 c24 ON c24.parent_id = t.id AND c24.col2 = "val"
LEFT JOIN t2 c25 ON c25.parent_id = t.id AND c25.col2 = "val"
+ LEFT JOIN t2 c26 ON c26.parent_id = t.id AND c26.col2 = "val"
+ LEFT JOIN t2 c27 ON c27.parent_id = t.id AND c27.col2 = "val"
ORDER BY
col1;