If mass delete all 'deleted users' profile post comments, there is a problem when click to "View previous comments..." on member profile post comments; "There are no comments to display." but there is still shows up "View previous comments..." link. I think it's a bug and I have a question there is a SQL Query for rebuild/cache profile posts and profile post comments?
This is why Mike says you can't just delete data from the database.
There is a lot of data which is maintained across multiple tables. So each profile post comment has its own entry in the xf_profile_post_comment table, but then there is a column in the xf_profile_post table which stores a cache of the number of comments that profile post has.
You have deleted the comments, but there is nothing that will trigger those counts to be updated.
The same applies to everything. If you delete a post from the xf_post table, it does not rebuild things like the message_count of the thread or the user, or the forum, or remove likes, or remove edit history etc. Running queries like that on your database, just as Mike says, without understanding the consequences, is not at all recommended because this is the exact problem it causes.
So you really should look at restoring that data from your most recent backup and then deleting the data properly.
It's a similar story. Each item of content additionally has a "like_users" column or similar which is a cache of all of the users who have liked an item of content. Deleting the content from xf_liked_content won't remove it from that cache so it may not entirely solve whatever you're trying to solve.