Details
-
Bug
-
Status: Open (View Workflow)
-
Major
-
Resolution: Unresolved
-
10.4, 10.5, 10.6, 10.11
-
None
-
None
Description
ANALYZE TABLE statement may or may not collect EITS statistics, depending
on the use_stat_tables setting.
It is replicated as statement, that is, the ANALYZE TABLE statement itself is written into the binary log.
If ANALYZE TABLE makes changes to mysql.column|table|index_stat tables, these are not caught by RBR and are not written into the binary log.
That is, we rely on ANALYZE TABLE to be executed on the slave in the same way as it was executed on the master.
But the value of use_stat_tables is not captured and not logged, so ANALYZE TABLE on the slave might not collect EITS when the master did, and vice versa.
Put the attached testcase into e.g. mysql-test/suite/rpl/t/rpl_a1.test and look into its output:
# EITS STATS ON MASTER:
|
select * from mysql.table_stats;
|
db_name table_name cardinality
|
connection slave;
|
no stats on master, but
# EITS STATS ON SLAVE:
|
select * from mysql.table_stats;
|
db_name table_name cardinality
|
test t1 3
|
there are stats on the slave.
One can construct cases where it's other way around, too.