• Sergey Petrunya's avatar
    MDEV-5992: EITS: Selectivity of non-indexed condition is counted twice in table's fanout · 26a3d567
    Sergey Petrunya authored
    MDEV-5984: EITS: Incorrect filtered% value for single-table select with range access
    - Fix calculate_cond_selectivity_for_table() to work correctly with range accesses 
      over multi-component keys:
      = First, take selectivity of all possible range scans into account. Remember which 
        fields were used bt the range scans.
      = Then, calculate selectivity produced by sargable predicates on fields. If a 
        field was used in a possible range access, assume its selectivity is already
        taken into account.
    - Fix table_cond_selectivity(): when quick select is used, selectivity of
      COND(table) is taken into account in matching_candidates_in_table(). In
      table_cond_selectivity() we should not apply it for the second time.
    26a3d567
selectivity_no_engine.result 6.63 KB