21282 Posts in 5730 Topics by 2601 members
|Go to End|
24 April 2009 at 9:24pm
I've noticed that one of our SS sites has 86,000 records in the SiteTree_versions table. There are only 166 pages in the SiteTree folder.
This is causing problems when releasing new updates to the site. I added a new page type, so this changed the ENUM on the SiteTree_versions table, causing the query to run for 5 - 10 minutes.
I would rather not remove all records from this table. Keeping the last revision or 2 would make sense. What is the best way to clear out the majority of these records?
25 April 2009 at 12:02am
changing the table structure (which is what you are doing adding a new page type) is going to take a while to run, but this is only an issue when adding new code to the site. It should not affect day to day operations.
If you do want to remove some of the rows from the Sitetree_versions table, you could run an sql command like:
"DELETE FROM `SiteTree_versions` WHERE `Created` < '2009-03-01 00:00:00'"
This would delete all rows created before March 1st. You could write something trickier to only leave the two most recent versions, but that would take a bit of effort....
Deleting rows should not affect the revision function (other than removing old data).
25 April 2009 at 12:48am
I think I'll remove the old revisions by date. The other method will take too long to implement.
Having too many records in the versions table is quite dangerous since running /dev/build on a live server can kill the performance on a server.
Perhaps it is worth adding a fix (or at least warning) to the /dev/build scripts to solve this issue?
|Go to Top|