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
Gears CRM 9Gears CRM 9 

Production Performace Issue Batch Query Timing out

We are experiencing performance issues with a custom object called first_invoices__c. The object has approximately 190,000 records however we are unable to query the object. From the back end we attempt to execute the following and we hit a 2 minute time out.

select id from first_invoices__c
limit 1

We also tried the following based on a recommendation with no improvement

select id from first_invoices__c
order by id
limit 1

We are also experience issues from the front end ...... at whatever color here...

NOTE: As part of an integration project, this object is completely purged and reloaded on a nightly basis.
PratikPratik (Salesforce Developers) 

Will you please try to add some condition using Where clause in query and let us know if it's still giving issue.

Sean FieldingSean Fielding
When we queried by id, we were also getting a time out?
The goal is to delete all the data, what type of where condition are you suggesting?  I can add someting like name != 'junk' which appears to run faster.  However, not sure why that would run faster that a query with no filters.