Jump to content

Manual:linktarget テーブル

From mediawiki.org
This page is a translated version of the page Manual:Linktarget table and the translation is 50% complete.
Manual:コンテンツ MediaWiki のデータベース レイアウト linktarget テーブル
MediaWiki バージョン:
1.38

This table stores a page namespace-title tuples, each one with a unique integer ID. This table is used for referenced page titles in tables that track links to pages: templatelinks , pagelinks tables.

This table contains immutable rows, which means only new rows are inserted, and never deleted or updated during normal wiki operation. However, the pruneUnusedLinkTargetRows.php maintenance script can be run to delete unused entries.

Access to this table from code is handled by instances of the class MediaWiki\Linker\LinkTargetLookup interface.

During schema migration, this table is filled using the migrateLinksTable.php maintenance script. $wgTemplateLinksSchemaMigrationStage controls whether data is read/written to this table.

フィールド

lt_id

主キー。

lt_namespace

リンク先の名前空間。

lt_title

リンク先から名前空間を除いたテキスト部分。

スキーマの要約

MediaWiki バージョン:
1.38

DESCRIBE linktarget;

+--------------+---------------------+------+-----+---------+----------------+
| Field        | Type                | Null | Key | Default | Extra          |
+--------------+---------------------+------+-----+---------+----------------+
| lt_id        | bigint(20) unsigned | NO   | PRI | NULL    | auto_increment |
| lt_namespace | int(11)             | NO   | MUL | NULL    |                |
| lt_title     | varbinary(255)      | NO   |     | NULL    |                |
+--------------+---------------------+------+-----+---------+----------------+

インデックス

MediaWiki バージョン:
1.38
Gerrit change 754989

SHOW INDEX IN linktarget;

+------------+------------+--------------------+--------------+--------------+-----------+-------------+----------+--------+------+------------+---------+---------------+
| Table      | Non_unique | Key_name           | Seq_in_index | Column_name  | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment | Index_comment |
+------------+------------+--------------------+--------------+--------------+-----------+-------------+----------+--------+------+------------+---------+---------------+
| linktarget |          0 | PRIMARY            |            1 | lt_id        | A         |           0 |     NULL | NULL   |      | BTREE      |         |               |
| linktarget |          0 | lt_namespace_title |            1 | lt_namespace | A         |           0 |     NULL | NULL   |      | BTREE      |         |               |
| linktarget |          0 | lt_namespace_title |            2 | lt_title     | A         |           0 |     NULL | NULL   |      | BTREE      |         |               |
+------------+------------+--------------------+--------------+--------------+-----------+-------------+----------+--------+------+------------+---------+---------------+