• Henry McGovern
  • NEWBIE
  • 0 Points
  • Member since 2013

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 2
    Replies

I just wanted to post this in case someone else runs into the same issue. We have a Flow on the Lead object that was generating warning messages about exceeding a query limit whenever we ran the Flow.  The email warning referenced a current record count which equaled the number of Lead records in the system, and since we have a similar Flow on the Opportunity object (which has over 100k records and no warning messages) it seemed like a specific issue with the Lead object.

 

Our flow was structured to have a Lead ID passed into the flow as a variable, and then a record lookup would query for the record associated with that Lead ID. Since this was pretty selective, we thought maybe the flow was triggering some custom code elsewhere that had a non-selective query.

 

After an extensive and fruitless search for the offending query, we decided to take the record count over 100k over the weekend to see what happened. Nothing broke, and at first the warning messages hung on the last record count before breaching 100k records. After a few hours the messages just went away. Salesforce did not indicate interest in treating this "false positive" as a bug, so I wanted to make folks aware so they don't loose sleep over their Lead object crashing over a flow. Of course, if you don't have "Send Apex Warning Emails" checked on your User record, then you'll never have to worry about this at all.

 

Here's the warning message:

 

Apex governor limit warning

 

Operation: /apex/HEA_Scheduling_Wizard

By user/organization: 005C0000003OomH/00D80000000czMn

Caused the following Apex resource warnings:

Approaching limit for non-selective query against large object type (more than 100000 rows). Current size is approximately 96592 rows. When the limit is reached, the query will fail. Consider an indexed filter or contact salesforce.com about custom indexing.
Even if a field is indexed a filter might still not be selective when:
1. The filter value includes null (for instance binding with a list that contains null)
2. Data skew exists whereby the number of matching rows is very large (for instance, filtering for a particular foreign key value that occurs many times)
null
Approaching limit for non-selective query against large object type (more than 100000 rows). Current size is approximately 96592 rows. When the limit is reached, the query will fail. Consider an indexed filter or contact salesforce.com about custom indexing.
Even if a field is indexed a filter might still not be selective when:
1. The filter value includes null (for instance binding with a list that contains null)
2. Data skew exists whereby the number of matching rows is very large (for instance, filtering for a particular foreign key value that occurs many times)
null

(these emails can be disabled from the user detail page for this user)

I just wanted to post this in case someone else runs into the same issue. We have a Flow on the Lead object that was generating warning messages about exceeding a query limit whenever we ran the Flow.  The email warning referenced a current record count which equaled the number of Lead records in the system, and since we have a similar Flow on the Opportunity object (which has over 100k records and no warning messages) it seemed like a specific issue with the Lead object.

 

Our flow was structured to have a Lead ID passed into the flow as a variable, and then a record lookup would query for the record associated with that Lead ID. Since this was pretty selective, we thought maybe the flow was triggering some custom code elsewhere that had a non-selective query.

 

After an extensive and fruitless search for the offending query, we decided to take the record count over 100k over the weekend to see what happened. Nothing broke, and at first the warning messages hung on the last record count before breaching 100k records. After a few hours the messages just went away. Salesforce did not indicate interest in treating this "false positive" as a bug, so I wanted to make folks aware so they don't loose sleep over their Lead object crashing over a flow. Of course, if you don't have "Send Apex Warning Emails" checked on your User record, then you'll never have to worry about this at all.

 

Here's the warning message:

 

Apex governor limit warning

 

Operation: /apex/HEA_Scheduling_Wizard

By user/organization: 005C0000003OomH/00D80000000czMn

Caused the following Apex resource warnings:

Approaching limit for non-selective query against large object type (more than 100000 rows). Current size is approximately 96592 rows. When the limit is reached, the query will fail. Consider an indexed filter or contact salesforce.com about custom indexing.
Even if a field is indexed a filter might still not be selective when:
1. The filter value includes null (for instance binding with a list that contains null)
2. Data skew exists whereby the number of matching rows is very large (for instance, filtering for a particular foreign key value that occurs many times)
null
Approaching limit for non-selective query against large object type (more than 100000 rows). Current size is approximately 96592 rows. When the limit is reached, the query will fail. Consider an indexed filter or contact salesforce.com about custom indexing.
Even if a field is indexed a filter might still not be selective when:
1. The filter value includes null (for instance binding with a list that contains null)
2. Data skew exists whereby the number of matching rows is very large (for instance, filtering for a particular foreign key value that occurs many times)
null

(these emails can be disabled from the user detail page for this user)