Skip to content

Don't reload ActiveRecord objects when building note URLs

username-removed-443319 requested to merge fix-n-plus-one-in-url-builder into master

What does this MR do?

Avoid reloading AR objects when building note URLs, which we do for every note that wasn't authored by you (to show the report abuse button).

Are there points in the code the reviewer needs to double check?

Don't think so.

Why was this MR needed?

This isn't N+1 in SQL, because of the query cache, but there's still a lot of time spent building AR objects.

Does this MR meet the acceptance criteria?

What are the relevant issue numbers?

Closes https://gitlab.com/gitlab-org/gitlab-ce/issues/34882.

Merge request reports