[IMPROVED] Optimized IDLE Worker Query

Fixes #811
Merge pull request #820 from TheSerapher/issue-811

[IMPROVED] Optimized IDLE Worker Query