Manual:Redirect table

Contains for each page that is currently a redirect (i.e., not for old revisions which are redirects) the id of the source page and the information about target. The target page may or may not exist.

''NOTE: as of August 2007, database dumps for Wikipedia and other Wikimedia projects as provided on http://download.wikimedia.org/ have incomplete data in this table: only redirect pages that have been created or edited recently are present. For older redirects, resort to using the pagelinks table.''

Fields
The rd_from field contains the page_id of the source page.

A target is broken into four parts: interwiki prefix (should be empty for a regular redirect), namespace, title and fragment. The rd_namespace field contains the number of the target's namespace. The rd_title contains the sanitized title of the target page. It is stored as text, with spaces replaced by underscores. The rd_fragment contains the target's fragment ID if present (see also 218), otherwise is NULL.

The rd_interwiki is not NULL only if an interwiki prefix is used: #REDIRECT &#99;[prefix:…]] (or such prefix as "w:" in Wikipedia). In this case a redirect is not visible in Special:WhatLinksHere (even if the target lies in the same wiki), rd_namespace is always 0 and rd_title may contain a possible namespace prefix, but rd_fragment may be non-NULL.

Schema summary
DESCRIBE redirect; in MediaWiki 1.18 results in: +--+-+--+-+-+---+ | Field       | Type            | Null | Key | Default | Extra | +--+-+--+-+-+---+ | rd_from     | int(8) unsigned | NO   |     | 0       |       | | rd_namespace | int(11)        | NO   |     | 0       |       | | rd_title    | varbinary(255)  | NO   |     |         |       | | rd_interwiki | varbinary(32)  | YES  |     | NULL    |       | | rd_fragment | varbinary(255)  | YES  |     | NULL    |       | +--+-+--+-+-+---+

DESCRIBE mw_redirect; in version 1.9 gives the following: mysql> describe mw_redirect; +--+-+--+-+-+---+ +--+-+--+-+-+---+ +--+-+--+-+-+---+ 3 rows in set (0.02 sec)
 * Field       | Type            | Null | Key | Default | Extra |
 * rd_from     | int(8) unsigned | NO   | PRI | 0       |       |
 * rd_namespace | int(11)        | NO   | MUL | 0       |       |
 * rd_title    | varchar(255)    | NO   |     | NULL    |       |