Salesforce Certified Data Architect — Question 28
The data architect for Universal Containers has written a SOQL query that will return all records from the Task object that do not have a value in the whatID field:
SELECT ID, Description, subject FROM Task WHERE WhatID != NULL
When the data architect uses the query to select values for a process, a time-out error occurs.
What does the data architect need to change to make this query more performant?
Answer options
- A. Change the WHERE clause to filter by a deterministic defined value.
- B. Change query to SOSL.
- C. Remove description from the requested field set.
- D. Add LIMIT 100 to the query.
Correct answer: C
Explanation
The correct answer is C because removing unnecessary fields like Description can reduce the amount of data processed, improving query performance. The other options either do not directly address the performance issue or are not relevant to the specific problem at hand.