r87721 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r87720‎ | r87721 | r87722 >
Date:14:55, 9 May 2011
Author:catrope
Status:ok
Tags:
Comment:
ArticleFeedback: Extend afshl_timestamp index to also cover avg_overall, such that the second query in SpecialArticleFeedback (WHERE ts=X ORDER BY avg_overall) is indexed properly.
Modified paths:
  • /trunk/extensions/ArticleFeedback/SpecialArticleFeedback.php (modified) (history)
  • /trunk/extensions/ArticleFeedback/sql/AddStatsHighsLowsTable.sql (modified) (history)

Diff [purge]

Index: trunk/extensions/ArticleFeedback/SpecialArticleFeedback.php
@@ -263,7 +263,7 @@
264264 ),
265265 array( 'afshl_ts' => $row->afshl_ts ),
266266 __METHOD__,
267 - array( "ORDER BY" => "afshl_avg_overall" ) // FIXME unindexed
 267+ array( "ORDER BY" => "afshl_avg_overall" )
268268 );
269269 $highs_lows = $this->buildHighsAndLows( $result );
270270 $wgMemc->set( $key, $highs_lows, 86400 );
Index: trunk/extensions/ArticleFeedback/sql/AddStatsHighsLowsTable.sql
@@ -8,4 +8,4 @@
99 -- timestamp of insertion job
1010 afshl_ts binary(14) NOT NULL
1111 ) /*$wgDBTableOptions*/;
12 -CREATE INDEX /*i*/ afshl_timestamp ON /*_*/article_feedback_stats_highs_lows (afshl_ts);
 12+CREATE INDEX /*i*/ afshl_ts_avg_overall ON /*_*/article_feedback_stats_highs_lows (afshl_ts, afshl_avg_overall);

Status & tagging log