Manual:pagelinks table

From mediawiki.org
This page is a translated version of the page Manual:Pagelinks table and the translation is 25% complete.
Manual:Mục lục MediaWiki database layout pagelinks table
Phiên bản MediaWiki:
1.5

Ghi nhận tất cả liên kết nội bộ của Wiki. Mỗi mục chứa ID trang nguồn cùng với không gian tên (số) và tên bài viết (chữ) được liên kết đến. ID của trang nguồn có thể xuất hiện nhiều lần, bằng số liên kết nội bộ chứa trong nó, tuy nhiên chỉ có thể có một mục cho mỗi liên kết tương ứng với một ID (nếu không MySQL sẽ báo lỗi).

Lưu ý rằng trang đích có thể tồn tại hoặc không, do những sự đổi tên hay xoá theo thời gian.

The table was introduced in version 1.5. It is the result of merging the links table and the brokenlinks table of version 1.4. Regenerating the pagelinks table is always possible using the rebuildall.php maintenance script.

Fields

pl_from

The page_id of the page containing the link.

pl_namespace

The page_namespace of the target page. The target page may or may not exist, and due to renames and deletions may refer to different page records as time goes by.

pl_title

The title of the target page in the page_title format. The target page may or may not exist, and due to renames and deletions may refer to different page records as time goes by. Spaces are converted to underscores, and the first letter may be automatically capitalized. So for example, a link to foo bar would have a pl_title of "Foo_bar" assuming $wgCapitalLinks = true; and no $wgCapitalLinkOverrides.

pl_from_namespace

Phiên bản MediaWiki:
1.24

The page_namespace of the page containing the link.

pl_target_id

Phiên bản MediaWiki:
1.41
Gerrit change 941474

Foreign key to linktarget.

Schema summary

Phiên bản MediaWiki:
1.41

DESCRIBE pagelinks;

+-------------------+---------------------+------+-----+---------+-------+
| Field             | Type                | Null | Key | Default | Extra |
+-------------------+---------------------+------+-----+---------+-------+
| pl_from           | int(10) unsigned    | NO   | PRI | 0       |       |
| pl_namespace      | int(11)             | NO   | PRI | 0       |       |
| pl_title          | varbinary(255)      | NO   | PRI |         |       |
| pl_from_namespace | int(11)             | NO   | MUL | 0       |       |
| pl_target_id      | bigint(20) unsigned | YES  | MUL | NULL    |       |
+-------------------+---------------------+------+-----+---------+-------+
Các phiên bản MediaWiki:
1.36 – 1.40

DESCRIBE pagelinks;

+-------------------+------------------+------+-----+---------+-------+
| Field             | Type             | Null | Key | Default | Extra |
+-------------------+------------------+------+-----+---------+-------+
| pl_from           | int(10) unsigned | NO   | PRI | 0       |       |
| pl_namespace      | int(11)          | NO   | PRI | 0       |       |
| pl_title          | varbinary(255)   | NO   | PRI |         |       |
| pl_from_namespace | int(11)          | NO   | MUL | 0       |       |
+-------------------+------------------+------+-----+---------+-------+
Các phiên bản MediaWiki:
1.26 – 1.35

DESCRIBE pagelinks;

+-------------------+------------------+------+-----+---------+-------+
| Field             | Type             | Null | Key | Default | Extra |
+-------------------+------------------+------+-----+---------+-------+
| pl_from           | int(10) unsigned | NO   | PRI | 0       |       |
| pl_from_namespace | int(11)          | NO   | MUL | 0       |       |
| pl_namespace      | int(11)          | NO   | PRI | 0       |       |
| pl_title          | varbinary(255)   | NO   | PRI |         |       |
+-------------------+------------------+------+-----+---------+-------+
Các phiên bản MediaWiki:
1.24 – 1.25

DESCRIBE pagelinks;

+-------------------+------------------+------+-----+---------+-------+
| Field             | Type             | Null | Key | Default | Extra |
+-------------------+------------------+------+-----+---------+-------+
| pl_from           | int(10) unsigned | NO   | PRI | 0       |       |
| pl_from_namespace | int(11)          | NO   |     | 0       |       |
| pl_namespace      | int(11)          | NO   | PRI | 0       |       |
| pl_title          | varbinary(255)   | NO   | PRI |         |       |
+-------------------+------------------+------+-----+---------+-------+
Các phiên bản MediaWiki:
1.10 – 1.23

