Fix #349 Perfomance problems on large sites with user logins