Comment 4 for bug 1426629

Revision history for this message
Frank Cizmich (frank-cizmich) wrote :

Hi Damon,

There are two different issues at play here. Both are related to floating point.

First issue:

To detect differences in floating point columns, the tool converts first to string, but due to rounding errors and internal representation of data , it might still detect differences (even when not apparent with a simple manual select).
This can be alleviated using the --float-precision option:
http://www.percona.com/doc/percona-toolkit/2.2/pt-table-sync.html#cmdoption-pt-table-sync--float-precision

Second issue:

The tool prefers to match rows using primary or unique keys, but this table has none; so it resorts to trying to match every single column value.
Again, this bring up the floating point issue. Matching floating point columns is very difficult due to the arbitrary precision and internal representation.
The best solution for this is to add a (non float) primary key for this table. It is also good practice.
If this is not an option you could try converting the problematic floats to decimal type. Decimal types do indeed match precisely across versions and platforms.

Check out this link for more info about the problems of matching floating point values:
http://dev.mysql.com/doc/refman/5.6/en/problems-with-float.html

Cheers,
   Frank