Time difference between deleteRecord vs deleteMultiple
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-05-2024 02:00 PM - edited 08-05-2024 07:47 PM
I need to delete around 100k records.
I tested with deletion of 2000 records using both methods, I did not find much difference in the time it took using both methods (deleteRecord vs deleteMultiple) for deleting same data (hardly a difference of 10s)
But I read in other community posts that 'deleteMultiple' will be quicker.
Question - Is is like only for LARGER datasets only deleteMultiple will make a difference and not smaller datasets?
If yes, larger datasets means how large?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-05-2024 03:18 PM
That will depend on the table, and number of reference fields. Deleting a large amount of records should be done in chucks. Add logic for that in your script, run it as a scheduled job maybe. But 100K may not take that long if you use Scripts - Background.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-05-2024 07:43 PM
@Bert_c1 When I deleted 'SAME SET OF RECORDS' using both methods (2k records), I hardly found a difference of 10s. ust a matter of 10s, is that quicker 🙂
Is that expected? J
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-05-2024 05:51 PM
hi @Suggy
For more efficient bulk deletions, use `deleteMultiple()` to enhance performance and reduce processing time. To gauge the benefits, conduct tests with a larger dataset (e.g., 5,000 to 10,000 records) before executing the final deletion.
Please mark my response as helpful or accept it as a solution if it meets your needs.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-05-2024 07:47 PM
Question - Is is like only for LARGER datasets only deleteMultiple will make a difference and not smaller datasets?
If yes, larger datasets means how large?