CC-5932: Update is_scheduled query is too slow

Forgot to remove some debugging statements
Merge branch '2.5.x' into saas