• gshchepa/uchum@host.loc's avatar
    Fixed bug#36006: Optimizer does table scan for SELECT COUNT(*) · 107b84f9
    gshchepa/uchum@host.loc authored
                     for ENGINE=MRG_MYISAM (should be optimized out).
    
    Before WL#3281 MERGE engine had the HA_NOT_EXACT_COUNT flag
    unset, and it worked with COUNT optimization as desired.
    After the removal of the HA_NOT_EXACT_COUNT flag neither
    HA_STATS_RECORDS_IS_EXACT (opposite to former HA_NOT_EXACT_COUNT
    flag) nor modern HA_HAS_RECORDS flag were not added to MERGE
    table flag mask.
    
    1. The HA_HAS_RECORDS table flag has been set.
    2. The ha_myisammrg::records method has been overridden to
       calculate total number of records in underlying tables.
    107b84f9
myrg_records.c 974 Bytes