3 ms·
It’s probably worth mentioning that at least in MySQL, this is dangerous if using statement based replication. https://dev.mysql.com/doc/refman/8.0/en/replicat
by _vertigo 7y ago
It’s probably worth mentioning that at least in MySQL, this is dangerous if using statement based replication.
https://dev.mysql.com/doc/refman/8.0/en/replication-sbr-rbr.html#replication-sbr-rbr-sbr-disadvantages https://dev.mysql.com/doc/refman/8.0/en/replication-sbr-rbr....
https://dev.mysql.com/doc/refman/8.0/en/replication-features-limit.html https://dev.mysql.com/doc/refman/8.0/en/replication-features...
- ploxiln 7y agoGreat point. I happen to use row-format mixed (default on RDS), so that can make it OK. Also, often I have some other related stuff to cleanup, so the pattern is more like: SELECT id, stuff FROM table WHERE expired LIMIT 1000; do cleanup; if all successful: DELETE FROM table WHERE id IN (id, id, ...); so the delete is deterministic for statement-based replication.