pt-table-checksum - how many rows to chunk at a time?

I was wondering how decides how many rows to chunk at a time for a table with primary key. I see that the first chunk is always of size 1000 rows. But the subsequent ones vary depending on the table. Can someone explain how these chunk sizes are decided?



The idea is that calculation of each chunk takes 0.5 second. It will start from 1000 rows, if this query takes more than 0.5 seconds, it next chunk will be with less rows, if the chunk takes less than 0.5 second, the next chunk it will take more rows and so on.

This is one of the safeguards that pt-table-checksum have and you can always modify this values (–chunk-time, --chunk-size, etc), also it will monitor the server load, replication lag, etc.

Please take a look to the documentation for more information. ksum.html


You can adjust the time of chunk with --chunk-time option