The following information reflects my own explorations into MediaWiki's database usage. Each list item header contains two parts. The left-hand part (e.g., "archive table") is a link to the "official" information, which resides under Help:Database_layout. The right-hand part (e.g., "mw_archive") is a link to my exploratory version.
MediaWiki uses about two dozen MySQL tables. These can be examined interactvely, using the mysql(1) command. They can also be dumped into XML and/or loaded into the wiki. See Data dumps for more information.
- archive table -
Holding area for deleted articles, which may be viewed or restored by admins through the Special:Undelete interface. The fields generally correspond to the page, revision, and text fields, with several caveats.
- categorylinks table -
Track category inclusions *used inline*. This tracks a single level of category membership (folksonomic tagging, really).
- externallinks table -
Track links to external URLs.
- hitcounter table -
Stores an ID for every time any article is visited; depending on $wgHitcounterUpdateFreq, it is periodically cleared and the page_counter column in the page table is updated for all of the articles that have been visited.
- image table -
Uploaded images and other files.
- imagelinks table -
Track links to images *used inline*. We don't distinguish live from broken links here, so they do not need to be changed on upload/removal.
- interwiki table -
Recognized interwiki link prefixes.
- ipblocks table -
The Internet is full of jerks, alas. Sometimes it's handy to block a vandal or troll account.
- jobs table -
Jobs performed by parallel Apache threads or a command-line daemon.
- logging table -
Activity logging information.
- math table -
Used by texvc math-rendering extension to keep track of previously-rendered items.
- objectcache table -
For a few generic cache operations if not using Memcached.
- oldimage table -
Previous revisions of uploaded files. Awkwardly, image rows have to be moved into this table at re-upload time.
- page table -
Core of the wiki: each page has an entry here which identifies it by title and contains some essential metadata.
- pagelinks table -
Track page-to-page hyperlinks within the wiki.
- querycache table -
Used for caching expensive grouped queries.
- recentchanges table -
Primarily a summary table for Special:Recentchanges, this table contains some additional info on edits from the last few days.
- revision table -
Every edit of a page creates also a revision row. This stores metadata about the revision, and a reference to the text storage backend.
- searchindex table -
When using the default MySQL search backend, page titles and text are munged to strip markup, do Unicode case folding, and prepare the result for MySQL's fulltext index.
This table must be MyISAM; InnoDB does not support the needed fulltext index.
- site_stats table -
Contains a single row with some aggregate info on the state of the site.
- templatelinks table -
Track template inclusions.
- text table -
Holds text of individual page revisions.
Field names are a holdover from the 'old' revisions table in MediaWiki 1.4 and earlier: an upgrade will transform that table into the 'text' table to minimize unnecessary churning and downtime. If upgrading, the other fields will be left unused.
- trackbacks table -
mw_trackbacks (unused at this time)
Contains page trackback information.
- transcache table -
Cache of InterWiki transclusions.
- user table -
Contains information about users.
- user_groups table -
User permissions have been broken out to a separate table; this allows sites with a shared user table to have different permissions assigned to a user in each project.
This table replaces the old user_rights field, which used a comma-separated blob.
- user_newtalk table -
Stores notifications of user talk page changes, for the display of the "you have new messages" box.
- validate table -
For article validation (unused at this time; the validation code has been removed).
- watchlist table -
Contains watchlist information.
Semantic MediaWiki currently adds three database tables:
- attributes table -
Contains attributes for RDF subjects (e.g., pages).
- relations table -
Contains relations between RDF subjects (e.g., pages) and objects (e.g., pages, URIs).
- special properties table -
Contains special properties for RDF subjects (e.g., pages).