a) force to read page first (as order by page_id is done) -
authorDomas Mituzas <midom@users.mediawiki.org>
Sun, 26 Mar 2006 10:24:12 +0000 (10:24 +0000)
committerDomas Mituzas <midom@users.mediawiki.org>
Sun, 26 Mar 2006 10:24:12 +0000 (10:24 +0000)
    probably it would be better to scan revision and order by rev_page, but that
    would require review of all possible uses of dump and special cases
   (as sometimes starting on page is more efficient)

b) use PRIMARY index for revision, as we read full row anyway
     (in InnoDB row data is clustered together with PK)

includes/Export.php

index 1e2ad7f..edea8ae 100644 (file)
@@ -188,19 +188,21 @@ class WikiExporter {
                if( $cond == '' ) {
                        // Optimization hack for full-database dump
                        $pageindex = 'FORCE INDEX (PRIMARY)';
-                       $revindex = 'FORCE INDEX(page_timestamp)';
+                       $revindex = 'FORCE INDEX (PRIMARY)';
+                       $straight = ' /*! STRAIGHT_JOIN */ ';
                } else {
                        $pageindex = '';
                        $revindex = '';
+                       $straight = '';
                }
                if( $this->text == MW_EXPORT_STUB ) {
-                       $sql = "SELECT * FROM
+                       $sql = "SELECT $straight * FROM
                                        $page $pageindex,
                                        $revision $revindex
                                        WHERE $where $join
                                        ORDER BY page_id";
                } else {
-                       $sql = "SELECT * FROM
+                       $sql = "SELECT $straight * FROM
                                        $page $pageindex,
                                        $revision $revindex,
                                        $text