Index: branches/wmf/1.17wmf1/extensions/FlaggedRevs/maintenance/updateStats.inc |
— | — | @@ -216,16 +216,16 @@ |
217 | 217 | $sql = " |
218 | 218 | SELECT |
219 | 219 | MIN(rev_timestamp) AS rt, MAX(p.fr_timestamp) AS pft, MIN(n.fr_timestamp) AS nft |
220 | | - FROM $revision |
| 220 | + FROM $revision FORCE INDEX (user_timestamp) |
221 | 221 | INNER JOIN $page FORCE INDEX (PRIMARY) ON |
222 | 222 | (page_id = rev_page AND page_namespace IN ($reviewableNS)) |
223 | | - INNER JOIN $flaggedrevs AS p FORCE INDEX (PRIMARY) ON |
| 223 | + INNER JOIN $flaggedrevs AS p FORCE INDEX (page_rev) ON |
224 | 224 | (p.fr_page_id = page_id AND p.fr_rev_id < rev_id AND p.fr_timestamp < rev_timestamp) |
225 | | - LEFT JOIN $flaggedrevs AS n FORCE INDEX (PRIMARY) ON |
| 225 | + LEFT JOIN $flaggedrevs AS n FORCE INDEX (page_rev) ON |
226 | 226 | (n.fr_page_id = page_id AND n.fr_rev_id >= rev_id AND n.fr_timestamp >= rev_timestamp) |
227 | 227 | WHERE |
228 | 228 | ((rev_user = 0) AND ($timeCondition) AND ((rev_id % $mod) = 0)) |
229 | | - GROUP BY rev_id"; |
| 229 | + GROUP BY rev_timestamp,rev_id"; |
230 | 230 | # Actually run the query... |
231 | 231 | $res = $dbr->doQuery( $sql, __METHOD__ ); |
232 | 232 | $secondsR = 0; // total wait seconds for edits later reviewed |