I designed a project and used a lot of database update operations: id is the primary key and state is the column to be modified. the default value is 0. now I want to modify s to 1 based on the specified id. once... mysqldba database
I designed a project and used a lot of database update operations:
Update db_acc_traffic set state = 1 where id = 1
Update db_acc_traffic set state = 1 where id = 2
Update db_acc_traffic set state = 1 where id = 3
Update db_acc_traffic set state = 1 where id = 11
Here, id is the primary key and state is the column to be modified. the default value is 0. now, modify s to 1 based on the specified id.
Processing tens of thousands of records at a time is very inefficient if one statement is executed. Transactions are not supported. apart from update, another thread performs a large number of insert operations on db_acc_traffic. Is there any way to improve update efficiency ??
Thank you for your help.