The best way is to delete them step by step using the LIMIT clause (over 10,000 elements), but not apply the order. This will allow MySQL to clear results faster, and transactions will not be huge. You can easily do this with any programming language that you have installed that has a connector for mysql. Be sure to commit after each statement.
An index will definitely help, but building it will take some time on a 100-GB table (in any case, itβs worth creating when you are going to reuse the index in the future). By the way, your current query is incorrect because the link to the USER table is not listed here. You must be careful with the index so that the optimizer can use it.
source share