1 -- Correct for the total lack of indexes in the MW 1.13 SQLite schema
3 -- Unique indexes need to be handled with INSERT SELECT since just running
4 -- the CREATE INDEX statement will fail if there are duplicate values.
6 -- Ignore duplicates, several tables will have them (e.g. bug 16966) but in
7 -- most cases it's harmless to discard them. We'll keep the old tables with
8 -- duplicates in so that the user can recover them in case of disaster.
10 --------------------------------------------------------------------------------
11 -- Drop temporary tables from aborted runs
12 --------------------------------------------------------------------------------
14 DROP TABLE IF EXISTS /*_*/user_tmp
;
15 DROP TABLE IF EXISTS /*_*/user_groups_tmp
;
16 DROP TABLE IF EXISTS /*_*/page_tmp
;
17 DROP TABLE IF EXISTS /*_*/revision_tmp
;
18 DROP TABLE IF EXISTS /*_*/pagelinks_tmp
;
19 DROP TABLE IF EXISTS /*_*/templatelinks_tmp
;
20 DROP TABLE IF EXISTS /*_*/imagelinks_tmp
;
21 DROP TABLE IF EXISTS /*_*/categorylinks_tmp
;
22 DROP TABLE IF EXISTS /*_*/category_tmp
;
23 DROP TABLE IF EXISTS /*_*/langlinks_tmp
;
24 DROP TABLE IF EXISTS /*_*/site_stats_tmp
;
25 DROP TABLE IF EXISTS /*_*/ipblocks_tmp
;
26 DROP TABLE IF EXISTS /*_*/watchlist_tmp
;
27 DROP TABLE IF EXISTS /*_*/math_tmp
;
28 DROP TABLE IF EXISTS /*_*/interwiki_tmp
;
29 DROP TABLE IF EXISTS /*_*/page_restrictions_tmp
;
30 DROP TABLE IF EXISTS /*_*/protected_titles_tmp
;
31 DROP TABLE IF EXISTS /*_*/page_props_tmp
;
33 --------------------------------------------------------------------------------
35 --------------------------------------------------------------------------------
37 CREATE TABLE /*_*/user_tmp (
38 user_id
int unsigned
NOT NULL PRIMARY KEY AUTO_INCREMENT
,
39 user_name
varchar(255) binary NOT NULL default '',
40 user_real_name
varchar(255) binary NOT NULL default '',
41 user_password tinyblob
NOT NULL,
42 user_newpassword tinyblob
NOT NULL,
43 user_newpass_time
binary(14),
44 user_email tinytext
NOT NULL,
45 user_options
blob NOT NULL,
46 user_touched
binary(14) NOT NULL default '',
47 user_token
binary(32) NOT NULL default '',
48 user_email_authenticated
binary(14),
49 user_email_token
binary(32),
50 user_email_token_expires
binary(14),
51 user_registration
binary(14),
54 CREATE UNIQUE INDEX /*i*/user_name
ON /*_*/user_tmp (user_name
);
55 CREATE INDEX /*i*/user_email_token
ON /*_*/user_tmp (user_email_token
);
58 CREATE TABLE /*_*/user_groups_tmp (
59 ug_user
int unsigned
NOT NULL default 0,
60 ug_group
varbinary(16) NOT NULL default ''
63 CREATE UNIQUE INDEX /*i*/ug_user_group
ON /*_*/user_groups_tmp (ug_user
,ug_group
);
64 CREATE INDEX /*i*/ug_group
ON /*_*/user_groups_tmp (ug_group
);
66 CREATE TABLE /*_*/page_tmp (
67 page_id
int unsigned
NOT NULL PRIMARY KEY AUTO_INCREMENT
,
68 page_namespace
int NOT NULL,
69 page_title
varchar(255) binary NOT NULL,
70 page_restrictions tinyblob
NOT NULL,
71 page_counter
bigint unsigned
NOT NULL default 0,
72 page_is_redirect tinyint unsigned
NOT NULL default 0,
73 page_is_new tinyint unsigned
NOT NULL default 0,
74 page_random
real unsigned
NOT NULL,
75 page_touched
binary(14) NOT NULL default '',
76 page_latest
int unsigned
NOT NULL,
77 page_len
int unsigned
NOT NULL
80 CREATE UNIQUE INDEX /*i*/name_title
ON /*_*/page_tmp (page_namespace
,page_title
);
81 CREATE INDEX /*i*/page_random
ON /*_*/page_tmp (page_random
);
82 CREATE INDEX /*i*/page_len
ON /*_*/page_tmp (page_len
);
85 CREATE TABLE /*_*/revision_tmp (
86 rev_id
int unsigned
NOT NULL PRIMARY KEY AUTO_INCREMENT
,
87 rev_page
int unsigned
NOT NULL,
88 rev_text_id
int unsigned
NOT NULL,
89 rev_comment tinyblob
NOT NULL,
90 rev_user
int unsigned
NOT NULL default 0,
91 rev_user_text
varchar(255) binary NOT NULL default '',
92 rev_timestamp
binary(14) NOT NULL default '',
93 rev_minor_edit tinyint unsigned
NOT NULL default 0,
94 rev_deleted tinyint unsigned
NOT NULL default 0,
96 rev_parent_id
int unsigned
default NULL
98 CREATE UNIQUE INDEX /*i*/rev_page_id
ON /*_*/revision_tmp (rev_page
, rev_id
);
99 CREATE INDEX /*i*/rev_timestamp
ON /*_*/revision_tmp (rev_timestamp
);
100 CREATE INDEX /*i*/page_timestamp
ON /*_*/revision_tmp (rev_page
,rev_timestamp
);
101 CREATE INDEX /*i*/user_timestamp
ON /*_*/revision_tmp (rev_user
,rev_timestamp
);
102 CREATE INDEX /*i*/usertext_timestamp
ON /*_*/revision_tmp (rev_user_text
,rev_timestamp
);
104 CREATE TABLE /*_*/pagelinks_tmp (
105 pl_from
int unsigned
NOT NULL default 0,
106 pl_namespace
int NOT NULL default 0,
107 pl_title
varchar(255) binary NOT NULL default ''
110 CREATE UNIQUE INDEX /*i*/pl_from
ON /*_*/pagelinks_tmp (pl_from
,pl_namespace
,pl_title
);
111 CREATE INDEX /*i*/pl_namespace_title
ON /*_*/pagelinks_tmp (pl_namespace
,pl_title
,pl_from
);
114 CREATE TABLE /*_*/templatelinks_tmp (
115 tl_from
int unsigned
NOT NULL default 0,
116 tl_namespace
int NOT NULL default 0,
117 tl_title
varchar(255) binary NOT NULL default ''
120 CREATE UNIQUE INDEX /*i*/tl_from
ON /*_*/templatelinks_tmp (tl_from
,tl_namespace
,tl_title
);
121 CREATE INDEX /*i*/tl_namespace_title
ON /*_*/templatelinks_tmp (tl_namespace
,tl_title
,tl_from
);
124 CREATE TABLE /*_*/imagelinks_tmp (
125 il_from
int unsigned
NOT NULL default 0,
126 il_to
varchar(255) binary NOT NULL default ''
127 ) /*$wgDBTableOptions*/;
128 CREATE UNIQUE INDEX /*i*/il_from
ON /*_*/imagelinks_tmp (il_from
,il_to
);
129 CREATE INDEX /*i*/il_to
ON /*_*/imagelinks_tmp (il_to
,il_from
);
132 CREATE TABLE /*_*/categorylinks_tmp (
133 cl_from
int unsigned
NOT NULL default 0,
134 cl_to
varchar(255) binary NOT NULL default '',
135 cl_sortkey
varchar(70) binary NOT NULL default '',
136 cl_timestamp
timestamp NOT NULL
138 CREATE UNIQUE INDEX /*i*/cl_from
ON /*_*/categorylinks_tmp (cl_from
,cl_to
);
139 CREATE INDEX /*i*/cl_sortkey
ON /*_*/categorylinks_tmp (cl_to
,cl_sortkey
,cl_from
);
140 CREATE INDEX /*i*/cl_timestamp
ON /*_*/categorylinks_tmp (cl_to
,cl_timestamp
);
143 CREATE TABLE /*_*/category_tmp (
144 cat_id
int unsigned
NOT NULL PRIMARY KEY AUTO_INCREMENT
,
145 cat_title
varchar(255) binary NOT NULL,
146 cat_pages
int signed
NOT NULL default 0,
147 cat_subcats
int signed
NOT NULL default 0,
148 cat_files
int signed
NOT NULL default 0,
149 cat_hidden tinyint unsigned
NOT NULL default 0
151 CREATE UNIQUE INDEX /*i*/cat_title
ON /*_*/category_tmp (cat_title
);
152 CREATE INDEX /*i*/cat_pages
ON /*_*/category_tmp (cat_pages
);
154 CREATE TABLE /*_*/langlinks_tmp (
155 ll_from
int unsigned
NOT NULL default 0,
156 ll_lang
varbinary(20) NOT NULL default '',
157 ll_title
varchar(255) binary NOT NULL default ''
160 CREATE UNIQUE INDEX /*i*/ll_from
ON /*_*/langlinks_tmp (ll_from
, ll_lang
);
161 CREATE INDEX /*i*/ll_lang_title
ON /*_*/langlinks_tmp (ll_lang
, ll_title
);
164 CREATE TABLE /*_*/site_stats_tmp (
165 ss_row_id
int unsigned
NOT NULL,
166 ss_total_views
bigint unsigned
default 0,
167 ss_total_edits
bigint unsigned
default 0,
168 ss_good_articles
bigint unsigned
default 0,
169 ss_total_pages
bigint default '-1',
170 ss_users
bigint default '-1',
171 ss_active_users
bigint default '-1',
172 ss_admins
int default '-1',
173 ss_images
int default 0
175 CREATE UNIQUE INDEX /*i*/ss_row_id
ON /*_*/site_stats_tmp (ss_row_id
);
178 CREATE TABLE /*_*/ipblocks_tmp (
179 ipb_id
int NOT NULL PRIMARY KEY AUTO_INCREMENT
,
180 ipb_address tinyblob
NOT NULL,
181 ipb_user
int unsigned
NOT NULL default 0,
182 ipb_by
int unsigned
NOT NULL default 0,
183 ipb_by_text
varchar(255) binary NOT NULL default '',
184 ipb_reason tinyblob
NOT NULL,
185 ipb_timestamp
binary(14) NOT NULL default '',
186 ipb_auto bool
NOT NULL default 0,
188 -- If set to 1, block applies only to logged-out users
189 ipb_anon_only bool
NOT NULL default 0,
190 ipb_create_account bool
NOT NULL default 1,
191 ipb_enable_autoblock bool
NOT NULL default '1',
192 ipb_expiry
varbinary(14) NOT NULL default '',
193 ipb_range_start tinyblob
NOT NULL,
194 ipb_range_end tinyblob
NOT NULL,
195 ipb_deleted bool
NOT NULL default 0,
196 ipb_block_email bool
NOT NULL default 0,
197 ipb_allow_usertalk bool
NOT NULL default 0
199 CREATE UNIQUE INDEX /*i*/ipb_address
ON /*_*/ipblocks_tmp (ipb_address(255), ipb_user
, ipb_auto
, ipb_anon_only
);
200 CREATE INDEX /*i*/ipb_user
ON /*_*/ipblocks_tmp (ipb_user
);
201 CREATE INDEX /*i*/ipb_range
ON /*_*/ipblocks_tmp (ipb_range_start(8), ipb_range_end(8));
202 CREATE INDEX /*i*/ipb_timestamp
ON /*_*/ipblocks_tmp (ipb_timestamp
);
203 CREATE INDEX /*i*/ipb_expiry
ON /*_*/ipblocks_tmp (ipb_expiry
);
206 CREATE TABLE /*_*/watchlist_tmp (
207 wl_user
int unsigned
NOT NULL,
208 wl_namespace
int NOT NULL default 0,
209 wl_title
varchar(255) binary NOT NULL default '',
210 wl_notificationtimestamp
varbinary(14)
213 CREATE UNIQUE INDEX /*i*/wl_user_namespace_title
ON /*_*/watchlist_tmp (wl_user
, wl_namespace
, wl_title
);
214 CREATE INDEX /*i*/namespace_title
ON /*_*/watchlist_tmp (wl_namespace
, wl_title
);
217 CREATE TABLE /*_*/math_tmp (
218 math_inputhash
varbinary(16) NOT NULL,
219 math_outputhash
varbinary(16) NOT NULL,
220 math_html_conservativeness tinyint
NOT NULL,
225 CREATE UNIQUE INDEX /*i*/math_inputhash
ON /*_*/math_tmp (math_inputhash
);
228 CREATE TABLE /*_*/interwiki_tmp (
229 iw_prefix
varchar(32) NOT NULL,
230 iw_url
blob NOT NULL,
231 iw_local bool
NOT NULL,
232 iw_trans tinyint
NOT NULL default 0
235 CREATE UNIQUE INDEX /*i*/iw_prefix
ON /*_*/interwiki_tmp (iw_prefix
);
238 CREATE TABLE /*_*/page_restrictions_tmp (
239 pr_page
int NOT NULL,
240 pr_type
varbinary(60) NOT NULL,
241 pr_level
varbinary(60) NOT NULL,
242 pr_cascade tinyint
NOT NULL,
244 pr_expiry
varbinary(14) NULL,
245 pr_id
int unsigned
NOT NULL PRIMARY KEY AUTO_INCREMENT
248 CREATE UNIQUE INDEX /*i*/pr_pagetype
ON /*_*/page_restrictions_tmp (pr_page
,pr_type
);
249 CREATE UNIQUE INDEX /*i*/pr_typelevel
ON /*_*/page_restrictions_tmp (pr_type
,pr_level
);
250 CREATE UNIQUE INDEX /*i*/pr_level
ON /*_*/page_restrictions_tmp (pr_level
);
251 CREATE UNIQUE INDEX /*i*/pr_cascade
ON /*_*/page_restrictions_tmp (pr_cascade
);
253 CREATE TABLE /*_*/protected_titles_tmp (
254 pt_namespace
int NOT NULL,
255 pt_title
varchar(255) binary NOT NULL,
256 pt_user
int unsigned
NOT NULL,
258 pt_timestamp
binary(14) NOT NULL,
259 pt_expiry
varbinary(14) NOT NULL default '',
260 pt_create_perm
varbinary(60) NOT NULL
262 CREATE UNIQUE INDEX /*i*/pt_namespace_title
ON /*_*/protected_titles_tmp (pt_namespace
,pt_title
);
263 CREATE INDEX /*i*/pt_timestamp
ON /*_*/protected_titles_tmp (pt_timestamp
);
265 CREATE TABLE /*_*/page_props_tmp (
266 pp_page
int NOT NULL,
267 pp_propname
varbinary(60) NOT NULL,
268 pp_value
blob NOT NULL
270 CREATE UNIQUE INDEX /*i*/pp_page_propname
ON /*_*/page_props_tmp (pp_page
,pp_propname
);
272 --------------------------------------------------------------------------------
273 -- Populate the new tables using INSERT SELECT
274 --------------------------------------------------------------------------------
276 INSERT OR IGNORE INTO /*_*/user_tmp
SELECT * FROM /*_*/user;
277 INSERT OR IGNORE INTO /*_*/user_groups_tmp
SELECT * FROM /*_*/user_groups
;
278 INSERT OR IGNORE INTO /*_*/page_tmp
SELECT * FROM /*_*/page
;
279 INSERT OR IGNORE INTO /*_*/revision_tmp
SELECT * FROM /*_*/revision
;
280 INSERT OR IGNORE INTO /*_*/pagelinks_tmp
SELECT * FROM /*_*/pagelinks
;
281 INSERT OR IGNORE INTO /*_*/templatelinks_tmp
SELECT * FROM /*_*/templatelinks
;
282 INSERT OR IGNORE INTO /*_*/imagelinks_tmp
SELECT * FROM /*_*/imagelinks
;
283 INSERT OR IGNORE INTO /*_*/categorylinks_tmp
SELECT * FROM /*_*/categorylinks
;
284 INSERT OR IGNORE INTO /*_*/category_tmp
SELECT * FROM /*_*/category
;
285 INSERT OR IGNORE INTO /*_*/langlinks_tmp
SELECT * FROM /*_*/langlinks
;
286 INSERT OR IGNORE INTO /*_*/site_stats_tmp
SELECT * FROM /*_*/site_stats
;
287 INSERT OR IGNORE INTO /*_*/ipblocks_tmp
SELECT * FROM /*_*/ipblocks
;
288 INSERT OR IGNORE INTO /*_*/watchlist_tmp
SELECT * FROM /*_*/watchlist
;
289 INSERT OR IGNORE INTO /*_*/math_tmp
SELECT * FROM /*_*/math
;
290 INSERT OR IGNORE INTO /*_*/interwiki_tmp
SELECT * FROM /*_*/interwiki
;
291 INSERT OR IGNORE INTO /*_*/page_restrictions_tmp
SELECT * FROM /*_*/page_restrictions
;
292 INSERT OR IGNORE INTO /*_*/protected_titles_tmp
SELECT * FROM /*_*/protected_titles
;
293 INSERT OR IGNORE INTO /*_*/page_props_tmp
SELECT * FROM /*_*/page_props
;
295 --------------------------------------------------------------------------------
296 -- Do the table renames
297 --------------------------------------------------------------------------------
299 DROP TABLE /*_*/user;
300 ALTER TABLE /*_*/user_tmp
RENAME TO /*_*/user;
301 DROP TABLE /*_*/user_groups
;
302 ALTER TABLE /*_*/user_groups_tmp
RENAME TO /*_*/user_groups
;
303 DROP TABLE /*_*/page
;
304 ALTER TABLE /*_*/page_tmp
RENAME TO /*_*/page
;
305 DROP TABLE /*_*/revision
;
306 ALTER TABLE /*_*/revision_tmp
RENAME TO /*_*/revision
;
307 DROP TABLE /*_*/pagelinks
;
308 ALTER TABLE /*_*/pagelinks_tmp
RENAME TO /*_*/pagelinks
;
309 DROP TABLE /*_*/templatelinks
;
310 ALTER TABLE /*_*/templatelinks_tmp
RENAME TO /*_*/templatelinks
;
311 DROP TABLE /*_*/imagelinks
;
312 ALTER TABLE /*_*/imagelinks_tmp
RENAME TO /*_*/imagelinks
;
313 DROP TABLE /*_*/categorylinks
;
314 ALTER TABLE /*_*/categorylinks_tmp
RENAME TO /*_*/categorylinks
;
315 DROP TABLE /*_*/category
;
316 ALTER TABLE /*_*/category_tmp
RENAME TO /*_*/category
;
317 DROP TABLE /*_*/langlinks
;
318 ALTER TABLE /*_*/langlinks_tmp
RENAME TO /*_*/langlinks
;
319 DROP TABLE /*_*/site_stats
;
320 ALTER TABLE /*_*/site_stats_tmp
RENAME TO /*_*/site_stats
;
321 DROP TABLE /*_*/ipblocks
;
322 ALTER TABLE /*_*/ipblocks_tmp
RENAME TO /*_*/ipblocks
;
323 DROP TABLE /*_*/watchlist
;
324 ALTER TABLE /*_*/watchlist_tmp
RENAME TO /*_*/watchlist
;
325 DROP TABLE /*_*/math
;
326 ALTER TABLE /*_*/math_tmp
RENAME TO /*_*/math
;
327 DROP TABLE /*_*/interwiki
;
328 ALTER TABLE /*_*/interwiki_tmp
RENAME TO /*_*/interwiki
;
329 DROP TABLE /*_*/page_restrictions
;
330 ALTER TABLE /*_*/page_restrictions_tmp
RENAME TO /*_*/page_restrictions
;
331 DROP TABLE /*_*/protected_titles
;
332 ALTER TABLE /*_*/protected_titles_tmp
RENAME TO /*_*/protected_titles
;
333 DROP TABLE /*_*/page_props
;
334 ALTER TABLE /*_*/page_props_tmp
RENAME TO /*_*/page_props
;
336 --------------------------------------------------------------------------------
337 -- Drop and create tables with unique indexes but no valuable data
338 --------------------------------------------------------------------------------
341 DROP TABLE IF EXISTS /*_*/searchindex
;
342 CREATE TABLE /*_*/searchindex (
343 si_page
int unsigned
NOT NULL,
344 si_title
varchar(255) NOT NULL default '',
345 si_text mediumtext
NOT NULL
347 CREATE UNIQUE INDEX /*i*/si_page
ON /*_*/searchindex (si_page
);
348 CREATE INDEX /*i*/si_title
ON /*_*/searchindex (si_title
);
349 CREATE INDEX /*i*/si_text
ON /*_*/searchindex (si_text
);
351 DROP TABLE IF EXISTS /*_*/transcache
;
352 CREATE TABLE /*_*/transcache (
353 tc_url
varbinary(255) NOT NULL,
355 tc_time
binary(14) NOT NULL
356 ) /*$wgDBTableOptions*/;
357 CREATE UNIQUE INDEX /*i*/tc_url_idx
ON /*_*/transcache (tc_url
);
359 DROP TABLE IF EXISTS /*_*/querycache_info
;
360 CREATE TABLE /*_*/querycache_info (
361 qci_type
varbinary(32) NOT NULL default '',
362 qci_timestamp
binary(14) NOT NULL default '19700101000000'
363 ) /*$wgDBTableOptions*/;
364 CREATE UNIQUE INDEX /*i*/qci_type
ON /*_*/querycache_info (qci_type
);
366 --------------------------------------------------------------------------------
367 -- Empty some cache tables to make the update faster
368 --------------------------------------------------------------------------------
370 DELETE FROM /*_*/querycache
;
371 DELETE FROM /*_*/objectcache
;
372 DELETE FROM /*_*/querycachetwo
;
374 --------------------------------------------------------------------------------
375 -- Add indexes to tables with no unique indexes
376 --------------------------------------------------------------------------------
378 CREATE INDEX /*i*/un_user_id
ON /*_*/user_newtalk (user_id
);
379 CREATE INDEX /*i*/un_user_ip
ON /*_*/user_newtalk (user_ip
);
380 CREATE INDEX /*i*/name_title_timestamp
ON /*_*/archive (ar_namespace
,ar_title
,ar_timestamp
);
381 CREATE INDEX /*i*/ar_usertext_timestamp
ON /*_*/archive (ar_user_text
,ar_timestamp
);
382 CREATE INDEX /*i*/el_from
ON /*_*/externallinks (el_from
, el_to(40));
383 CREATE INDEX /*i*/el_to
ON /*_*/externallinks (el_to(60), el_from
);
384 CREATE INDEX /*i*/el_index
ON /*_*/externallinks (el_index(60));
385 CREATE INDEX /*i*/img_usertext_timestamp
ON /*_*/image (img_user_text
,img_timestamp
);
386 CREATE INDEX /*i*/img_size
ON /*_*/image (img_size
);
387 CREATE INDEX /*i*/img_timestamp
ON /*_*/image (img_timestamp
);
388 CREATE INDEX /*i*/img_sha1
ON /*_*/image (img_sha1
);
389 CREATE INDEX /*i*/oi_usertext_timestamp
ON /*_*/oldimage (oi_user_text
,oi_timestamp
);
390 CREATE INDEX /*i*/oi_name_timestamp
ON /*_*/oldimage (oi_name
,oi_timestamp
);
391 CREATE INDEX /*i*/oi_name_archive_name
ON /*_*/oldimage (oi_name
,oi_archive_name(14));
392 CREATE INDEX /*i*/oi_sha1
ON /*_*/oldimage (oi_sha1
);
393 CREATE INDEX /*i*/fa_name
ON /*_*/filearchive (fa_name
, fa_timestamp
);
394 CREATE INDEX /*i*/fa_group_key
ON /*_*/filearchive (fa_storage_group
, fa_storage_key
);
395 CREATE INDEX /*i*/fa_deleted_timestamp
ON /*_*/filearchive (fa_deleted_timestamp
);
396 CREATE INDEX /*i*/fa_user_timestamp
ON /*_*/filearchive (fa_user_text
,fa_timestamp
);
397 CREATE INDEX /*i*/rc_timestamp
ON /*_*/recentchanges (rc_timestamp
);
398 CREATE INDEX /*i*/rc_namespace_title
ON /*_*/recentchanges (rc_namespace
, rc_title
);
399 CREATE INDEX /*i*/rc_cur_id
ON /*_*/recentchanges (rc_cur_id
);
400 CREATE INDEX /*i*/new_name_timestamp
ON /*_*/recentchanges (rc_new
,rc_namespace
,rc_timestamp
);
401 CREATE INDEX /*i*/rc_ip
ON /*_*/recentchanges (rc_ip
);
402 CREATE INDEX /*i*/rc_ns_usertext
ON /*_*/recentchanges (rc_namespace
, rc_user_text
);
403 CREATE INDEX /*i*/rc_user_text
ON /*_*/recentchanges (rc_user_text
, rc_timestamp
);
404 CREATE INDEX /*i*/qc_type_value
ON /*_*/querycache (qc_type
,qc_value
);
405 CREATE INDEX /*i*/oc_exptime
ON /*_*/objectcache (exptime
);
406 CREATE INDEX /*i*/type_time
ON /*_*/logging (log_type
, log_timestamp
);
407 CREATE INDEX /*i*/user_time
ON /*_*/logging (log_user
, log_timestamp
);
408 CREATE INDEX /*i*/page_time
ON /*_*/logging (log_namespace
, log_title
, log_timestamp
);
409 CREATE INDEX /*i*/times
ON /*_*/logging (log_timestamp
);
410 CREATE INDEX /*i*/tb_page
ON /*_*/trackbacks (tb_page
);
411 CREATE INDEX /*i*/job_cmd_namespace_title
ON /*_*/job (job_cmd
, job_namespace
, job_title
);
412 CREATE INDEX /*i*/rd_ns_title
ON /*_*/redirect (rd_namespace
,rd_title
,rd_from
);
413 CREATE INDEX /*i*/qcc_type
ON /*_*/querycachetwo (qcc_type
,qcc_value
);
414 CREATE INDEX /*i*/qcc_title
ON /*_*/querycachetwo (qcc_type
,qcc_namespace
,qcc_title
);
415 CREATE INDEX /*i*/qcc_titletwo
ON /*_*/querycachetwo (qcc_type
,qcc_namespacetwo
,qcc_titletwo
);
417 INSERT INTO /*_*/updatelog
VALUES ('initial_indexes');