Yes, almost all statistics are based on non-deleted topics and posts. One exception to this is for queries that are run in the Data Explorer plugin. For those queries, you need to explicitly set a WHERE deleted_at is NULL condition to avoid pulling in data from deleted topics and posts.
Yes, a user’s deleted post count is recorded. The only place that I know of where it’s displayed in the user interface is when a user’s summary page is viewed by a staff user. In that case, they will see something like this:
No, when a topic is deleted, only the first post in the topic is deleted. Unless the topic is restored, there is no way to see the remaining posts.
Most of the Discourse badges run a daily revocation query to see if the badge should be removed from the user. If the topic or post that they were granted the badge for has been deleted, the badge will be revoked.
Having deleted posts has no effect on a users trust level. Deleting posts can be very useful for keeping topics readable. A good example of that is how we deal with documentation topics. If anything in a documentation topic is unclear, readers can reply to the topic to ask for clarification. Replies to these questions can be incorporated into the topic’s first post. When that has been done, it’s best to delete the replies to prevent the topic from becoming unreadable.
The number that you see is is the actual number of deleted posts. Since deleting a topic does not delete replies to the topic, the number will not increase.
One other thing that’s useful for site staff is knowing how to search for deleted topics. That can be done by adding the ?status=deleted query parameter to the URL for a Discourse topic list.
Complete deletion from the database is possible, but it is not recommended. Unless it’s done correctly you risk causing problems with site stats.
