Index: trunk/phase3/maintenance/tables.sql |
— | — | @@ -1234,35 +1234,38 @@ |
1235 | 1235 | ul_key varchar(255) NOT NULL PRIMARY KEY |
1236 | 1236 | ) /*$wgDBTableOptions*/; |
1237 | 1237 | |
| 1238 | + |
1238 | 1239 | --- A table to track tags for revisions, logs and recent changes. |
1239 | 1240 | CREATE TABLE /*_*/change_tag ( |
1240 | 1241 | ct_rc_id int NULL, |
1241 | 1242 | ct_log_id int NULL, |
1242 | 1243 | ct_rev_id int NULL, |
1243 | 1244 | ct_tag varchar(255) NOT NULL, |
1244 | | - ct_params BLOB NULL, |
1245 | | - |
1246 | | - UNIQUE KEY (ct_rc_id,ct_tag), |
1247 | | - UNIQUE KEY (ct_log_id,ct_tag), |
1248 | | - UNIQUE KEY (ct_rev_id,ct_tag), |
1249 | | - KEY (ct_tag,ct_rc_id,ct_rev_id,ct_log_id) -- Covering index, so we can pull all the info only out of the index. |
| 1245 | + ct_params BLOB NULL |
1250 | 1246 | ) /*$wgDBTableOptions*/; |
1251 | 1247 | |
| 1248 | +CREATE UNIQUE INDEX /*i*/change_tag_rc_tag ON /*_*/change_tag (ct_rc_id,ct_tag); |
| 1249 | +CREATE UNIQUE INDEX /*i*/change_tag_log_tag ON /*_*/change_tag (ct_log_id,ct_tag); |
| 1250 | +CREATE UNIQUE INDEX /*i*/change_tag_rev_tag ON /*_*/change_tag (ct_rev_id,ct_tag); |
| 1251 | +-- Covering index, so we can pull all the info only out of the index. |
| 1252 | +CREATE INDEX /*i*/change_tag_tag_id ON /*_*/change_tag (ct_tag,ct_rc_id,ct_rev_id,ct_log_id); |
| 1253 | + |
| 1254 | + |
1252 | 1255 | -- Rollup table to pull a LIST of tags simply without ugly GROUP_CONCAT that only works on MySQL 4.1+ |
1253 | 1256 | CREATE TABLE /*_*/tag_summary ( |
1254 | 1257 | ts_rc_id int NULL, |
1255 | 1258 | ts_log_id int NULL, |
1256 | 1259 | ts_rev_id int NULL, |
1257 | | - ts_tags BLOB NOT NULL, |
1258 | | - |
1259 | | - UNIQUE KEY (ts_rc_id), |
1260 | | - UNIQUE KEY (ts_log_id), |
1261 | | - UNIQUE KEY (ts_rev_id) |
| 1260 | + ts_tags BLOB NOT NULL |
1262 | 1261 | ) /*$wgDBTableOptions*/; |
1263 | 1262 | |
| 1263 | +CREATE UNIQUE INDEX /*i*/tag_summary_rc_id ON /*_*/tag_summary (ts_rc_id); |
| 1264 | +CREATE UNIQUE INDEX /*i*/tag_summary_log_id ON /*_*/tag_summary (ts_log_id); |
| 1265 | +CREATE UNIQUE INDEX /*i*/tag_summary_rev_id ON /*_*/tag_summary (ts_rev_id); |
| 1266 | + |
| 1267 | + |
1264 | 1268 | CREATE TABLE /*_*/valid_tag ( |
1265 | | - vt_tag varchar(255) NOT NULL, |
1266 | | - PRIMARY KEY (vt_tag) |
| 1269 | + vt_tag varchar(255) NOT NULL PRIMARY KEY |
1267 | 1270 | ) /*$wgDBTableOptions*/; |
1268 | 1271 | |
1269 | 1272 | |