the following executes fast:
delete from text_blocks
where text_id in (
7684,
7683,
7682,
...);
Note, the above list of values is short e.g. 130 retrieved from a separate query. Table text_blocks has ~ 7,000 rows.
The following executes really slow:
delete from text_blocks
where text_id in (select a_text_id from someTable
where name like "%_SomeSuffix");
The subquery in example 2 is the same as used to get the list of 130 in example 1. Neither text_id or a_text_id are indexed.
Any ideas why it is super slow, and or hanging?