1. Salesforce Architect Documentation
Architect's Guide to Large Data Volumes:
For C (Selective Criteria): The guide states
"The single most important thing you can do to improve the performance of a SOQL query is to make sure that it is selective." It emphasizes using indexed fields in the WHERE clause. (See section: "Make SOQL Selective").
For D (Sharing Restrictions): The guide explains
"Sharing calculations can be costly... When a query is executed
the platform checks the sharing table... For a user who can see a small subset of the data
this check can be time-consuming." It recommends strategies like using a user with "View All Data" to bypass these checks for integrations. (See section: "Sharing").
2. Salesforce Developer Documentation
SOQL and SOSL Reference:
For C (Selective Criteria): The "Query & Search Optimization Cheat Sheet" details how the Force.com query optimizer uses indexes on fields in WHERE clauses to run queries efficiently. It defines a selective query as one that filters on an indexed field. (See section: "The Force.com Query Optimizer").
3. Salesforce Developer Documentation
Apex Developer Guide:
For C (Selective Criteria): The guide notes
"For best performance
SOQL queries must be selective... To avoid long execution times
the system terminates non-selective SOQL queries." (See Chapter 3
"Database & .NET Concepts
" section: "Working with Very Large SOQL Queries").
For D (Sharing Restrictions): The guide explains the use of with sharing and without sharing keywords
which control the enforcement of sharing rules. Using without sharing can improve performance by not evaluating the organization's sharing model for the current user. (See Chapter 2
"Classes
" section: "Using the with sharing
without sharing
and inherited sharing Keywords").