Bug 1032192 - Improve query performance for alert cache refresh; using n + 1 selects