-
Add index for merge_requests.merge_commit_sha · abcfdd5cYorick Peterse authored
This is a composite index on (target_project_id, merge_commit_sha, id) that allows queries such as the following to use a full backwards index scan: SELECT "merge_requests".* FROM "merge_requests" WHERE "merge_requests"."deleted_at" IS NULL AND "merge_requests"."target_project_id" = 13083 AND "merge_requests"."merge_commit_sha" = 'e80a893f' ORDER BY "merge_requests"."id" DESC LIMIT 1; Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/38507
×