Skip to content
  • Jorgen Loland's avatar
    403acfc4
    Bug#17889511: FORCE INDEX UNABLE TO FORCE AN ORDER BY WITH JOIN · 403acfc4
    Jorgen Loland authored
    "FORCE INDEX [FOR ORDER BY] (indexName)" did not work for joins
    because test_if_skip_sort_order() contains a heuristic that 
    table scan + join cache tends to be cheaper than an index scan.
    
    While the heuristic may be correct, it should not override the
    users explicit request to use the index.
    
    This patch also changes the warning created for EXPLAIN. Instead
    of printing only "IGNORE/USE/FORCE INDEX" it now also prints
    "FOR [GROUP BY|ORDER BY|JOIN]" if this was specified in the
    query.
    403acfc4
    Bug#17889511: FORCE INDEX UNABLE TO FORCE AN ORDER BY WITH JOIN
    Jorgen Loland authored
    "FORCE INDEX [FOR ORDER BY] (indexName)" did not work for joins
    because test_if_skip_sort_order() contains a heuristic that 
    table scan + join cache tends to be cheaper than an index scan.
    
    While the heuristic may be correct, it should not override the
    users explicit request to use the index.
    
    This patch also changes the warning created for EXPLAIN. Instead
    of printing only "IGNORE/USE/FORCE INDEX" it now also prints
    "FOR [GROUP BY|ORDER BY|JOIN]" if this was specified in the
    query.
Loading