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
6a7f8af3
Commit
6a7f8af3
authored
Oct 05, 2013
by
Sergey Petrunya
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MDEV-3798: EXPLAIN UPDATE/DELETE
- Address review feedback: rename files
parent
fedf769f
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
24 additions
and
33 deletions
+24
-33
libmysqld/CMakeLists.txt
libmysqld/CMakeLists.txt
+1
-1
sql/CMakeLists.txt
sql/CMakeLists.txt
+1
-1
sql/sql_explain.cc
sql/sql_explain.cc
+0
-0
sql/sql_explain.h
sql/sql_explain.h
+0
-0
sql/sql_lex.cc
sql/sql_lex.cc
+5
-5
sql/sql_select.cc
sql/sql_select.cc
+16
-25
sql/sql_select.h
sql/sql_select.h
+1
-1
No files found.
libmysqld/CMakeLists.txt
View file @
6a7f8af3
...
...
@@ -99,7 +99,7 @@ SET(SQL_EMBEDDED_SOURCES emb_qcache.cc libmysqld.c lib_sql.cc
../sql/sql_expression_cache.cc
../sql/my_apc.cc ../sql/my_apc.h
../sql/rpl_gtid.cc
../sql/
opt_qpf.cc ../sql/opt_qpf
.h
../sql/
sql_explain.cc ../sql/sql_explain
.h
${
GEN_SOURCES
}
${
MYSYS_LIBWRAP_SOURCE
}
)
...
...
sql/CMakeLists.txt
View file @
6a7f8af3
...
...
@@ -80,7 +80,7 @@ SET (SQL_SOURCE
sql_reload.cc
# added in MariaDB:
opt_qpf.h opt_qpf
.cc
sql_explain.h sql_explain
.cc
sql_lifo_buffer.h sql_join_cache.h sql_join_cache.cc
create_options.cc multi_range_read.cc
opt_index_cond_pushdown.cc opt_subselect.cc
...
...
sql/
opt_qpf
.cc
→
sql/
sql_explain
.cc
View file @
6a7f8af3
File moved
sql/
opt_qpf
.h
→
sql/
sql_explain
.h
View file @
6a7f8af3
File moved
sql/sql_lex.cc
View file @
6a7f8af3
...
...
@@ -3516,14 +3516,14 @@ bool st_select_lex::optimize_unflattened_subqueries(bool const_only)
inner_join
->
select_options
=
save_options
;
un
->
thd
->
lex
->
current_select
=
save_select
;
Explain_query
*
qpf
;
if
((
qpf
=
inner_join
->
thd
->
lex
->
explain
))
Explain_query
*
eq
;
if
((
eq
=
inner_join
->
thd
->
lex
->
explain
))
{
Explain_select
*
qp
_sel
;
if
((
qp_sel
=
qpf
->
get_select
(
inner_join
->
select_lex
->
select_number
)))
Explain_select
*
expl
_sel
;
if
((
expl_sel
=
eq
->
get_select
(
inner_join
->
select_lex
->
select_number
)))
{
sl
->
set_explain_type
(
TRUE
);
qp
_sel
->
select_type
=
sl
->
type
;
expl
_sel
->
select_type
=
sl
->
type
;
}
}
...
...
sql/sql_select.cc
View file @
6a7f8af3
...
...
@@ -2328,14 +2328,6 @@ void join_save_qpf(JOIN *join)
void
JOIN
::
exec
()
{
/*
Enable SHOW EXPLAIN only if we're in the top-level query.
*/
/*
psergey: we can produce SHOW explain at this point. This means, we're ready
to save the query plan.
*/
thd
->
apc_target
.
enable
();
DBUG_EXECUTE_IF
(
"show_explain_probe_join_exec_start"
,
if
(
dbug_user_var_equals_int
(
thd
,
...
...
@@ -2343,7 +2335,6 @@ void JOIN::exec()
select_lex
->
select_number
))
dbug_serve_apcs
(
thd
,
1
);
);
exec_inner
();
if
(
!
exec_saved_explain
)
...
...
@@ -22505,15 +22496,15 @@ int JOIN::save_explain_data(Explain_query *output, bool need_tmp_table,
if
(
message
)
{
Explain_select
*
qp
_sel
;
qp_node
=
qp
_sel
=
new
(
output
->
mem_root
)
Explain_select
;
Explain_select
*
xpl
_sel
;
qp_node
=
xpl
_sel
=
new
(
output
->
mem_root
)
Explain_select
;
join
->
select_lex
->
set_explain_type
(
true
);
qp
_sel
->
select_id
=
join
->
select_lex
->
select_number
;
qp
_sel
->
select_type
=
join
->
select_lex
->
type
;
qp
_sel
->
message
=
message
;
/* Setting
qp
_sel->message means that all other members are invalid */
output
->
add_node
(
qp
_sel
);
xpl
_sel
->
select_id
=
join
->
select_lex
->
select_number
;
xpl
_sel
->
select_type
=
join
->
select_lex
->
type
;
xpl
_sel
->
message
=
message
;
/* Setting
xpl
_sel->message means that all other members are invalid */
output
->
add_node
(
xpl
_sel
);
}
else
if
(
join
->
select_lex
==
join
->
unit
->
fake_select_lex
)
{
...
...
@@ -22522,13 +22513,13 @@ int JOIN::save_explain_data(Explain_query *output, bool need_tmp_table,
else
if
(
!
join
->
select_lex
->
master_unit
()
->
derived
||
join
->
select_lex
->
master_unit
()
->
derived
->
is_materialized_derived
())
{
Explain_select
*
qp
_sel
;
qp_node
=
qp
_sel
=
new
(
output
->
mem_root
)
Explain_select
;
Explain_select
*
xpl
_sel
;
qp_node
=
xpl
_sel
=
new
(
output
->
mem_root
)
Explain_select
;
table_map
used_tables
=
0
;
join
->
select_lex
->
set_explain_type
(
true
);
qp
_sel
->
select_id
=
join
->
select_lex
->
select_number
;
qp
_sel
->
select_type
=
join
->
select_lex
->
type
;
xpl
_sel
->
select_id
=
join
->
select_lex
->
select_number
;
xpl
_sel
->
select_type
=
join
->
select_lex
->
type
;
JOIN_TAB
*
const
first_top_tab
=
first_breadth_first_tab
(
join
,
WALK_OPTIMIZATION_TABS
);
...
...
@@ -22572,7 +22563,7 @@ int JOIN::save_explain_data(Explain_query *output, bool need_tmp_table,
}
Explain_table_access
*
qpt
=
new
(
output
->
mem_root
)
Explain_table_access
;
qp
_sel
->
add_table
(
qpt
);
xpl
_sel
->
add_table
(
qpt
);
qpt
->
key
.
set
(
thd
->
mem_root
,
NULL
,
(
uint
)
-
1
);
qpt
->
quick_info
=
NULL
;
...
...
@@ -22583,7 +22574,7 @@ int JOIN::save_explain_data(Explain_query *output, bool need_tmp_table,
qpt
->
sjm_nest_select_id
=
0
;
/* select_type */
qp
_sel
->
select_type
=
join
->
select_lex
->
type
;
xpl
_sel
->
select_type
=
join
->
select_lex
->
type
;
/* table */
if
(
table
->
derived_select_number
)
...
...
@@ -22893,12 +22884,12 @@ int JOIN::save_explain_data(Explain_query *output, bool need_tmp_table,
if
(
need_tmp_table
)
{
need_tmp_table
=
0
;
qp
_sel
->
using_temporary
=
true
;
xpl
_sel
->
using_temporary
=
true
;
}
if
(
need_order
)
{
need_order
=
0
;
qp
_sel
->
using_filesort
=
true
;
xpl
_sel
->
using_filesort
=
true
;
}
if
(
distinct
&
test_all_bits
(
used_tables
,
join
->
select_list_used_tables
))
...
...
@@ -22956,7 +22947,7 @@ int JOIN::save_explain_data(Explain_query *output, bool need_tmp_table,
// For next iteration
used_tables
|=
table
->
map
;
}
output
->
add_node
(
qp
_sel
);
output
->
add_node
(
xpl
_sel
);
}
for
(
SELECT_LEX_UNIT
*
unit
=
join
->
select_lex
->
first_inner_unit
();
...
...
sql/sql_select.h
View file @
6a7f8af3
...
...
@@ -198,7 +198,7 @@ int rr_sequential(READ_RECORD *info);
int
rr_sequential_and_unpack
(
READ_RECORD
*
info
);
#include "
opt_qpf
.h"
#include "
sql_explain
.h"
/**************************************************************************************
* New EXPLAIN structures END
...
...
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