Index: trunk/extensions/UsabilityInitiative/PrefStats/SpecialPrefStats.php |
— | — | @@ -114,6 +114,7 @@ |
115 | 115 | $maxTS = wfTimestamp( TS_UNIX ) - $min; |
116 | 116 | $minTS = wfTimestamp( TS_UNIX ) - $max; |
117 | 117 | $count2 = $dbr->selectField( 'prefstats', 'COUNT(*)', array( |
| 118 | + 'ps_pref' => $pref, |
118 | 119 | 'ps_duration IS NULL', |
119 | 120 | 'ps_start <' . $dbr->timestamp( $maxTS ), |
120 | 121 | 'ps_start >=' . $dbr->timestamp( $minTS ) |
Index: trunk/extensions/UsabilityInitiative/PrefStats/PrefStats.sql |
— | — | @@ -24,4 +24,4 @@ |
25 | 25 | ) /*$wgDBTableOptions*/; |
26 | 26 | |
27 | 27 | 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); |