diff options
author | Stan Hu <stanhu@gmail.com> | 2019-03-03 23:33:20 -0800 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2019-03-03 23:40:43 -0800 |
commit | d13fcca2acc01d1fbbf6240d694fbf1bb69b073e (patch) | |
tree | 36847d53d869571d62b2735c4b5354adaa47ed0d /db | |
parent | 615c14b28990489d99371b7ffdb57fe54d463e64 (diff) | |
download | gitlab-ce-sh-optimize-last-commit-sha.tar.gz |
Optimize MergeRequestDiff#last_commit_shash-optimize-last-commit-sha
The previous implementation would load all the MergeRequestDiffCommit
entries into memory and retrieve the SHA from the latest entry. We can
save a bit of query time and memory by retrieving the SHA directly from
the first item from the database. This is particularly helpful when
there are many merge requests that need this information.
Seen while investigating Todo API performance in
https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/25711.
Diffstat (limited to 'db')
0 files changed, 0 insertions, 0 deletions