Guest User

Untitled

a guest
Jan 21st, 2018
297
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.57 KB | None | 0 0
  1. mysql> explain SELECT sub.id, sub.oid AS oid, COUNT(sr.host) AS copies
  2. -> FROM (
  3. -> SELECT id, oid FROM storage_blobs
  4. -> WHERE id BETWEEN 0 AND 1256276
  5. -> ) AS sub
  6. -> LEFT JOIN (
  7. -> SELECT fs.host, fs.non_voting, sr.storage_blob_id
  8. -> FROM storage_replicas AS sr
  9. -> INNER JOIN storage_file_servers fs
  10. -> ON sr.host = fs.host AND fs.non_voting = 1 AND fs.online = 1
  11. -> ) AS sr
  12. -> ON sub.id = sr.storage_blob_id
  13. -> GROUP BY sub.id
  14. -> HAVING copies != 1
  15. -> ORDER BY id
  16. -> LIMIT 5000
  17. -> ;
  18. +----+-------------+---------------+------------+--------+----------------------------------------------------------+----------------+---------+--------------------------------------------------------------+------+----------+----------------------------------------------+
  19. | id | select_type | table | partitions | type | possible_keys | key | key_len | ref | rows | filtered | Extra |
  20. +----+-------------+---------------+------------+--------+----------------------------------------------------------+----------------+---------+--------------------------------------------------------------+------+----------+----------------------------------------------+
  21. | 1 | SIMPLE | storage_blobs | NULL | range | PRIMARY,index_storage_blobs_on_oid | PRIMARY | 4 | NULL | 6 | 100.00 | Using where; Using temporary; Using filesort |
  22. | 1 | SIMPLE | fs | NULL | ALL | index_storage_file_servers_on_host | NULL | NULL | NULL | 3 | 100.00 | Using where |
  23. | 1 | SIMPLE | sr | NULL | eq_ref | by_server_blob,index_storage_replicas_on_storage_blob_id | by_server_blob | 771 | github_enterprise.fs.host,github_enterprise.storage_blobs.id | 1 | 100.00 | Using index |
  24. +----+-------------+---------------+------------+--------+----------------------------------------------------------+----------------+---------+--------------------------------------------------------------+------+----------+----------------------------------------------+
  25. 3 rows in set, 1 warning (0.00 sec)
Add Comment
Please, Sign In to add comment