• Monty's avatar
    MDEV-25830 optimizer_use_condition_selectivity=4 sometimes produces worse plan... · fdec8852
    Monty authored
    MDEV-25830 optimizer_use_condition_selectivity=4 sometimes produces worse plan than optimizer_use_condition_selectivity=1
    
    The issue was that calc_cond_selectivity_for_table prefered ranges with
    many parts and when deciding on which selectivity to use.
    
    Fixed by going through ranges according to the number of rows in the range.
    
    This ensures that selectivity from ranges with few rows will be prefered
    over ranges with many rows for indexes that uses the same columns.
    fdec8852
group_min_max.result 139 KB