Details
-
Bug
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
10.0(EOL), 10.1(EOL), 10.2(EOL), 10.3(EOL), 10.4(EOL), 10.5
Description
Please, check upstream http://bugs.mysql.com/bug.php?id=70629. Based on the last comment from Vasil Dimov there:
"The problem here is that InnoDB's statistics rec_per_key[] (or cardinality or n_diff[]) are published to the optimizer when ha_innobase::info(HA_STATUS_CONST) is called and it is called only when a table object is created (usually only when the table is opened). So when InnoDB recalculates the statistics due to subsequent DML, the old stats are being used to calculate the execution plan.
We will do some experiments and will probably call ha_innobase::info(HA_STATUS_CONST) at the beginning of each query."
I am not sure if calling ha_innobase::info(HA_STATUS_CONST) before every statement is a good idea, but it makes sense to check why it is not called (as it seems) when 10% of table data are changed and automatic recalculation by background thread happens.