Description:
After a relatively small set of INSERTS, falcon row estimate turns ot to be very unrealistic - Falcon reports 10% of the rows would match, whereas in reality only one row, or 0.1% of all rows would match.
This is bound to cause bad optimizer decisions. Innodb consistently reports a correct estimate.
How to repeat:
Load the attached sql script, and execute:
mysql> select count(*) from t2;
+----------+
| count(*) |
+----------+
| 1199 |
+----------+
mysql> explain select t2.fld3 from t2 where fld3 = 'honeysuckle';
+----+-------------+-------+------+---------------+------+---------+-------+------+-------------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+----+-------------+-------+------+---------------+------+---------+-------+------+-------------+
| 1 | SIMPLE | t2 | ref | fld3 | fld3 | 30 | const | 119 | Using where |
+----+-------------+-------+------+---------------+------+---------+-------+------+-------------+
mysql> optimize table t2;
+---------+----------+----------+----------+
| Table | Op | Msg_type | Msg_text |
+---------+----------+----------+----------+
| test.t2 | optimize | status | OK |
+---------+----------+----------+----------+
1 row in set (0.03 sec)
mysql> explain select t2.fld3 from t2 where fld3 = 'honeysuckle';
+----+-------------+-------+------+---------------+------+---------+-------+------+-------------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+----+-------------+-------+------+---------------+------+---------+-------+------+-------------+
| 1 | SIMPLE | t2 | ref | fld3 | fld3 | 30 | const | 2 | Using where |
+----+-------------+-------+------+---------------+------+---------+-------+------+-------------+
1 row in set (0.00 sec)
Suggested fix:
Make the row estimation figure consistent with reality.