fix stubs dump query to use straight join
authorAriel T. Glenn <ariel@wikimedia.org>
Tue, 23 Oct 2018 15:18:47 +0000 (18:18 +0300)
committerAriel T. Glenn <ariel@wikimedia.org>
Tue, 23 Oct 2018 15:33:02 +0000 (18:33 +0300)
regression from a combination of
https://gerrit.wikimedia.org/r/#/c/mediawiki/core/+/380669/
and
https://gerrit.wikimedia.org/r/#/c/mediawiki/core/+/459885/

We have to do a straight join for all stubs, since they all
now order revisions by rev_id after deployment of the second
patchset above.

Bug: T207628
Change-Id: I4d2a311c14c66d4813eb9fc3c587fa3ddb958454

includes/export/WikiExporter.php

index 1f2b81d..32f7519 100644 (file)
@@ -55,7 +55,7 @@ class WikiExporter {
        const TEXT = 0;
        const STUB = 1;
 
-       const BATCH_SIZE = 1000;
+       const BATCH_SIZE = 50000;
 
        /** @var int */
        public $text;
@@ -367,8 +367,9 @@ class WikiExporter {
                } elseif ( $this->history & self::FULL ) {
                        # Full history dumps...
                        # query optimization for history stub dumps
-                       if ( $this->text == self::STUB && $orderRevs ) {
+                       if ( $this->text == self::STUB ) {
                                $tables = $revQuery['tables'];
+                               $opts[] = 'STRAIGHT_JOIN';
                                $opts['USE INDEX']['revision'] = 'rev_page_id';
                                unset( $join['revision'] );
                                $join['page'] = [ 'INNER JOIN', 'rev_page=page_id' ];