DESCRIBE pagelinks;

+--------------+---------------------+------+-----+---------+-------+
| Field        | Type                | Null | Key | Default | Extra |
+--------------+---------------------+------+-----+---------+-------+
| pl_from      | int(10) unsigned    | NO   | PRI | 0       |       |
| pl_namespace | int(11)             | NO   | PRI | 0       |       |
| pl_title     | varchar(255) binary | NO   | PRI | NULL    |       |
+--------------+---------------------+------+-----+---------+-------+
Các phiên bản MediaWiki:
1.5 – 1.9

DESCRIBE pagelinks;

+--------------+---------------------+------+-----+---------+-------+
| Field        | Type                | Null | Key | Default | Extra |
+--------------+---------------------+------+-----+---------+-------+
| pl_from      | int(8) unsigned     | NO   | PRI | 0       |       |
| pl_namespace | int(11)             | NO   | PRI | 0       |       |
| pl_title     | varchar(255) binary | NO   | PRI | NULL    |       |
+--------------+---------------------+------+-----+---------+-------+

Indexes

Phiên bản MediaWiki:
1.41

SHOW INDEX IN pagelinks;

+-----------+------------+----------------------------------+--------------+-------------------+-----------+-------------+----------+--------+------+------------+---------+---------------+
| Table     | Non_unique | Key_name                         | Seq_in_index | Column_name       | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment | Index_comment |
+-----------+------------+----------------------------------+--------------+-------------------+-----------+-------------+----------+--------+------+------------+---------+---------------+
| pagelinks |          0 | PRIMARY                          |            1 | pl_from           | A         |           0 |     NULL | NULL   |      | BTREE      |         |               |
| pagelinks |          0 | PRIMARY                          |            2 | pl_namespace      | A         |           0 |     NULL | NULL   |      | BTREE      |         |               |
| pagelinks |          0 | PRIMARY                          |            3 | pl_title          | A         |           0 |     NULL | NULL   |      | BTREE      |         |               |
| pagelinks |          1 | pl_namespace                     |            1 | pl_namespace      | A         |           0 |     NULL | NULL   |      | BTREE      |         |               |
| pagelinks |          1 | pl_namespace                     |            2 | pl_title          | A         |           0 |     NULL | NULL   |      | BTREE      |         |               |
| pagelinks |          1 | pl_namespace                     |            3 | pl_from           | A         |           0 |     NULL | NULL   |      | BTREE      |         |               |
| pagelinks |          1 | pl_backlinks_namespace           |            1 | pl_from_namespace | A         |           0 |     NULL | NULL   |      | BTREE      |         |               |
| pagelinks |          1 | pl_backlinks_namespace           |            2 | pl_namespace      | A         |           0 |     NULL | NULL   |      | BTREE      |         |               |
| pagelinks |          1 | pl_backlinks_namespace           |            3 | pl_title          | A         |           0 |     NULL | NULL   |      | BTREE      |         |               |
| pagelinks |          1 | pl_backlinks_namespace           |            4 | pl_from           | A         |           0 |     NULL | NULL   |      | BTREE      |         |               |
| pagelinks |          1 | pl_target_id                     |            1 | pl_target_id      | A         |           0 |     NULL | NULL   | YES  | BTREE      |         |               |
| pagelinks |          1 | pl_target_id                     |            2 | pl_from           | A         |           0 |     NULL | NULL   |      | BTREE      |         |               |
| pagelinks |          1 | pl_backlinks_namespace_target_id |            1 | pl_from_namespace | A         |           0 |     NULL | NULL   |      | BTREE      |         |               |
| pagelinks |          1 | pl_backlinks_namespace_target_id |            2 | pl_target_id      | A         |           0 |     NULL | NULL   | YES  | BTREE      |         |               |
| pagelinks |          1 | pl_backlinks_namespace_target_id |            3 | pl_from           | A         |           0 |     NULL | NULL   |      | BTREE      |         |               |
+-----------+------------+----------------------------------+--------------+-------------------+-----------+-------------+----------+--------+------+------------+---------+---------------+