This looks fishy. The two queries are not equivalent. `c.session_id` will never be `NULL`.

In the old query `s.session_id` will be `NULL` if and only if there is a session in `c` but not `s` (due to LEFT JOIN), i.e. you detect records in `c` that no longer have a session.