設計で、トリガーコンテキストでの大きなオブジェクト種別に対する非選択的クエリは許可されません (Apex トリガーの評価時)。この設計の制限により、非決定的クエリの実行時間 (SOQL クエリの実行に必要な完全/部分テーブルスキャンのため) がエンドユーザーのエクスペリエンスに及ぼす可能性のある影響を回避します。結果として、トリガーコンテキスト内の大きなオブジェクト種別への非選択的クエリの実行の試みが妨げられ、前述のエラーメッセージが表示されます。
注: この制限を設定せず、影響を受けるクエリが、レコードの保存時に呼び出される指定したトリガー内で実行された場合、最悪のケースシナリオでは、エンドユーザーはクエリがタイムアウトし、何らかの UI フィードバックを取得するまで待つ必要があります。
クエリが Developer Console 内または SOAP/REST API を介して実行された場合は、同じ制限が適用されません。このケースでは、標準のクエリタイムアウトが適用されます。つまり、クエリが試みられ、特定の時間より長くかかった場合にのみタイムアウトします。
影響を受ける SOQL クエリがインデックスを利用できるように、クエリを最適化することをお勧めします。SOQL クエリを最適化する方法の詳細については、Salesforce クエリ検索最適化開発者向けチートシートを参照してください。
000386468

We use three kinds of cookies on our websites: required, functional, and advertising. You can choose whether functional and advertising cookies apply. Click on the different cookie categories to find out more about each category and to change the default settings.
Privacy Statement
Required cookies are necessary for basic website functionality. Some examples include: session cookies needed to transmit the website, authentication cookies, and security cookies.
Functional cookies enhance functions, performance, and services on the website. Some examples include: cookies used to analyze site traffic, cookies used for market research, and cookies used to display advertising that is not directed to a particular individual.
Advertising cookies track activity across websites in order to understand a viewer’s interests, and direct them specific marketing. Some examples include: cookies used for remarketing, or interest-based advertising.