There should be no reason it needs to do that expensive SELECT. It adds about 4 seconds to each call in our prod environment which adds up to a lot.
Oops, this was the system releasing code path in update_dirty_job(), not provision_scheduled_recipe().
Also fixed this while I was in there (although it's unrelated):
Okay so there *is* the same problem in provision_scheduled_recipe() also, and that's because it is ultimately the same code system.enqueue_command() which was needlessly SELECT'ing out the commands before inserting. So the patch above fixes the same problem in both places.