Manual:Reduce size of the database

It is possible to reduce the size of the database.

MediaWiki 1.2 and 1.3
cd /path/to/wiki/maintenance php compressOld.php

In MediaWiki 1.2 and 1.3, this will reduce the size of the old table (which is typically the bulk of the database) by about 50%.

In MediaWiki 1.4, it will typically reduce the size of the old table by about 85%, but at the expense of making it difficult to delete existing articles.

(Q: "difficult" as in you'll have to do some sql manipulation? or difficult as in computationally expensive?)

Note: Doesn't exist in MediaWiki 1.13+

Permanently remove the history of deleted pages
To permanently remove the history of deleted pages, first delete the pages using the normal page deletion feature.

Then clear out the archive table, where deleted revisions are stored, at the database level:

DELETE FROM archive;

or (which is sometimes MUCH faster)

TRUNCATE TABLE archive;

Of course, it will then no longer be possible to view and restore deleted pages and their history.

Extensions

 * Extension:SpecialDeleteOldRevisions2 - will drastically reduce the size of the database (more than 90% in some cases) because it deletes old revisions of all articles. Page histories will be lost and only the current version of any article will be saved in the database