Hello @Josep Maria Camps R.
I guess you are looking for the below information. If you think you need to tweak AutoPurge further, or this is not the exact code you are looking for then contact support.
the clean-up task does the following (in that order):
- remove unreferenced CI data
- remove deleted system profile data
- remove deleted measure configs
- remove unreferenced or deleted incident rules
- remove unreferenced percentiles and age / aggregate the rest
- remove unreferenced / timed-out measurements and age / aggregate the rest
- remove dangling / timed-out incident records
- remove unreferenced agent records
- remove unreferenced thersholds
Each of these steps is a set of more or less complex SQL statements. We don't disclose them as they're prone to change even in minor updates.
The logging information in Repository.0.0.log gives a relatively detailed summary of the single steps.