r52155 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r52154‎ | r52155 | r52156 >
Date:08:46, 19 June 2009
Author:catrope
Status:deferred
Tags:
Comment:
PrefStats: Add ps_pref field to ps_duration_start index for better indexing and corrected query
Modified paths:
  • /trunk/extensions/UsabilityInitiative/PrefStats/PrefStats.sql (modified) (history)
  • /trunk/extensions/UsabilityInitiative/PrefStats/SpecialPrefStats.php (modified) (history)

Diff [purge]

Index: trunk/extensions/UsabilityInitiative/PrefStats/SpecialPrefStats.php
@@ -114,6 +114,7 @@
115115 $maxTS = wfTimestamp( TS_UNIX ) - $min;
116116 $minTS = wfTimestamp( TS_UNIX ) - $max;
117117 $count2 = $dbr->selectField( 'prefstats', 'COUNT(*)', array(
 118+ 'ps_pref' => $pref,
118119 'ps_duration IS NULL',
119120 'ps_start <' . $dbr->timestamp( $maxTS ),
120121 'ps_start >=' . $dbr->timestamp( $minTS )
Index: trunk/extensions/UsabilityInitiative/PrefStats/PrefStats.sql
@@ -24,4 +24,4 @@
2525 ) /*$wgDBTableOptions*/;
2626
2727 CREATE UNIQUE INDEX /*i*/ps_user_pref_start ON /*_*/prefstats (ps_user, ps_pref, ps_start);
28 -CREATE INDEX /*i*/ps_duration_start ON /*_*/prefstats (ps_duration, ps_start);
 28+CREATE INDEX /*i*/ps_pref_duration_start ON /*_*/prefstats (ps_pref, ps_duration, ps_start);

Status & tagging log