r110967 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r110966‎ | r110967 | r110968 >
Date:21:44, 8 February 2012
Author:catrope
Status:ok
Tags:aft 
Comment:
Followup r110959: reintroduce another good part of r96722 (sort of): add an index on (page_id, user_text, anon_token, revision) so it properly indexes the queries we actually run, and delete the index on (user_id, page_id, revision) because it's not being used
Modified paths:
  • /trunk/extensions/ArticleFeedback/ArticleFeedback.hooks.php (modified) (history)
  • /trunk/extensions/ArticleFeedback/sql/ArticleFeedback.sql (modified) (history)
  • /trunk/extensions/ArticleFeedback/sql/aa_page_user_token.sql (added) (history)
  • /trunk/extensions/ArticleFeedback/sql/delete-aa_user_page_revision.sql (added) (history)

Diff [purge]

Index: trunk/extensions/ArticleFeedback/sql/ArticleFeedback.sql
@@ -21,10 +21,10 @@
2222 -- 1 vote per user per revision
2323 PRIMARY KEY (aa_revision, aa_user_text, aa_rating_id, aa_user_anon_token)
2424 ) /*$wgDBTableOptions*/;
25 -CREATE INDEX /*i*/aa_user_page_revision ON /*_*/article_feedback (aa_user_id, aa_page_id, aa_revision);
2625 -- Create an index on the article_feedback.aa_timestamp field
2726 CREATE INDEX /*i*/article_feedback_timestamp ON /*_*/article_feedback (aa_timestamp);
2827 CREATE INDEX /*i*/aa_page_id ON /*_*/article_feedback (aa_page_id, aa_timestamp);
 28+CREATE INDEX /*i*/aa_page_user_token ON /*_*/article_feedback (aa_page_id, aa_user_text, aa_user_anon_token, aa_revision);
2929
3030 -- Aggregate rating table for a page
3131 CREATE TABLE IF NOT EXISTS /*_*/article_feedback_pages (
Index: trunk/extensions/ArticleFeedback/sql/delete-aa_user_page_revision.sql
@@ -0,0 +1,2 @@
 2+DROP INDEX /*i*/aa_user_page_revision ON /*_*/article_feedback;
 3+
Property changes on: trunk/extensions/ArticleFeedback/sql/delete-aa_user_page_revision.sql
___________________________________________________________________
Added: svn:eol-style
14 + native
Index: trunk/extensions/ArticleFeedback/sql/aa_page_user_token.sql
@@ -0,0 +1,2 @@
 2+CREATE INDEX /*i*/aa_page_user_token ON /*_*/article_feedback (aa_page_id, aa_user_text, aa_user_anon_token, aa_revision);
 3+
Property changes on: trunk/extensions/ArticleFeedback/sql/aa_page_user_token.sql
___________________________________________________________________
Added: svn:eol-style
14 + native
Index: trunk/extensions/ArticleFeedback/ArticleFeedback.hooks.php
@@ -207,6 +207,22 @@
208208 $dir . '/sql/AddArticleFeedbackTimestampIndex.sql',
209209 true
210210 ) );
 211+
 212+ $updater->addExtensionUpdate( array(
 213+ 'addIndex',
 214+ 'article_feedback',
 215+ 'aa_page_user_token',
 216+ $dir . '/sql/aa_page_user_token.sql',
 217+ true
 218+ ) );
 219+
 220+ $updater->addExtensionUpdate( array(
 221+ 'dropIndex',
 222+ 'article_feedback',
 223+ 'aa_user_page_revision',
 224+ $dir . '/sql/delete-aa_user_page_revision.sql',
 225+ true
 226+ ) );
211227
212228 return true;
213229 }

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r96722Epic followup to r94404, r94509: change the ArticleFeedback schema such that ...catrope15:26, 10 September 2011
r110959Revert most of r96722. The massive schema change was way overkill given that ...catrope20:21, 8 February 2012

Status & tagging log