1
クラスター化インデックススキャンの実行回数が非常に多いのはなぜですか?
同じクエリプランを生成する2つの類似したクエリがありますが、1つのクエリプランがクラスタ化インデックススキャンを1316回実行し、もう1つのクエリプランが1回実行することを除きます。 2つのクエリの唯一の違いは、異なる日付基準です。長時間実行されるクエリは、実際には日付基準を絞り込み、引き戻すデータを減らします。 両方のクエリに役立ついくつかのインデックスを特定しましたが、クラスター化インデックススキャン演算子が1回実行するクエリと実質的に同じクエリで1316回実行する理由を理解したいだけです。 スキャンされているPKの統計を確認しましたが、比較的最新です。 元のクエリ: select distinct FIR_Incident.IncidentID from FIR_Incident left join ( select incident_id as exported_incident_id from postnfirssummary ) exported_incidents on exported_incidents.exported_incident_id = fir_incident.incidentid where FI_IncidentDate between '2011-06-01 00:00:00.000' and '2011-07-01 00:00:00.000' and exported_incidents.exported_incident_id is not null この計画を生成します。 日付範囲の基準を絞り込んだ後: select distinct FIR_Incident.IncidentID from FIR_Incident left join ( select incident_id …