patternsqlMinor
Will creating a view on a MySQL replication slave break the replication?
Viewed 0 times
thecreatingslaveviewreplicationmysqlwillbreak
Problem
We need to run some very ugly queries on a MySQL replication cluster.
Does anyone know if creating a view directly on the slave will break the replication of the other, otherwise untouched data synced with the master?
Does anyone know if creating a view directly on the slave will break the replication of the other, otherwise untouched data synced with the master?
Solution
This will work fine. The only caveat is that if you, in the future, create a view on the master with the same view name, in the same schema, replication will stop due to the conflict.
Another potentially useful thing you can do -- quite safely -- on a slave server is adding indexes to base tables to help your reporting queries, even if the same index wouldn't be needed or justified on the master. Of course, you should not add unique indexes or foreign keys directly to the slave, since these could cause conflicts and don't really make sense when not on the master ...but ordinary single and multi-column indexes are also safe to add directly to a slave.
Another potentially useful thing you can do -- quite safely -- on a slave server is adding indexes to base tables to help your reporting queries, even if the same index wouldn't be needed or justified on the master. Of course, you should not add unique indexes or foreign keys directly to the slave, since these could cause conflicts and don't really make sense when not on the master ...but ordinary single and multi-column indexes are also safe to add directly to a slave.
Context
StackExchange Database Administrators Q#42695, answer score: 6
Revisions (0)
No revisions yet.