Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- EXPLAIN
- SELECT
- posts.*
- FROM
- posts
- INNER JOIN categories ON posts.category_id = categories.id
- AND categories.main = 1
- AND(categories.private_category = 0
- OR categories.private_category IS NULL)
- WHERE
- posts.id NOT IN('')
- AND posts.deleted = 0
- AND posts.hidden = 0
- AND posts.total_points >= - 5
- ORDER BY
- posts.id DESC
- LIMIT 25;
- | id | select_type | table | partitions | type | possible_keys | key | key_len | ref | rows | filtered | Extra |
- |----|-------------|-------------|------------|------|------------------------------------------------------------------------------------------------------------------------------------------------------------------|-----------------------------|---------|-------------------------------|-------|----------|----------------------------------------------|
- | 1 | SIMPLE | categories | | ALL | PRIMARY,index_categories_on_private_category | | | | 12 | 10.00 | Using where; Using temporary; Using filesort |
- | 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 |
- | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra |
- |----|-------------|-------------|--------|------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------|---------|-----------------------------------|-------|-------------|
- | 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 |
- | 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