Manual:Reduce size of the database

From MediaWiki.org

Jump to: navigation, search
Wikimedia-logo-meta.png

This page was recently moved from MetaWiki.
It probably requires cleanup – please feel free to help out. In addition, some links on the page may be red; respective pages might be found at Meta. Remove this template once cleanup is complete.


It may be possible to reduce the size of the database.

[edit] Compress old revisions

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?)

(Doesn't exist anymore in MediaWiki 1.13+.)

[edit] 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.

[edit] 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