I know this topic has been debated before but cannot find any other answer than to use 'moosh', which is what I will probably do (although it doesn't seem to really DELETE them).
I still like to raise the question of language and explain my desire to actually remove stuff from the database.
First, language. To use the word “delete” not only actually means “destroy, blot out, efface” but there's also the SQL statement DELETE with an extremely clear meaning. To use the word “delete” in connection with a database and NOT mean delete will throw anyone who knows anything about databases into a spin. It’s unclear or even deceiving language. A more clear wording would be “hide” or something similar.
Second, what to delete. I understand that for many the moodle forum posts are of importance. Not so for us: we use the plugin CodeRunner a lot. And every time a student press “check” (in total 10-20,000 times per day) a blob that can be several hundred bytes large is stored in the database. Needless to say, it grows fast! Having a database that never gets pruned gives us longer and longer backup times and also longer restore times. Backup is currently at approx. 30 minutes, which is ok, but the restore times are at 2 hours. That means that we cannot recover from a crash during an exam. So I feel a strong need to remove old stuff from the database.
Attached is a partial image from a SQL-report that I have written (can be found on GitHub) and there you can see that the largest tables are in our case related to CodeRunner (mdl_question_attempt_…), the standard log and grading. I would really like to cut down on those tables.
I believed that a proper deletion of a user would also remove stuff from these tables but it seems that nothing happens.
We have some 12,000 users in our server and almost half of those have not logged in for > 2 years and I would really, really like to delete them.