Index: trunk/phase3/includes/Article.php |
— | — | @@ -2461,8 +2461,8 @@ |
2462 | 2462 | * |
2463 | 2463 | * @param Revision $rev |
2464 | 2464 | * |
2465 | | - * @todo This is a shitty interface function. Kill it and replace the |
2466 | | - * other shitty functions like editUpdates and such so it's not needed |
| 2465 | + * @todo This is a lousy interface function. Kill it and replace the |
| 2466 | + * other cruddy functions like editUpdates and such so it's not needed |
2467 | 2467 | * anymore. |
2468 | 2468 | */ |
2469 | 2469 | function createUpdates( $rev ) { |
Index: trunk/phase3/maintenance/updaters.inc |
— | — | @@ -1032,6 +1032,8 @@ |
1033 | 1033 | |
1034 | 1034 | do_oldimage_user_index(); flush (); |
1035 | 1035 | |
| 1036 | + do_revision_page_user_index(); flush (); |
| 1037 | + |
1036 | 1038 | echo "Deleting old default messages (this may take a long time!)..."; flush(); |
1037 | 1039 | deleteDefaultMessages(); |
1038 | 1040 | echo "Done\n"; flush(); |
— | — | @@ -1130,6 +1132,17 @@ |
1131 | 1133 | |
1132 | 1134 | } |
1133 | 1135 | |
| 1136 | +function do_revision_page_user_index() { |
| 1137 | + global $wgDatabase; |
| 1138 | + if( $wgDatabase->indexExists( 'revision', 'page_user_timestamp' ) ) { |
| 1139 | + echo "...page,user,timestamp key on revision already exists.\n"; |
| 1140 | + } else { |
| 1141 | + echo "Adding page,user,timestamp key on revision table... "; |
| 1142 | + dbsource( archive("patch-revision-user-page-index.sql"), $wgDatabase ); |
| 1143 | + echo "ok\n"; |
| 1144 | + } |
| 1145 | +} |
| 1146 | + |
1134 | 1147 | function |
1135 | 1148 | pg_describe_table($table) |
1136 | 1149 | { |
— | — | @@ -1529,4 +1542,4 @@ |
1530 | 1543 | } |
1531 | 1544 | |
1532 | 1545 | return; |
1533 | | -} |
\ No newline at end of file |
| 1546 | +} |
Index: trunk/phase3/maintenance/archives/patch-revision-user-page-index.sql |
— | — | @@ -0,0 +1,5 @@ |
| 2 | +-- New index on revision table to allow searches for all edits by a given user |
| 3 | +-- to a given page. Added 2007-08-28 |
| 4 | + |
| 5 | +ALTER TABLE /*$wgDBprefix*/revision |
| 6 | + ADD INDEX page_user_timestamp (rev_page,rev_user,rev_timestamp); |
Property changes on: trunk/phase3/maintenance/archives/patch-revision-user-page-index.sql |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 7 | + native |
Index: trunk/phase3/maintenance/tables.sql |
— | — | @@ -282,7 +282,8 @@ |
283 | 283 | INDEX rev_timestamp (rev_timestamp), |
284 | 284 | INDEX page_timestamp (rev_page,rev_timestamp), |
285 | 285 | INDEX user_timestamp (rev_user,rev_timestamp), |
286 | | - INDEX usertext_timestamp (rev_user_text,rev_timestamp) |
| 286 | + INDEX usertext_timestamp (rev_user_text,rev_timestamp), |
| 287 | + INDEX page_user_timestamp (rev_page,rev_user,rev_timestamp) |
287 | 288 | |
288 | 289 | ) /*$wgDBTableOptions*/ MAX_ROWS=10000000 AVG_ROW_LENGTH=1024; |
289 | 290 | -- In case tables are created as MyISAM, use row hints for MySQL <5.0 to avoid 4GB limit |