MySQL, delete and index hint

Posted by Manuel Darveau on Stack Overflow See other posts from Stack Overflow or by Manuel Darveau
Published on 2010-05-27T20:33:14Z Indexed on 2010/05/27 20:41 UTC
Read the original article Hit count: 188

I have to delete about 10K rows from a table that has more than 100 million rows based on some criteria. When I execute the query, it takes about 5 minutes. I ran an explain plan (the delete query converted to select * since MySQL does not support explain delete) and found that MySQL uses the wrong index.

My question is: is there any way to tell MySQL which index to use during delete? If not, what ca I do? Select to temp table then delete from temp table?

Thank you!

© Stack Overflow or respective owner

Related posts about mysql

Related posts about delete