• Aditya A's avatar
    WL9513 Bug#23333990 PERSISTENT INDEX STATISTICS UPDATE BEFORE TRANSACTION IS COMMITTED · 44b1fb36
    Aditya A authored
    PROBLEM
    
    By design stats estimation always reading uncommitted data. In this scenario
    an uncommitted transaction has deleted all rows in the table. In Innodb
    uncommitted delete records are marked as delete but not actually removed
    from Btree until the transaction has committed or a read view for the rows
    is present.While calculating persistent stats we were ignoring the delete
    marked records,since all the records are delete marked we were estimating
    the number of rows present in the table as zero which leads to bad plans
    in other transaction operating on the table.
    
    Fix
    
    Introduced a system variable called innodb_stats_include_delete_marked
    which when enabled includes delete marked records for stat
    calculations .
    44b1fb36
innodb_stats_del_mark.test 3.67 KB