Noticed that deleteThread performance was horrendous... the query took like 15min, and it took locks on a bunch of tables while it was ongoing.
We had a similar problem for deleteAccount that was solved in D1288 by splitting up the query, so I decided to do the same thing here.