Implement cost_of_filesort()
The sort length is extracted similarly to how sortlength() function does it. The function makes use of filesort_use_addons function to compute the length of addon fields. Finally, by calling compute_sort_costs we get the fastest_sort possible. Other changes: * Sort_param::using_addon_fields() assumes addon fields are already allocated. This makes the use of Sort_param unusable for compute_sort_costs *if* we don't want to allocate addon fields. As a preliminary fix, pass "with_addon_fields" as bool value to compute_sort_costs() and make the internal functions use that value instead of Sort_param::using_addon_fields() method. The ideal fix would be to define a "leaner" struct with only the necessary members, but this can be done as a separate commit. Reviewer: Monty
Showing
Please register or sign in to comment