diff options
author | Varun Gupta <varun.gupta@mariadb.com> | 2019-01-03 05:03:57 +0530 |
---|---|---|
committer | Varun Gupta <varun.gupta@mariadb.com> | 2019-01-03 07:01:41 +0530 |
commit | 4bdd97be25b70b53a0f265dfcda58db0d89ddb7c (patch) | |
tree | 4dc3f599c89c5808d6817c25878b6104f7c4d13e /sql/sql_select.cc | |
parent | 2c978c8292e320912440a814fcd3ba77a9e85836 (diff) | |
download | mariadb-git-10.4-mdev6111.tar.gz |
Fixing minor stuff in code10.4-mdev6111
Diffstat (limited to 'sql/sql_select.cc')
-rw-r--r-- | sql/sql_select.cc | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 81c79a78ee8..558cf4f537a 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -8023,9 +8023,17 @@ optimize_straight_join(JOIN *join, table_map join_tables) uint use_cond_selectivity= join->thd->variables.optimizer_use_condition_selectivity; POSITION loose_scan_pos; + Opt_trace_context* const trace= &join->thd->opt_trace; + Json_writer* writer= trace->get_current_json(); for (JOIN_TAB **pos= join->best_ref + idx ; (s= *pos) ; pos++) { + Json_writer_object trace_one_table(writer); + if (unlikely(trace->get_current_trace())) + { + trace_plan_prefix(join, idx, join_tables); + trace_one_table.add_member("table").add_table_name(s->tab_list); + } /* Find the best access method from 's' to the current partial plan */ best_access_path(join, s, join_tables, idx, disable_jbuf, record_count, join->positions + idx, &loose_scan_pos); @@ -27035,8 +27043,9 @@ test_if_cheaper_ordering(const JOIN_TAB *tab, ORDER *order, TABLE *table, bool group= join && join->group && order == join->group_list; ha_rows refkey_rows_estimate= table->quick_condition_rows; const bool has_limit= (select_limit_arg != HA_POS_ERROR); + THD* thd= join ? join->thd : table->in_use; - Opt_trace_context *const trace = &join->thd->opt_trace; + Opt_trace_context *const trace = &thd->opt_trace; Json_writer *writer= trace->get_current_json(); Json_writer_object trace_wrapper(writer); Json_writer_object trace_cheaper_ordering( |