diff options
author | Sergey Petrunya <psergey@askmonty.org> | 2013-06-27 17:56:49 +0400 |
---|---|---|
committer | Sergey Petrunya <psergey@askmonty.org> | 2013-06-27 17:56:49 +0400 |
commit | befacafd73d4892f2ad84991ad7c2d4626e45c47 (patch) | |
tree | b83bb27634fa3f82471bcdeb5fc134f2262bc00a /sql/sql_join_cache.cc | |
parent | 5422098b758dfec801b32c833b8840ec96e00081 (diff) | |
download | mariadb-git-befacafd73d4892f2ad84991ad7c2d4626e45c47.tar.gz |
[SHOW] EXPLAIN UPDATE/DELETE, code re-structuring
- Let Query Plan Footprint store join buffer type
in binary form, not string.
- Same for LooseScan type.
Diffstat (limited to 'sql/sql_join_cache.cc')
-rw-r--r-- | sql/sql_join_cache.cc | 35 |
1 files changed, 13 insertions, 22 deletions
diff --git a/sql/sql_join_cache.cc b/sql/sql_join_cache.cc index 9fca8730cb5..7710db5c7ba 100644 --- a/sql/sql_join_cache.cc +++ b/sql/sql_join_cache.cc @@ -2568,34 +2568,26 @@ finish: none */ -void JOIN_CACHE::print_explain_comment(String *str) +void JOIN_CACHE::save_qpf(struct st_qpf_bka_type *qpf) { - str->append(STRING_WITH_LEN(" (")); - const char *buffer_type= prev_cache ? "incremental" : "flat"; - str->append(buffer_type); - str->append(STRING_WITH_LEN(", ")); - - const char *join_alg=""; + qpf->incremental= test(prev_cache); + switch (get_join_alg()) { case BNL_JOIN_ALG: - join_alg= "BNL"; + qpf->join_alg= "BNL"; break; case BNLH_JOIN_ALG: - join_alg= "BNLH"; + qpf->join_alg= "BNLH"; break; case BKA_JOIN_ALG: - join_alg= "BKA"; + qpf->join_alg= "BKA"; break; case BKAH_JOIN_ALG: - join_alg= "BKAH"; + qpf->join_alg= "BKAH"; break; default: DBUG_ASSERT(0); } - - str->append(join_alg); - str->append(STRING_WITH_LEN(" join")); - str->append(STRING_WITH_LEN(")")); } /** @@ -2621,18 +2613,17 @@ static void add_mrr_explain_info(String *str, uint mrr_mode, handler *file) } } - -void JOIN_CACHE_BKA::print_explain_comment(String *str) +void JOIN_CACHE_BKA::save_qpf(struct st_qpf_bka_type *qpf) { - JOIN_CACHE::print_explain_comment(str); - add_mrr_explain_info(str, mrr_mode, join_tab->table->file); + JOIN_CACHE::save_qpf(qpf); + add_mrr_explain_info(&qpf->mrr_type, mrr_mode, join_tab->table->file); } -void JOIN_CACHE_BKAH::print_explain_comment(String *str) +void JOIN_CACHE_BKAH::save_qpf(struct st_qpf_bka_type *qpf) { - JOIN_CACHE::print_explain_comment(str); - add_mrr_explain_info(str, mrr_mode, join_tab->table->file); + JOIN_CACHE::save_qpf(qpf); + add_mrr_explain_info(&qpf->mrr_type, mrr_mode, join_tab->table->file); } |