* live fix: force index on Special:Export only for backup dump
authorBrion Vibber <brion@users.mediawiki.org>
Wed, 13 Jul 2005 01:59:12 +0000 (01:59 +0000)
committerBrion Vibber <brion@users.mediawiki.org>
Wed, 13 Jul 2005 01:59:12 +0000 (01:59 +0000)
RELEASE-NOTES
includes/SpecialExport.php

index d7b93bf..9ff7f21 100644 (file)
@@ -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 ===
index 0504c05..40fef6a 100644 (file)
@@ -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 );