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
dfcdfc 

Are Foreign Key Columns Automatically Indexed?

Question for an SFDC resource or other expert:

 

(1) Are master-detail foreign key columns automatically indexed?

(2) Are lookup foreign key columns automatically indexed?

 

In order to build "selective" queries that do not bump up against the infamous "Non-selective query against large object type (more than 100000 rows).... " you seem to need to create not only a good, tight where clause, but you must use indexed columns in the where clause.  Thus my two questions above.

 

Thanks!

 

Dave

 

hisrinuhisrinu

Even we too have the same issue........... and when we use lookup/master-detail fields in where clause, query works in a better way.

 

It would be great if salesforce moderators can confirm whether these fields are indexed or not.

 

 

DFC, As of my knowledge these fields are indexed.

dfcdfc

Could a Salesforce resource please respond?

 

Thanks!

 

Dave