• Michael Widenius's avatar
    Fixed some issues with FORCE INDEX · 33fc8037
    Michael Widenius authored
    Added code to support that force index can be used to force an index scan
    instead of a full table scan. Currently this code is disable but I added
    a test to verify that things works if the code is ever enabled.
    
    Other things:
    
    - FORCE INDEX will now work with "Range checked for each record" and
      join cache (see main/type_time_6065)
    - Removed code ifdef with BAD_OPTIMIZATION (New cost calculations should
      fix this).
    - Removed TABLE_LIST->force_index and comment that it should be removed
    - Added TABLE->force_index_join and use in the corresponding places.
      This means that FORCE INDEX FOR ORDER BY will not affect keys used
      in joins anymore.
      Remove TODO that the above should be added.
      I still kept TABLE->force_index as it's used in
      test_if_cheaper_ordering() and opt_range.cc
    - Removed setting table->force_index when calling test_quick_select() as
      it's not needed (force_index is an argument to test_quick_select())
    33fc8037
sql_select.h 85.9 KB