Performance optimization for session status query.