I am wondering, why queries with IN-Operator are much slower than a simple
Query1: SELECT VIDEO_ID FROM videos (about 8000 rows with 1 column)
Query2: DELETE FROM video_snapshot WHERE video_snapshot.VIDEO_ID IN (Query1)
For more record
IN clause performance is very slow in this case you can use
INNER JOIN with delete query
DELETE video_snapshot FROM video_snapshot INNER JOIN videos ON video_snapshot.VIDEO_ID=videos.VIDEO_ID;
In my experience IN is a very slow operator, since SQL normally evaluates it as a series of WHERE clauses separated by "OR" (WHERE x=Y OR x=Z OR...).. BUT mainly explicit join is faster when need to compare field with other table field.