use a single query to fetch alerts