Welcome to ExamTopics
ExamTopics Logo
- Expert Verified, Online, Free.
exam questions

Exam Certified Data Architect All Questions

View all questions & answers for the Certified Data Architect exam

Exam Certified Data Architect topic 1 question 12 discussion

Actual exam question from Salesforce's Certified Data Architect
Question #: 12
Topic #: 1
[All Certified Data Architect Questions]

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?

  • 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.
Show Suggested Answer Hide Answer
Suggested Answer: C 🗳️

Comments

Chosen Answer:
This is a voting comment (?) , you can switch to a simple comment.
Switch to a voting comment New
BoicottMx7
3 weeks, 2 days ago
Selected Answer: A
The question mentions that it should return all records that do NOT have a value in the WhatId field and the conditions that the architect wrote in the query will search for all records that the WhatId field is different from null. Therefore it is option A.
upvoted 1 times
...
92b6348
2 months, 2 weeks ago
Shouldn’t it be D , Time-out error: A time-out error typically indicates that the query is taking too long to execute. This can happen when querying large datasets or performing complex calculations.Where conditions improve performance but doesn’t throw errors, right ?
upvoted 1 times
...
lizbette
6 months, 2 weeks ago
Selected Answer: C
Answer has to be C. Remember the purpose of the question. Wants ALL records that DON'T have a value in WhatID. D is wrong, because that limits the results to only 100 records, and there might be more. B is wrong, we need SOQL. A is wrong IN THIS case, because we already have a deterministic WHERE clause. We want records where WHATID is not null. C makes sense because if we want to increase performance, get rid of stuff we don't care about. The purpose of the query is to pull not null What IDs, so we don't care about the long text description.
upvoted 1 times
...
6967185
7 months, 2 weeks ago
Answer is A. See https://help.salesforce.com/s/articleView?id=000385213&type=1 to explain how to mitigate query limitation one must add "selective criteria" into the SOQL query. For example, "The performance of the SOQL query improves when two or more filters used in the WHERE clause meet the mentioned conditions."
upvoted 3 times
lizbette
6 months, 2 weeks ago
the query is already selective. can't make it more selective than that. however, we can get rid of unwanted fields, like the description.
upvoted 1 times
dsousa98
3 months, 2 weeks ago
You cannot be sure if the query is selective or not because it depends on the ORGs table scan. If you run the Query Plan on diff orgs you have different relative costs (<1 is selective).
upvoted 1 times
...
...
...
LarsXYZ
9 months, 1 week ago
Here are some examples of deterministic defined values that could be used to filter the query: A specific task ID The current date The ID of the current user By filtering the query to retrieve a smaller number of records, the data architect can significantly improve its performance and avoid timeout errors.
upvoted 1 times
lizbette
6 months, 2 weeks ago
but then that wouldn't get us what the architect wants, which is all tasks that do not have a whatID value.
upvoted 1 times
...
...
Pheebs23
10 months, 4 weeks ago
Selected Answer: C
I think it is C. As we are looking for records that have WhatID as blank, I don't see how we can have a more "deterministic defined value" as a criteria. D option limits to 100 and therefore doesn't return everything either.
upvoted 1 times
...
tobicky
11 months, 3 weeks ago
Selected Answer: A
A. Change the WHERE clause to filter by a deterministic defined value: This is a good practice. The query should be selective, meaning one of the query filters is on an indexed field and the query filter reduces the resulting number of rows below a system-defined threshold
upvoted 3 times
lizbette
6 months, 2 weeks ago
this is normally a best practice, but in the context of this question, incorrect, as the query is already selective. any more selective and we don't answer the architect's question.
upvoted 1 times
...
...
ksho
1 year, 1 month ago
Selected Answer: C
I think it is C, removing a long text field would make a query more performant and Description is not required for the request. Changing the filter to a deterministic value would mean it's not fetching all records where WhatId != null.
upvoted 2 times
ksho
1 year, 1 month ago
https://help.salesforce.com/s/articleView?id=sf.improving_report_performance.htm&type=5
upvoted 2 times
...
...
Ooson
1 year, 3 months ago
Only A is suitable! As D suggested from thneeb is not selective, because whatId is required field, therefore, there is no sense to check WhatID != null
upvoted 3 times
...
thneeb
1 year, 3 months ago
Selected Answer: D
I think that A is wrong. I would use D and limit the result and reexecute the query until the NULL values are solved.
upvoted 1 times
supersam1982
1 year, 3 months ago
how you can query all record if you put a LIMIT clause?
upvoted 5 times
...
...
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...