Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
85571ea7
Commit
85571ea7
authored
Jul 14, 2011
by
Sergey Petrunya
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Disable LooseScan and FirstMatch when outer joins are present.
parent
bf284498
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
12 additions
and
11 deletions
+12
-11
mysql-test/r/subselect4.result
mysql-test/r/subselect4.result
+2
-2
mysql-test/r/subselect_sj.result
mysql-test/r/subselect_sj.result
+2
-2
mysql-test/r/subselect_sj2.result
mysql-test/r/subselect_sj2.result
+3
-3
mysql-test/r/subselect_sj2_jcl6.result
mysql-test/r/subselect_sj2_jcl6.result
+2
-2
sql/opt_subselect.cc
sql/opt_subselect.cc
+3
-2
No files found.
mysql-test/r/subselect4.result
View file @
85571ea7
...
@@ -1219,7 +1219,7 @@ EXPLAIN
...
@@ -1219,7 +1219,7 @@ EXPLAIN
SELECT * FROM (t2 LEFT JOIN t1 ON t1.c1) LEFT JOIN t3 on t3.c1 WHERE 's' IN (SELECT c1 FROM t2);
SELECT * FROM (t2 LEFT JOIN t1 ON t1.c1) LEFT JOIN t3 on t3.c1 WHERE 's' IN (SELECT c1 FROM t2);
id select_type table type possible_keys key key_len ref rows Extra
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t1 system NULL NULL NULL NULL 0 const row not found
1 PRIMARY t1 system NULL NULL NULL NULL 0 const row not found
1 PRIMARY t2 ALL NULL NULL NULL NULL 2 Using where;
FirstMatch(t1)
1 PRIMARY t2 ALL NULL NULL NULL NULL 2 Using where;
Start temporary; End temporary
1 PRIMARY t2 ALL NULL NULL NULL NULL 2 Using join buffer (flat, BNL join)
1 PRIMARY t2 ALL NULL NULL NULL NULL 2 Using join buffer (flat, BNL join)
1 PRIMARY t3 ALL NULL NULL NULL NULL 3 Using where
1 PRIMARY t3 ALL NULL NULL NULL NULL 3 Using where
SELECT * FROM (t2 LEFT JOIN t1 ON t1.c1) LEFT JOIN t3 on t3.c1 WHERE 's' IN (SELECT c1 FROM t2);
SELECT * FROM (t2 LEFT JOIN t1 ON t1.c1) LEFT JOIN t3 on t3.c1 WHERE 's' IN (SELECT c1 FROM t2);
...
@@ -1227,7 +1227,7 @@ c1 c1 c1
...
@@ -1227,7 +1227,7 @@ c1 c1 c1
EXPLAIN
EXPLAIN
SELECT * FROM t4 LEFT JOIN t2 ON t4.c1 WHERE 's' IN (SELECT c1 FROM t2);
SELECT * FROM t4 LEFT JOIN t2 ON t4.c1 WHERE 's' IN (SELECT c1 FROM t2);
id select_type table type possible_keys key key_len ref rows Extra
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t2 ALL NULL NULL NULL NULL 2 Using where;
FirstMatch
1 PRIMARY t2 ALL NULL NULL NULL NULL 2 Using where;
Start temporary; End temporary
1 PRIMARY t4 index NULL PRIMARY 3 NULL 2 Using index; Using join buffer (flat, BNL join)
1 PRIMARY t4 index NULL PRIMARY 3 NULL 2 Using index; Using join buffer (flat, BNL join)
1 PRIMARY t2 ALL NULL NULL NULL NULL 2 Using where
1 PRIMARY t2 ALL NULL NULL NULL NULL 2 Using where
SELECT * FROM t4 LEFT JOIN t2 ON t4.c1 WHERE 's' IN (SELECT c1 FROM t2);
SELECT * FROM t4 LEFT JOIN t2 ON t4.c1 WHERE 's' IN (SELECT c1 FROM t2);
...
...
mysql-test/r/subselect_sj.result
View file @
85571ea7
...
@@ -1457,8 +1457,8 @@ explain
...
@@ -1457,8 +1457,8 @@ explain
select * from t0 where a in (select t1.a from t1 left join t2 on t1.a=t2.a);
select * from t0 where a in (select t1.a from t1 left join t2 on t1.a=t2.a);
id select_type table type possible_keys key key_len ref rows Extra
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t0 ALL NULL NULL NULL NULL 2
1 PRIMARY t0 ALL NULL NULL NULL NULL 2
1 PRIMARY t1 ALL NULL NULL NULL NULL 4 Using where
1 PRIMARY t1 ALL NULL NULL NULL NULL 4 Using where
; Start temporary
1 PRIMARY t2 ALL NULL NULL NULL NULL 1 Using where;
FirstMatch(t0)
1 PRIMARY t2 ALL NULL NULL NULL NULL 1 Using where;
End temporary
select * from t0 where a in (select t1.a from t1 left join t2 on t1.a=t2.a);
select * from t0 where a in (select t1.a from t1 left join t2 on t1.a=t2.a);
a
a
1
1
...
...
mysql-test/r/subselect_sj2.result
View file @
85571ea7
...
@@ -267,10 +267,10 @@ explain select *
...
@@ -267,10 +267,10 @@ explain select *
from t0 where a in
from t0 where a in
(select t2.a+t3.a from t1 left join (t2 join t3) on t2.a=t1.a and t3.a=t1.a);
(select t2.a+t3.a from t1 left join (t2 join t3) on t2.a=t1.a and t3.a=t1.a);
id select_type table type possible_keys key key_len ref rows Extra
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t0 ALL NULL NULL NULL NULL 10
1 PRIMARY t0 ALL NULL NULL NULL NULL 10
Start temporary
1 PRIMARY t1 index NULL a 5 NULL 10 Using index
1 PRIMARY t1 index NULL a 5 NULL 10 Using index
; Using join buffer (flat, BNL join)
1 PRIMARY t2 ref a a 5 test.t1.a 1 Using where; Using index
1 PRIMARY t2 ref a a 5 test.t1.a 1 Using where; Using index
1 PRIMARY t3 ref a a 5 test.t1.a 1 Using where; Using index;
FirstMatch(t0)
1 PRIMARY t3 ref a a 5 test.t1.a 1 Using where; Using index;
End temporary
drop table t0, t1,t2,t3;
drop table t0, t1,t2,t3;
CREATE TABLE t1 (
CREATE TABLE t1 (
ID int(11) NOT NULL auto_increment,
ID int(11) NOT NULL auto_increment,
...
...
mysql-test/r/subselect_sj2_jcl6.result
View file @
85571ea7
...
@@ -275,10 +275,10 @@ explain select *
...
@@ -275,10 +275,10 @@ explain select *
from t0 where a in
from t0 where a in
(select t2.a+t3.a from t1 left join (t2 join t3) on t2.a=t1.a and t3.a=t1.a);
(select t2.a+t3.a from t1 left join (t2 join t3) on t2.a=t1.a and t3.a=t1.a);
id select_type table type possible_keys key key_len ref rows Extra
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t0 ALL NULL NULL NULL NULL 10
1 PRIMARY t0 ALL NULL NULL NULL NULL 10
Start temporary
1 PRIMARY t1 index NULL a 5 NULL 10 Using index; Using join buffer (flat, BNL join)
1 PRIMARY t1 index NULL a 5 NULL 10 Using index; Using join buffer (flat, BNL join)
1 PRIMARY t2 ref a a 5 test.t1.a 1 Using where; Using index
1 PRIMARY t2 ref a a 5 test.t1.a 1 Using where; Using index
1 PRIMARY t3 ref a a 5 test.t1.a 1 Using where; Using index;
FirstMatch(t0)
1 PRIMARY t3 ref a a 5 test.t1.a 1 Using where; Using index;
End temporary
drop table t0, t1,t2,t3;
drop table t0, t1,t2,t3;
CREATE TABLE t1 (
CREATE TABLE t1 (
ID int(11) NOT NULL auto_increment,
ID int(11) NOT NULL auto_increment,
...
...
sql/opt_subselect.cc
View file @
85571ea7
...
@@ -2160,7 +2160,8 @@ void advance_sj_state(JOIN *join, table_map remaining_tables,
...
@@ -2160,7 +2160,8 @@ void advance_sj_state(JOIN *join, table_map remaining_tables,
table_map
handled_by_fm_or_ls
=
0
;
table_map
handled_by_fm_or_ls
=
0
;
/* FirstMatch Strategy */
/* FirstMatch Strategy */
if
(
new_join_tab
->
emb_sj_nest
&&
if
(
new_join_tab
->
emb_sj_nest
&&
optimizer_flag
(
join
->
thd
,
OPTIMIZER_SWITCH_FIRSTMATCH
))
optimizer_flag
(
join
->
thd
,
OPTIMIZER_SWITCH_FIRSTMATCH
)
&&
!
join
->
outer_join
)
{
{
const
table_map
outer_corr_tables
=
const
table_map
outer_corr_tables
=
new_join_tab
->
emb_sj_nest
->
nested_join
->
sj_corr_tables
|
new_join_tab
->
emb_sj_nest
->
nested_join
->
sj_corr_tables
|
...
@@ -2255,7 +2256,7 @@ void advance_sj_state(JOIN *join, table_map remaining_tables,
...
@@ -2255,7 +2256,7 @@ void advance_sj_state(JOIN *join, table_map remaining_tables,
If we got an option to use LooseScan for the current table, start
If we got an option to use LooseScan for the current table, start
considering using LooseScan strategy
considering using LooseScan strategy
*/
*/
if
(
loose_scan_pos
->
read_time
!=
DBL_MAX
)
if
(
loose_scan_pos
->
read_time
!=
DBL_MAX
&&
!
join
->
outer_join
)
{
{
pos
->
first_loosescan_table
=
idx
;
pos
->
first_loosescan_table
=
idx
;
pos
->
loosescan_need_tables
=
pos
->
loosescan_need_tables
=
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment