PERF: Keep track of first unread PM and first unread group PM for user. (PR #10586)

This optimization helps to filter away topics so that the joins on related tables when querying for unread messages is not expensive.

GitHub

Very nice. Clean and easy to follow.

Thank you for reviewing @eviltrout :+1: