
david at kineticode
Jun 30, 2013, 1:12 AM
Post #3 of 14
(240 views)
Permalink
|
|
Re: Delete deactivated stories and media (1.8.5): does this work on 2.x?
[In reply to]
|
|
On Jun 28, 2013, at 7:16 PM, Phillip Smith <ps [at] phillipadsmith> wrote: > I was just hunting around in the wiki for an SQL query to remove old cruft from the database and found this: > https://github.com/bricoleurs/bricolage/wiki/Useful-SQL > > … has anyone tried that on a recent version of Bricolage? > > Specifically, the database in question is full of wire service stories, and each story has up to 50 versions stored. There are more than 10,000 of them, which is a sizeable percentage of the total number of stories in the system, and I can't help but think that permanently deleting them, along with their version, would reduce the size of the database and possibly improve performance. Only if you have a rather underpowered server. Or run PostgreSQL on EC2. > Thoughts on the above and how to achieve both the deletion of the stories, and their version, and so on? Does anyone know if there's a "cascade on delete" that's going to run and handle all of that if I run the above SQL? There is a cascade on delete, yes. For example: https://github.com/bricoleurs/bricolage/blob/master/sql/Pg/Bric/Biz/Asset/Business/Story.con#L46 But I do suggest trying it in a cloned Bricolage instance, first, or at least a dumped and reloaded database. Best, David
|