Salesforce Certified Platform Developer II Practice Questions

Salesforce Certified Platform Developer II exam preparation

Salesforce Certified Platform Developer II practice questions in English: 180 questions with explanations. The mock exam has 60 questions and 120 minutes.

Salesforce Certified Platform Developer II free question 9 / 10 · Domain 5: Performance

In an org with 3 million accounts, a developer writes a SOQL query that filters on an indexed field. Which statement about the selectivity threshold in the documentation is correct?

  1. A query is selective if it narrows the result to less than 1% of the total number of records
  2. 5% of the first million records and less than 10% of the records after that, up to 1,000,000
  3. 10% of the first million records and less than 5% of the records after that, up to 333,333
  4. Filtering on an indexed field is enough by itself to make the query selective
Show the answer and explanation

Answer: C

Why this is correct
The "More Efficient SOQL Queries" part of the Working with Very Large SOQL Queries page says a query is selective when one of the query filters is on an indexed field and the filter reduces the resulting number of rows below a system-defined threshold. The selectivity threshold is 10% of the first million records and less than 5% of the records after the first million records, up to a maximum of 333,333 records. In some circumstances, for example with a query filter that is an indexed standard field, the threshold can be higher, and the threshold is subject to change.

Why the other options are wrong
"A query is selective if it narrows the result to less than 1% of the total number of records" … The threshold is 10% of the first million records and less than 5% of the records after that, up to a maximum of 333,333 records.
"5% of the first million records and less than 10% of the records after that, up to 1,000,000" … The percentages are the other way around: 10% applies to the first million records and less than 5% to the records after it, with a maximum of 333,333.
"Filtering on an indexed field is enough by itself to make the query selective" … The page says a query is selective when a filter is on an indexed field and the filter reduces the number of rows below the threshold. Both conditions are needed.

Two or more filters
The page says the performance of the SOQL query improves when two or more filters used in the WHERE clause meet these conditions. It stresses selective queries particularly inside triggers.

Go to the Salesforce Certified Platform Developer II practice app (10 free questions; purchase unlocks all questions)

See the full practice set