Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F113075
Draft_query
No One
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Authored By
Nikerabbit
Apr 15 2015, 6:34 AM
2015-04-15 06:34:42 (UTC+0)
Size
2 KB
Referenced Files
None
Subscribers
None
Draft_query
View Options
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.
File Metadata
Details
Attached
Mime Type
text/plain; charset=utf-8
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
109747
Default Alt Text
Draft_query (2 KB)
Attached To
Mode
P522 Draft query
Attached
Detach File
Event Timeline
Log In to Comment