Skip to content

Commit

Permalink
Adjusted Range_rowid_filter_cost_info lookup cost slightly.
Browse files Browse the repository at this point in the history
If the array size would be 1, the cost would be 0 which is wrong.
Fixed by adding a small (0.001) base value to the lookup cost.

This causes not changes in any result files.
  • Loading branch information
montywi authored and spetrunia committed Jan 30, 2023
1 parent 987fcf9 commit 07b0d1a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion sql/rowid_filter.cc
Expand Up @@ -29,7 +29,8 @@ lookup_cost(Rowid_filter_container_type cont_type)
{
switch (cont_type) {
case SORTED_ARRAY_CONTAINER:
return log(est_elements)*0.01;
/* The addition is here to take care of arrays with 1 element */
return log(est_elements)*0.01+0.001;
default:
DBUG_ASSERT(0);
return 0;
Expand Down

0 comments on commit 07b0d1a

Please sign in to comment.