• unknown's avatar
    Fix bug MDEV-641 · 768b62fe
    unknown authored
    Analysis:
    Range analysis discoveres that the query can be executed via loose index scan for GROUP BY.
    Later, GROUP BY analysis fails to confirm that the GROUP operation can be computed via an
    index because there is no logic to handle duplicate field references in the GROUP clause.
    As a result the optimizer produces an inconsistent plan. It constructs a temporary table,
    but on the other hand the group fields are not set to point there.
        
    Solution:
    Make loose scan analysis work in sync with order by analysis. In the case of duplicate
    columns loose scan will not be applicable. This limitation will be lifted in 10.0 by
    removing duplicate columns.
    768b62fe
opt_range.cc 361 KB