diff options
author | Phil Hughes <me@iamphill.com> | 2017-02-15 10:42:54 +0000 |
---|---|---|
committer | Phil Hughes <me@iamphill.com> | 2017-02-16 08:47:48 +0000 |
commit | 2a60f4dea86c9aa052d88de9c772e91750885a9a (patch) | |
tree | 031dd225b517fc766bf3d34f2b0404570082a40e /app/views/search | |
parent | 6038355f9e802f5078e19d31166e2c05b7b21af1 (diff) | |
download | gitlab-ce-2a60f4dea86c9aa052d88de9c772e91750885a9a.tar.gz |
Reduce query count for snippet searchsnippets-search-performance
Recudes the number of queries within the snippet search from approx. 50
to approx. 14 by preloading the authors
Part of #27392
Diffstat (limited to 'app/views/search')
-rw-r--r-- | app/views/search/results/_snippet_blob.html.haml | 2 | ||||
-rw-r--r-- | app/views/search/results/_snippet_title.html.haml | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/app/views/search/results/_snippet_blob.html.haml b/app/views/search/results/_snippet_blob.html.haml index f7808ea6aff..e977c1f1698 100644 --- a/app/views/search/results/_snippet_blob.html.haml +++ b/app/views/search/results/_snippet_blob.html.haml @@ -7,7 +7,7 @@ = snippet.title by = link_to user_snippets_path(snippet.author) do - = image_tag avatar_icon(snippet.author_email), class: "avatar avatar-inline s16", alt: '' + = image_tag avatar_icon(snippet.author), class: "avatar avatar-inline s16", alt: '' = snippet.author_name %span.light= time_ago_with_tooltip(snippet.created_at) %h4.snippet-title diff --git a/app/views/search/results/_snippet_title.html.haml b/app/views/search/results/_snippet_title.html.haml index 704d1d01a81..026f404ce07 100644 --- a/app/views/search/results/_snippet_title.html.haml +++ b/app/views/search/results/_snippet_title.html.haml @@ -18,6 +18,6 @@ %span by = link_to user_snippets_path(snippet_title.author) do - = image_tag avatar_icon(snippet_title.author_email), class: "avatar avatar-inline s16", alt: '' + = image_tag avatar_icon(snippet_title.author), class: "avatar avatar-inline s16", alt: '' = snippet_title.author_name %span.light= time_ago_with_tooltip(snippet_title.created_at) |