The big problem is that the most important factor (of course) in determining how long a request will take has nothing to do with the request itself. Rather, the most important factor in determining the response is the load placed in the database during the execution of the request, especially including loading from other requests. For complex queries in active systems, this load can change significantly during the query.
What you can do is get the execution plan for your request using the EXPLAIN keyword. You can use this to get a relative idea, all other things being equal, for how much a particular request can cost. Even here, however, MySql does not make it easy, as it will not just give you good tariff plans or run-time numbers that you can use, as the sql server does. You should output these numbers based on strings and disk reads.
Again, even if you generate an estimated cost and then run the request, you can get the results for a longer or shorter time than expected because the server load changes after you create the estimate and execute the request.
In this case, after 10 hours, it looks like you might have a lock / lock problem. If you have another active (possibly long-term or frequently repeated) query that uses this table, try killing it, and there is a good chance that your query will complete naturally in a few minutes.
source share