Last modified: 2011-11-25 07:12:47 UTC
All proposed schema changes are at http://meta.wikimedia.org/wiki/Proposed_Database_Schema_Changes There is a need for some special pages to cache two links per line instead of one. Examples include [[Special:Disambiguations]], [[Special:BrokenRedirects]], [[Special:DoubleRedirects]], and possibly any other that are currently not implemented because of the caching limitations. The table structure will be identical to querycache table, except that it will have two additional fields (namespace2 & title2), plus it might have a number of additional indexes to facilitate better sorting. CREATE TABLE `querycache2` ( `qc2_type` char(32) NOT NULL, `qc2_value` int(5) unsigned NOT NULL default '0', `qc2_namespace` int(11) NOT NULL default '0', `qc2_title` char(255) character set latin1 collate latin1_bin NOT NULL default , `qc2_namespace2` int(11) NOT NULL default '0', `qc2_title2` char(255) character set latin1 collate latin1_bin NOT NULL default , KEY `qc2_value` (`qc2_type`,`qc2_value`), KEY `qc2_title` (`qc2_type`,`qc2_namespace`,`qc2_title`), KEY `qc2_title2` (`qc2_type`,`qc2_namespace2`,`qc2_title2`) )
The table has been created in the databases, so the only thing left is to change the special pages to start using `querycache2` table instead of `querycache`.
If this table is to replace querycache, then it should probably just be named querycache; the 2 can be dropped. Obviously this will need some co-ordination and a bit of work in the update script.
We could delete querycache2 and simply add one more ns+title pair to the querycache table. The positive would be a more consolidated data structure and a much simpler common code for the special pages, but the negative is the wasted space for all the queries that do not need a second title.
I like the positives, though. Two tables for very similar purposes is taking the p***.
Fwiw, we've been using querycache and querycachetwo for several years now. Are there still any intentions to combine these into one table eventually?