Manual:Category table

Track all existing categories. Something is a category if
 * 1) it has an entry somewhere in cl>Special:MyLanguage/Manual:Categorylinks table|categorylinks, or
 * 2) it once did ().

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

The pages and sub-categories are stored in the cl>Special:MyLanguage/Manual:Categorylinks table|categorylinks table.

Information regarding which categories are hidden is stored in the ppt>Special:MyLanguage/Manual:Page props table|page_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 script, if neccessary with the   option.

cat_id
Primary key

cat_title
Name of the category, in the same form as pt>Special:MyLanguage/Manual:page table|page.title>Special:MyLanguage/Manual:Page_table#page_title|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
Number of pages in the category. This number includes the number of subcategories and the number of files.

cat_subcats
Number of sub-categories in the category.

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

cat_hidden
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 props>Special:MyLanguage/Manual:Page props table|page props table as the property "<tvar|hc>hiddencat</>" in <tvar|ppn> </>.

Schema summary
<tt>DESCRIBE category;</tt> +-+-+--+-+-++ +-+-+--+-+-++ +-+-+--+-+-++
 * 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       |                |

<tt>DESCRIBE category;</tt> +-+-+--+-+-++ | 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       |                | +-+-+--+-+-++