r59831 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r59830‎ | r59831 | r59832 >
Date:16:43, 8 December 2009
Author:aaron
Status:ok
Tags:
Comment:
Partial revert of r59619: declare certain indexes PRIMARY again for 'use index' clauses
Modified paths:
  • /trunk/extensions/FlaggedRevs/FlaggedRevs.sql (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/FlaggedRevs.sql
@@ -6,7 +6,7 @@
77 -- Add page tracking table for flagged revisions
88 CREATE TABLE IF NOT EXISTS /*_*/flaggedpages (
99 -- Foreign key to page.page_id
10 - fp_page_id integer unsigned NOT NULL,
 10+ fp_page_id integer unsigned NOT NULL PRIMARY KEY,
1111 -- Is the stable version synced?
1212 fp_reviewed bool NOT NULL default '0',
1313 -- When (or NULL) the first edit after the stable version was made
@@ -18,7 +18,6 @@
1919 fp_quality tinyint(1) default NULL
2020 ) /*$wgDBTableOptions*/;
2121
22 -CREATE UNIQUE INDEX /*i*/fp_page_id ON /*_*/flaggedpages (fp_page_id);
2322 CREATE INDEX /*i*/fp_reviewed_page ON /*_*/flaggedpages (fp_reviewed,fp_page_id);
2423 CREATE INDEX /*i*/fp_quality_page ON /*_*/flaggedpages (fp_quality,fp_page_id);
2524 CREATE INDEX /*i*/fp_pending_since ON /*_*/flaggedpages (fp_pending_since);
@@ -32,10 +31,11 @@
3332 -- The last rev ID with this quality
3433 fpp_rev_id integer unsigned NOT NULL,
3534 -- Time of the first edit after the last revision reviewed to this level
36 - fpp_pending_since char(14) NOT NULL
 35+ fpp_pending_since char(14) NOT NULL,
 36+
 37+ PRIMARY KEY (fpp_page_id,fpp_quality)
3738 ) /*$wgDBTableOptions*/;
3839
39 -CREATE UNIQUE INDEX /*i*/fpp_page_qal ON /*_*/flaggedpage_pending (fpp_page_id,fpp_quality);
4040 CREATE INDEX /*i*/fpp_quality_pending ON /*_*/flaggedpage_pending (fpp_quality,fpp_pending_since);
4141
4242 -- This stores all of our revision reviews; it is the main table
@@ -68,10 +68,11 @@
6969 -- Timestamp of file (when uploaded) (NULL if n/a)
7070 fr_img_timestamp char(14) NULL default NULL,
7171 -- Statistically unique SHA-1 key (NULL if n/a)
72 - fr_img_sha1 varbinary(32) NULL default NULL
 72+ fr_img_sha1 varbinary(32) NULL default NULL,
 73+
 74+ PRIMARY KEY (fr_page_id,fr_rev_id)
7375 ) /*$wgDBTableOptions*/;
7476
75 -CREATE UNIQUE INDEX /*i*/fr_page_rev ON /*_*/flaggedrevs (fr_page_id,fr_rev_id);
7677 CREATE INDEX /*i*/fr_img_sha1 ON /*_*/flaggedrevs (fr_img_sha1);
7778 CREATE INDEX /*i*/page_qal_rev ON /*_*/flaggedrevs (fr_page_id,fr_quality,fr_rev_id);
7879
@@ -82,11 +83,11 @@
8384 ft_namespace int NOT NULL default '0',
8485 ft_title varchar(255) binary NOT NULL default '',
8586 -- Revisions ID used when reviewed
86 - ft_tmp_rev_id integer unsigned NULL
 87+ ft_tmp_rev_id integer unsigned NULL,
 88+
 89+ PRIMARY KEY (ft_rev_id,ft_namespace,ft_title)
8790 ) /*$wgDBTableOptions*/;
8891
89 -CREATE UNIQUE INDEX /*i*/ft_rev_namespace_title ON /*_*/flaggedtemplates (ft_rev_id,ft_namespace,ft_title);
90 -
9192 -- This stores all of our image revision pointers
9293 CREATE TABLE IF NOT EXISTS /*_*/flaggedimages (
9394 fi_rev_id integer unsigned NOT NULL,
@@ -95,15 +96,15 @@
9697 -- Timestamp of image used when reviewed
9798 fi_img_timestamp char(14) NOT NULL default '',
9899 -- Statistically unique SHA-1 key
99 - fi_img_sha1 varbinary(32) NOT NULL default ''
 100+ fi_img_sha1 varbinary(32) NOT NULL default '',
 101+
 102+ PRIMARY KEY (fi_rev_id,fi_name)
100103 ) /*$wgDBTableOptions*/;
101104
102 -CREATE UNIQUE INDEX /*i*/fi_rev_name ON /*_*/flaggedimages (fi_rev_id,fi_name);
103 -
104105 -- This stores settings on how to select the stable/default revision
105106 CREATE TABLE IF NOT EXISTS /*_*/flaggedpage_config (
106107 -- Foreign key to page.page_id
107 - fpc_page_id integer unsigned NOT NULL,
 108+ fpc_page_id integer unsigned NOT NULL PRIMARY KEY,
108109 -- Integers to represent what to show by default:
109110 -- 0: quality -> stable
110111 -- 1: latest reviewed
@@ -117,7 +118,6 @@
118119 fpc_expiry varbinary(14) NOT NULL default 'infinity'
119120 ) /*$wgDBTableOptions*/;
120121
121 -CREATE UNIQUE INDEX /*i*/fpc_page_id ON /*_*/flaggedpage_config (fpc_page_id);
122122 CREATE INDEX /*i*/fpc_expiry ON /*_*/flaggedpage_config (fpc_expiry);
123123
124124 -- Track includes/links only in stable versions
@@ -133,8 +133,6 @@
134134 -- This stores user demotions and stats
135135 CREATE TABLE IF NOT EXISTS /*_*/flaggedrevs_promote (
136136 -- Foreign key to user.user_id
137 - frp_user_id integer unsigned NOT NULL,
 137+ frp_user_id integer unsigned NOT NULL PRIMARY KEY,
138138 frp_user_params mediumblob NOT NULL
139139 ) /*$wgDBTableOptions*/;
140 -
141 -CREATE UNIQUE INDEX /*i*/frp_user_id ON /*_*/flaggedrevs_promote (frp_user_id);

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r59619Tweaks for SQLiteaaron07:47, 1 December 2009

Status & tagging log