Skip to content
  • Chaithra Gopalareddy's avatar
    ddc4ff06
    Bug #18109609: LOOSE INDEX SCAN IS NOT USED WHEN IT SHOULD · ddc4ff06
    Chaithra Gopalareddy authored
    Problem:
    Loose index scan is not chosen if a query has a equality condition.
    
    Analysis:
    Optimizer indeed chooses loose index scan as the cheapest possible access
    plan for the given query before it checks for ref access.
    However optimizer chooses ref access without calculating the cost because
    of the heuristic "ref scan is always cheaper compared to range scan if it
    is utilizing the same or more keyparts ". However in case of loose index
    scan, it is not always guranteed that ref scan will be looking at
    same/less number of qualifying rows.
    
    Solution:
    Do not consider the above heuristic when the chosen access plan is loose
    index scan. Instead calculated the cost for doing ref access before choosing
    it.
    ddc4ff06
    Bug #18109609: LOOSE INDEX SCAN IS NOT USED WHEN IT SHOULD
    Chaithra Gopalareddy authored
    Problem:
    Loose index scan is not chosen if a query has a equality condition.
    
    Analysis:
    Optimizer indeed chooses loose index scan as the cheapest possible access
    plan for the given query before it checks for ref access.
    However optimizer chooses ref access without calculating the cost because
    of the heuristic "ref scan is always cheaper compared to range scan if it
    is utilizing the same or more keyparts ". However in case of loose index
    scan, it is not always guranteed that ref scan will be looking at
    same/less number of qualifying rows.
    
    Solution:
    Do not consider the above heuristic when the chosen access plan is loose
    index scan. Instead calculated the cost for doing ref access before choosing
    it.
Loading