Indexes and optimizations for threads_with_visited_status.