MCPcopy Create free account
hub / github.com/MariaDB/server / determine_search_depth

Function determine_search_depth

sql/sql_select.cc:10584–10602  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10582*/
10583
10584static uint
10585determine_search_depth(JOIN *join)
10586{
10587 uint table_count= join->table_count - join->const_tables;
10588 uint search_depth;
10589 /* TODO: this value should be determined dynamically, based on statistics: */
10590 uint max_tables_for_exhaustive_opt= 7;
10591
10592 if (table_count <= max_tables_for_exhaustive_opt)
10593 search_depth= table_count+1; // use exhaustive for small number of tables
10594 else
10595 /*
10596 TODO: this value could be determined by some mapping of the form:
10597 depth : table_count -> [max_tables_for_exhaustive_opt..MAX_EXHAUSTIVE]
10598 */
10599 search_depth= max_tables_for_exhaustive_opt; // use greedy search
10600
10601 return search_depth;
10602}
10603
10604
10605/**

Callers 1

choose_planFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected