• Jerry Lai
  • NEWBIE
  • 0 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 3
    Replies
Hi, has anyone faced similar issue like mine before? What happened is that a few days ago I tried to deploy something new from sandbox... and it failed because a few classes in the production failed its test....but the things I have had these classes in production for at least 2 years...and I even succesfully deployed something on the 20th of april 2015....and now those classes failed all of a sudden...the weird thing is I have the same classes in sandbox (obviously) and they pass the tests fine....so I yeah I am just baffaled as to why would something like this happen...why is it happening...
Hi all, I know there are quite alot of disccusion on this matter but I still don't quite get it.

here I have a query

currentWeek = [SELECT CurrentWeek__c FROM Donation__c WHERE CurrentWeek__c != null LIMIT 1];

and its giving me this error message in the debug log
"Non-selective query against large object type (more than 100000 rows). 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)"

like others if I run this query obviously it will just return 1 record because in the query I specifically limited it to 1. but if I take the limit 1 out I get more than 100,000+ records returned so I guess this is the problem and it make sense that I am querying against a large object type that has more than 100,000+ rows.

So my real questions is how can I solve this? I have seen people saying filter it more which I did "WHERE CurrentWeek__c != null" but of course it still won't work and this left me with one more solution poeple posted it. "making a property an External ID" <-- I am not too sure as to what they meant. so yeah..anyone who has any idea please help !!

in the query
currentWeek is a string;
CurrentWeek__c is a formual text field in a custom object called Donation__c
Hi, has anyone faced similar issue like mine before? What happened is that a few days ago I tried to deploy something new from sandbox... and it failed because a few classes in the production failed its test....but the things I have had these classes in production for at least 2 years...and I even succesfully deployed something on the 20th of april 2015....and now those classes failed all of a sudden...the weird thing is I have the same classes in sandbox (obviously) and they pass the tests fine....so I yeah I am just baffaled as to why would something like this happen...why is it happening...
Hi all, I know there are quite alot of disccusion on this matter but I still don't quite get it.

here I have a query

currentWeek = [SELECT CurrentWeek__c FROM Donation__c WHERE CurrentWeek__c != null LIMIT 1];

and its giving me this error message in the debug log
"Non-selective query against large object type (more than 100000 rows). 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)"

like others if I run this query obviously it will just return 1 record because in the query I specifically limited it to 1. but if I take the limit 1 out I get more than 100,000+ records returned so I guess this is the problem and it make sense that I am querying against a large object type that has more than 100,000+ rows.

So my real questions is how can I solve this? I have seen people saying filter it more which I did "WHERE CurrentWeek__c != null" but of course it still won't work and this left me with one more solution poeple posted it. "making a property an External ID" <-- I am not too sure as to what they meant. so yeah..anyone who has any idea please help !!

in the query
currentWeek is a string;
CurrentWeek__c is a formual text field in a custom object called Donation__c