Page MenuHomePhabricator

Create a two-link QueryCache table
Closed, ResolvedPublic

Description

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


Version: unspecified
Severity: enhancement
OS: Windows XP
Platform: PC
URL: http://meta.wikimedia.org/wiki/Proposed_Database_Schema_Changes#Two-link_QueryCache_table

Details

Reference
bz7311

Event Timeline

bzimport raised the priority of this task from to Low.Nov 21 2014, 9:28 PM
bzimport set Reference to bz7311.
bzimport added a subscriber: Unknown Object (MLST).

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.

robchur wrote:

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.

robchur wrote:

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?

Krinkle subscribed.

Closing for now since https://www.mediawiki.org/wiki/Manual:Querycachetwo_table did get created. If we want to merge these two tables, let's have a separate task for that.