In SQL,
WHERE user_id NOT IN (SELECT owner_id FROM blocked_accounts) silently returns zero rows if even one row in blocked_accounts has a NULL owner_id. Writing it with NOT EXISTS avoids that three-valued logic trap completely and gives Postgres a cleaner hash anti-join plan.commit becfdb8