0

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.

QUERY FOR BATCH

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

6
  • Why are you using data.prgoram__c instead of prgoram__c? Or is the field name actually Program__c?
    – Adrian Larson
    Apr 30, 2020 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, 2020 at 18:09
  • @AdrianLarson not the actual field names ^ just sample.
    – T. Young
    Apr 30, 2020 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) Apr 30, 2020 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, 2020 at 18:19

0

You must log in to answer this question.

Browse other questions tagged .