Index: branches/REL1_18/extensions/ArticleFeedback/sql/AddArticleFeedbackPageIndex.sql |
— | — | @@ -0,0 +1 @@ |
| 2 | +CREATE INDEX /*i*/aa_page_id ON /*_*/article_feedback (aa_page_id, aa_timestamp); |
Index: branches/REL1_18/extensions/ArticleFeedback/sql/ArticleFeedback.sql |
— | — | @@ -35,6 +35,7 @@ |
36 | 36 | PRIMARY KEY (aa_revision, aa_user_text, aa_rating_id, aa_user_anon_token) |
37 | 37 | ) /*$wgDBTableOptions*/; |
38 | 38 | CREATE INDEX /*i*/aa_user_page_revision ON /*_*/article_feedback (aa_user_id, aa_page_id, aa_revision); |
| 39 | +CREATE INDEX /*i*/aa_page_id ON /*_*/article_feedback (aa_page_id, aa_timestamp); |
39 | 40 | |
40 | 41 | -- Aggregate rating table for a page |
41 | 42 | CREATE TABLE IF NOT EXISTS /*_*/article_feedback_pages ( |
Index: branches/REL1_18/extensions/ArticleFeedback/ArticleFeedback.hooks.php |
— | — | @@ -174,6 +174,15 @@ |
175 | 175 | true |
176 | 176 | ) ); |
177 | 177 | } |
| 178 | + if ( !db->indexExists( 'article_feedback', 'aa_page_id', __METHOD__ ) ) { |
| 179 | + $updater->addExtensionUpdate( array( |
| 180 | + 'addIndex', |
| 181 | + 'article_feedback', |
| 182 | + 'aa_page_id', |
| 183 | + $dir . '/sql/AddArticleFeedbackPageIndex.sql', |
| 184 | + true |
| 185 | + ) ); |
| 186 | + } |
178 | 187 | $updater->addExtensionUpdate( array( |
179 | 188 | 'addTable', |
180 | 189 | 'article_feedback_properties', |