r25954 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r25953‎ | r25954 | r25955 >
Date:09:11, 20 September 2007
Author:proes
Status:old
Tags:
Comment:
* Fixed wikidataSourceTables.sql: did not run anymore since recent addition of comment
* Removed spurious ALTER TABLE commands that resulted in a lot of duplicate indexes
Modified paths:
  • /trunk/extensions/Wikidata/Database+scripts/Convenience/wikidataSourceTables.sql (modified) (history)

Diff [purge]

Index: trunk/extensions/Wikidata/Database scripts/Convenience/wikidataSourceTables.sql
@@ -12,14 +12,6 @@
1313 KEY `versioned_start_source` (`add_transaction_id`,`source_id`,`meaning_mid`,`meaning_text_tcid`)
1414 ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
1515
16 -ALTER TABLE /*$wgWDprefix*/alt_meaningtexts
17 - ADD INDEX /*$wgWDprefix*/versioned_end_meaning (`remove_transaction_id`, `meaning_mid`, `meaning_text_tcid`, `source_id`),
18 - ADD INDEX /*$wgWDprefix*/versioned_end_text (`remove_transaction_id`, `meaning_text_tcid`, `meaning_mid`, `source_id`),
19 - ADD INDEX /*$wgWDprefix*/versioned_end_source (`remove_transaction_id`, `source_id`, `meaning_mid`, `meaning_text_tcid`),
20 - ADD INDEX /*$wgWDprefix*/versioned_start_meaning (`add_transaction_id`, `meaning_mid`, `meaning_text_tcid`, `source_id`),
21 - ADD INDEX /*$wgWDprefix*/versioned_start_text (`add_transaction_id`, `meaning_text_tcid`, `meaning_mid`, `source_id`),
22 - ADD INDEX /*$wgWDprefix*/versioned_start_source (`add_transaction_id`, `source_id`, `meaning_mid`, `meaning_text_tcid`);
23 -
2416 CREATE TABLE /*$wgWDprefix*/bootstrapped_defined_meanings (
2517 `name` varchar(255) NOT NULL,
2618 `defined_meaning_id` int(11) NOT NULL,
@@ -27,18 +19,12 @@
2820 KEY `unversioned_name` (`name`,`defined_meaning_id`)
2921 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
3022
31 -ALTER TABLE /*$wgWDprefix*/bootstrapped_defined_meanings
32 - ADD INDEX /*$wgWDprefix*/unversioned_meaning (`defined_meaning_id`),
33 - ADD INDEX /*$wgWDprefix*/unversioned_name (`name` (255), `defined_meaning_id`);
34 -
35 -
36 -
3723 -- object_id - key for the attribute, used elsewhere as a foreign key
3824 -- class_mid - which class (identified by DMID) has this attribute?
3925 -- level_mid - on which level can we annotate: Annotation, DefinedMeaning, Definition, Relation, SynTrans; these are also cached in *_bootstrapped_defined_meanings
4026 -- attribute_mid - which attribute are we describing?
4127 -- attribute_type - what kind of information are we talking about? can be 'DM', 'TRNS' (translatable text), 'TEXT', 'URL', 'OPTN' (multiple DMs to choose from)a
42 -attribute_id - refers to the object_id from xx_class_attributes
 28+-- attribute_id - refers to the object_id from xx_class_attributes
4329 CREATE TABLE /*$wgWDprefix*/class_attributes (
4430 `object_id` int(11) NOT NULL,
4531 `class_mid` int(11) NOT NULL default '0',
@@ -55,14 +41,6 @@
5642 KEY `versioned_start_object` (`add_transaction_id`,`object_id`)
5743 ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
5844
59 -ALTER TABLE /*$wgWDprefix*/class_attributes
60 - ADD INDEX /*$wgWDprefix*/versioned_end_class (`remove_transaction_id`, `class_mid`, `attribute_mid`, `object_id`),
61 - ADD INDEX /*$wgWDprefix*/versioned_end_attribute (`remove_transaction_id`, `attribute_mid`, `class_mid`, `object_id`),
62 - ADD INDEX /*$wgWDprefix*/versioned_end_object (`remove_transaction_id`, `object_id`),
63 - ADD INDEX /*$wgWDprefix*/versioned_start_class (`add_transaction_id`, `class_mid`, `attribute_mid`, `object_id`),
64 - ADD INDEX /*$wgWDprefix*/versioned_start_attribute (`add_transaction_id`, `attribute_mid`, `class_mid`, `object_id`),
65 - ADD INDEX /*$wgWDprefix*/versioned_start_object (`add_transaction_id`, `object_id`);
66 -
6745 CREATE TABLE /*$wgWDprefix*/class_membership (
6846 `class_membership_id` int(11) NOT NULL,
6947 `class_mid` int(11) NOT NULL default '0',
@@ -77,14 +55,6 @@
7856 KEY `versioned_start_class_membership` (`add_transaction_id`,`class_membership_id`)
7957 ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
8058
81 -ALTER TABLE /*$wgWDprefix*/class_membership
82 - ADD INDEX /*$wgWDprefix*/versioned_end_class (`remove_transaction_id`, `class_mid`, `class_member_mid`),
83 - ADD INDEX /*$wgWDprefix*/versioned_end_class_member (`remove_transaction_id`, `class_member_mid`, `class_mid`),
84 - ADD INDEX /*$wgWDprefix*/versioned_end_class_membership (`remove_transaction_id`, `class_membership_id`),
85 - ADD INDEX /*$wgWDprefix*/versioned_start_class (`add_transaction_id`, `class_mid`, `class_member_mid`),
86 - ADD INDEX /*$wgWDprefix*/versioned_start_class_member (`add_transaction_id`, `class_member_mid`, `class_mid`),
87 - ADD INDEX /*$wgWDprefix*/versioned_start_class_membership (`add_transaction_id`, `class_membership_id`);
88 -
8959 CREATE TABLE /*$wgWDprefix*/collection_contents (
9060 `collection_id` int(10) NOT NULL default '0',
9161 `member_mid` int(10) NOT NULL default '0',
@@ -100,16 +70,6 @@
10171 KEY `versioned_start_internal_id` (`add_transaction_id`,`internal_member_id`,`collection_id`,`member_mid`)
10272 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
10373
104 -ALTER TABLE /*$wgWDprefix*/collection_contents
105 - ADD INDEX /*$wgWDprefix*/versioned_end_collection (`remove_transaction_id`, `collection_id`, `member_mid`),
106 - ADD INDEX /*$wgWDprefix*/versioned_end_collection_member (`remove_transaction_id`, `member_mid`, `collection_id`),
107 - ADD INDEX /*$wgWDprefix*/versioned_end_internal_id (`remove_transaction_id`, `internal_member_id` (255), `collection_id`, `member_mid`),
108 - ADD INDEX /*$wgWDprefix*/versioned_start_collection (`add_transaction_id`, `collection_id`, `member_mid`),
109 - ADD INDEX /*$wgWDprefix*/versioned_start_collection_member (`add_transaction_id`, `member_mid`, `collection_id`),
110 - ADD INDEX /*$wgWDprefix*/versioned_start_internal_id (`add_transaction_id`, `internal_member_id` (255), `collection_id`, `member_mid`),
111 - ADD INDEX /*$wgWDprefix*/collection_id_idx (`collection_id`),
112 - ADD INDEX /*$wgWDprefix*/member_mid_idx (`member_mid`);
113 -
11474 CREATE TABLE /*$wgWDprefix*/collection_language (
11575 `collection_id` int(10) NOT NULL default '0',
11676 `language_id` int(10) NOT NULL default '0'
@@ -129,14 +89,6 @@
13090 KEY `versioned_start_collection_type` (`add_transaction_id`,`collection_type`,`collection_id`,`collection_mid`)
13191 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
13292
133 -ALTER TABLE /*$wgWDprefix*/collection
134 - ADD INDEX /*$wgWDprefix*/versioned_end_collection (`remove_transaction_id`, `collection_id`, `collection_mid`),
135 - ADD INDEX /*$wgWDprefix*/versioned_end_collection_meaning (`remove_transaction_id`, `collection_mid`, `collection_id`),
136 - ADD INDEX /*$wgWDprefix*/versioned_end_collection_type (`remove_transaction_id`, `collection_type` (4), `collection_id`, `collection_mid`),
137 - ADD INDEX /*$wgWDprefix*/versioned_start_collection (`add_transaction_id`, `collection_id`, `collection_mid`),
138 - ADD INDEX /*$wgWDprefix*/versioned_start_collection_meaning (`add_transaction_id`, `collection_mid`, `collection_id`),
139 - ADD INDEX /*$wgWDprefix*/versioned_start_collection_type (`add_transaction_id`, `collection_type` (4), `collection_id`, `collection_mid`);
140 -
14193 CREATE TABLE /*$wgWDprefix*/defined_meaning (
14294 `defined_meaning_id` int(8) unsigned NOT NULL,
14395 `expression_id` int(10) NOT NULL,
@@ -151,15 +103,6 @@
152104 KEY `versioned_start_meaning_text` (`add_transaction_id`,`meaning_text_tcid`,`defined_meaning_id`)
153105 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
154106
155 -ALTER TABLE /*$wgWDprefix*/defined_meaning
156 - ADD INDEX /*$wgWDprefix*/versioned_end_meaning (`remove_transaction_id`, `defined_meaning_id`, `expression_id`),
157 - ADD INDEX /*$wgWDprefix*/versioned_end_expression (`remove_transaction_id`, `expression_id`, `defined_meaning_id`),
158 - ADD INDEX /*$wgWDprefix*/versioned_end_meaning_text (`remove_transaction_id`, `meaning_text_tcid`, `defined_meaning_id`),
159 - ADD INDEX /*$wgWDprefix*/versioned_start_meaning (`add_transaction_id`, `defined_meaning_id`, `expression_id`),
160 - ADD INDEX /*$wgWDprefix*/versioned_start_expression (`add_transaction_id`, `expression_id`, `defined_meaning_id`),
161 - ADD INDEX /*$wgWDprefix*/versioned_start_meaning_text (`add_transaction_id`, `meaning_text_tcid`, `defined_meaning_id`),
162 - ADD INDEX /*$wgWDprefix*/defined_meaning_idx (`defined_meaning_id`);
163 -
164107 CREATE TABLE /*$wgWDprefix*/expression (
165108 `expression_id` int(10) unsigned NOT NULL,
166109 `spelling` varchar(255) NOT NULL default '',
@@ -174,17 +117,6 @@
175118 KEY `versioned_start_spelling` (`add_transaction_id`,`spelling`,`expression_id`,`language_id`)
176119 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
177120
178 -ALTER TABLE /*$wgWDprefix*/expression
179 - ADD INDEX /*$wgWDprefix*/versioned_end_expression (`remove_transaction_id`, `expression_id`, `language_id`),
180 - ADD INDEX /*$wgWDprefix*/versioned_end_language (`remove_transaction_id`, `language_id`, `expression_id`),
181 - ADD INDEX /*$wgWDprefix*/versioned_end_spelling (`remove_transaction_id`, `spelling` (255), `expression_id`, `language_id`),
182 - ADD INDEX /*$wgWDprefix*/versioned_start_expression (`add_transaction_id`, `expression_id`, `language_id`),
183 - ADD INDEX /*$wgWDprefix*/versioned_start_language (`add_transaction_id`, `language_id`, `expression_id`),
184 - ADD INDEX /*$wgWDprefix*/versioned_start_spelling (`add_transaction_id`, `spelling` (255), `expression_id`, `language_id`),
185 - ADD INDEX /*$wgWDprefix*/expressions_unique_idx (`expression_id`,`language_id`),
186 - ADD INDEX /*$wgWDprefix*/expressions_idx (`expression_id`),
187 - ADD INDEX /*$wgWDprefix*/language_idx (`language_id`);
188 -
189121 CREATE TABLE /*$wgWDprefix*/meaning_relations (
190122 `relation_id` int(11) NOT NULL,
191123 `meaning1_mid` int(10) NOT NULL default '0',
@@ -200,14 +132,6 @@
201133 KEY `versioned_start_relation` (`add_transaction_id`,`relation_id`)
202134 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
203135
204 -ALTER TABLE /*$wgWDprefix*/meaning_relations
205 - ADD INDEX /*$wgWDprefix*/versioned_end_outgoing (`remove_transaction_id`, `meaning1_mid`, `relationtype_mid`, `meaning2_mid`),
206 - ADD INDEX /*$wgWDprefix*/versioned_end_incoming (`remove_transaction_id`, `meaning2_mid`, `relationtype_mid`, `meaning1_mid`),
207 - ADD INDEX /*$wgWDprefix*/versioned_end_relation (`remove_transaction_id`, `relation_id`),
208 - ADD INDEX /*$wgWDprefix*/versioned_start_outgoing (`add_transaction_id`, `meaning1_mid`, `relationtype_mid`, `meaning2_mid`),
209 - ADD INDEX /*$wgWDprefix*/versioned_start_incoming (`add_transaction_id`, `meaning2_mid`, `relationtype_mid`, `meaning1_mid`),
210 - ADD INDEX /*$wgWDprefix*/versioned_start_relation (`add_transaction_id`, `relation_id`);
211 -
212136 CREATE TABLE /*$wgWDprefix*/objects (
213137 `object_id` int(11) NOT NULL auto_increment,
214138 `table` varchar(100) collate utf8_bin NOT NULL,
@@ -234,15 +158,6 @@
235159 KEY `versioned_start_id` (`add_transaction_id`,`option_id`)
236160 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
237161
238 -ALTER TABLE /*$wgWDprefix*/option_attribute_options
239 - ADD INDEX /*$wgWDprefix*/versioned_end_option (`remove_transaction_id`, `option_mid`, `attribute_id`, `option_id`),
240 - ADD INDEX /*$wgWDprefix*/versioned_end_attribute (`remove_transaction_id`, `attribute_id`, `option_id`, `option_mid`),
241 - ADD INDEX /*$wgWDprefix*/versioned_end_id (`remove_transaction_id`, `option_id`),
242 - ADD INDEX /*$wgWDprefix*/versioned_start_option (`add_transaction_id`, `option_mid`, `attribute_id`, `option_id`),
243 - ADD INDEX /*$wgWDprefix*/versioned_start_attribute (`add_transaction_id`, `attribute_id`, `option_id`, `option_mid`),
244 - ADD INDEX /*$wgWDprefix*/versioned_start_id (`add_transaction_id`, `option_id`);
245 -
246 -
247162 CREATE TABLE /*$wgWDprefix*/option_attribute_values (
248163 `value_id` int(11) NOT NULL default '0',
249164 `object_id` int(11) NOT NULL default '0',
@@ -257,14 +172,6 @@
258173 KEY `versioned_start_value` (`add_transaction_id`,`value_id`)
259174 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
260175
261 -ALTER TABLE /*$wgWDprefix*/option_attribute_values
262 - ADD INDEX /*$wgWDprefix*/versioned_end_object (`remove_transaction_id`, `object_id`, `option_id`, `value_id`),
263 - ADD INDEX /*$wgWDprefix*/versioned_end_option (`remove_transaction_id`, `option_id`, `object_id`, `value_id`),
264 - ADD INDEX /*$wgWDprefix*/versioned_end_value (`remove_transaction_id`, `value_id`),
265 - ADD INDEX /*$wgWDprefix*/versioned_start_object (`add_transaction_id`, `object_id`, `option_id`, `value_id`),
266 - ADD INDEX /*$wgWDprefix*/versioned_start_option (`add_transaction_id`, `option_id`, `object_id`, `value_id`),
267 - ADD INDEX /*$wgWDprefix*/versioned_start_value (`add_transaction_id`, `value_id`);
268 -
269176 CREATE TABLE /*$wgWDprefix*/script_log (
270177 `script_id` int(11) NOT NULL default '0',
271178 `time` datetime NOT NULL default '0000-00-00 00:00:00',
@@ -287,17 +194,6 @@
288195 KEY `versioned_start_defined_meaning` (`add_transaction_id`,`defined_meaning_id`,`identical_meaning`,`expression_id`)
289196 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
290197
291 -ALTER TABLE /*$wgWDprefix*/syntrans
292 - ADD INDEX /*$wgWDprefix*/versioned_end_syntrans (`remove_transaction_id`, `syntrans_sid`),
293 - ADD INDEX /*$wgWDprefix*/versioned_end_expression (`remove_transaction_id`, `expression_id`, `identical_meaning`, `defined_meaning_id`),
294 - ADD INDEX /*$wgWDprefix*/versioned_end_defined_meaning (`remove_transaction_id`, `defined_meaning_id`, `identical_meaning`, `expression_id`),
295 - ADD INDEX /*$wgWDprefix*/versioned_start_syntrans (`add_transaction_id`, `syntrans_sid`),
296 - ADD INDEX /*$wgWDprefix*/versioned_start_expression (`add_transaction_id`, `expression_id`, `identical_meaning`, `defined_meaning_id`),
297 - ADD INDEX /*$wgWDprefix*/versioned_start_defined_meaning (`add_transaction_id`, `defined_meaning_id`, `identical_meaning`, `expression_id`),
298 - ADD INDEX /*$wgWDprefix*/syntrans_defined_meaning_idx (`defined_meaning_id`),
299 - ADD INDEX /*$wgWDprefix*/syntrans_expression_id_idx (`expression_id`),
300 - ADD INDEX /*$wgWDprefix*/syntrans_remove_transaction_idx (`remove_transaction_id`);
301 -
302198 CREATE TABLE /*$wgWDprefix*/text (
303199 `text_id` int(8) unsigned NOT NULL auto_increment,
304200 `text_text` mediumblob NOT NULL,
@@ -320,14 +216,6 @@
321217 KEY `versioned_start_value` (`add_transaction_id`,`value_id`)
322218 ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
323219
324 -ALTER TABLE /*$wgWDprefix*/text_attribute_values
325 - ADD INDEX /*$wgWDprefix*/versioned_end_object (`remove_transaction_id`, `object_id`, `attribute_mid`, `value_id`),
326 - ADD INDEX /*$wgWDprefix*/versioned_end_attribute (`remove_transaction_id`, `attribute_mid`, `object_id`, `value_id`),
327 - ADD INDEX /*$wgWDprefix*/versioned_end_value (`remove_transaction_id`, `value_id`),
328 - ADD INDEX /*$wgWDprefix*/versioned_start_object (`add_transaction_id`, `object_id`, `attribute_mid`, `value_id`),
329 - ADD INDEX /*$wgWDprefix*/versioned_start_attribute (`add_transaction_id`, `attribute_mid`, `object_id`, `value_id`),
330 - ADD INDEX /*$wgWDprefix*/versioned_start_value (`add_transaction_id`, `value_id`);
331 -
332220 CREATE TABLE /*$wgWDprefix*/transactions (
333221 `transaction_id` int(11) NOT NULL auto_increment,
334222 `user_id` int(5) NOT NULL,
@@ -338,9 +226,6 @@
339227 KEY `user` (`user_id`,`transaction_id`)
340228 ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
341229
342 -ALTER TABLE /*$wgWDprefix*/transactions
343 - ADD INDEX /*$wgWDprefix*/user (`user_id`, `transaction_id`);
344 -
345230 CREATE TABLE /*$wgWDprefix*/translated_content (
346231 `translated_content_id` int(11) NOT NULL default '0',
347232 `language_id` int(10) NOT NULL default '0',
@@ -353,12 +238,6 @@
354239 KEY `versioned_start_text` (`add_transaction_id`,`text_id`,`translated_content_id`,`language_id`)
355240 ) ENGINE=MyISAM DEFAULT CHARSET=utf8;
356241
357 -ALTER TABLE /*$wgWDprefix*/translated_content
358 - ADD INDEX /*$wgWDprefix*/versioned_end_translated_content (`remove_transaction_id`, `translated_content_id`, `language_id`, `text_id`),
359 - ADD INDEX /*$wgWDprefix*/versioned_end_text (`remove_transaction_id`, `text_id`, `translated_content_id`, `language_id`),
360 - ADD INDEX /*$wgWDprefix*/versioned_start_translated_content (`add_transaction_id`, `translated_content_id`, `language_id`, `text_id`),
361 - ADD INDEX /*$wgWDprefix*/versioned_start_text (`add_transaction_id`, `text_id`, `translated_content_id`, `language_id`);
362 -
363242 CREATE TABLE /*$wgWDprefix*/translated_content_attribute_values (
364243 `value_id` int(11) NOT NULL default '0',
365244 `object_id` int(11) NOT NULL,
@@ -376,16 +255,6 @@
377256 KEY `versioned_start_value` (`add_transaction_id`,`value_id`)
378257 ) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
379258
380 -ALTER TABLE /*$wgWDprefix*/translated_content_attribute_values
381 - ADD INDEX /*$wgWDprefix*/versioned_end_object (`remove_transaction_id`, `object_id`, `attribute_mid`, `value_tcid`),
382 - ADD INDEX /*$wgWDprefix*/versioned_end_attribute (`remove_transaction_id`, `attribute_mid`, `object_id`, `value_tcid`),
383 - ADD INDEX /*$wgWDprefix*/versioned_end_translated_content (`remove_transaction_id`, `value_tcid`, `value_id`),
384 - ADD INDEX /*$wgWDprefix*/versioned_end_value (`remove_transaction_id`, `value_id`),
385 - ADD INDEX /*$wgWDprefix*/versioned_start_object (`add_transaction_id`, `object_id`, `attribute_mid`, `value_tcid`),
386 - ADD INDEX /*$wgWDprefix*/versioned_start_attribute (`add_transaction_id`, `attribute_mid`, `object_id`, `value_tcid`),
387 - ADD INDEX /*$wgWDprefix*/versioned_start_translated_content (`add_transaction_id`, `value_tcid`, `value_id`),
388 - ADD INDEX /*$wgWDprefix*/versioned_start_value (`add_transaction_id`, `value_id`);
389 -
390259 CREATE TABLE /*$wgWDprefix*/url_attribute_values (
391260 `value_id` int(11) NOT NULL,
392261 `object_id` int(11) NOT NULL,
@@ -400,14 +269,5 @@
401270 KEY `versioned_start_object` (`add_transaction_id`,`object_id`,`attribute_mid`,`value_id`),
402271 KEY `versioned_start_attribute` (`add_transaction_id`,`attribute_mid`,`object_id`,`value_id`),
403272 KEY `versioned_start_value` (`add_transaction_id`,`value_id`)
404 -) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
 273+) ENGINE=MyISAM DEFAULT CHARSET=utf8 COLLATE=utf8_bin;
405274
406 -ALTER TABLE /*$wgWDprefix*/url_attribute_values
407 - ADD INDEX /*$wgWDprefix*/versioned_end_object (`remove_transaction_id`, `object_id`, `attribute_mid`, `value_id`),
408 - ADD INDEX /*$wgWDprefix*/versioned_end_attribute (`remove_transaction_id`, `attribute_mid`, `object_id`, `value_id`),
409 - ADD INDEX /*$wgWDprefix*/versioned_end_value (`remove_transaction_id`, `value_id`),
410 - ADD INDEX /*$wgWDprefix*/versioned_start_object (`add_transaction_id`, `object_id`, `attribute_mid`, `value_id`),
411 - ADD INDEX /*$wgWDprefix*/versioned_start_attribute (`add_transaction_id`, `attribute_mid`, `object_id`, `value_id`),
412 - ADD INDEX /*$wgWDprefix*/versioned_start_value (`add_transaction_id`, `value_id`);
413 -
414 -

Status & tagging log