diff --git a/CHANGELOG b/CHANGELOG
index 80f404423c79add95f9d1246957053211c4d3cbf..ae0785c37f845535dab8ff9492a9e209ff9d925b 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -26,6 +26,7 @@ v 8.9.3 (unreleased)
   - Fix encrypted data backwards compatibility after upgrading attr_encrypted gem
   - Update mobile button icons to be more inline with typical UI paradigms
   - Fixes missing avatar on system notes. !4954
+  - Improve performance of obtaining the maximum access of a user in a project
 
 v 8.9.2
   - Fix visibility of snippets when searching.
diff --git a/app/models/member.rb b/app/models/member.rb
index c74a16367dbd9f0f8b27e071b6096ef8fceac8bf..57161397e2bc244bea742a65c070f88d1b82b473 100644
--- a/app/models/member.rb
+++ b/app/models/member.rb
@@ -32,6 +32,7 @@ class Member < ActiveRecord::Base
   scope :request, -> { where.not(requested_at: nil) }
   scope :non_request, -> { where(requested_at: nil) }
   scope :non_pending, -> { non_request.non_invite }
+  scope :has_access, -> { where('access_level > 0') }
 
   scope :guests, -> { where(access_level: GUEST) }
   scope :reporters, -> { where(access_level: REPORTER) }
diff --git a/app/models/project_team.rb b/app/models/project_team.rb
index 73e736820af25d81fcc2ba9b0eb65a3be44ea222..0865b979ce052cf6dc56e45db69e4e77f553199d 100644
--- a/app/models/project_team.rb
+++ b/app/models/project_team.rb
@@ -137,20 +137,10 @@ class ProjectTeam
   def max_member_access(user_id)
     access = []
 
-    project.members.non_request.each do |member|
-      if member.user_id == user_id
-        access << member.access_field if member.access_field
-        break
-      end
-    end
+    access += project.members.non_request.where(user_id: user_id).has_access.pluck(:access_level)
 
     if group
-      group.members.non_request.each do |member|
-        if member.user_id == user_id
-          access << member.access_field if member.access_field
-          break
-        end
-      end
+      access += group.members.non_request.where(user_id: user_id).has_access.pluck(:access_level)
     end
 
     if project.invited_groups.any? && project.allowed_to_share_with_group?