summaryrefslogtreecommitdiff
path: root/mysql-test/r/explain_json.result
diff options
context:
space:
mode:
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;