Optimizer-Related Issues Conversely, to get rows where the numbers are the same, the test should find differences within the tolerance value: Floating-point values are subject to platform or implementation dependencies. Suppose that you execute the following statements: On some platforms, the  SELECT  statement returns  inf  and  -inf . On others, it returns  0  and  -0 . An implication of the preceding issues is that if you attempt to create a replica by dumping table contents with  mysqldump  on the source and reloading the dump file into the replica, tables containing floating-point columns might differ between the two hosts. CREATE TABLE t1(c1 FLOAT(53,0), c2 FLOAT(53,0)); INSERT INTO t1 VALUES(’1e+52’,’-1e+52’); SELECT * FROM t1; B.3.5 Optimizer-Related Issues MySQL uses a cost-based optimizer to determine the best way to resolve a query. In many cases, MySQL can calculate the best possible query plan, but sometimes MySQL does not have enough information about the data at hand and has to make “educated”  guesses about the data. For the cases when MySQL does not do the "right" thing, tools that you have available to help MySQL are: mysql>  EXPLAIN SELECT * FROM t1, t2 WHERE t1.i = t2.i; •Use the  EXPLAIN  statement to get information about how MySQL processes a query. To use it, just add the keyword  EXPLAIN  to the front of your  SELECT  statement: •Use  ANALYZE TABLE  tbl_name  to update the key distributions for the scanned table. See Section 13.7.3.1, “ANALYZE TABLE Statement” . • Use  FORCE INDEX  for the scanned table to tell MySQL that table scans are very expensive compared to using the given index: •Global and table-level  STRAIGHT_JOIN . See Section 13.2.10, “SELECT Statement” . •You can tune global or thread-specific system variables. For example, start  mysqld  with the  --max- seeks-for-key=1000  option or use  SET max_seeks_for_key=1000  to tell the optimizer to assume that no key scan causes more than 1,000 key seeks. See Section 5.1.8, “Server System Variables” . 5313 USE INDEX  and  IGNORE INDEX  may also be useful. See Section 8.9.4, “Index Hints” . EXPLAIN  is discussed in more detail in Section 13.8.2, “EXPLAIN Statement” . SELECT * FROM t1, t2 FORCE INDEX (index_for_column) WHERE t1.col_name=t2.col_name; mysql>  SELECT i, SUM(d1) AS a, SUM(d2) AS b FROM t1 ->  GROUP BY i HAVING ABS(a - b) <= 0.0001; +------+------+------+ | i | a | b | +------+------+------+ | 1 | 21.4 | 21.4 | | 2 | 76.8 | 76.8 | | 3 | 7.4 | 7.4 | | 4 | 15.4 | 15.4 | | 5 | 7.2 | 7.2 | +------+------+------+ 5 rows in set (0.03 sec)