SF-PD2 Performance Practice Question
Exhibit
SELECT Name, Account.Name FROM Contact WHERE Account.Industry = 'Technology'
Refer to the exhibit. The query is performing poorly on an object with 5 million records. What is the most likely cause, and how should it be addressed?
⚠ Common exam trap
Candidates often blame poor SOQL performance on general data volume alone, failing to recognize that filtering across unindexed relationship fields triggers full table scans.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
Filtering on a related object field is causing a full table scan.
The query filters on a related object field, which can lead to inefficient joins if the field is not indexed. In Salesforce, filtering on fields from related objects often bypasses standard indexes. To optimize this, the developer should consider denormalizing data or ensuring the cross-object relationship filter is supported by an index to avoid full table scans that degrade performance significantly.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
The query is selecting too many fields and should use SELECT *.
Why it's wrong here
Salesforce does not support the use of SELECT * in SOQL queries. Developers must explicitly define the fields they need. Furthermore, selecting more fields does not generally cause performance degradation compared to the filter criteria, which is the primary driver for high query execution time.
- ✓
Filtering on a related object field is causing a full table scan.
Why this is correct
Filtering on fields of related objects can cause the query optimizer to perform a full scan if the relationship is not appropriately indexed. This results in slow execution times as the engine checks millions of records to determine which meet the 'Technology' industry criteria on the parent.
- ✗
The batch size is too small, causing excessive API calls.
Why it's wrong here
Batch size affects data transmission, not the internal query execution performance on the Salesforce servers. Even if the batch size were adjusted, the underlying issue of an unindexed filter condition on a related record remains, meaning the database would still take the same time to resolve.
- ✗
The query needs to be converted into a subquery using a nested SELECT.
Why it's wrong here
Using a subquery might change the data structure of the results but does not inherently optimize the filter performance. The primary bottleneck is the search condition on the parent object, which needs to be indexed regardless of whether the query uses joins or nested subqueries.
About these practice questions
Courseiva writes every SF-PD2 question from scratch — 226 in total, each with an explanation and a wrong-answer breakdown. None are copied from real exams or dumps. Learn why practice questions differ from exam dumps →
JA
Written and reviewed by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
Last reviewed September 2026 · checked against the official Salesforce exam blueprint
This SF-PD2 practice question is part of Courseiva's free Salesforce certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the SF-PD2 exam.