• Sergei Petrunia's avatar
    MDEV-8989: ORDER BY optimizer ignores equality propagation · 99cd5a96
    Sergei Petrunia authored
    Variant #4 of the fix.
    
    Make ORDER BY optimization functions take into account multiple
    equalities. This is done in several places:
    - remove_const() checks whether we can sort the first table in the
      join, or we need to put rows into temp.table and then sort.
    - test_if_order_by_key() checks whether there are indexes that
      can be used to produce the required ordering
    - make_unireg_sortorder() constructs sort criteria for filesort.
    99cd5a96
sql_update.cc 81.3 KB