Can someone explain this last step in ManageMaintenance? It seems needlessly complicated, IMHO:
// final steps ... made more difficult since we don't yet support sub-selects on joins
AFAICS the whole part is to reset all members with no post in elkarte_messages to 0. Wouldn't it make more sense to just reset all members by:
update elkarte_members SET posts = 0;
and then recount the post for members, This is already done in the code above the mentioned line.