Manual:Reduce size of the database

From MediaWiki.org

Jump to: navigation, search
This page is kept for historical interest. This MediaWiki page is inactive and kept for historical interest. It may document extensions or features that are obsolete and/or no longer supported. Do not rely on the information here being up-to-date.

It is possible to reduce the size of the database.

Contents

[edit] Compress old revisions

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

[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 can drastically reduce the size of the database, more than 90% in some cases. It deletes old revisions of all articles, or in certain namespaces, or with titles matching a certain string. Optionally a cut date can be defined, so that older revision are deleted, and newer are kept. Page histories will be lost and only the current version (or recent versions since the cut date) of any article will be saved in the database. --Wikinaut 00:07, 29 December 2009 (UTC)