inefficient query to find out all the people to send notifications to given a triggered event