• Mattias Jonsson's avatar
    Bug#53806: Wrong estimates for range query in partitioned MyISAM table · 50150fd6
    Mattias Jonsson authored
    Bug#46754: 'rows' field doesn't reflect partition pruning
    
    The EXPLAIN's result in 'rows' field
    was evaluated to number of rows when the table was opened
    (not from the table cache) and only the partitions left
    after pruning was updated with its correct number
    of rows.
    
    The evaluation of the 'rows' field was using handler::records()
    which is a potentially expensive call, and ignores the partitioning
    pruning.
    
    The fix was to use the handlers stats.records after updating it
    with ::info(HA_STATUS_VARIABLE) instead.
    50150fd6
sql_select.cc 549 KB