Ref T2450. File blame tends to have the same commit a lot of times, and we don't do lookups like this efficiently right now.
In particular, for a file like __phutil_library_map__.php, we would issue a query with ~9,000 clauses like this:
(repositoryID = 1 AND commitIdentifier LIKE "XYZ%")
...but only a few hundred of those identifiers were unique. Instead, issue only one clause per unique identifier.
MySQL also seems to do a little better on "commitIdentifier = X" if we have the full hash, so special case that slightly.