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
frederic baudaxfrederic baudax 

Non-selective Query Error after winter 11 release

Hope someone can give me an idea to get around this,

 

Just after our instance was upgraded to winter 11 we reached the 100.000 accounts mark, we have a deduplication trigger/class that merge duplicates from prospects inserted trough imports. As obviously i started getting the limit error I’ve been looking trough the boards. Based on my readings I’ve created a new fields, trough workflow it gets populated with the recordtypid (external id to get it indexed) and changed the query to only inspect that part of our records. That made the trick and all went well but today when trying to deploy a new Class all of a sudden I’m getting that error again on the same triggers and for the same query.

 

 

SELECT *fields*  FROM Account where Status__c = 'Prospect' AND Isdeleted = false AND VAT__c != NULL AND recordtypeid__c = '012200000008qQz' AND createddate > :bypass AND VAT__c IN :VATnrs LIMIT :intLimit

 

 

Status__c is a picklist (thus supposed to be indexed by default) and both recordtypeid__c and VAT__c are external id fields. As you can see i'm already stripping out the NULL values and I’ve even tried to get around it by taking a timeframe of only a couple of months but it still fails.

 

Anyone experienced something similar and found out how to fix it ?

 

Thanks in advance for any help.

Kr,

Fred