Thomas Gries wrote:
Question to the database experts:
- How can the database of MediaWiki 1.5.x safely be pruned
( in order to actually remove the oldest revisions of Article, Talk,
User and User_talk pages ) ?
MediaWiki is designed to retain *all* versions permanently, so I wouldn't
recommend ever doing this.
If you want to anyway, then you'll need to be somewhat careful about how you go
about it; it'll be harder to do it 'safely' with the 1.5 schema.
An older answer given to me begin of 2005 was
DELETE FROM old WHERE old_timestamp < '20050101000000'; or whatever
Is it safe to use this statement or is another one recommended ?
Well that definitely won't work as there is no more 'old' table. :)
To destroy a stored revision you'll need to remove its entries from both:
* 'revision' table: one row for each revision, including the current version
* 'text' table: each row may be used by *one or more* revisions
If you are using multiple-row compression options, it will be difficult to
determine if a given text table entry is really unused. If you're not using
this, then you can just check on the join from revision.rev_text_id to text.old_id.
You could probably do a SELECT on revision and page to get non-current revisions
older than a certain date. Dump their rev_text_ids into a temporary table.
Delete the matching revisions from revision, then remove from the temporary
table any rev_text_ids that still exist in revision. Now, delete the rows from
text which match the remaining listed text rows. Might work.
-- brion vibber (brion @
pobox.com)