as in the question, when I add or remove indexes for a table in the database, I have two choices
- use alter table to change the table structure
- use the create/drop index command
I have also thought about preparing a copy of this table and operating on the backup table, but if there must be a write operation in the course of the operation, this leads to a discrepancy between the data of the backup table and the actual table.
I wonder if there are any good methods and ideas? At ordinary times, the amount of data of my project is smaller than the price. I have not considered this problem. Please give me advice from all kinds of gods!