Database cleanup for orphaned records?

Has anyone put together a database cleanup script?
I think we may have orphaned records that are not flagged to be deleted but have broken references.
We have been experiencing slowness and none of the suggestions found on the board seem to help.
Page loads and saves can be up to 10 seconds.
Suite CRM 7.6.4
PHP 5.6.2

what you mean with orphaned records? technically in SuiteCRM nothing is deleted, things are just not shown, if you do have orphaned records is because you deleted things without the application it self, this means that you deleted them via sql commands

best regards

Yes. I deleted a bunch of records straight from the database without using the application. So that’s why I’m thinking there are parts of records still there that are slowing the program down.