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
687a51f8
Commit
687a51f8
authored
Feb 15, 2016
by
Sergei Petrunia
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Forgot to add sql_select.cc to the previous commit
parent
970307f5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
26 deletions
+10
-26
sql/sql_select.cc
sql/sql_select.cc
+10
-26
No files found.
sql/sql_select.cc
View file @
687a51f8
...
...
@@ -7304,13 +7304,13 @@ double JOIN::get_examined_rows()
{
double
examined_rows
;
double
prev_fanout
=
1
;
JOIN_TAB
*
tab
=
first_breadth_first_
optimization_
tab
();
JOIN_TAB
*
tab
=
first_breadth_first_tab
();
JOIN_TAB
*
prev_tab
=
tab
;
examined_rows
=
tab
->
get_examined_rows
();
while
((
tab
=
next_breadth_first_tab
(
first_breadth_first_
optimization_
tab
(),
top_
table_access_tabs
_count
,
tab
)))
while
((
tab
=
next_breadth_first_tab
(
first_breadth_first_tab
(),
top_
join_tab
_count
,
tab
)))
{
prev_fanout
*=
prev_tab
->
records_read
;
examined_rows
+=
tab
->
get_examined_rows
()
*
prev_fanout
;
...
...
@@ -8262,7 +8262,7 @@ static JOIN_TAB *next_breadth_first_tab(JOIN_TAB *first_top_tab,
JOIN_TAB
*
first_explain_order_tab
(
JOIN
*
join
)
{
JOIN_TAB
*
tab
;
tab
=
join
->
table_access_tabs
;
tab
=
join
->
join_tab
;
return
(
tab
->
bush_children
)
?
tab
->
bush_children
->
start
:
tab
;
}
...
...
@@ -8276,7 +8276,7 @@ JOIN_TAB *next_explain_order_tab(JOIN* join, JOIN_TAB* tab)
/* Move to next tab in the array we're traversing */
tab
++
;
if
(
tab
==
join
->
table_access_tabs
+
join
->
top_join_tab_count
)
if
(
tab
==
join
->
join_tab
+
join
->
top_join_tab_count
)
return
NULL
;
/* Outside SJM nest and reached EOF */
if
(
tab
->
bush_children
)
...
...
@@ -8302,7 +8302,7 @@ JOIN_TAB *first_top_level_tab(JOIN *join, enum enum_with_const_tables const_tbls
JOIN_TAB
*
next_top_level_tab
(
JOIN
*
join
,
JOIN_TAB
*
tab
)
{
tab
=
next_breadth_first_tab
(
join
->
first_breadth_first_
execution_
tab
(),
tab
=
next_breadth_first_tab
(
join
->
first_breadth_first_tab
(),
join
->
top_join_tab_count
,
tab
);
if
(
tab
&&
tab
->
bush_root_tab
)
tab
=
NULL
;
...
...
@@ -8636,12 +8636,6 @@ bool JOIN::get_best_combination()
top_join_tab_count
=
join_tab_ranges
.
head
()
->
end
-
join_tab_ranges
.
head
()
->
start
;
/*
Save pointers to select join tabs for SHOW EXPLAIN
*/
table_access_tabs
=
join_tab
;
top_table_access_tabs_count
=
top_join_tab_count
;
update_depend_map
(
this
);
DBUG_RETURN
(
0
);
...
...
@@ -11754,20 +11748,10 @@ void JOIN::cleanup(bool full)
*/
if
(
table_count
)
{
for
(
tab
=
first_breadth_first_
optimization_
tab
();
tab
;
tab
=
next_breadth_first_tab
(
first_breadth_first_
optimization_
tab
(),
top_
table_access_tabs
_count
,
tab
))
for
(
tab
=
first_breadth_first_tab
();
tab
;
tab
=
next_breadth_first_tab
(
first_breadth_first_tab
(),
top_
join_tab
_count
,
tab
))
tab
->
cleanup
();
/* We've walked optimization tabs, do execution ones too. */
if
(
first_breadth_first_execution_tab
()
!=
first_breadth_first_optimization_tab
())
{
for
(
tab
=
first_breadth_first_execution_tab
();
tab
;
tab
=
next_breadth_first_tab
(
first_breadth_first_execution_tab
(),
top_join_tab_count
,
tab
))
tab
->
cleanup
();
}
}
cleaned
=
true
;
//psergey2: added (Q: why not in the above loop?)
...
...
@@ -24163,7 +24147,7 @@ int JOIN::save_explain_data_intern(Explain_query *output, bool need_tmp_table,
xpl_sel
->
having
=
having
;
xpl_sel
->
having_value
=
having_value
;
JOIN_TAB
*
const
first_top_tab
=
join
->
first_breadth_first_
optimization_
tab
();
JOIN_TAB
*
const
first_top_tab
=
join
->
first_breadth_first_tab
();
JOIN_TAB
*
prev_bush_root_tab
=
NULL
;
Explain_basic_join
*
cur_parent
=
xpl_sel
;
...
...
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