File tree Expand file tree Collapse file tree 2 files changed +32
-0
lines changed Expand file tree Collapse file tree 2 files changed +32
-0
lines changed Original file line number Diff line number Diff line change @@ -148,6 +148,35 @@ EXPLAIN
148
148
}
149
149
}
150
150
}
151
+ explain format=json select * from t2 where (a1=1 and a2=1) or
152
+ (b1=2 and b2=1);
153
+ EXPLAIN
154
+ {
155
+ "query_block": {
156
+ "select_id": 1,
157
+ "table": {
158
+ "table_name": "t2",
159
+ "access_type": "index_merge",
160
+ "possible_keys": ["a1", "b1"],
161
+ "key_length": "10,10",
162
+ "index_merge": {
163
+ "union": {
164
+ "range": {
165
+ "key": "a1",
166
+ "used_key_parts": ["a1", "a2"]
167
+ },
168
+ "range": {
169
+ "key": "b1",
170
+ "used_key_parts": ["b1", "b2"]
171
+ }
172
+ }
173
+ },
174
+ "rows": 2,
175
+ "filtered": 100,
176
+ "attached_condition": "(((t2.a1 = 1) and (t2.a2 = 1)) or ((t2.b1 = 2) and (t2.b2 = 1)))"
177
+ }
178
+ }
179
+ }
151
180
# Try ref access on two key components
152
181
explain format=json select * from t0,t2 where t2.b1=t0.a and t2.b2=4;
153
182
EXPLAIN
Original file line number Diff line number Diff line change @@ -34,6 +34,9 @@ explain format=json select * from t2 where a1<5;
34
34
explain format=json select * from t2 where a1=1 or b1=2;
35
35
explain format=json select * from t2 where a1=1 or (b1=2 and b2=3);
36
36
37
+ explain format=json select * from t2 where (a1=1 and a2=1) or
38
+ (b1=2 and b2=1);
39
+
37
40
--echo # Try ref access on two key components
38
41
39
42
explain format=json select * from t0,t2 where t2.b1=t0.a and t2.b2=4;
You can’t perform that action at this time.
0 commit comments