Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- mysql> explain SELECT sub.id, sub.oid AS oid, COUNT(sr.host) AS copies
- -> FROM (
- -> SELECT id, oid FROM storage_blobs
- -> WHERE id BETWEEN 0 AND 1256276
- -> ) AS sub
- -> LEFT JOIN (
- -> SELECT fs.host, fs.non_voting, sr.storage_blob_id
- -> FROM storage_replicas AS sr
- -> INNER JOIN storage_file_servers fs
- -> ON sr.host = fs.host AND fs.non_voting = 1 AND fs.online = 1
- -> ) AS sr
- -> ON sub.id = sr.storage_blob_id
- -> GROUP BY sub.id
- -> HAVING copies != 1
- -> ORDER BY id
- -> LIMIT 5000
- -> ;
- +----+-------------+---------------+------------+--------+----------------------------------------------------------+----------------+---------+--------------------------------------------------------------+------+----------+----------------------------------------------+
- | id | select_type | table | partitions | type | possible_keys | key | key_len | ref | rows | filtered | Extra |
- +----+-------------+---------------+------------+--------+----------------------------------------------------------+----------------+---------+--------------------------------------------------------------+------+----------+----------------------------------------------+
- | 1 | SIMPLE | storage_blobs | NULL | range | PRIMARY,index_storage_blobs_on_oid | PRIMARY | 4 | NULL | 6 | 100.00 | Using where; Using temporary; Using filesort |
- | 1 | SIMPLE | fs | NULL | ALL | index_storage_file_servers_on_host | NULL | NULL | NULL | 3 | 100.00 | Using where |
- | 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 |
- +----+-------------+---------------+------------+--------+----------------------------------------------------------+----------------+---------+--------------------------------------------------------------+------+----------+----------------------------------------------+
- 3 rows in set, 1 warning (0.00 sec)
Add Comment
Please, Sign In to add comment