Manual:Recentchanges table

The recentchanges table contains information about the latest modifications done to the wiki (not older than $wgRCMaxAge; see also below). The contents of this table are used to generate the recent changes pages, related changes pages, watchlists, and the list of new pages, and contain information such as editors' IP addresses not found on other tables.

rc_id
This is the primary key for the table. (Introduced in MediaWiki 1.5)

rc_timestamp
Holds the timestamp of the edit.

rc_cur_time
Held for backwards compatibility, although still used in a few places.

rc_user
This is equal to the user_id of the user who made this edit. The value for this field is 0 for anonymous edits, initialization scripts, and for some mass imports.

rc_user_text
This fields holds the text of the editor's username, or the IP address of the editor if the revision was done by an unregistered user.

rc_namespace
The namespace number of the page that was modified.

If this row describes a logged action, this field has a value of -1 (NS_SPECIAL), as it records an entry for a Special:Log subpage. This is the only place in which Special: pages are directly recorded in database namespace/title pairs at present.

rc_title
The name of the page that was modified, with the namespace stripped. This field stores information in text form.

rc_comment
This field holds an editor's edit summary (editor's comment on revision). This text is shown in the recent changes, related changes, watchlists, and, in the case of page creation, the list of new pages. (The revision table contains a copy used for the history and user contributions pages.) It is rendered in a subset of wiki markup.

rc_minor
Records whether the user marked the 'minor edit' checkbox. If the value for this field is 1, then the edit was declared as 'minor'; it is 0 otherwise. Many automated edits are marked as minor.

rc_bot
Records whether the edit was made by a 'bot account'. If the value for this field is 1, then the edit was made by a 'bot'; it is 0 otherwise. Users cannot designate their edits as bot edits individually; MediaWiki fills this column's value automatically.

rc_new
If the value for this field is 1, then this edit created a page; it is 0 otherwise.

rc_cur_id
This field links to the page_id key in the page table, which stores the metadata of the page.

rc_this_oldid
Links to the rev_id key of the new page revision (after the edit occurs) in the revision table.

rc_last_oldid
Links to rev_id of the revision prior to this edit, which included the previous content of the page.

rc_type

 * Probably incomplete

This field stores the type of modification that was made to a page:
 * 0 - edit of existing page
 * 1 - new page
 * 3 - log action (introduced in MediaWiki 1.2)

rc_moved_to_ns
This field stored the namespace of a page whenever it was moved. As of MediaWiki 1.8, it remains on the table for backwards compatibility only, and always has the value 0.

rc_moved_to_title
This field stored the new page title of a page whenever it was moved. As of MediaWiki 1.8, it remains on the table for backwards compatibility only, and is always a null string.

rc_patrolled
If the Recent Changes Patrol option ($wgUseRCPatrol) is enabled, users may mark edits as having been reviewed to remove a warning flag on the RC list. A value of 1 indicates the page has been reviewed. (Introduced in MediaWiki 1.4)

rc_ip
This field stores the IP address of the user specified on rc_user if $wgPutIPinRC is enabled. This field is used to generate CheckUser reports, as this information is not stored anywhere else on MediaWiki's database architecture. (Introduced in MediaWiki 1.3)

rc_old_len
This field stores the size, in bytes, of previous revision's text. This field is used to generate the added and removed characters feature in recent changes, related changes and watchlists.

rc_new_len
This field stores the size, in bytes, of the current revision's text. This field is used to generate the added and removed characters feature in recent changes, related changes and watchlists.

rc_deleted
This field stores a value for this particular revision's visibility within the wiki. It was created to accommodate upcoming revisions to the deletion system. The field is analogous to rev_deleted.

rc_log_id
This field is a foreign key to the logging table, which links to log_id if this row corresponds to a log entry. The field was introduced in MediaWiki 1.10.

rc_log_type
If a log action is referenced in this row, this field stores the type of log action that was performed, and which is referenced in this row. Typical values are. This field is comparable to log_type.

rc_log_action
If a log action is referenced in this row, this field stores the type of log action that was performed, and which is referenced in this row. This field is comparable to log_action.

