Movatterモバイル変換


[0]ホーム

URL:


Jump to content
MediaWiki
Search

Manual:category table

From mediawiki.org
Translate this page
Languages:
Manual:Contents
MediaWiki database layout
category table
MediaWiki version:
1.13

Thecategory table tracks all existing categories.Something is a category if it has an entry somewhere incategorylinks table

Categories might not have corresponding pages, so they need to be tracked separately.cat_pages,cat_subcats, andcat_files are signed to make underflow more obvious.

The pages and sub-categories are stored in thecategorylinks table.
Information regarding which categories are hidden is stored in thepage_props table.
The number fields are signed to make underflow more obvious. We make the first number include the second two for better sorting: subtracting for display is easy, adding for ordering is not.
If the information in this table is incorrect, run the maintenance scriptspopulateCategory.php and/orcleanupEmptyCategories.php, if necessary with the--force option.

Fields

[edit]

cat_id

[edit]

Primary key

cat_title

[edit]

Name of the category, in the same form aspage.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

[edit]

Number of pages in the category.This number includes the number of subcategories and the number of files.

cat_subcats

[edit]

Number of sub-categories in the category.

cat_files

[edit]

Number of files (i.e. Image: namespace members) in the category.

cat_hidden

[edit]
MediaWiki version:
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 thepage_props table as the property "hiddencat" inpp_propname.

Schema summary

[edit]
MediaWiki version:
1.20

DESCRIBEcategory;

+-------------+------------------+------+-----+---------+----------------+| 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 versions:
1.13 – 1.19

DESCRIBEcategory;

+-------------+---------------------+------+-----+---------+----------------+| 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       |                |+-------------+---------------------+------+-----+---------+----------------+

Indexes

[edit]
MediaWiki version:
1.13

SHOWINDEXINcategory;

+----------+------------+-----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+| 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      |         |               |+----------+------------+-----------+--------------+-------------+-----------+-------------+----------+--------+------+------------+---------+---------------+
Engines
Current
Former
Technical documentation
Configuration
Development
Core tables
Current
Former
Retrieved from "https://www.mediawiki.org/w/index.php?title=Manual:Category_table&oldid=6519423"
Category:

[8]ページ先頭

©2009-2025 Movatter.jp