Prerequisite:
Take the downtime from the client.
Pause the scheduler
Scale down the webrunner pod.
Run the below query to identify the free space in the Database.
SELECT table_schema "DataBase Name",
sum( data_length + index_length ) / 1024 / 1024 "Database Size in MB",
sum( data_free )/ 1024 / 1024 "Free Space in MB"
FROM information_schema.TABLES GROUP BY table_schema;
Refer the below link for the table for which we have to perform cleanup
https://support.adeptia.com/hc/en-us/articles/207881923-Truncate-Log-Tables-Manually
Run the optimize query “OPTIMIZE TABLE tablename;” This query will create a lock on the table and then create a new table with the same name and same data.
Post maintenance:
Run the above query (point4) to verify the free space
Scale up the webrunner pod
Resume the scheduler
Drop confirmation email to client.