Let nextJobDB.php narrow down the type based on a set.

* This can avoid slower for loops in jobs-loop.sh.

Change-Id: I4d686400dcb83a3c64c14a01100ad6b451542f05
Merge "Let nextJobDB.php narrow down the type based on a set."