You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This commit introduces:
- the infrastructure for optimizer hints;
- hints for join buffering: BNL(), NO_BNL(), BKA(), NO_BKA();
- NO_ICP() hint for disabling index condition pushdown;
- MRR(), MO_MRR() hint for multi-range reads control;
- NO_RANGE_OPTIMIZATION() for disabling range optimization;
- QB_NAME() for assigning names for query blocks.
Copy file name to clipboardExpand all lines: mysql-test/main/opt_hints.result
+31-31Lines changed: 31 additions & 31 deletions
Original file line number
Diff line number
Diff line change
@@ -139,7 +139,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
139
139
1 SIMPLE t4 ref y_idx y_idx 5 const 1 100.00
140
140
1 SIMPLE t5 range x_idx x_idx 5 NULL 2 100.00 Using where; Using join buffer (flat, BNL join)
141
141
Warnings:
142
-
Warning 4199 Unresolved name `t5`@`select#2` `z_idx` for NO_ICP hint
142
+
Warning 4205 Unresolved index name `t5`@`select#2` `z_idx` for NO_ICP hint
143
143
Note 1003 select /*+ NO_ICP(`t5`@`select#2` `y_idx`) NO_ICP(`t5`@`select#2` `x_idx`) */ `test`.`t4`.`x` AS `x`,`test`.`t5`.`y` AS `y` from `test`.`t4` join `test`.`t4` `t5` where `test`.`t4`.`y` = 8 and `test`.`t5`.`x` between 7 and <cache>(8 + 0)
144
144
# ICP should still be used
145
145
EXPLAIN EXTENDED SELECT * FROM
@@ -405,7 +405,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
405
405
1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00
406
406
1 SIMPLE t2 ALL f1 NULL NULL NULL 28 25.00 Using where; Using join buffer (flat, BNL join)
407
407
Warnings:
408
-
Warning 4198 Query block name `qb1` is not found for BKA hint
408
+
Warning 4203 Query block name `qb1` is not found for BKA hint
409
409
Note 1003 select /*+ QB_NAME(`qb1`) */ `test`.`t2`.`f1` AS `f1`,`test`.`t2`.`f2` AS `f2`,`test`.`t2`.`f3` AS `f3` from `test`.`t1` join `test`.`t2` where `test`.`t2`.`f1` = `test`.`t1`.`f1` and `test`.`t2`.`f2` between `test`.`t1`.`f1` and `test`.`t1`.`f2` and `test`.`t2`.`f2` + 1 >= `test`.`t1`.`f1` + 1
410
410
# Should not crash
411
411
PREPARE stmt1 FROM "SELECT /*+ BKA(t2) */ t2.f1, t2.f2, t2.f3 FROM t1,t2
@@ -449,9 +449,9 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
449
449
1 SIMPLE t1 ALL NULL NULL NULL NULL 3 100.00
450
450
1 SIMPLE t2 ALL f1 NULL NULL NULL 28 25.00 Using where; Using join buffer (flat, BNL join)
451
451
Warnings:
452
-
Warning 4199 Unresolved name `t3`@`select#1` for BKA hint
453
-
Warning 4199 Unresolved name `t3`@`select#1` for NO_RANGE_OPTIMIZATION hint
454
-
Warning 4199 Unresolved name `t3`@`select#1` `idx1` for NO_RANGE_OPTIMIZATION hint
452
+
Warning 4204 Unresolved table name `t3`@`select#1` for BKA hint
453
+
Warning 4204 Unresolved table name `t3`@`select#1` for NO_RANGE_OPTIMIZATION hint
454
+
Warning 4205 Unresolved index name `t3`@`select#1` `idx1` for NO_RANGE_OPTIMIZATION hint
455
455
Note 1003 select /*+ BKA(`t2`@`select#1`) NO_BNL(`t1`@`select#1`) */ `test`.`t2`.`f1` AS `f1`,`test`.`t2`.`f2` AS `f2`,`test`.`t2`.`f3` AS `f3` from `test`.`t1` join `test`.`t2` where `test`.`t2`.`f1` = `test`.`t1`.`f1` and `test`.`t2`.`f2` between `test`.`t1`.`f1` and `test`.`t1`.`f2` and `test`.`t2`.`f2` + 1 >= `test`.`t1`.`f1` + 1
456
456
# Check illegal syntax
457
457
EXPLAIN EXTENDED SELECT /*+ BKA(qb1 t3@qb1) */ f2 FROM
@@ -488,7 +488,7 @@ id select_type table type possible_keys key key_len ref rows filtered Extra
488
488
1 SIMPLE tbl12 ALL NULL NULL NULL NULL 10 100.00 Using where
489
489
1 SIMPLE tbl13 hash_ALL a #hash#a 5 test.tbl12.a 1000 0.10 Using where; Using join buffer (flat, BNLH join)
490
490
Warnings:
491
-
Warning 4199 Unresolved name `tbl2`@`select#1` for BKA hint
491
+
Warning 4204 Unresolved table name `tbl2`@`select#1` for BKA hint
492
492
Note 1003 select `test`.`tbl12`.`a` AS `a`,`test`.`tbl12`.`b` AS `b`,`test`.`tbl13`.`a` AS `a`,`test`.`tbl13`.`b` AS `b`,`test`.`tbl13`.`c` AS `c`,`test`.`tbl13`.`filler` AS `filler` from `test`.`t12` `tbl12` join `test`.`t13` `tbl13` where `test`.`tbl13`.`a` = `test`.`tbl12`.`a` and `test`.`tbl13`.`b` + 1 <= `test`.`tbl13`.`b` + 1
493
493
# Check that PS and conventional statements give the same result.
0 commit comments