From: Brion Vibber Date: Wed, 13 Jul 2005 01:59:12 +0000 (+0000) Subject: * live fix: force index on Special:Export only for backup dump X-Git-Tag: 1.5.0beta4~147 X-Git-Url: https://git.cyclocoop.org/%242?a=commitdiff_plain;h=36aa91dd067e2123f354db2b965450bb899f280d;p=lhc%2Fweb%2Fwiklou.git * live fix: force index on Special:Export only for backup dump --- diff --git a/RELEASE-NOTES b/RELEASE-NOTES index d7b93bfc4c..9ff7f215e6 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -566,6 +566,7 @@ of MediaWiki:Newpagetext) to &action=edit, if page is new. * (bug 2825) Fix regression in newtalk notifications for anons w/ enotif off * (bug 2833) Fix bug in previous fix * Accept --server option for database to read main query from on backup +* live fix: force index on Special:Export only for backup dump === Caveats === diff --git a/includes/SpecialExport.php b/includes/SpecialExport.php index 0504c05573..40fef6a931 100644 --- a/includes/SpecialExport.php +++ b/includes/SpecialExport.php @@ -272,10 +272,18 @@ class WikiExporter { if( $this->buffer == MW_EXPORT_STREAM ) { $prev = $this->db->bufferResults( false ); } + if( $cond == '' ) { + // Optimization hack for full-database dump + $pageindex = 'FORCE INDEX (PRIMARY)'; + $revindex = 'FORCE INDEX(page_timestamp)'; + } else { + $pageindex = ''; + $revindex = ''; + } $result = $this->db->query( "SELECT * FROM - $page FORCE INDEX (PRIMARY), - $revision FORCE INDEX(page_timestamp), + $page $pageindex, + $revision $revindex, $text WHERE $where $join AND rev_text_id=old_id ORDER BY page_id", $fname );