r66892 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r66891‎ | r66892 | r66893 >
Date:20:37, 25 May 2010
Author:reedy
Status:ok (Comments)
Tags:
Comment:
Followup to r65105 after discussion with Roan

Make the non-unique index index all fields

Patches updated, patch created to update index. Table.sql also updated
Modified paths:
  • /trunk/phase3/maintenance/archives/patch-iwlinks.sql (modified) (history)
  • /trunk/phase3/maintenance/archives/patch-rename-iwl_prefix.sql (added) (history)
  • /trunk/phase3/maintenance/tables.sql (modified) (history)
  • /trunk/phase3/maintenance/updaters.inc (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/archives/patch-rename-iwl_prefix.sql
@@ -0,0 +1,5 @@
 2+--
 3+-- Recreates the iwl_prefix for the iwlinks table
 4+--
 5+DROP INDEX /*i*/iwl_prefix ON /*_*/iwlinks;
 6+CREATE INDEX /*i*/iwl_prefix_from_title ON /*_*/iwlinks (iwl_prefix, iwl_from, iwl_title);
\ No newline at end of file
Property changes on: trunk/phase3/maintenance/archives/patch-rename-iwl_prefix.sql
___________________________________________________________________
Name: svn:eol-style
17 + native
Index: trunk/phase3/maintenance/archives/patch-iwlinks.sql
@@ -13,4 +13,4 @@
1414 ) /*$wgDBTableOptions*/;
1515
1616 CREATE UNIQUE INDEX /*i*/iwl_from ON /*_*/iwlinks (iwl_from, iwl_prefix, iwl_title);
17 -CREATE INDEX /*i*/iwl_prefix ON /*_*/iwlinks (iwl_prefix, iwl_title);
 17+CREATE INDEX /*i*/iwl_prefix_from_title ON /*_*/iwlinks (iwl_prefix, iwl_from, iwl_title);
Index: trunk/phase3/maintenance/updaters.inc
@@ -205,6 +205,7 @@
206206
207207 // 1.17
208208 array( 'add_table', 'iwlinks', 'patch-iwlinks.sql' ),
 209+ array( 'add_index', 'iwlinks', 'iwl_prefix', 'patch-rename-iwl_prefix.sql' ),
209210 ),
210211 );
211212
@@ -315,6 +316,21 @@
316317 }
317318 }
318319
 320+function drop_index_if_exists( $table, $index, $patch, $fullpath = false ) {
 321+ global $wgDatabase;
 322+ if ( $wgDatabase->indexExists( $table, $index ) ) {
 323+ wfOut( "Dropping $index from table $table... " );
 324+ if ( $fullpath ) {
 325+ $wgDatabase->sourceFile( $patch );
 326+ } else {
 327+ $wgDatabase->sourceFile( archive( $patch ) );
 328+ }
 329+ wfOut( "ok\n" );
 330+ } else {
 331+ wfOut( "...$index doesn't exist.\n" );
 332+ }
 333+}
 334+
319335 function do_interwiki_update() {
320336 # Check that interwiki table exists; if it doesn't source it
321337 global $wgDatabase, $IP;
Index: trunk/phase3/maintenance/tables.sql
@@ -623,7 +623,7 @@
624624 ) /*$wgDBTableOptions*/;
625625
626626 CREATE UNIQUE INDEX /*i*/iwl_from ON /*_*/iwlinks (iwl_from, iwl_prefix, iwl_title);
627 -CREATE INDEX /*i*/iwl_prefix ON /*_*/iwlinks (iwl_prefix, iwl_title);
 627+CREATE INDEX /*i*/iwl_prefix_from_title ON /*_*/iwlinks (iwl_prefix, iwl_from, iwl_title);
628628
629629
630630 --

Follow-up revisions

RevisionCommit summaryAuthorDate
r66895Fixup index to add from r66892reedy21:07, 25 May 2010
r66897Fixup fail from r66892 - Had added it to the sqlite section...reedy21:17, 25 May 2010
r66898Attempt at changing postgres as per r66892...reedy21:36, 25 May 2010
r66920follow-up to r66892: fix update SQL on on SQLitemaxsem14:29, 26 May 2010
r69721Rename the iwl_prefix_from_title index (again) to iwl_prefix_title_from and c...catrope08:52, 22 July 2010

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r65105Followup to r65104, PG updater/table defoverlordq02:35, 16 April 2010

Comments

#Comment by Reedy (talk | contribs)   20:39, 25 May 2010

Includes function drop_index_if_exists( $table, $index, $patch, $fullpath = false ) which I forgot to remove. Might aswell just leave it, does no harm, might be usable for someone..

#Comment by Reedy (talk | contribs)   21:15, 25 May 2010

Followup to r65104 even

#Comment by Reedy (talk | contribs)   21:15, 25 May 2010

Even after r66895, it doesn't seem to run, help?

Also, needs relevant PG changes, and SQLite doing please

#Comment by Reedy (talk | contribs)   21:17, 25 May 2010

SQLite doesn't need doing. See r66897 comment

Status & tagging log