summaryrefslogtreecommitdiff
path: root/mysql-test/r/explain_json.result
diff options
context:
space:
mode:
authorSergei Petrunia <psergey@askmonty.org>2014-12-02 01:40:10 +0300
committerSergei Petrunia <psergey@askmonty.org>2014-12-02 01:40:10 +0300
commit0000695025dea9740842ea57a5d79cd56d880405 (patch)
treea3dab25aa3464ce8619cf87f4775cc6bdfba9230 /mysql-test/r/explain_json.result
parenta35b05399ef20de3c0d5e521a62b5e297c6ccd1e (diff)
downloadmariadb-git-0000695025dea9740842ea57a5d79cd56d880405.tar.gz
EXPLAIN FORMAT=JSON
Add support for semi-join strategies: FirstMatch, DuplicateWeedout, LooseScan.
Diffstat (limited to 'mysql-test/r/explain_json.result')
-rw-r--r--mysql-test/r/explain_json.result72
1 files changed, 72 insertions, 0 deletions
diff --git a/mysql-test/r/explain_json.result b/mysql-test/r/explain_json.result
index 4a45e8d7594..c159161a8bd 100644
--- a/mysql-test/r/explain_json.result
+++ b/mysql-test/r/explain_json.result
@@ -592,5 +592,77 @@ EXPLAIN
}
}
}
+#
+# First-Match
+#
+explain
+select * from t2 where t2.a in ( select a from t1 where t1.b=t2.b);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t2 ALL NULL NULL NULL NULL 10
+1 PRIMARY t1 ALL NULL NULL NULL NULL 10 Using where; FirstMatch(t2); Using join buffer (flat, BNL join)
+explain format=json
+select * from t2 where t2.a in ( select a from t1 where t1.b=t2.b);
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "table": {
+ "table_name": "t2",
+ "access_type": "ALL",
+ "rows": 10,
+ "filtered": 100
+ },
+ "block-nl-join": {
+ "table": {
+ "table_name": "t1",
+ "access_type": "ALL",
+ "rows": 10,
+ "filtered": 100,
+ "first_match": "t2"
+ },
+ "buffer_type": "flat",
+ "join_type": "BNL",
+ "attached_condition": "((t1.b = t2.b) and (t1.a = t2.a))"
+ }
+ }
+}
+#
+# Duplicate Weedout
+#
+set @tmp= @@optimizer_switch;
+set optimizer_switch='firstmatch=off';
+explain
+select * from t2 where t2.a in ( select a from t1 where t1.b=t2.b);
+id select_type table type possible_keys key key_len ref rows Extra
+1 PRIMARY t2 ALL NULL NULL NULL NULL 10
+1 PRIMARY t1 ALL NULL NULL NULL NULL 10 Using where; Start temporary; End temporary; Using join buffer (flat, BNL join)
+explain format=json
+select * from t2 where t2.a in ( select a from t1 where t1.b=t2.b);
+EXPLAIN
+{
+ "query_block": {
+ "select_id": 1,
+ "table": {
+ "table_name": "t2",
+ "access_type": "ALL",
+ "rows": 10,
+ "filtered": 100
+ },
+ "duplicates_removal": {
+ "block-nl-join": {
+ "table": {
+ "table_name": "t1",
+ "access_type": "ALL",
+ "rows": 10,
+ "filtered": 100
+ },
+ "buffer_type": "flat",
+ "join_type": "BNL",
+ "attached_condition": "((t1.b = t2.b) and (t1.a = t2.a))"
+ }
+ }
+ }
+}
+set optimizer_switch=@tmp;
drop table t1,t2;
drop table t0;