From: Yuri Astrakhan Date: Fri, 15 Jun 2007 18:37:38 +0000 (+0000) Subject: bug 10280: For table categorylinks, add cl_from to the cl_sortkey index X-Git-Tag: 1.31.0-rc.0~52540 X-Git-Url: http://git.cyclocoop.org//%27http:/code.google.com/p/ie7-js//%27?a=commitdiff_plain;h=e8bd64591da7d48ce535320def78441c0984eaf4;p=lhc%2Fweb%2Fwiklou.git bug 10280: For table categorylinks, add cl_from to the cl_sortkey index --- diff --git a/maintenance/archives/patch-categorylinksindex.sql b/maintenance/archives/patch-categorylinksindex.sql new file mode 100644 index 0000000000..8a9ff1239c --- /dev/null +++ b/maintenance/archives/patch-categorylinksindex.sql @@ -0,0 +1,11 @@ +-- +-- patch-categorylinksindex.sql +-- +-- Per bug 10280 / http://bugzilla.wikimedia.org/show_bug.cgi?id=10280 +-- +-- Improve enum continuation performance of the what pages belong to a category query +-- + +ALTER TABLE /*$wgDBprefix*/categorylinks + DROP INDEX cl_sortkey, + ADD INDEX cl_sortkey(cl_to, cl_sortkey, cl_from); diff --git a/maintenance/updaters.inc b/maintenance/updaters.inc index c2a69c9b6b..66038614c8 100644 --- a/maintenance/updaters.inc +++ b/maintenance/updaters.inc @@ -837,6 +837,14 @@ function do_backlinking_indices_update() { } } +function do_categorylinks_indices_update() { + echo( "Checking for categorylinks indices...\n" ); + if (!index_has_field('categorylinks', 'cl_sortkey', 'cl_from')) + { + dbsource( archive( 'patch-categorylinksindex.sql' ) ); + } +} + function do_stats_init() { // Sometimes site_stats table is not properly populated. global $wgDatabase; @@ -932,6 +940,8 @@ function do_all_updates( $shared = false, $purge = true ) { do_backlinking_indices_update(); flush(); + do_categorylinks_indices_update(); flush(); + do_restrictions_update(); flush (); echo "Deleting old default messages (this may take a long time!)..."; flush();