Need to test out different grouping strategies for a matching process I'm building. Problem is there are too many records to query the data for a count(). In dev console I get a 'communication failure: No response from the server' message. And in workbench I get the future_get-9-1588268637 error.


SELECT count() 
FROM data__c 
WHERE date__c >= 2020-02-01 AND 
      date__c <= 2020-02-28 AND
      data2__r.program__c LIKE '%test%'

I know there are people who have to work with millions of records.. how come it's so difficult to work with a few hundred thousand? Any suggestions

Thank you

  • Why are you using data.prgoram__c instead of prgoram__c? Or is the field name actually Program__c? – Adrian Larson Apr 30 '20 at 18:07
  • The issue here is likely you are using a none selective query. The fields you are using may not be indexed and that like operator is very expensive while querying. – manjit5190 Apr 30 '20 at 18:09
  • @AdrianLarson not the actual field names ^ just sample. – T. Young Apr 30 '20 at 18:10
  • Try to set the prgoram__c (or whichever field it is) as ExternalId to force Salesforce to index it. (I'm afraid that to index date fields you will have to get in contact with support) – Sergio Alcocer Apr 30 '20 at 18:11
  • @SergioAlcocer I'll give that a shot. Does setting as ExternalId create any conflict with processes that reference its Salesforce Id? – T. Young Apr 30 '20 at 18:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.