SF-Data-Arch Large Data Volume Considerations Practice Question
A Salesforce org has a custom object Case_Comment__c with 5 million records. The object has a lookup to Case. Users frequently run SOQL queries that filter by CaseId and OrderBy CreatedDate. The queries are slow. What should be done to improve performance?
⚠ Common exam trap
The trap here is assuming that indexing only the sort field or using a formula field will help, but the filter field must also be indexed, and composite indexes are key for combined filter-sort queries.
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
✓
Create a composite custom index on CaseId and CreatedDate.
When queries filter on one field and sort by another, a composite index covering both fields allows the database to use the index for both operations, avoiding expensive sorting and full scans. This is the most effective optimization for the given query pattern.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Create a separate custom index on CreatedDate only.
Why it's wrong here
Indexing only CreatedDate does not optimize filtering by CaseId, which is the primary filter. The query would still need to scan many records to find those matching CaseId, and the index on CreatedDate alone may not be used effectively for the combined filter and sort.
- ✗
Use a formula field to combine CaseId and CreatedDate.
Why it's wrong here
Formula fields are not indexed and cannot be used to improve query performance. They are calculated at runtime, so filtering and sorting on a formula field would still require a full scan, making it ineffective for large data volumes.
- ✓
Create a composite custom index on CaseId and CreatedDate.
Why this is correct
A composite index on both the filter field (CaseId) and the sort field (CreatedDate) allows the database to efficiently satisfy the query's WHERE and ORDER BY clauses. This reduces the need for sorting and scanning, significantly improving performance for large data volumes.
- ✗
Enable skinny table for Case_Comment__c.
Why it's wrong here
Skinny tables can improve read performance but are not the first step for optimizing a specific query pattern. They require Salesforce support and may not include all fields, and they do not replace the need for proper indexing on frequently queried fields.
About these practice questions
One of 222 original SF-Data-Arch practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. 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-Data-Arch 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-Data-Arch exam.