I am trying to understand more about "SOQL Query Performance" topic and I'm reading all the Salesforce docs.

I have a doubt when we have a WHERE clause with an AND condition.

The two docs on this topic are:

Make SOQL query selective

Query & Search Optimization Cheat Sheet

In the first document, we can read:

fieldExpression1 AND fieldExpression2 - shows 2 simple filters

but in the second one, there is a more detailed analysis of the AND condition and it is called composite filter.

Is the first document too shallow? Thanks

  • Nothing prevents both assessments from being correct. You do have two simple filters, and they make up a composite once joined by AND.
    – Adrian Larson
    Commented Apr 8, 2019 at 11:10

1 Answer 1


Is the first document too shallow?


First document states overall guidance on how to make SOQL query selective and provides few important points.

It also provides following materials to fully understand how standard and custom indexes are different, and how they're employed.

  • Working with very large SOQL queries
  • Webinar: Inside the Force.com Query Optimizer
  • Database Query & Search Optimization Cheat Sheet
  • Force.com Query Optimizer FAQ
  • Maximizing the performance of Force.com SOQL, reports and list views
  • Force.com SOQL Best Practices: nulls and formula fields
  • Force.com SOQL Performance Tips: LastModifiedDate vs SystemModStamp

You can see the 'Database Query & Search Optimization Cheat Sheet' is part of the first document those all the points in that pdf are not included.

  • I agree with you. The first document provides few important points but regarding the AND condition it provides different/wrong information. Isn't it? Thanks
    – vt89
    Commented Apr 5, 2019 at 10:26

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .