Database size is increasing while removing data from the table cmdb_rel_ci

madhanrajesh
Tera Contributor

"We are supposed to delete 10 lakh records per day (since we have 10Cr+ unwanted data) from the cmdb_rel_ci table, but this is generating a large number of entries in sys_audit_relation, sys_audit, and sys_audit_delete tables approximately 3 times the count of deleted records. Specifically, deleting a single record from cmdb_rel_ci results in 2 entries in sys_audit_relation, 1 entry in sys_audit, and 1 entry in sys_audit_delete. How can we optimize or prevent this excessive logging while performing deletions?"

9 REPLIES 9

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @madhanrajesh 

 

As the count is big, and the above solutions are not working better log a now support case, and the team can give you a more optimal solution.

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************

Sandeep90
ServiceNow Employee
ServiceNow Employee

@madhanrajesh if the audit is not needed please disable BR on cmdb_rel_ci 'Audit Relationship Changes' to stop populating sys_audit table. Regarding other two tables please reach to support which can analyze use case and provide the instructions on how to disable populating those tables. 

 

hi sandeep

thanks for helping.,

we tried with, 

  1. Used gr.setWorkflow(false);
  2. Used gr.autoSysFields(false);
  3. Disabled the "Audit Relationship Changes" Business Rule on cmdb_rel_ci
  4. Cleared cache

However, we are still facing the same issue.

Sandeep90
ServiceNow Employee
ServiceNow Employee

Audit Relationship change will only help with not writing deletes to the sys_audit table, there are other properties that could be tweaked to stop writing to sys_audit_delete and sys_audit_relation table. Support should be equipped to provide those. 

madhanrajesh_0-1741002685690.png

Still, it's logging into the sys audit tables, any idea? @Sandeep90