rc_params
This field will be a mirror of log_params, following the log_params text rewrite. Introduced in MediaWiki 1.10.

Schema summary
DESCRIBE recentchanges in MediaWiki 1.10 gives the following: mysql> describe mw_recentchanges; +---+-+--+-+-++ +---+-+--+-+-++ +---+-+--+-+-++ 25 rows in set (0.24 sec)
 * Field            | Type                | Null | Key | Default | Extra          |
 * rc_id            | int(8)              | NO   | PRI | NULL    | auto_increment |
 * rc_timestamp     | varchar(14)         | NO   | MUL | NULL    |                |
 * rc_cur_time      | varchar(14)         | NO   |     | NULL    |                |
 * rc_user          | int(10) unsigned    | NO   |     | 0       |                |
 * rc_user_text     | varchar(255)        | NO   | MUL | NULL    |                |
 * rc_namespace     | int(11)             | NO   | MUL | 0       |                |
 * rc_title         | varchar(255)        | NO   |     | NULL    |                |
 * rc_comment       | varchar(255)        | NO   |     | NULL    |                |
 * rc_minor         | tinyint(3) unsigned | NO   |     | 0       |                |
 * rc_bot           | tinyint(3) unsigned | NO   |     | 0       |                |
 * rc_new           | tinyint(3) unsigned | NO   | MUL | 0       |                |
 * rc_cur_id        | int(10) unsigned    | NO   | MUL | 0       |                |
 * rc_this_oldid    | int(10) unsigned    | NO   |     | 0       |                |
 * rc_last_oldid    | int(10) unsigned    | NO   |     | 0       |                |
 * rc_type          | tinyint(3) unsigned | NO   |     | 0       |                |
 * rc_moved_to_ns   | tinyint(3) unsigned | NO   |     | 0       |                |
 * rc_moved_to_title | varchar(255)       | NO   |     | NULL    |                |
 * rc_patrolled     | tinyint(3) unsigned | NO   |     | 0       |                |
 * rc_ip            | char(15)            | NO   | MUL | NULL    |                |
 * rc_old_len       | int(10)             | YES  |     | NULL    |                |
 * rc_new_len       | int(10)             | YES  |     | NULL    |                |
 * rc_deleted       | tinyint(1) unsigned | NO   |     | 0       |                |
 * rc_logid         | int(10) unsigned    | NO   |     | 0       |                |
 * rc_log_type      | varchar(255)        | YES  |     | NULL    |                |
 * rc_params        | blob                | NO   |     | NULL    |                |

DESCRIBE recentchanges in MediaWiki 1.9 gives the following: mysql> describe mw_recentchanges; +---+-+--+-+-++ +---+-+--+-+-++ +---+-+--+-+-++ 21 rows in set
 * Field            | Type                | Null | Key | Default | Extra          |
 * rc_id            | int(8)              | NO   | PRI | NULL    | auto_increment |
 * rc_timestamp     | varchar(14)         | NO   | MUL | NULL    |                |
 * rc_cur_time      | varchar(14)         | NO   |     | NULL    |                |
 * rc_user          | int(10) unsigned    | NO   |     | 0       |                |
 * rc_user_text     | varchar(255)        | NO   | MUL | NULL    |                |
 * rc_namespace     | int(11)             | NO   | MUL | 0       |                |
 * rc_title         | varchar(255)        | NO   |     | NULL    |                |
 * rc_comment       | varchar(255)        | NO   |     | NULL    |                |
 * rc_minor         | tinyint(3) unsigned | NO   |     | 0       |                |
 * rc_bot           | tinyint(3) unsigned | NO   |     | 0       |                |
 * rc_new           | tinyint(3) unsigned | NO   | MUL | 0       |                |
 * rc_cur_id        | int(10) unsigned    | NO   | MUL | 0       |                |
 * rc_this_oldid    | int(10) unsigned    | NO   |     | 0       |                |
 * rc_last_oldid    | int(10) unsigned    | NO   |     | 0       |                |
 * rc_type          | tinyint(3) unsigned | NO   |     | 0       |                |
 * rc_moved_to_ns   | tinyint(3) unsigned | NO   |     | 0       |                |
 * rc_moved_to_title | varchar(255)       | NO   |     | NULL    |                |
 * rc_patrolled     | tinyint(3) unsigned | NO   |     | 0       |                |
 * rc_ip            | char(15)            | NO   | MUL | NULL    |                |
 * rc_old_len       | int(10)             | YES  |     | NULL    |                |
 * rc_new_len       | int(10)             | YES  |     | NULL    |                |

