Commit

33fee6f

Checking whether a user has any audit log rows with if ($user->auditLogs()->count() > 0) forces MySQL to scan and count every matching index entry. Using $user->auditLogs()->exists() compiles down to SELECT EXISTS(... LIMIT 1) and stops scanning on the very first match.

commit 33fee6f