Manual:watchlistテーブル

This page is a translated version of the page Manual:Watchlist table and the translation is 50% complete.
Manual:コンテンツ MediaWiki のデータベース レイアウト watchlist テーブル

watchlist テーブルは、各登録利用者の ID とその利用者がウォッチしているすべてのページの利用者の、名前空間 ID、名前空間を除いたページ名、通知のタイムスタンプを格納します。ページの変更の通知に使用されます。

MediaWiki works with the assumption that when people watch pages they either watch both the talk page and the normal page, or neither. That means that for each watched page MediaWiki always automatically adds two entries: One for the page and one for its talk page. E.g. when the user watches the Main Page, then there will be two rows in the database table: One for the Main Page in namespace 0 and one for the Main Page in namespace 1 (which is the according talk page). Missing page rows are added by the maintenance script update.php.

フィールド

wl_id

MediaWiki バージョン:
1.27

This is the primary key for the table.

wl_user

これは user.user_id へのキーです。

wl_namespace

これは page_namespace へのキーです。

wl_title

これは page_title へのキーです。

wl_notificationtimestamp

MediaWiki バージョン:
1.4

This is the timestamp of the first change to the page made by another user after the last visit by the watching user; the timestamp is cleared when the user visits the page. When the timestamp is updated, notification email may be sent.

The timestamp is always cleared (made NULL) when the user visits the page, whatever their personal settings, as long as either of $wgUseEnotif or $wgShowUpdatedMarker is true.

MediaWiki バージョン:
1.26

Since git #836ad263, the timestamp update may be deferred to the job queue.

スキーマの概要

MediaWiki バージョン:
1.27

DESCRIBE watchlist;

+--------------------------+------------------+------+-----+---------+----------------+
| Field                    | Type             | Null | Key | Default | Extra          |
+--------------------------+------------------+------+-----+---------+----------------+
| wl_id                    | int(10) unsigned | NO   | PRI | NULL    | auto_increment |
| wl_user                  | int(10) unsigned | NO   | MUL | NULL    |                |
| wl_namespace             | int(11)          | NO   | MUL | 0       |                |
| wl_title                 | varbinary(255)   | NO   |     |         |                |
| wl_notificationtimestamp | varbinary(14)    | YES  |     | NULL    |                |
+--------------------------+------------------+------+-----+---------+----------------+
MediaWiki バージョン:
1.10 – 1.26

DESCRIBE watchlist;

+--------------------------+------------------+------+-----+---------+-------+
| Field                    | Type             | Null | Key | Default | Extra |
+--------------------------+------------------+------+-----+---------+-------+
| wl_user                  | int(10) unsigned | NO   | PRI | NULL    |       |
| wl_namespace             | int(11)          | NO   | PRI | 0       |       |
| wl_title                 | varbinary(255)   | NO   | PRI |         |       |
| wl_notificationtimestamp | varbinary(14)    | YES  |     | NULL    |       |
+--------------------------+------------------+------+-----+---------+-------+
MediaWiki バージョン:
1.6 – 1.9

DESCRIBE watchlist;

+--------------------------+---------------------+------+-----+---------+-------+
| Field                    | Type                | Null | Key | Default | Extra |
+--------------------------+---------------------+------+-----+---------+-------+
| wl_user                  | int(5) unsigned     | NO   | PRI | NULL    |       |
| wl_namespace             | int(11)             | NO   | PRI | 0       |       |
| wl_title                 | varchar(255) binary | NO   | PRI | NULL    |       |
| wl_notificationtimestamp | varchar(14) binary  | YES  |     | NULL    |       |
+--------------------------+---------------------+------+-----+---------+-------+
MediaWiki バージョン:
1.5

DESCRIBE watchlist;

+--------------------------+---------------------+------+-----+---------+-------+
| Field                    | Type                | Null | Key | Default | Extra |
+--------------------------+---------------------+------+-----+---------+-------+
| wl_user                  | int(5) unsigned     | NO   | PRI | NULL    |       |
| wl_namespace             | int(11)             | NO   | PRI | 0       |       |
| wl_title                 | varchar(255) binary | NO   | PRI | NULL    |       |
| wl_notificationtimestamp | varchar(14) binary  | NO   |     | NULL    |       |
+--------------------------+---------------------+------+-----+---------+-------+
MediaWiki バージョン:
1.1 – 1.4

DESCRIBE watchlist;

+--------------+---------------------+------+-----+---------+-------+
| Field        | Type                | Null | Key | Default | Extra |
+--------------+---------------------+------+-----+---------+-------+
| wl_user      | int(5) unsigned     | NO   | PRI | NULL    |       |
| wl_namespace | tinyint(2) unsigned | NO   | PRI | 0       |       |
| wl_title     | varchar(255) binary | NO   | PRI | NULL    |       |
+--------------+---------------------+------+-----+---------+-------+

インデックス

MediaWiki バージョン:
1.36

SHOW INDEX IN watchlist;

+-----------+------------+-------------------------------+--------------+--------------------------+-----------+-------------+----------+--------+------+------------+---------+---------------+
| Table     | Non_unique | Key_name                      | Seq_in_index | Column_name              | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment | Index_comment |
+-----------+------------+-------------------------------+--------------+--------------------------+-----------+-------------+----------+--------+------+------------+---------+---------------+
| watchlist |          0 | PRIMARY                       |            1 | wl_id                    | A         |           0 |     NULL | NULL   |      | BTREE      |         |               |
| watchlist |          0 | wl_user                       |            1 | wl_user                  | A         |           0 |     NULL | NULL   |      | BTREE      |         |               |
| watchlist |          0 | wl_user                       |            2 | wl_namespace             | A         |           0 |     NULL | NULL   |      | BTREE      |         |               |
| watchlist |          0 | wl_user                       |            3 | wl_title                 | A         |           0 |     NULL | NULL   |      | BTREE      |         |               |
| watchlist |          1 | wl_namespace_title            |            1 | wl_namespace             | A         |           0 |     NULL | NULL   |      | BTREE      |         |               |
| watchlist |          1 | wl_namespace_title            |            2 | wl_title                 | A         |           0 |     NULL | NULL   |      | BTREE      |         |               |
| watchlist |          1 | wl_user_notificationtimestamp |            1 | wl_user                  | A         |           0 |     NULL | NULL   |      | BTREE      |         |               |
| watchlist |          1 | wl_user_notificationtimestamp |            2 | wl_notificationtimestamp | A         |           0 |     NULL | NULL   | YES  | BTREE      |         |               |
+-----------+------------+-------------------------------+--------------+--------------------------+-----------+-------------+----------+--------+------+------------+---------+---------------+

関連項目