Manual:category テーブル

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

category テーブルは既存のすべてのカテゴリを追跡します。 カテゴリとは、categorylinks テーブルのどこかに項目があるもののことです

カテゴリには対応するページがない場合もあるので、ページとは別に追跡する必要があります。 cat_pagescat_subcatscat_filesは符号をつけて下位桁あふれがより明確となるようにしています。

ページと下位カテゴリは categorylinks テーブルに保管されています。
非表示のカテゴリに関する情報は、page_props テーブルに保管されます。
数値のフィールドは、アンダーフローをより明確にするために符号付きにしています。 最初の数値に2番目の2つの数値を含めることで、より良い並べ替えを実現します: 表示のための減算は簡単ですが、並べ替えのための加算は容易ではありません。
If the information in this table is incorrect, run the maintenance scripts populateCategory.php and/or cleanupEmptyCategories.php , if necessary with the --force option.

フィールド

cat_id

主キー

cat_title

Name of the category, in the same form as page .page_title (with underscores). If there is a category page corresponding to this category, by definition, it has this name (in the Category namespace).

cat_pages

カテゴリに属しているページの数。 この数字には、下位カテゴリの数やファイルの数を含みます。

cat_subcats

カテゴリに入っている下位カテゴリの数。

cat_files

カテゴリに入っているファイルの数。

cat_hidden

MediaWiki バージョン:
1.19

Was reserved for future use; apparently no one found a use for it because it was removed in v1.20. Instead, the status of hidden categories is stored in the page_props table as the property "hiddencat" in pp_propname.

スキーマの要約

MediaWiki バージョン:
1.20

DESCRIBE category;

+-------------+------------------+------+-----+---------+----------------+
| Field       | Type             | Null | Key | Default | Extra          |
+-------------+------------------+------+-----+---------+----------------+
| cat_id      | int(10) unsigned | NO   | PRI | NULL    | auto_increment |
| cat_title   | varbinary(255)   | NO   | UNI | NULL    |                |
| cat_pages   | int(11)          | NO   | MUL | 0       |                |
| cat_subcats | int(11)          | NO   |     | 0       |                |
| cat_files   | int(11)          | NO   |     | 0       |                |
+-------------+------------------+------+-----+---------+----------------+
MediaWiki バージョン:
1.13 – 1.19

DESCRIBE category;

+-------------+---------------------+------+-----+---------+----------------+
| Field       | Type                | Null | Key | Default | Extra          |
+-------------+---------------------+------+-----+---------+----------------+
| cat_id      | int(10) unsigned    | NO   | PRI | NULL    | auto_increment |
| cat_title   | varbinary(255)      | NO   | UNI | NULL    |                |
| cat_pages   | int(11)             | NO   | MUL | 0       |                |
| cat_subcats | int(11)             | NO   |     | 0       |                |
| cat_files   | int(11)             | NO   |     | 0       |                |
| cat_hidden  | tinyint(3) unsigned | NO   |     | 0       |                |
+-------------+---------------------+------+-----+---------+----------------+

インデックス

MediaWiki バージョン:
1.13

SHOW INDEX IN category;

+----------+------------+-----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+
| Table    | Non_unique | Key_name  | Seq_in_index | Column_name | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment | Index_comment |
+----------+------------+-----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+
| category |          0 | PRIMARY   |            1 | cat_id      | A         |           0 |     NULL | NULL   |      | BTREE      |         |               |
| category |          0 | cat_title |            1 | cat_title   | A         |           0 |     NULL | NULL   |      | BTREE      |         |               |
| category |          1 | cat_pages |            1 | cat_pages   | A         |           0 |     NULL | NULL   |      | BTREE      |         |               |
+----------+------------+-----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+