function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Mr. KarateMr. Karate 

SOQL query time out for Task table

I'm trying to run this query below, but the query times out if the date is further in the past than two days.  Could there be a problem with the table not indexing the column lastmodifieddate?  Is there an optimal query variant or a way to break up this query into smaller batches?  Our task table is very big fyi.

 

select id from task where lastmodifieddate > 2013-09-20T09:00:00-0700 and lastmodifieddate < 2013-09-20T10:00:00-0700 order by id limit 10

 

Thank you!