The old query would diff the wait period from all records in the database, then find ones that needed reindexing. The new query limits the check to only recent diffs
after figuring out how to get around hsqldb error go back to pure SQL dates
Merge pull request #1217 from ORCID/improveWaitPeroidQuery

The old query would diff the wait period from all records in the databas...