• Monty's avatar
    Fix cost calculation for get_best_group_min_max() · 7afa819f
    Monty authored
    If the final range restrictions (SEL_ARG tree) over GROUP BY
    columns are single-point, we can compute the number of GROUP BY groups.
    
    Example: in the query:
    SELECT ... FROM tbl
    WHERE keypart1 IN (1,2,3) and keypart2 IN ('foo','bar')
    
    Other things:
    - Fixed cost calculation to more correctly count the number of blocks
      that may be read. The old code could use the total blocks in the file
      even if a range was available.
    7afa819f
group_by.test 70.8 KB