Advertisement
Guest User

Untitled

a guest
Jun 16th, 2019
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.91 KB | None | 0 0
  1. EXPLAIN
  2. SELECT
  3. posts.*
  4. FROM
  5. posts
  6. INNER JOIN categories ON posts.category_id = categories.id
  7. AND categories.main = 1
  8. AND(categories.private_category = 0
  9. OR categories.private_category IS NULL)
  10. WHERE
  11. posts.id NOT IN('')
  12. AND posts.deleted = 0
  13. AND posts.hidden = 0
  14. AND posts.total_points >= - 5
  15. ORDER BY
  16. posts.id DESC
  17. LIMIT 25;
  18.  
  19. | id | select_type | table | partitions | type | possible_keys | key | key_len | ref | rows | filtered | Extra |
  20. |----|-------------|-------------|------------|------|------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------|---------|-------------------------------|-------|----------|----------------------------------------------|
  21. | 1 | SIMPLE | categories | | ALL | PRIMARY,index_categories_on_private_category | | | | 12 | 10.00 | Using where; Using temporary; Using filesort |
  22. | 1 | SIMPLE | posts | | ref | PRIMARY,index_posts_on_category_id,index_posts_on_deleted_and_hidden_and_user_id_and_created_at,index_posts_deleted,index_posts_hidden,index_posts_total_points | index_posts_on_category_id | 5 | mydb.categories.id | 37516 | 12.50 | Using index condition; Using where |
  23.  
  24. | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
  25. |----|-------------|-------------|--------|------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------|---------|-----------------------------------|-------|-------------|
  26. | 1 | SIMPLE | posts | range | PRIMARY,index_posts_on_category_id,index_posts_on_deleted_and_hidden_and_user_id_and_created_at,index_posts_deleted,index_posts_hidden,index_posts_total_points | PRIMARY | 4 | | 37516 | Using where |
  27. | 1 | SIMPLE | categories | eq_ref | PRIMARY,index_categories_on_private_category,index_categories_on_main | PRIMARY | 4 | mydb.posts.category_id | 12 | Using where |
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement