deleteMultiple() too slow - 600ms per delete.

dougconnell
Kilo Guru

I am testing an import job that I just finished Developing using the IntegrationHub ETL CMDB tudio app.  My target table is a CMDB Table created to hold the Exchange Distrbution Lists.  Currently this table has 70,000 records.
I want to delete all hte records so I can rer-run my import with a clean table just for testing purposes.

I just ran a 10 minute test using deleteMultiple() script as shown below.  This script takes 10 minutes to delete 900 records.  gr.setWorkflow(false); seams to make no difference.  This is 660ms per delete!
660ms reminds me of our old ITSM Solution which was Computer Associates' SDM product.  This had a similar 600-700ms per insertion (not deletion) so was effectively unusable as a proper CMDB.

 

I really like the fact that the defaujlt mode for importing data into the cMDB is to setWorkflow(false) - which makes insertions very fast.  This is great.  But why are insertions really fast and deletions realy slow?

I have tried another solutions such as a table cleaner or deleteRecord() or a background job.  All these options take about the same time.  It would take me about 12 hours to delete all the records in my table.  This issue has existed in SN for quite a few years.  One option I have used in the past is to set the Operational Status to "retired" and then let the table cleaner do its thing.  However, this is frustratiing for developer / testing purposes - if you just want to start fresh.  I have read other Questions on the communities about this issue - so it is a common frustration.

 

I am really confused why this needs to be so slow.  I asm totally guessing that there are lots of checks running in the background to prevent orphaned records and keep the database "clean".  However, I would have thought that with some careful thinking, there would be other ways to solve the problem of orphaned records.

 

Can anyone shed any light on this situation?    

 

var gr = new GlideRecord("u_cmdb_ci_exchange_dl");
gr.query();
gr.setWorkflow(false);
gr.deleteMultiple();

PS:  [This not was added later] I also tried Dellete All Records as suggested below.
Well the "Delete All Records" button is not working for me either.  It keeps stopping after about 5 minutes.  I then have to click on it again.  I now have 64,203 records.  The rate of deletions has really slowed down. At this rate, it will still take all night to delete the records.

5 REPLIES 5

CJ Hinton
Tera Contributor

Hey, Doug. What was the best solution you discovered to delete a large number of CIs?