Index: trunk/extensions/FlaggedRevs/maintenance/updateStats.inc |
— | — | @@ -138,17 +138,9 @@ |
139 | 139 | } |
140 | 140 | # Sanity check the starting timestamp |
141 | 141 | $minTS = max($minTS,$installed); |
142 | | - # Get correspond rev_ids to boundaries |
| 142 | + # Get timestamp boundaries |
143 | 143 | $timeCondition = 'rev_timestamp BETWEEN '.$dbr->addQuotes($minTS).' AND '.$dbr->addQuotes($maxTS); |
144 | | - $minRev = (int)$dbr->selectField( 'revision', 'rev_id', |
145 | | - array( $timeCondition, 'rev_user' => 0 ), |
146 | | - __METHOD__, array( 'ORDER BY' => 'rev_timestamp ASC' ) |
147 | | - ); |
148 | | - $maxRev = (int)$dbr->selectField( 'revision', 'rev_id', |
149 | | - array( $timeCondition, 'rev_user' => 0 ), |
150 | | - __METHOD__, array( 'ORDER BY' => 'rev_timestamp DESC' ) |
151 | | - ); |
152 | | - # Modulus |
| 144 | + # Modulus (to spread out over range) |
153 | 145 | $mod = intval($rows/$size); |
154 | 146 | $mod = max($mod,1); # $mod >= 1 |
155 | 147 | # For edits that started off pending, how long do they take to get reviewed? |
— | — | @@ -158,7 +150,6 @@ |
159 | 151 | array( 'UNIX_TIMESTAMP(rev_timestamp) AS rt', 'UNIX_TIMESTAMP(MIN(fr_timestamp)) AS ft', 'MIN(log_timestamp)' ), |
160 | 152 | array( |
161 | 153 | $timeCondition, // in time range |
162 | | - "rev_id BETWEEN $minRev AND $maxRev", // Better INDEX usage |
163 | 154 | 'rev_user = 0', // IP edits (should start off unreviewed) |
164 | 155 | "(rev_id % $mod) = 0", // Better spread |
165 | 156 | ), |
— | — | @@ -176,7 +167,7 @@ |
177 | 168 | 'logging' => array('INNER JOIN','log_namespace = page_namespace AND log_title = page_title |
178 | 169 | AND log_type = "review" AND log_timestamp < rev_timestamp'), |
179 | 170 | // Check *if* it was later reviewed |
180 | | - 'flaggedrevs' => array('LEFT JOIN', 'fr_page_id = rev_page AND fr_rev_id >= rev_id AND fr_timestamp > rev_timestamp'), |
| 171 | + 'flaggedrevs' => array('LEFT JOIN', 'fr_page_id = page_id AND fr_rev_id >= rev_id AND fr_timestamp > rev_timestamp'), |
181 | 172 | ) |
182 | 173 | ); |
183 | 174 | # Actually run the query... |