Manual:Categorylinks table/pl

Tabela categorylinks przechowuje wszystkie wpisy o linkach typu  lub , służące do umieszczania strony w kategorii o nazwie Title (dla których przypisana strona opisu może, ale nie musi istnieć). Linki zaczynające się dwukropkiem, na przykład, nie są przechowywane w tabeli categorylinks, ponieważ tworzą zwykły klikalny link wewnętrzny (w tym przypadku prowadzący do strony Category:Title). Edytowalna część stron kategorii jest przechowywana tak jak normalne strony.

Są cztery indeksy wspomagające wydajność:


 * The concatenation of cl_from and cl_to (for when an article is edited)
 * The concatenation of cl_to, cl_type, cl_sortkey, and cl_from (for showing articles in order)
 * The concatenation of cl_to and cl_timestamp
 * cl_collation

cl_from
Przechowuje page. artykułu, w którym link został umieszczony (skategoryzowany artykuł).

cl_to
Stores the name of the desired category in the format (that is, with   and excluding namespace prefix).

cl_sortkey
Stores the title by which the page should be sorted in a category list. This is the binary sortkey, that depending on may or may not be readable by a human (but should sort in correct order when comparing as a byte string), and is not valid UTF-8 whenever the database truncates the sortkey in the middle of a multi-byte sequence.

cl_timestamp
Przechowuje czas kiedy link został ostatnio zaktualizowany w tabeli.

cl_sortkey_prefix
This is either the empty string if a page is using the default sortkey (aka the sortkey is unspecified). Otherwise it is the human readable version of cl_sortkey. Needed mostly so that cl_sortkey can be easily updated in certain situations without re-parsing the entire page. More recently added values are valid UTF-8 (see change 449280 on Gerrit).

cl_collation
What collation is in use. Used so that if the collation changes, the script knows what rows need to be fixed in db.

cl_type
Rodzaj strony ( (plik),   (podkategoria) lub   (strona)). Wykorzystywane do efektywnego oddzielnego wyświetlania tych rodzajów stron na stronie kategorii.

Podsumowanie struktury
+---+--+--+-+---+-+ +---+--+--+-+---+-+ +---+--+--+-+---+-+
 * Field            | Type                         | Null | Key | Default           | Extra                       |
 * cl_from          | int(10) unsigned             | NO   | PRI | 0                 |                             |
 * cl_to            | varbinary(255)               | NO   | PRI |                   |                             |
 * cl_sortkey       | varbinary(230)               | NO   |     |                   |                             |
 * cl_sortkey_prefix | varbinary(255)              | NO   |     |                   |                             |
 * cl_timestamp     | timestamp                    | NO   |     | CURRENT_TIMESTAMP | on update CURRENT_TIMESTAMP |
 * cl_collation     | varbinary(32)                | NO   | MUL |                   |                             |
 * cl_type          | enum('page','subcat','file') | NO   |     | page              |                             |

+--+--+--+-+---+-+ +--+--+--+-+---+-+ +--+--+--+-+---+-+
 * Field       | Type             | Null | Key | Default           | Extra                       |
 * cl_from     | int(10) unsigned | NO   | PRI | 0                 |                             |
 * cl_to       | varbinary(255)   | NO   | PRI |                   |                             |
 * cl_sortkey  | varbinary(70)    | NO   |     |                   |                             |
 * cl_timestamp | timestamp       | NO   |     | CURRENT_TIMESTAMP | on update CURRENT_TIMESTAMP |

+--+-+--+-+---+-+ +--+-+--+-+---+-+ +--+-+--+-+---+-+
 * Field       | Type            | Null | Key | Default           | Extra                       |
 * cl_from     | int(8) unsigned | NO   | PRI | 0                 |                             |
 * cl_to       | varchar(255)    | NO   | PRI |                   |                             |
 * cl_sortkey  | varchar(86)     | NO   |     |                   |                             |
 * cl_timestamp | timestamp      | NO   |     | CURRENT_TIMESTAMP | on update CURRENT_TIMESTAMP |

+--+-+--+-+---+-+ +--+-+--+-+---+-+ +--+-+--+-+---+-+
 * Field       | Type            | Null | Key | Default           | Extra                       |
 * cl_from     | int(8) unsigned | NO   | PRI | 0                 |                             |
 * cl_to       | varchar(255)    | NO   | PRI |                   |                             |
 * cl_sortkey  | varchar(255)    | NO   |     |                   |                             |
 * cl_timestamp | timestamp      | NO   |     | CURRENT_TIMESTAMP | on update CURRENT_TIMESTAMP |

Indeksy
 +---++--+--+--+---+-+--++--++-+---+ +---++--+--+--+---+-+--++--++-+---+ +---++--+--+--+---+-+--++--++-+---+
 * Table        | Non_unique | Key_name         | Seq_in_index | Column_name  | Collation | Cardinality | Sub_part | Packed | Null | Index_type | Comment | Index_comment |
 * categorylinks |         0 | PRIMARY          |            1 | cl_from      | A         |           0 |     NULL | NULL   |      | BTREE      |         |               |
 * categorylinks |         0 | PRIMARY          |            2 | cl_to        | A         |           0 |     NULL | NULL   |      | BTREE      |         |               |
 * categorylinks |         1 | cl_sortkey       |            1 | cl_to        | A         |           0 |     NULL | NULL   |      | BTREE      |         |               |
 * categorylinks |         1 | cl_sortkey       |            2 | cl_type      | A         |           0 |     NULL | NULL   |      | BTREE      |         |               |
 * categorylinks |         1 | cl_sortkey       |            3 | cl_sortkey   | A         |           0 |     NULL | NULL   |      | BTREE      |         |               |
 * categorylinks |         1 | cl_sortkey       |            4 | cl_from      | A         |           0 |     NULL | NULL   |      | BTREE      |         |               |
 * categorylinks |         1 | cl_timestamp     |            1 | cl_to        | A         |           0 |     NULL | NULL   |      | BTREE      |         |               |
 * categorylinks |         1 | cl_timestamp     |            2 | cl_timestamp | A         |           0 |     NULL | NULL   |      | BTREE      |         |               |
 * categorylinks |         1 | cl_collation_ext |            1 | cl_collation | A         |           0 |     NULL | NULL   |      | BTREE      |         |               |
 * categorylinks |         1 | cl_collation_ext |            2 | cl_to        | A         |           0 |     NULL | NULL   |      | BTREE      |         |               |
 * categorylinks |         1 | cl_collation_ext |            3 | cl_type      | A         |           0 |     NULL | NULL   |      | BTREE      |         |               |
 * categorylinks |         1 | cl_collation_ext |            4 | cl_from      | A         |           0 |     NULL | NULL   |      | BTREE      |         |               |