r93211 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r93210‎ | r93211 | r93212 >
Date:17:03, 26 July 2011
Author:reedy
Status:resolved (Comments)
Tags:scaptrap 
Comment:
* (bug 22744) Add/Update indexes for queries done by the API

Add index to logging table accross log_type and log_action
Modified paths:
  • /trunk/phase3/includes/installer/MysqlUpdater.php (modified) (history)
  • /trunk/phase3/maintenance/archives/patch-logging-type-action-index.sql (added) (history)
  • /trunk/phase3/maintenance/tables.sql (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/archives/patch-logging-type-action-index.sql
@@ -0,0 +1 @@
 2+CREATE INDEX /*i*/type_action ON /*_*/logging(log_type, log_action);
Property changes on: trunk/phase3/maintenance/archives/patch-logging-type-action-index.sql
___________________________________________________________________
Added: svn:eol-style
13 + native
Index: trunk/phase3/maintenance/tables.sql
@@ -1226,6 +1226,7 @@
12271227 CREATE INDEX /*i*/times ON /*_*/logging (log_timestamp);
12281228 CREATE INDEX /*i*/log_user_type_time ON /*_*/logging (log_user, log_type, log_timestamp);
12291229 CREATE INDEX /*i*/log_page_id_time ON /*_*/logging (log_page,log_timestamp);
 1230+CREATE INDEX /*i*/type_action ON /*_*/logging(log_type, log_action);
12301231
12311232
12321233 CREATE TABLE /*_*/log_search (
Index: trunk/phase3/includes/installer/MysqlUpdater.php
@@ -181,10 +181,11 @@
182182 array( 'doUserNewTalkTimestampNotNull' ),
183183 array( 'addIndex', 'user', 'user_email', 'patch-user_email_index.sql' ),
184184 array( 'modifyField', 'user_properties', 'up_property', 'patch-up_property.sql' ),
185 - array( 'addTable', 'uploadstash', 'patch-uploadstash.sql' ),
 185+ array( 'addTable', 'uploadstash', 'patch-uploadstash.sql' ),
186186
187187 // 1.19
188 - array( 'addTable', 'config', 'patch-config.sql' ),
 188+ array( 'addTable', 'config', 'patch-config.sql' ),
 189+ array( 'addIndex', 'logging', 'type_action', 'patch-logging-type-action-index.sql')
189190 );
190191 }
191192

Follow-up revisions

RevisionCommit summaryAuthorDate
r93213Apparently MaxSem cares about SQLite ;)...reedy17:13, 26 July 2011
r94239Followup r93211, add log_timestamp to end of the indexreedy12:49, 11 August 2011

Comments

#Comment by Aaron Schulz (talk | contribs)   17:57, 2 August 2011

Why is there no timetamp portion?

#Comment by Catrope (talk | contribs)   10:37, 11 August 2011

Aaron's right, this needs to contain log_timestamp as well.

#Comment by Krinkle (talk | contribs)   12:57, 11 August 2011

Does this mean we can finally filter on 'action' on Special:Log (rather than just the "type") ?

#Comment by Reedy (talk | contribs)   18:00, 9 September 2011

Not so much a scap trap, as it's not used to enable any new features, just improve what's there already ;)

Status & tagging log