I have a simple delete statement. It works fast about the first 100 deletes. Then it slows down, then it will sped up. Explain looks pretty fast but the deletes are slow.
for loop
delete from data.stafftable where staffname='something' and time_deleted<now() and staff_type='teach';
Explain
id: 1
select_type: DELETE
table: stafftable
partitions: NULL
type: range
possible_keys: PRIMARY,staff_name_index,time_deleted_index
key: PRIMARY
key_len: 7
ref: const
rows: 1
filtered: 100.00
staffnameeach time? Why not do them all at once withwhere staffname in ('something', 'something else', ...)?