Optimized urgency rank query