This article is a mirror article of machine translation, please click here to jump to the original article.

View: 13953|Reply: 1

[Source] MySQL delete data delete not in performs very slow optimizations

[Copy link]
Posted on 3/13/2019 12:56:11 PM | | | |
100,000 level queries Zhiqiang e5 CPU single core 100% can be completed in more than 3 minutes.

It can be run within 10 seconds after optimization.

Idea: Create an index through a temporary table and exchange space for time to avoid frequent reading of the original table information

mysql deletion principle

not exist is more efficient than not in (the online project maintains correctness, no attempt is recommended by someone on the Internet to use not exist due to large changes)

truncate is more efficient than delete


(Actual measurement, the original data was deleted for 5 minutes, but it was done in 5 seconds after optimization)





Previous:Google AdSense ad balancing feature
Next:Lock wait timeout exceeded; try restarting transaction
Posted on 3/13/2019 1:10:14 PM |
get
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com