朋友问:
best_extension_by_limited_search,
这个函数的功能是选取余下表中代价最小的那个,这个代价最小具体指的是什么呢? 1, 遍历余下的表,选择最小代价的那个,2,
还是所有余下的表中组合代价最小的第1个表呢?
回答:
1 MySQL代码注释说:
The algorithm begins with an empty partial
plan stored in 'join->positions'
and a set of N tables - 'remaining_tables'.
Each step of the algorithm
evaluates the cost of the partial plan
extended by all access plans for
each of the relations in 'remaining_tables',
expands the current partial
plan with the access plan that results in
lowest cost of the expanded
partial plan, and removes the corresponding
relation from
'remaining_tables'. The …