aboutsummaryrefslogtreecommitdiffstats
path: root/maintenance/archives/patch-pl_from_namespace.sql
diff options
context:
space:
mode:
authorAaron Schulz <aschulz@wikimedia.org>2014-03-06 15:01:35 -0800
committerOri Livneh <ori@wikimedia.org>2014-07-21 12:04:56 -0700
commitb8c038f6784ef08205f7cf6d7cc11462140e3fa2 (patch)
tree2a0c071c75d1aa8df7f760ca2cbe3d41e6403368 /maintenance/archives/patch-pl_from_namespace.sql
parentb87966f6bbd753655cd684cbddd0ec7fe8e6616c (diff)
downloadmediawikicore-b8c038f6784ef08205f7cf6d7cc11462140e3fa2.tar.gz
mediawikicore-b8c038f6784ef08205f7cf6d7cc11462140e3fa2.zip
Redo WhatLinksHere query and add a *_from_namespace field to link tables
* Also tweaked the query so MySQL avoids doing a page_name index scan when it should start with the link table index * Added population script (triggered by update.php) * Also removed uniqueness from some indexes where it is redundant * Renamed two confusing variables Bug: 60618 Change-Id: Icca99b6ae0ef76cb77695faf82c615516191da36
Diffstat (limited to 'maintenance/archives/patch-pl_from_namespace.sql')
-rw-r--r--maintenance/archives/patch-pl_from_namespace.sql4
1 files changed, 4 insertions, 0 deletions
diff --git a/maintenance/archives/patch-pl_from_namespace.sql b/maintenance/archives/patch-pl_from_namespace.sql
new file mode 100644
index 000000000000..2f7ff046dd93
--- /dev/null
+++ b/maintenance/archives/patch-pl_from_namespace.sql
@@ -0,0 +1,4 @@
+ALTER TABLE /*_*/pagelinks
+ ADD COLUMN pl_from_namespace int NOT NULL default 0;
+
+CREATE INDEX /*i*/pl_backlinks_namespace ON /*_*/pagelinks (pl_namespace,pl_title,pl_from_namespace,pl_from);