[Wikia-l] Category tree
Laurence Parry
greenreaper at hotmail.com
Thu Aug 7 14:14:23 UTC 2008
> Re Wikipedia: Conceivably they could disable a feature such as this due to
> their
> enormous and fast-changing categories (I imagine the feature would have a
> performance hit).
I understand they made a special Category table just to track this
information so that it wouldn't be too expensive. From the trunk database
schema:
-- Track all existing categories. Something is a category if 1) it has an
en-
-- try somewhere in categorylinks, or 2) it once did. Categories might not
-- have corresponding pages, so they need to be tracked separately.
--
CREATE TABLE /*$wgDBprefix*/category (
-- Primary key
cat_id int unsigned NOT NULL auto_increment,
-- Name of the category, in the same form as 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_title varchar(255) binary NOT NULL,
-- The numbers of member pages (including categories and media),
subcatego-
-- ries, and Image: namespace members, respectively. These 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
order-
-- ing is not.
cat_pages int signed NOT NULL default 0,
cat_subcats int signed NOT NULL default 0,
cat_files int signed NOT NULL default 0,
-- Reserved for future use
cat_hidden tinyint unsigned NOT NULL default 0,
PRIMARY KEY (cat_id),
UNIQUE KEY (cat_title),
-- For Special:Mostlinkedcategories
KEY (cat_pages)
) /*$wgDBTableOptions*/;
--
Laurence "GreenReaper" Parry
http://greenreaper.co.uk/ - http://wikifur.com/
"Eternity lies ahead of us, and behind. Have you drunk your fill?"
More information about the Wikia-l
mailing list