+ Start a Discussion
Nathan WilliamsNathan Williams 

Column Indexing Availability

It appears that column indexing is only available to customers with premier support.  I was redirected to the developer forums by salesforce support, which makes no sense since developers cannot index a column for me.  Any workarounds people have found?  My use-case is that I need to query our leads table, which contains >700k records (too many for a simple query) and cannot get a query to flag as selective without a custom column index... 
Hi Nathan,

Please share your query and provide following details:

1) Are you indexing custom or standard field?

2) How many fields for the object are marked as external, has the limit been reached for maximum number of external field allowed on particular object.
AmitAmit (Salesforce Developers) 

Please refer below links for more information

http://help.salesforce.com/apex/HTViewSolution?id=000181277&language=en_US  https://www.salesforce.com/us/developer/docs/apexcode/Content/langCon_apex_SOQL_VLSQ.htm http://www.salesforce.com/docs/en/cce/ldv_deployments/salesforce_large_data_volumes_bp.pdf http://help.salesforce.com/help/pdfs/en/salesforce_query_search_optimization_developer_cheatsheet.pdf
Nathan WilliamsNathan Williams
Thanks for the responses.

My use case is as follows: our marketing team wants to focus on a certain subset of our leads, and in order to identify those, I've created a domains table, which is tied with accounts.  I tell my system that @mydomain.com is a domain of account "My Company" and I want it to then go search through the leads database to find all the @cisco.com leads and mark them as "marketing target".  To help this query be more selective, I've created a new field for domain on the lead and a workflow rule that populates just "@mydomain.com" in that field from the email field of "bob@mydomain.com".  My query is then an after-insert trigger which, after I add "@mydomain.com" to the domain table, it goes and queries "[SELECT Id FROM Lead WHERE Domain__c IN :domainList]" where domainList is simply a List<String> of all the new domains... 


1. It is querying a custom field on a standard object [Lead.Domain__c]
2. I can't mark it as external since it is not unique... many leads may exist for the same company/domain -- My thought here is that I could make it another field as an external id based on a workflow rule of "Id & Domain__c" but then my query would have to be "LIKE %..." which is not efficient/selective...


Ok, in that case I would suggest you to add one more filter in the query like createdDate or LastModified date.
Nathan WilliamsNathan Williams
Hi Vinita,

Will I need to restrict CreatedDate or LastModifiedDate to a recent timeframe?  If so, that does not work for my requirements.  I need to query the entire table to find every lead that happens to match the domain I'm looking for, regardless of when it was created or modified...