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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
mariadb
Commits
932d5166
Commit
932d5166
authored
Jul 14, 2011
by
Sergey Petrunya
Browse files
Options
Browse Files
Download
Plain Diff
Merge
parents
2a9c86be
85571ea7
Changes
5
Show 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 @
932d5166
...
...
@@ -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);
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 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 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);
...
...
@@ -1227,7 +1227,7 @@ c1 c1 c1
EXPLAIN
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
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 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);
...
...
mysql-test/r/subselect_sj.result
View file @
932d5166
...
...
@@ -1457,8 +1457,8 @@ explain
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
1 PRIMARY t0 ALL NULL NULL NULL NULL 2
1 PRIMARY t1 ALL NULL NULL NULL NULL 4 Using where
1 PRIMARY t2 ALL NULL NULL NULL NULL 1 Using where;
FirstMatch(t0)
1 PRIMARY t1 ALL NULL NULL NULL NULL 4 Using where
; Start temporary
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);
a
1
...
...
mysql-test/r/subselect_sj2.result
View file @
932d5166
...
...
@@ -267,10 +267,10 @@ explain select *
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);
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY t0 ALL NULL NULL NULL NULL 10
1 PRIMARY t1 index NULL a 5 NULL 10 Using index
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 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;
CREATE TABLE t1 (
ID int(11) NOT NULL auto_increment,
...
...
mysql-test/r/subselect_sj2_jcl6.result
View file @
932d5166
...
...
@@ -275,10 +275,10 @@ explain select *
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);
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 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;
CREATE TABLE t1 (
ID int(11) NOT NULL auto_increment,
...
...
sql/opt_subselect.cc
View file @
932d5166
...
...
@@ -2160,7 +2160,8 @@ void advance_sj_state(JOIN *join, table_map remaining_tables,
table_map
handled_by_fm_or_ls
=
0
;
/* FirstMatch Strategy */
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
=
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,
If we got an option to use LooseScan for the current table, start
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
->
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