Does ServiceNow run OPTIMIZE TABLE periodically to reduce storage size of tables?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-01-2022 02:35 PM
We have several large tables that will need to get many records deleted. Does anyone know if ServiceNow runs OPTIMIZE TABLE statement periodically to deallocate storage. Reading MariaDB and MySQL documentation it doesn't appear to happen automatically when you run DELETE statements.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-01-2022 03:11 PM
Seems you may be looking for proprietary information. Your hosted instances are maintained by Servicenow, and any problems should be reported via a Support Case. GlideRecord API works, deleting records from the UI works.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-27-2023 11:24 AM
Apologies for the late response, I figure you already have your answer but hopefully someone else might find this helpful.
If you delete more than 50% of the data in the table at a time that should trigger an automatic drop/swap and reclaim space, but on large tables you may only be targeting 5-10% of data to delete at any given time (based on your retention policies and such), so that might not apply. In my experience you will need to ask ServiceNow to rebuild tables to reclaim memory in the event you delete any data, particularly on large tables.
You may be able to use table cleaners (auto flush) and enable force optimization but I would thoroughly test that before attempting in prod. Depending on the size of the table it may take 10+ hours to rebuild and definitely not something you want running during business hours or peak usage.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-19-2023 09:27 AM
The answer is No, this is not automatically done, but there are 2 options to get it done.
We just had multiple cases opened for getting tables resized. Allegedly, Table cleaner will resize it if there is enough free space available (we're skeptical about this). Otherwise open a case and support can do it for you.