r23222 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r23221‎ | r23222 | r23223 >
Date:14:36, 22 June 2007
Author:kim
Status:old
Tags:
Comment:
Andre Malafaya baptista:
Missing.php faster and more efficient
Modified paths:
  • /trunk/extensions/Wikidata/util/missing.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Wikidata/util/missing.php
@@ -97,7 +97,7 @@
9898 # Malafaya: This is my query (performance must be checked live) for missing expressions based on
9999 # * don't count deleted stuff (old query did)
100100 # * do 2 joins: between members of collection and target language, and then with english for default, but only for elements having target language expression as NULL (non-existing)
101 -# * this gives us the DM id, the spelling in target language (or NULL, if none), the spelling in English (or NULL, if none)
 101+# * this gives us the DM id, the spelling in target language (or NULL, if none), the spelling in English (or NULL, if none)
102102 # Warning: some DMs came up in OLPC and Swadesh collections belonging to those collections but having no expressions associated... These are visible in this query
103103
104104 $result = mysql_query("
@@ -116,6 +116,13 @@
117117 uw_expression_ns.expression_id = uw_syntrans.expression_id
118118 AND uw_syntrans.remove_transaction_id IS NULL
119119 AND language_id = $language_esc
 120+ AND defined_meaning_id IN
 121+ (
 122+ SELECT member_mid as id
 123+ FROM uw_collection_contents WHERE
 124+ collection_id = $collection_esc
 125+ AND remove_transaction_id IS NULL
 126+ )
120127 ) as translation
121128 ON
122129 translation.defined_meaning_id = member.id
@@ -126,6 +133,13 @@
127134 uw_expression_ns.expression_id = uw_syntrans.expression_id
128135 AND uw_syntrans.remove_transaction_id IS NULL
129136 AND language_id = 85
 137+ AND defined_meaning_id IN
 138+ (
 139+ SELECT member_mid as id
 140+ FROM uw_collection_contents WHERE
 141+ collection_id = $collection_esc
 142+ AND remove_transaction_id IS NULL
 143+ )
130144 ) as translation_en
131145 ON
132146 translation_en.defined_meaning_id = member.id

Status & tagging log