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
74bb936d
Commit
74bb936d
authored
Mar 29, 2011
by
Sergey Petrunya
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
optimize_wo_join_buffering(): Put saving/restoring of cur_sj_inner_tables back,
together with explanation why we need it.
parent
c763fb1b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
15 additions
and
0 deletions
+15
-0
sql/sql_select.cc
sql/sql_select.cc
+15
-0
No files found.
sql/sql_select.cc
View file @
74bb936d
...
@@ -11541,6 +11541,20 @@ void optimize_wo_join_buffering(JOIN *join, uint first_tab, uint last_tab,
...
@@ -11541,6 +11541,20 @@ void optimize_wo_join_buffering(JOIN *join, uint first_tab, uint last_tab,
*
outer_rec_count
=
rec_count
;
*
outer_rec_count
=
rec_count
;
for
(
i
=
first_tab
;
i
<=
last_tab
;
i
++
)
for
(
i
=
first_tab
;
i
<=
last_tab
;
i
++
)
reopt_remaining_tables
|=
join
->
positions
[
i
].
table
->
table
->
map
;
reopt_remaining_tables
|=
join
->
positions
[
i
].
table
->
table
->
map
;
/*
best_access_path() optimization depends on the value of
join->cur_sj_inner_tables. Our goal in this function is to do a
re-optimization with disabled join buffering, but no other changes.
In order to achieve this, cur_sj_inner_tables needs have the same
value it had during the original invocations of best_access_path.
We know that this function, optimize_wo_join_buffering() is called to
re-optimize semi-join join order range, which allows to conclude that
the "original" value of cur_sj_inner_tables was 0.
*/
table_map
save_cur_sj_inner_tables
=
join
->
cur_sj_inner_tables
;
join
->
cur_sj_inner_tables
=
0
;
for
(
i
=
first_tab
;
i
<=
last_tab
;
i
++
)
for
(
i
=
first_tab
;
i
<=
last_tab
;
i
++
)
{
{
...
@@ -11567,6 +11581,7 @@ void optimize_wo_join_buffering(JOIN *join, uint first_tab, uint last_tab,
...
@@ -11567,6 +11581,7 @@ void optimize_wo_join_buffering(JOIN *join, uint first_tab, uint last_tab,
if
(
!
rs
->
emb_sj_nest
)
if
(
!
rs
->
emb_sj_nest
)
*
outer_rec_count
*=
pos
.
records_read
;
*
outer_rec_count
*=
pos
.
records_read
;
}
}
join
->
cur_sj_inner_tables
=
save_cur_sj_inner_tables
;
*
reopt_cost
=
cost
;
*
reopt_cost
=
cost
;
}
}
...
...
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