diff options
author | unknown <timour@askmonty.org> | 2010-03-11 23:43:31 +0200 |
---|---|---|
committer | unknown <timour@askmonty.org> | 2010-03-11 23:43:31 +0200 |
commit | 3d2a74609a7161311fa49ca8c96555c729175612 (patch) | |
tree | 733fb9c9cf7b1d49eaa94ea45b3eaec8b0a29ccc /mysql-test/t/subselect3.test | |
parent | 292d466749134850a23247e488a8dde52d5f90e8 (diff) | |
download | mariadb-git-3d2a74609a7161311fa49ca8c96555c729175612.tar.gz |
MWL#68 Subquery optimization: Efficient NOT IN execution with NULLs
This patch does three things:
- It adds the possibility to force the execution of top-level [NOT] IN
subquery predicates via the IN=>EXISTS transformation. This is done by
setting both optimizer switches partial_match_rowid_merge and
partial_match_table_scan to "off".
- It adjusts all test cases where the complete optimizer_switch is
selected because now we have two more switches.
- For those test cases where the plan changes because of the new available
strategies, we switch off both partial match strategies in order to
force the "old" IN=>EXISTS strategy. This is done because most of these
test cases specifically test bugs in this strategy.
sql/opt_subselect.cc:
Adds the possibility to force the execution of top-level [NOT] IN
subquery predicates via the IN=>EXISTS transformation. This is done by
setting both optimizer switches partial_match_rowid_merge and
partial_match_table_scan to "off".
Diffstat (limited to 'mysql-test/t/subselect3.test')
-rw-r--r-- | mysql-test/t/subselect3.test | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/mysql-test/t/subselect3.test b/mysql-test/t/subselect3.test index 8ae73587d6e..fa1f916261c 100644 --- a/mysql-test/t/subselect3.test +++ b/mysql-test/t/subselect3.test @@ -59,9 +59,13 @@ select a in (select max(ie) from t1 where oref=4 group by grp) from t3; show status like 'Handler_read_rnd_next'; select ' ^ This must show 11' Z; +set @save_optimizer_switch=@@optimizer_switch; +set @@optimizer_switch="partial_match_rowid_merge=off,partial_match_table_scan=off"; + # This must show trigcond: explain extended select a in (select max(ie) from t1 where oref=4 group by grp) from t3; +set @@optimizer_switch=@save_optimizer_switch; drop table t1, t2, t3; # @@ -529,6 +533,9 @@ SELECT a, MAX(b), DROP TABLE t1, t2; +# The next three test cases must be executed with the IN=>EXISTS strategy +set @save_optimizer_switch=@@optimizer_switch; +set @@optimizer_switch="partial_match_rowid_merge=off,partial_match_table_scan=off"; # # Bug #27870: crash of an equijoin query with WHERE condition containing @@ -588,6 +595,8 @@ EXPLAIN SELECT a FROM t1 WHERE a NOT IN (SELECT a FROM t2); DROP TABLE t1, t2; +set @@optimizer_switch=@save_optimizer_switch; + # # Bug #34763: item_subselect.cc:1235:Item_in_subselect::row_value_transformer: # Assertion failed, unexpected error message: |