インデックス What is selective query in Salesforce?

次の項目はデフォルトでインデックスが付けられます。
主キー (Id、Name、OwnerId 項目)
外部キー (参照関係または主従関係項目)
監査日付 (CreatedDate、SystemModstamp 項目)
RecordType 項目 (これらの項目を備えたすべての標準オブジェクトにインデックス付け)
外部 ID または一意としてマークされたカスタム項目


通常、次の場合はカスタムインデックスが使用されません。
照会された値がシステム定義のしきい値を超える場合
検索条件の演算子が、NOT EQUAL TO (または !=)、NOT CONTAINS、NOT STARTS WITH などの否定演算子である場合
検索条件に CONTAINS 演算子が使用され、スキャンされる行数が 333,333 を超える場合。

CONTAINS 演算子にはインデックスの完全スキャンが必要です。このしきい値は変化します。
空の値と比較している場合 (Name != '')

 

What is selective query in Salesforce?

https://help.salesforce.com/articleView?language=en_US&type=1&mode=1&id=000325257

A query is selective when 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. The performance of the SOQL query improves when two or more filters used in the WHERE clause meet the mentioned conditions.

posted @ 2019-11-14 22:31  dlywang0411  阅读(6)  评论(0编辑  收藏  举报