As the JobSandbox table grows, the time taken to query the database for crashed jobs also grows and eventually causes timeouts meaning any crashed jobs are no longer loaded.

The query looks like this:
SELECT * FROM JOB_SANDBOX WHERE (FINISH_DATE_TIME IS NULL AND CANCEL_DATE_TIME IS NULL AND RUN_BY_INSTANCE_ID = ?) ORDER BY START_DATE_TIME ASC which doesn't give the database much to work with and results in most of the table's contents being scanned.

If I add statusId into the mix the query returns almost instantly. Does anyone see any potential problems if I remove the finishDateTime and cancelDateTime fields from the query and instead check for any of the following statuses:
SERVICE_PENDING
SERVICE_QUEUED
SERVICE_RUNNING

Thanks
Scott

HotWax Media
http://www.hotwaxmedia.com

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to