DESCRIBE recentchanges in MediaWiki 1.5 through 1.8 gives the following: +---+-+--+-+-++ +---+-+--+-+-++ +---+-+--+-+-++ 19 rows in set
 * Field            | Type                | Null | Key | Default | Extra          |
 * rc_id            | int(8)              | NO   | PRI | NULL    | auto_increment |
 * rc_timestamp     | varchar(14)         | NO   | MUL |         |                |
 * rc_cur_time      | varchar(14)         | NO   |     |         |                |
 * rc_user          | int(10) unsigned    | NO   |     | 0       |                |
 * rc_user_text     | varchar(255)        | NO   |     |         |                |
 * rc_namespace     | int(11)             | NO   | MUL | 0       |                |
 * rc_title         | varchar(255)        | NO   |     |         |                |
 * rc_comment       | varchar(255)        | NO   |     |         |                |
 * rc_minor         | tinyint(3) unsigned | NO   |     | 0       |                |
 * rc_bot           | tinyint(3) unsigned | NO   |     | 0       |                |
 * rc_new           | tinyint(3) unsigned | NO   | MUL | 0       |                |
 * rc_cur_id        | int(10) unsigned    | NO   | MUL | 0       |                |
 * rc_this_oldid    | int(10) unsigned    | NO   |     | 0       |                |
 * rc_last_oldid    | int(10) unsigned    | NO   |     | 0       |                |
 * rc_type          | tinyint(3) unsigned | NO   |     | 0       |                |
 * rc_moved_to_ns   | tinyint(3) unsigned | NO   |     | 0       |                |
 * rc_moved_to_title | varchar(255)       | NO   |     |         |                |
 * rc_patrolled     | tinyint(3) unsigned | NO   |     | 0       |                |
 * rc_ip            | char(15)            | NO   | MUL |         |                |

DESCRIBE recentchanges in MediaWiki 1.4 gives the following: +---+-+--+-+-++ +---+-+--+-+-++ +---+-+--+-+-++ 18 rows in set
 * Field            | Type                | Null | Key | Default | Extra          |
 * rc_timestamp     | varchar(14)         | NO   | MUL |         |                |
 * rc_cur_time      | varchar(14)         | NO   |     |         |                |
 * rc_user          | int(10) unsigned    | NO   |     | 0       |                |
 * rc_user_text     | varchar(255)        | NO   |     |         |                |
 * rc_namespace     | int(11)             | NO   | MUL | 0       |                |
 * rc_title         | varchar(255)        | NO   |     |         |                |
 * rc_comment       | varchar(255)        | NO   |     |         |                |
 * rc_minor         | tinyint(3) unsigned | NO   |     | 0       |                |
 * rc_bot           | tinyint(3) unsigned | NO   |     | 0       |                |
 * rc_new           | tinyint(3) unsigned | NO   | MUL | 0       |                |
 * rc_cur_id        | int(10) unsigned    | NO   | MUL | 0       |                |
 * rc_this_oldid    | int(10) unsigned    | NO   |     | 0       |                |
 * rc_last_oldid    | int(10) unsigned    | NO   |     | 0       |                |
 * rc_type          | tinyint(3) unsigned | NO   |     | 0       |                |
 * rc_moved_to_ns   | tinyint(3) unsigned | NO   |     | 0       |                |
 * rc_moved_to_title | varchar(255)       | NO   |     |         |                |
 * rc_patrolled     | tinyint(3) unsigned | NO   |     | 0       |                |
 * rc_ip            | char(15)            | NO   | MUL |         |                |

