There are 3 places where there may be efficiency issues
Batch Update is not used when calling JDBC, resulting in low performance
Checking 500 items each time is too few, checking a few thousand items each time should be fine
The tables in computer room B have indexes and constraints. These should be turned off or dropped during migration, and then turned on again after the migration is completed
Your speed is abnormal. Is the IO full? Or is there a problem with the network? I used to use Kettle to migrate millions of data an hour. Because I was used to using ETL tools, I never wrote a program for data migration.
There are 3 places where there may be efficiency issues
Batch Update is not used when calling JDBC, resulting in low performance
Checking 500 items each time is too few, checking a few thousand items each time should be fine
The tables in computer room B have indexes and constraints. These should be turned off or dropped during migration, and then turned on again after the migration is completed
Your speed is abnormal. Is the IO full? Or is there a problem with the network? I used to use Kettle to migrate millions of data an hour. Because I was used to using ETL tools, I never wrote a program for data migration.
Ugh. . , why use java? Isn't 1 million data a lot? Wouldn't it be faster to back it up and then dump it on the same machine?