Fixes query performance of a scheduling check.