What are the advantages and disadvantages of pt-osc tools
This article mainly introduces the advantages and disadvantages of pt-osc tools, has a certain reference value, interested friends can refer to, I hope you can learn a lot after reading this article, the following let the editor take you to understand it.
Principle:
Create a new table based on the original table structure
Modify the new table according to the alter statement of pt-osc
Copy the data from the original table to the new table
Apply data updates during the copy data period of the original table to the new table through triggers
Rename the original table, rename the new table to the original table, and then delete the original table.
Advantages of pt-osc:
The alter phase does not block reads and writes.
Disadvantages of pt-osc:
1. Triggers cannot exist in the original table because pt-osc needs to apply the data generated by the copy data phase of the original table to the new table through triggers.
two。 Tables must have primary and unique keys.
3. The original table cannot be the parent of other foreign keys, you need to add the-alter-foreign-keys-method parameter.
4. When the field property is NOT NULL, you must have a DEFAULT property, otherwise an error will be reported.
5. May cause master-slave data delay
6. If an error is reported during the operation, it cannot continue from the previous location and needs to start from scratch.
7. Virtual column function of MySQL5.7 is not supported
Thank you for reading this article carefully. I hope the article "what are the advantages and disadvantages of pt-osc tools" shared by the editor will be helpful to you. At the same time, I also hope you will support us and pay attention to the industry information channel. More related knowledge is waiting for you to learn!