Expensive aggregate query in CMDB Get Well Metric Collection jobDescriptionInefficient queries from daily job: "CMDB Get Well Metric Collection" causing DB CPU to spikeSteps to Reproduce On customer's instance (~1 billion records)Issue Definition: - Issue 1 - EXPENSIVE aggregate query on sys_object_source table where target table are children of CMDB_CI_VM_INSTANCE and CMDB_CI_HARDWARE which ran for more than 4 hours. (Update: Aug 2022, this query has been optimized in v2.0 version of the dashboard, which was released to the store on August 5, 2022. Please consider upgrading to this version) - Issue 2 - EXPENSIVE aggregate query on cmdb_rel_ci table to find orphaned rels ran for 1hr 17 min. - Issue 3 - EXPENSIVE aggregate query on cmdb_ci_hardware tableSteps to Reproduce: Run the Job "CMDB Get Well Metric Collection"WorkaroundFor "CMDB Get Well Metric Collection" scheduled job WORKAROUND:- Goto the following scheduled job:https://<instance_name>.service-now.com/nav_to.do?uri=sysauto_script.do?sys_id=d4a09b6653b8501032b7ddeeff7b12c7 - Comment out lines 5 and 7- Comment out line 3, for "new sn_getwell.CMDBGetWellCalculateCIsMissingSN().calculateCIsMissingSN();" For "CSDM Get Well Metric Collection" scheduled job WORKAROUND: 1. goto the scheduled job: https://<instance_name>.service-now.com/nav_to.do?uri=sysauto.do?sys_id=a0b393e653b8501032b7ddeeff7b1269 2.comment out line 15Related Problem: PRB1553457