The only optimization I can think of for this would be to change the queryset to prefetch the preference objects, but that would only have the benefit of warming any relevant caches and could be an overall loss, since it would fetch preferences related to all users (as opposed to just those in the requested page).