Performing Repository Regular Maintenance Tasks
With RDBMS repositories you must include a regular maintenance plan. You (or your database administrator) should, for each repository (SystemDb repository included), perform the following maintenance tasks regularly (at least once a week):
rebuild indexes
update the statistics
(optional) shrink the logs regarding the policies
perform the stored procedures
SP_CLEAN_MEGA_DATABASE
SP_CONSOLIDATE_MEGA_DATABASE