diff options
author | Varun Gupta <varun.gupta@mariadb.com> | 2019-10-04 13:30:26 +0530 |
---|---|---|
committer | Varun Gupta <varun.gupta@mariadb.com> | 2019-10-04 13:30:26 +0530 |
commit | db1545cfba2ff06f018f880b928ed85079e30d4f (patch) | |
tree | ff5eb5727fd227f2034310ad6a4184efe71b6b77 | |
parent | c01fe5a58bf6c1133e122ebc30f25aa2be4d91fb (diff) | |
download | mariadb-git-db1545cfba2ff06f018f880b928ed85079e30d4f.tar.gz |
minor fix
-rw-r--r-- | sql/opt_trace.h | 1 | ||||
-rw-r--r-- | sql/sql_select.cc | 6 | ||||
-rw-r--r-- | sql/sql_select.h | 3 | ||||
-rw-r--r-- | sql/sql_sort_nest.cc | 4 |
4 files changed, 8 insertions, 6 deletions
diff --git a/sql/opt_trace.h b/sql/opt_trace.h index d2330420a2e..385553dc584 100644 --- a/sql/opt_trace.h +++ b/sql/opt_trace.h @@ -111,6 +111,7 @@ void print_best_access_for_table(THD *thd, POSITION *pos, enum join_type type); void add_sort_nest_tables_to_trace(JOIN *join, Mat_join_tab_nest_info* nest_info); +void trace_sort_nest(JOIN *join, uint idx, table_map remaining_tables); /* Security related (need to add a proper comment here) diff --git a/sql/sql_select.cc b/sql/sql_select.cc index 61ae4b16413..25cf486f27d 100644 --- a/sql/sql_select.cc +++ b/sql/sql_select.cc @@ -5301,8 +5301,6 @@ make_join_statistics(JOIN *join, List<TABLE_LIST> &tables_list, } } - join->join_tab= stat; - join->make_notnull_conds_for_range_scans(); /* Here a call is made to remove the constant from the order by clause, this call would only remove the basic constants. This is done primarily @@ -5317,6 +5315,9 @@ make_join_statistics(JOIN *join, List<TABLE_LIST> &tables_list, join->propagate_equal_field_for_orderby(); + join->join_tab= stat; + join->make_notnull_conds_for_range_scans(); + /* Calc how many (possible) matched records in each table */ /* @@ -9664,7 +9665,6 @@ best_extension_by_limited_search(JOIN *join, { position->sort_nest_operation_here= TRUE; } ->>>>>>> ORDER BY LIMIT /* Compute the cost of extending the plan with 's' */ current_record_count= COST_MULT(record_count, position->records_read); diff --git a/sql/sql_select.h b/sql/sql_select.h index f8deea0036e..ec86ae346ed 100644 --- a/sql/sql_select.h +++ b/sql/sql_select.h @@ -2285,7 +2285,8 @@ void best_access_path(JOIN *join, JOIN_TAB *s, table_map remaining_tables, const POSITION *join_positions, uint idx, bool disable_jbuf, double record_count, - POSITION *pos, POSITION *loose_scan_pos); + POSITION *pos, POSITION *loose_scan_pos, + table_map sort_nest_tables, bool nest_created); bool cp_buffer_from_ref(THD *thd, TABLE *table, TABLE_REF *ref); bool error_if_full_join(JOIN *join); int report_error(TABLE *table, int error); diff --git a/sql/sql_sort_nest.cc b/sql/sql_sort_nest.cc index 87773414342..857b1a172ac 100644 --- a/sql/sql_sort_nest.cc +++ b/sql/sql_sort_nest.cc @@ -43,7 +43,7 @@ clause. Let's say we have tables t1, t2, t3, t4 .............tk,tk+1.........................tn - |<---------prefix------------>|<-------suffix---------------> + |<---------prefix------------>|<-------suffix--------------->| and lets assume the prefix can resolve the ORDER BY clause and we can push the LIMIT. @@ -124,7 +124,7 @@ Preparation of Sort Nest Let's say we have the best join order as: t1, t2, t3, t4 .............tk,tk+1.........................tn - |<---------prefix------------>|<-------suffix---------------> + |<---------prefix------------>|<-------suffix--------------->| The array of join_tab structures would look like |