Advertisement
Guest User

Untitled

a guest
Oct 22nd, 2016
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.68 KB | None | 0 0
  1. mysql> EXPLAIN SELECT `content_comment`.`id`, `content_comment`.`content_id`, `content_comment`.`author_id`, `content_comment`.`text`, `content_comment`.`typotext`, `content_comment`.`created`, `content_post`.`id`, `content_post`.`html_title`, `content_post`.`permalink`, `auth_user`.`id`, `auth_user`.`username`, `auth_user`.`first_name`, `auth_user`.`last_name`, `auth_user`.`avatar` FROM `content_comment` INNER JOIN `content_post` ON (`content_comment`.`content_id` = `content_post`.`id`) INNER JOIN `post_article` ON (`content_post`.`id` = `post_article`.`content_id`) LEFT OUTER JOIN `auth_user` ON (`content_comment`.`author_id` = `auth_user`.`id`) WHERE (`content_comment`.`deleted` IS NULL AND `post_article`.`id` IS NOT NULL) ORDER BY `content_comment`.`created` DESC LIMIT 15;
  2. +----+-------------+-----------------+------------+--------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------+---------+-----------------------------------+------+----------+-----------------------------------------------------------+
  3. | id | select_type | table | partitions | type | possible_keys | key | key_len | ref | rows | filtered | Extra |
  4. +----+-------------+-----------------+------------+--------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------+---------+-----------------------------------+------+----------+-----------------------------------------------------------+
  5. | 1 | SIMPLE | post_article | NULL | index | PRIMARY,content_id | content_id | 4 | NULL | 3745 | 90.00 | Using where; Using index; Using temporary; Using filesort |
  6. | 1 | SIMPLE | content_post | NULL | eq_ref | PRIMARY | PRIMARY | 4 | dou.post_article.content_id | 1 | 100.00 | NULL |
  7. | 1 | SIMPLE | content_comment | NULL | ref | content_comment_cc8ff3c,content_comment_deleted,ix_approved_deleted_content_id,ix_approved_deleted,ix_deleted_author_id,ix_content_author_approved,deleted,idx_deleted_total_votes_created | ix_approved_deleted_content_id | 6 | const,dou.post_article.content_id | 33 | 100.00 | Using index condition |
  8. | 1 | SIMPLE | auth_user | NULL | eq_ref | PRIMARY | PRIMARY | 4 | dou.content_comment.author_id | 1 | 100.00 | NULL |
  9. +----+-------------+-----------------+------------+--------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+--------------------------------+---------+-----------------------------------+------+----------+-----------------------------------------------------------+
  10. 4 rows in set, 1 warning (0,40 sec)
  11.  
  12. mysql> EXPLAIN SELECT `content_comment`.`id`, `content_comment`.`content_id`, `content_comment`.`author_id`, `content_comment`.`text`, `content_comment`.`typotext`, `content_comment`.`created`, `content_post`.`id`, `content_post`.`html_title`, `content_post`.`permalink`, `auth_user`.`id`, `auth_user`.`username`, `auth_user`.`first_name`, `auth_user`.`last_name`, `auth_user`.`avatar` FROM `content_comment` INNER JOIN `content_post` ON (`content_comment`.`content_id` = `content_post`.`id`) INNER JOIN `forum_topic` ON (`content_post`.`id` = `forum_topic`.`content_id`) LEFT OUTER JOIN `auth_user` ON (`content_comment`.`author_id` = `auth_user`.`id`) WHERE (`content_comment`.`deleted` IS NULL AND `forum_topic`.`id` IS NOT NULL) ORDER BY `content_comment`.`created` DESC LIMIT 15;
  13. +----+-------------+-----------------+------------+--------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-----------------------------+---------+--------------------------------+------+----------+--------------------------+
  14. | id | select_type | table | partitions | type | possible_keys | key | key_len | ref | rows | filtered | Extra |
  15. +----+-------------+-----------------+------------+--------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-----------------------------+---------+--------------------------------+------+----------+--------------------------+
  16. | 1 | SIMPLE | content_comment | NULL | index | content_comment_cc8ff3c,content_comment_deleted,ix_approved_deleted_content_id,ix_approved_deleted,ix_deleted_author_id,ix_content_author_approved,deleted,idx_deleted_total_votes_created | ix_created | 5 | NULL | 70 | 50.00 | Using where |
  17. | 1 | SIMPLE | forum_topic | NULL | eq_ref | PRIMARY,forum_topic_content_id_uniq | forum_topic_content_id_uniq | 4 | dou.content_comment.content_id | 1 | 90.00 | Using where; Using index |
  18. | 1 | SIMPLE | content_post | NULL | eq_ref | PRIMARY | PRIMARY | 4 | dou.content_comment.content_id | 1 | 100.00 | NULL |
  19. | 1 | SIMPLE | auth_user | NULL | eq_ref | PRIMARY | PRIMARY | 4 | dou.content_comment.author_id | 1 | 100.00 | NULL |
  20. +----+-------------+-----------------+------------+--------+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-----------------------------+---------+--------------------------------+------+----------+--------------------------+
  21. 4 rows in set, 1 warning (0,00 sec)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement