summaryrefslogtreecommitdiff
path: root/app/helpers/snippets_helper.rb
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2017-09-16 23:25:34 -0700
committerStan Hu <stanhu@gmail.com>2017-09-18 06:53:33 -0700
commit8690ca5c2857da39c8f5839b9383931ee026f559 (patch)
tree287b8d1dab66e00c0094027510bbbae4f10423ae /app/helpers/snippets_helper.rb
parenta70c76df8fd746e5a83b305acbbc1c260955e332 (diff)
downloadgitlab-ce-sh-optimize-discussion-json.tar.gz
Eliminate N+1 queries in loading discussions.json endpointsh-optimize-discussion-json
In #37955,we see that the profile had a number of N+1 queries from repeated access to `cross_reference_not_visible_for?`. This was optimized in previous versions of GitLab by rendering all notes at once, counting the number of visible references, and then using that number to check whether a system note should be fully redacted. There was also another N+1 query calling `ProjectTeam#member?`, which did not take advantage of an optimization in prepare_notes_for_rendering that would preload the maximum access level per project. Closes #37955
Diffstat (limited to 'app/helpers/snippets_helper.rb')
0 files changed, 0 insertions, 0 deletions