Index: trunk/extensions/ArticleFeedbackv5/sql/ArticleFeedbackv5.sql |
— | — | @@ -71,7 +71,7 @@ |
72 | 72 | CREATE INDEX /*i*/article_feedback_timestamp ON /*_*/aft_article_feedback (af_created); |
73 | 73 | CREATE INDEX /*i*/af_page_id ON /*_*/aft_article_feedback (af_page_id, af_created); |
74 | 74 | CREATE INDEX /*i*/af_page_feedback_id ON /*_*/aft_article_feedback (af_page_id, af_id); |
75 | | -CREATE INDEX /*_*/af_page_net_helpfulness_af_id ON /*_*/aft_article_feedback (af_page_id, af_net_helpfulness, af_id); |
| 75 | +CREATE INDEX /*i*/af_page_net_helpfulness_af_id ON /*_*/aft_article_feedback (af_page_id, af_net_helpfulness, af_id); |
76 | 76 | |
77 | 77 | -- Allows for organizing fields into fieldsets, for reporting or rendering. |
78 | 78 | -- A group is just a name and an ID. |
— | — | @@ -93,6 +93,7 @@ |
94 | 94 | -- Which 'bucket' this field should be rendered in. |
95 | 95 | afi_bucket_id integer unsigned NOT NULL |
96 | 96 | ) /*$wgDBTableOptions*/; |
| 97 | +CREATE UNIQUE INDEX /*i*/afi_name ON /*_*/aft_article_field (afi_name); |
97 | 98 | |
98 | 99 | -- Stores options for multi-value feedback fields (ie, select boxes) |
99 | 100 | CREATE TABLE IF NOT EXISTS /*_*/aft_article_field_option ( |
Index: trunk/extensions/ArticleFeedbackv5/api/ApiViewActivityArticleFeedbackv5.php |
— | — | @@ -266,7 +266,13 @@ |
267 | 267 | __METHOD__, |
268 | 268 | array( |
269 | 269 | 'LIMIT' => $limit + 1, |
270 | | - 'ORDER BY' => 'log_timestamp DESC' |
| 270 | + 'ORDER BY' => 'log_timestamp DESC', |
| 271 | + // Force the page_time index (on _namespace, _title, _timestamp) |
| 272 | + // We don't expect many if any rows for Special:ArticleFeedbackv5/foo that |
| 273 | + // don't match log_type='articlefeedbackv5' , so we can afford to have that |
| 274 | + // clause be unindexed. The alternative is to have the log_type clause be indexed |
| 275 | + // and the namespace/title clauses unindexed, that would be bad. |
| 276 | + 'USE INDEX' => 'page_time' |
271 | 277 | ) |
272 | 278 | ); |
273 | 279 | |