SF-PD2 Performance Practice Question
Which THREE factors contribute to slow execution of SOQL queries in Salesforce?
⚠ Common exam trap
Candidates often forget that OR conditions and leading wildcards in SOQL filters can invalidate existing indexes, forcing the database to perform a full table scan, killing performance.
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
✓
Querying on unindexed fields with high cardinality.
SOQL performance is influenced by data volume, indexing, and query complexity. Queries on unindexed fields, excessive record scanning, and sub-optimal joins all force the database to work harder, increasing CPU time and latency. Understanding these factors allows developers to write more efficient queries that leverage existing indexes and minimize the amount of data the system must process to return results.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Using indexed fields in the WHERE clause.
Why it's wrong here
Using indexed fields actually improves SOQL performance. It allows the database to locate records directly rather than scanning the entire table. Therefore, this is a best practice, not a factor that contributes to slow query execution. Developers should always aim to have their primary filter fields indexed.
- ✓
Querying on unindexed fields with high cardinality.
Why this is correct
Unindexed fields force a full table scan. In objects with millions of records, this is extremely slow. When the field also has high cardinality, the query optimizer cannot easily narrow down the results, leading to significant delays as the engine parses every single record in the object table.
- ✓
Using OR conditions that bypass existing indexes.
Why this is correct
Complex OR conditions often cause the query optimizer to abandon index usage. If the optimizer decides that a full scan is more efficient than merging multiple index lookups, the query performance will degrade significantly. This is a common performance pitfall when building complex filter logic in SOQL queries.
- ✗
Selecting a small number of fields from the object.
Why it's wrong here
Selecting fewer fields is a best practice. It reduces the payload size and the memory required to store the results. This action does not contribute to slow execution; rather, it helps the query perform better by reducing the overall amount of data the platform must transfer and process.
- ✓
Deeply nested relationship queries across many levels.
Why this is correct
Deeply nested SOQL queries require multiple joins, which increases the execution time. Each level of relationship adds complexity to the query processing, making it harder for the optimizer to execute the query efficiently. This can lead to timeouts and performance degradation, especially with large datasets.
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.