When the number of tables in a single instance exceeds 1 million, it may cause backup failure and affect database monitoring. You need to keep the number of tables in a single instance below 1 million.
If there is no primary key table in the instance and the binlog is in row format, when a large amount of data is updated or deleted through a SQL statsment, playback on the slave machine will cause a large transaction, resulting in the backup thread unable to acquire the lock, resulting in backup failure.
select TABLE_SCHEMA,TABLE_NAME,TABLE_TYPE,ENGINE,TABLE_ROWS from information_schema.tables where (table_schema,table_name) not in (select table_schema,table_name from information_schema.columns where COLUMN_KEY='PRI') and table_schema not in ('sys','mysql','information_schema','performance_schema');
alter table table_name add primary key(`column_name`);