Page 1 of 1

Skip Optimize for the archive script

PostPosted: Tue Apr 25, 2023 8:36 am
by RBecker
We have a high volume system that runs nightly table archiving, and I see that part of this process is running an OPTIMIZE TABLE on the archive tables the data was inserted into. From my understanding there's no benefit to optimizing the table after inserting, only when deleting data from it. I have taken to running my own copy of this script with all of the optimizes removed, but that means that any time there is a code upgrade that adds new tables, I have to add those in manually. I propose a --skip-optimize-archive flag that could be added to that script which would skip those statements. There could also be a --skip-optimize-all flag that would skip optimizing the tables that data was just archived from. I run weekly optimizing across the entire system which is why I remove them from the nightly archive script. Hopefully this is something the team would like to pick up, but I could also write and submit a patch to Mantis for this if others are interested.

Re: Skip Optimize for the archive script

PostPosted: Tue Apr 25, 2023 8:50 am
by mflorell
Sounds like a good idea. Please post your new code to the Issue Tracker and provide a link on this topic.

Thanks!

Re: Skip Optimize for the archive script

PostPosted: Fri Apr 28, 2023 1:15 pm
by RBecker