MySQL replace into 与insert into

https://blog.csdn.net/helloxiaozhe/article/details/77427266

 

The use replace brought

1, Replace into operation in the unique key duplication, it is the first attempt to write, a collision is detected then delete the original record, and then write a new record. This operation is only a binary log update operation will result in the same table auto_increment value from the main inconsistency, the master-slave switching, business writing failure easily induced;

2, according to Description 1, there are two primary operating DB write operation Replace into the worst case, the operation burden;

3, the concurrency, Replace into problems due to the different order of acquisition session lock, the higher the probability of generating a deadlock;

 

 

ABC election

 

Guess you like

Origin www.cnblogs.com/ivyharding/p/11592424.html