If you have an index, it can be very fast.
However, there is a bug in MySQL, perhaps if it is installed in MySQL 5.5), if the index is missing, it will not just be slow, it will be incredibly slow. This is because a subquery can be detected as a DEPENDENT SUBQUERY (correlated subquery), even if it is not. You can see if MySQL is using the correct query plan by running EXPLAIN SELECT ... and checking that key not NULL for your subquery. I made another entry about this error with more details:
You might also consider rewriting your request to use JOIN instead of IN to avoid this error.
source share