There are two functions for this that are not made available in the menus.
SERVER/index.php/admin_db/get_non_production_systems
SERVER/index.php/admin_db/delete_non_production_systems
These will report on and delete from the database systems with a status of "deleted".
NOTE - the "count" column on the report shows the number of systems matching the hostname. It is correct, but maybe not something we are used to seeing. I had several systems that were set to "deleted", but had been put back into service, hence I had multiple systems with the same hostname, but only one with a status of deleted per hostname (if that makes sense).
These functions are not exposed because they are very powerful and there is no warnings or reversing this action. I also had users specifically request that rows NOT be allowed to be deleted because of regulatory requirements. Having the functions but not exposing them in the web interface is my compromise
I should probably make it an option to enable them...
I plan on introducing some general database maintenance routines soon (as has been raised here on the forums). I recently upgraded a previous employers version (they were on beta 7 from memory!), and they had 50 million rows in the alerts table. Good times!