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)
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