DESCRIBE recentchanges in MediaWiki 1.3 gives the following: +---+-+--+-+-+---+ +---+-+--+-+-+---+ +---+-+--+-+-+---+ 17 rows in set
 * Field            | Type                | Null | Key | Default | Extra |
 * rc_timestamp     | varchar(14) binary  |      | MUL |         |       |
 * rc_cur_time      | varchar(14) binary  |      |     |         |       |
 * rc_user          | int(10) unsigned    |      |     | 0       |       |
 * rc_user_text     | varchar(255) binary |      |     |         |       |
 * rc_namespace     | tinyint(3) unsigned |      | MUL | 0       |       |
 * rc_title         | varchar(255) binary |      |     |         |       |
 * rc_comment       | varchar(255) binary |      |     |         |       |
 * rc_minor         | tinyint(3) unsigned |      |     | 0       |       |
 * rc_bot           | tinyint(3) unsigned |      |     | 0       |       |
 * rc_new           | tinyint(3) unsigned |      | MUL | 0       |       |
 * rc_cur_id        | int(10) unsigned    |      | MUL | 0       |       |
 * rc_this_oldid    | int(10) unsigned    |      |     | 0       |       |
 * rc_last_oldid    | int(10) unsigned    |      |     | 0       |       |
 * rc_type          | tinyint(3) unsigned |      |     | 0       |       |
 * rc_moved_to_ns   | tinyint(3) unsigned |      |     | 0       |       |
 * rc_moved_to_title | varchar(255) binary |     |     |         |       |
 * rc_ip            | varchar(15)         |      | MUL |         |       |

DESCRIBE recentchanges in MediaWiki 1.2 gives the following: +---+-+--+-+-+---+ +---+-+--+-+-+---+ +---+-+--+-+-+---+ 16 rows in set
 * Field            | Type                | Null | Key | Default | Extra |
 * rc_timestamp     | varchar(14) binary  |      | MUL |         |       |
 * rc_cur_time      | varchar(14) binary  |      |     |         |       |
 * rc_user          | int(10) unsigned    |      |     | 0       |       |
 * rc_user_text     | varchar(255) binary |      |     |         |       |
 * rc_namespace     | tinyint(3) unsigned |      | MUL | 0       |       |
 * rc_title         | varchar(255) binary |      |     |         |       |
 * rc_comment       | varchar(255) binary |      |     |         |       |
 * rc_minor         | tinyint(3) unsigned |      |     | 0       |       |
 * rc_bot           | tinyint(3) unsigned |      |     | 0       |       |
 * rc_new           | tinyint(3) unsigned |      | MUL | 0       |       |
 * rc_cur_id        | int(10) unsigned    |      | MUL | 0       |       |
 * rc_this_oldid    | int(10) unsigned    |      |     | 0       |       |
 * rc_last_oldid    | int(10) unsigned    |      |     | 0       |       |
 * rc_type          | tinyint(3) unsigned |      |     | 0       |       |
 * rc_moved_to_ns   | tinyint(3) unsigned |      |     | 0       |       |
 * rc_moved_to_title | varchar(255) binary |     |     |         |       |

DESCRIBE recentchanges in MediaWiki 1.1 gives the following: +---+-+--+-+-+---+ +---+-+--+-+-+---+ +---+-+--+-+-+---+ 13 rows in set
 * Field            | Type                | Null | Key | Default | Extra |
 * rc_timestamp     | varchar(14) binary  |      | MUL |         |       |
 * rc_cur_time      | varchar(14) binary  |      |     |         |       |
 * rc_user          | int(10) unsigned    |      |     | 0       |       |
 * rc_user_text     | varchar(255) binary |      |     |         |       |
 * rc_namespace     | tinyint(3) unsigned |      | MUL | 0       |       |
 * rc_title         | varchar(255) binary |      |     |         |       |
 * rc_comment       | varchar(255) binary |      |     |         |       |
 * rc_minor         | tinyint(3) unsigned |      |     | 0       |       |
 * rc_bot           | tinyint(3) unsigned |      |     | 0       |       |
 * rc_new           | tinyint(3) unsigned |      | MUL | 0       |       |
 * rc_cur_id        | int(10) unsigned    |      | MUL | 0       |       |
 * rc_this_oldid    | int(10) unsigned    |      |     | 0       |       |
 * rc_last_oldid    | int(10) unsigned    |      |     | 0       |       |