ExamGecko
Question list
Search
Search

List of questions

Search

Related questions











Question 191 - Certified Data Architect discussion

Report
Export

The data architect for UC 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 usages 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.
Remove description from the requested field set.
Answers
A.
Remove description from the requested field set.
B.
Change query to SOSL.
Answers
B.
Change query to SOSL.
C.
Add limit 100 to the query.
Answers
C.
Add limit 100 to the query.
D.
Change the where clause to filter by a deterministic defined value.
Answers
D.
Change the where clause to filter by a deterministic defined value.
Suggested answer: D

Explanation:

According to the Salesforce documentation, SOQL is a query language that allows querying data from Salesforce objects and fields. SOQL queries have various clauses and operators that can be used to filter and sort the results. However, some clauses and operators can affect the performance of SOQL queries by increasing the cost or complexity of executing them.

To make this query more performant, a data architect should change the where clause to filter by a deterministic defined value (option D). This means using a filter condition that specifies a concrete value or range of values for a field, such as WhatId = '001xx000003DGg3' or WhatId IN ('001xx000003DGg3', '001xx000003DGg4'). This can improve the performance of the query by reducing the number of records that need to be scanned and returned. A deterministic defined value can also leverage an index on the field, which can speed up the query execution.

Removing description from the requested field set (option A) is not a good solution, as it can affect the functionality or usability of the query. The description field may contain important or relevant information that is needed for the process. Changing the query to SOSL (option B) is also not a good solution, as SOSL is a different query language that allows searching text fields across multiple objects. SOSL queries have different syntax and limitations than SOQL queries, and may not return the same results or performance. Adding limit 100 to the query (option C) is also not a good solution, as it can affect the completeness or accuracy of the query. The limit clause specifies the maximum number of records that can be returned by the query, which may not include all the records that match the filter condition.

asked 23/09/2024
Jeff Sonola
35 questions
User
Your answer:
0 comments
Sorted by

Leave a comment first