diff options
author | Sergei Petrunia <psergey@askmonty.org> | 2015-07-02 13:33:08 +0300 |
---|---|---|
committer | Sergei Petrunia <psergey@askmonty.org> | 2015-07-02 13:40:03 +0300 |
commit | 302bf7c4664b904482ecc133476e822d497b114d (patch) | |
tree | a8327b258642841a6dfaccc4504cc998dc1d020b /sql/sql_explain.cc | |
parent | 28a8ba089fa3ebc11ed6649ee07536c1d30b4791 (diff) | |
download | mariadb-git-302bf7c4664b904482ecc133476e822d497b114d.tar.gz |
Tabular ANALYZE must get its data from execution tracker
Diffstat (limited to 'sql/sql_explain.cc')
-rw-r--r-- | sql/sql_explain.cc | 32 |
1 files changed, 30 insertions, 2 deletions
diff --git a/sql/sql_explain.cc b/sql/sql_explain.cc index 9f4b635fbf4..41d4268748c 100644 --- a/sql/sql_explain.cc +++ b/sql/sql_explain.cc @@ -726,8 +726,36 @@ int Explain_select::print_explain(Explain_query *query, } else { - bool using_tmp= using_temporary; - bool using_fs= using_filesort; + bool using_tmp; + bool using_fs; + + if (is_analyze) + { + /* + Get the data about "Using temporary; Using filesort" from execution + tracking system. + */ + using_tmp= false; + using_fs= false; + Sort_and_group_tracker::Iterator iter(&ops_tracker); + enum_qep_action action; + Filesort_tracker *dummy; + + while ((action= iter.get_next(&dummy)) != EXPL_ACTION_EOF) + { + if (action == EXPL_ACTION_FILESORT) + using_fs= true; + else if (action == EXPL_ACTION_TEMPTABLE) + using_tmp= true; + } + } + else + { + /* Use imprecise "estimates" we got with the query plan */ + using_tmp= using_temporary; + using_fs= using_filesort; + } + for (uint i=0; i< n_join_tabs; i++) { join_tabs[i]->print_explain(output, explain_flags, is_analyze, select_id, |