This post is regarding an update fault. Below you may find the solution to this fault.
Impact
Use the parking lot data loading of the XX video cloud project as an example. When a vehicle enters the parking lot, its information will be written into the database table over the CopyManager interface in microbatch mode, such as the license plate number and entering time. When the vehicle leaves the parking lot, the leaving time corresponding to the license plate number will be updated in the database table.
If records are updated one by one, the huge update operations will bring great performance pressure to the database.
Inspection method
Investigate application developers and do code walkthrough if necessary to learn about the data update mode.
Optimization method
As to the fault above, change the update mode from one by one to batch update.
The procedure is as follows: In each batch update period (for example, 60s), batch load the primary key and the leaving time column for the records to be updated to a temporary table, then join the temporary table with the base table, and batch synchronize the leaving time column of all vehicles in the current period to the base table.
Note:
It is recommended that the size of a batch update window be the same as that of a microbatch window.