Notification performance fixes
This changes two things:
- Change a nonsensical join that never worked so that it actually works
- Add an index for user_id sorted id, so that the planner won't even get the idea of joining over activities first.
This should improve performance overall and also prevent pathological cases of super slow notifications, which have been reported from time to time.