- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-10-2019 01:10 PM
We have a table in our production instance with over 1TB of data in it (1118168054 rows). I'm looking for guidance on the best way to purge this table without affecting system performance. I do not believe there is any reason to retain these records and no new records are being added to it. Would archiving (and destroying) be the most effective, or would it take too long or cause performance issues?
Solved! Go to Solution.
- Labels:
-
Best Practices
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-23-2019 06:34 PM
Thanks all for the replies but I think the correct answer is submit a case with ServiceNow Support. They can truncate the table in seconds.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-10-2019 01:41 PM
you can do it 2 ways
open the result list--> right click on header of list--> confgure--> table-- click on delete all record button
or you can do it in phase likecreated in last 3 month or 6 months
below script can be run on scripts background
var gr = new GlideRecord('<you table name>');
gr.addEncodedQuery(<condition/query>);
gr.query();
gr.next();
gr.deleteMultiple();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-11-2019 06:11 AM
Hi rajesh9885,
Thanks for the reply. I understand how to delete records through the UI and with scripting, I just want to make sure it is done responsibly. I can't even open the list because there are too many records.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-11-2019 06:49 AM
thats why i said delete record in phase of 3 months
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-18-2023 07:42 AM
Before using deleteMultiple() it's not a good practice to use the query() and/or next() functions (the deleteMultiple will do the query so we don't need to use those 2 functions) 😉