I have to run a huge SQL script which deletes around 2 million entries from
url_rewrite by entity_id. This script runs a couple of days, but is interrupted by other processes and so I always get the deadlock SQL error and the script is aborted and I have to restart it manually.
Now I was thinking to write lock
url_rewrite while the script runs. How would I do that and is it a good idea?