Index: trunk/phase3/includes/api/ApiQueryWatchlist.php |
— | — | @@ -48,10 +48,11 @@ |
49 | 49 | $this->run($resultPageSet); |
50 | 50 | } |
51 | 51 | |
52 | | - private $fld_ids = false, $fld_title = false, $fld_patrol = false, $fld_flags = false, $fld_timestamp = false, $fld_user = false, $fld_comment = false; |
| 52 | + private $fld_ids = false, $fld_title = false, $fld_patrol = false, $fld_flags = false, |
| 53 | + $fld_timestamp = false, $fld_user = false, $fld_comment = false; |
53 | 54 | |
54 | 55 | private function run($resultPageSet = null) { |
55 | | - global $wgUser; |
| 56 | + global $wgUser, $wgDBtype; |
56 | 57 | |
57 | 58 | $this->selectNamedDB('watchlist', DB_SLAVE, 'watchlist'); |
58 | 59 | |
— | — | @@ -132,7 +133,9 @@ |
133 | 134 | $this->addWhereRange('rc_timestamp', $dir, $start, $end); |
134 | 135 | $this->addWhereFld('wl_namespace', $namespace); |
135 | 136 | $this->addWhereIf('rc_this_oldid=page_latest', !$allrev); |
136 | | - $this->addWhereIf("rc_timestamp > ''", !isset ($start) && !isset ($end)); |
| 137 | + |
| 138 | + # This is a index optimization for mysql, as done in the Special:Watchlist page |
| 139 | + $this->addWhereIf("rc_timestamp > ''", !isset ($start) && !isset ($end) && $wgDBtype == 'mysql'); |
137 | 140 | |
138 | 141 | $this->addOption('LIMIT', $limit +1); |
139 | 142 | |