Details
Details
- Reviewers
amckinley - Commits
- rPd1b4c9f50b99: Add a missing key on DrydockLease
Viewed Drydock lease page to get the query.
Ran explain SELECT * FROM `drydock_lease` WHERE (status IN ('pending', 'acquired', 'active')) ORDER BY `id` DESC LIMIT 101; before and after the change.
I don't have a ton of leases locally so the un-key'd EXPLAIN isn't that bad, but still shows that we're getting a better key. Before:
mysql> explain SELECT * FROM `drydock_lease` WHERE (status IN ('pending', 'acquired', 'active')) ORDER BY `id` DESC LIMIT 101; +----+-------------+---------------+-------+---------------+---------+---------+------+------+-------------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +----+-------------+---------------+-------+---------------+---------+---------+------+------+-------------+ | 1 | SIMPLE | drydock_lease | index | NULL | PRIMARY | 4 | NULL | 101 | Using where | +----+-------------+---------------+-------+---------------+---------+---------+------+------+-------------+ 1 row in set (0.00 sec)
After:
mysql> explain SELECT * FROM `drydock_lease` WHERE (status IN ('pending', 'acquired', 'active')) ORDER BY `id` DESC LIMIT 101; +----+-------------+---------------+-------+---------------+------------+---------+------+------+---------------------------------------+ | id | select_type | table | type | possible_keys | key | key_len | ref | rows | Extra | +----+-------------+---------------+-------+---------------+------------+---------+------+------+---------------------------------------+ | 1 | SIMPLE | drydock_lease | range | key_status | key_status | 130 | NULL | 5 | Using index condition; Using filesort | +----+-------------+---------------+-------+---------------+------------+---------+------+------+---------------------------------------+ 1 row in set (0.00 sec)
Diff Detail
Diff Detail
- Repository
- rP Phabricator
- Branch
- key4
- Lint
Lint Passed - Unit
Tests Passed - Build Status
Buildable 18747 Build 25262: Run Core Tests Build 25261: arc lint + arc unit