UC 開発者は、SOQL クエリを使用してカスタムリストビューを設定する Apex コントローラを使用する新しい Lightning コンポーネントを作成しました。ユーザーからは、コンポーネントが頻繁にロードに失敗し、タイムアウト エラーが返されるとの苦情が寄せられています。
データ アーキテクトは、クエリに時間がかかりすぎる理由を特定するためにどのツールを使用する必要がありますか?
正解:B
According to the Salesforce documentation1, the query plan tool is a tool that can be enabled and used in the developer console to analyze the performance of a SOQL query. The query plan tool shows the cost, cardinality, sObject type, and relative cost of each query plan that Salesforce considers for a query. The relative cost indicates how expensive a query plan is compared to the Force.com query optimizer threshold. A query plan with a relative cost above 1.0 is likely to cause a time-out error.
To identify why the query is taking too long, a data architect should use the query plan tool in the developer console (option B). This way, the data architect can see which query plan is chosen by Salesforce and how it affects the performance of the query. The data architect can also use the query plan tool to optimize the query by adding indexes, filters, or limits to reduce the cost and improve the efficiency of the query.
Using Splunk to query the system logs looking for transaction time and CPU usage (option A) is not a good solution, as it can be complex, costly, and difficult to integrate with Salesforce. It may also not provide enough information or insights to identify and optimize the query performance. Using Salesforce's query optimizer to analyze the query in the developer console (option C) is also not a good solution, as it is not a separate tool that can be used in the developer console. The query optimizer is a feature that runs automatically when a SOQL query is executed and chooses the best query plan based on various factors2. Opening a ticket with Salesforce support to retrieve transaction logs to be analyzed for processing time (option D) is also not a good solution, as it can be time-consuming, dependent, and inefficient. It may also not provide enough information or insights to identify and optimize the query performance.