Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Paste
P522
Draft query
Active
Public
Actions
Authored by
Nikerabbit
on Apr 15 2015, 6:34 AM.
Edit Paste
Archive Paste
View Raw File
Subscribe
Mute Notifications
Award Token
Flag For Later
Tags
ContentTranslation
Referenced Files
F113075: Draft_query
Apr 15 2015, 6:34 AM
2015-04-15 06:34:43 (UTC+0)
Subscribers
KartikMistry
explain SELECT /* ContentTranslation\Translator::getTranslation Nike */ * FROM `bw_cx_translations`,`bw_cx_translators`,`bw_cx_drafts` WHERE translator_translation_id = '135' AND draft_id = '135' AND translator_user_id = '1';
+------+-------------+--------------------+-------+----------------------------+----------------------------+---------+-------------+------+-------------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+------+-------------+--------------------+-------+----------------------------+----------------------------+---------+-------------+------+-------------+
| 1 | SIMPLE | bw_cx_translators | const | cx_translation_translators | cx_translation_translators | 8 | const,const | 1 | Using index |
| 1 | SIMPLE | bw_cx_drafts | const | PRIMARY | PRIMARY | 4 | const | 1 | |
| 1 | SIMPLE | bw_cx_translations | ALL | NULL | NULL | NULL | NULL | 27 | |
+------+-------------+--------------------+-------+----------------------------+----------------------------+---------+-------------+------+-------------+
Returns 27 rows due to missing join condition, causing the selected draf_content be duplicated as many times as there are rows in cx_translations.
explain SELECT /* ContentTranslation\Translator::getDraftContent Nike */ draft_content FROM `bw_cx_translators`,`bw_cx_drafts` WHERE translator_user_id = '1' AND translator_translation_id = '135' AND (translator_translation_id = draft_id) LIMIT 1;
+------+-------------+-------------------+-------+----------------------------+----------------------------+---------+-------------+------+-------------+
| id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
+------+-------------+-------------------+-------+----------------------------+----------------------------+---------+-------------+------+-------------+
| 1 | SIMPLE | bw_cx_translators | const | cx_translation_translators | cx_translation_translators | 8 | const,const | 1 | Using index |
| 1 | SIMPLE | bw_cx_drafts | const | PRIMARY | PRIMARY | 4 | const | 1 | |
+------+-------------+-------------------+-------+----------------------------+----------------------------+---------+-------------+------+-------------+
Returns (one field of) 1 row and skips cx_translations completely.
Event Timeline
Nikerabbit
edited the content of this paste.
(Show Details)
Apr 15 2015, 6:34 AM
2015-04-15 06:34:43 (UTC+0)
Nikerabbit
changed the title of this paste from untitled to
Draft query
.
Nikerabbit
updated the paste's language from
autodetect
to
autodetect
.
Nikerabbit
added a project:
ContentTranslation
.
Nikerabbit
mentioned this in
T94402: Unable to reenter the ongoing translation
.
KartikMistry
subscribed.
Apr 15 2015, 7:21 AM
2015-04-15 07:21:00 (UTC+0)
Log In to Comment