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