Skip to content
  • Olav Sandstaa's avatar
    785450ac
    WL#6082 Improve the Disk-Sweep Multi-Range Read cost model · 785450ac
    Olav Sandstaa authored
    Fix to make the innodb_mysql test stable when run with 4K InnoDB
    block size.
    
    The following explain in the innodb_mysql test:
    
    EXPLAIN SELECT * FROM t1 WHERE f1 IN
    (3305028,3353871,3772880,3346860,4228206,3336022,
     3470988,3305175,3329875,3817277,3856380,3796193,
     3784744,4180925,4559596,3963734,3856391,4494153)
    AND f5 = 'abcdefghijklmnopwrst' AND f2 = 1221457 AND f4 = 0 ;
    
    started to fail due to changes in the query plan when running
    the test with 4K InnoDB block size. The change was from using index
    merge on (idx2,idx1,PRIMARY) to use index merge on (idx2,PRIMARY). 
    This cause for this change is that the new DS-MRR cost model 
    produces lower cost estimates for reading the table as a "disk sweep".
    The reason for producing different plans when running with 16K versus
    4K InnoDB block size is that for the 4K InnoDB blocksize case the size
    of the table is smaller (32KB vs 48KB) and this influences on the
    cost estimate for reading the data.
    
    In order to get the same query plan when running with 4K and 16K
    block size, the fix for this problem is to:
    -add some extra records to the table
    -enable persistent statistics on the table to get more exact statistical data
    
    Approved by Vasil on IM.
    785450ac
    WL#6082 Improve the Disk-Sweep Multi-Range Read cost model
    Olav Sandstaa authored
    Fix to make the innodb_mysql test stable when run with 4K InnoDB
    block size.
    
    The following explain in the innodb_mysql test:
    
    EXPLAIN SELECT * FROM t1 WHERE f1 IN
    (3305028,3353871,3772880,3346860,4228206,3336022,
     3470988,3305175,3329875,3817277,3856380,3796193,
     3784744,4180925,4559596,3963734,3856391,4494153)
    AND f5 = 'abcdefghijklmnopwrst' AND f2 = 1221457 AND f4 = 0 ;
    
    started to fail due to changes in the query plan when running
    the test with 4K InnoDB block size. The change was from using index
    merge on (idx2,idx1,PRIMARY) to use index merge on (idx2,PRIMARY). 
    This cause for this change is that the new DS-MRR cost model 
    produces lower cost estimates for reading the table as a "disk sweep".
    The reason for producing different plans when running with 16K versus
    4K InnoDB block size is that for the 4K InnoDB blocksize case the size
    of the table is smaller (32KB vs 48KB) and this influences on the
    cost estimate for reading the data.
    
    In order to get the same query plan when running with 4K and 16K
    block size, the fix for this problem is to:
    -add some extra records to the table
    -enable persistent statistics on the table to get more exact statistical data
    
    Approved by Vasil on IM.
Loading