Plan değişimi P401
Düşük İyileşme 18,4× BekliyorDB-12 · query_id 731 · DBA.usp_Apply_Qds · değişim 28.09.2026 13:00 · plan 4448 → 5955 · Dönüşümlü (27 el değiştirme) · Sorgu detayı ve analizleri
Güven gerekçesiDüşük: güçlü karşı kanıt (WORK_PROPORTIONAL).
Sorgu metni
(@ServerID int,@DatabaseName nvarchar(128))INSERT perf.QdsRuntimeStats
SELECT g.* FROM perf.Stg_QdsRuntimeStats AS g
WHERE g.ServerID = @ServerID AND g.DatabaseName = @DatabaseName
AND NOT EXISTS (SELECT 1 FROM perf.QdsRuntimeStats AS r
WHERE r.ServerID = g.ServerID AND r.DatabaseName = g.DatabaseName AND r.plan_id = g.plan_id
AND r.runtime_stats_interval_id = g.runtime_stats_interval_id AND r.execution_type = g.execution_type
AND r.IntervalStartUtc = g.IntervalStartUtc)1. Etki özeti
| Metrik | Eski plan (4448) | Yeni plan (5955) | Değişim |
|---|---|---|---|
| Çalışma | 28 | 333 | |
| İptal / hata | 0 / 7 | 0 / 0 | |
| Süre ort. (ms) | 110,4 | 6,0 | -95% |
| Süre maks. (ms) | 1.042,6 | 160,2 | -85% |
| Süre sapma (ms) | 182,4 | 15,2 | -92% |
| CPU ort. (ms) | 81,4 | 4,6 | -94% |
| CPU maks. (ms) | 284,0 | 73,7 | -74% |
| Mantıksal okuma ort. | 14.862,9 | 1.056,0 | -93% |
| Mantıksal okuma maks. | 28.091,0 | 16.421,0 | -42% |
| Fiziksel okuma | 976,4 | 18,3 | -98% |
| Yazma | 450,5 | 29,3 | -93% |
| Bellek (KB) | 2.009,1 | 0,0 | -100% |
| Tempdb (KB) | 438,9 | 15,0 | -97% |
| DOP | 1,0 | 1,0 | 0% |
| Satır ort. | 2.117,2 | 96,1 | -95% |
| Satır maks. | 4.410,0 | 1.504,0 | -66% |
| Dönem | 28.09.2026 12:00 → 6.10.2026 07:00 | 28.09.2026 13:00 → 8.10.2026 21:00 |
Bekleme kategorileri
ms / çalışma| Bekleme kategorisi | Eski plan (4448) | Yeni plan (5955) |
|---|---|---|
| Buffer IO | 27,2 | 1,3 |
| CPU | 0,3 | 0,2 |
| Memory | 3,1 | 0,0 |
| Idle | 2,1 | – |
| Preemptive | 0,9 | – |
2. Zaman çizelgesi
Eski planYeni plan
┆ değişim anı (kesik çizgi)░ olay (bant: zamanı aralık olarak bilinen)
Pencerede olay yok — metadata toplama 1.10.2026 tarihinde başladı, değişimden önceki olaylar görülemez (veri yok).
3. Plan karşılaştırması
- Yalnız eski planda join: Hash Match (Left Anti Semi Join)
- Yalnız yeni planda join: Nested Loops (Left Anti Semi Join)
- Tahmini maliyet: 0.902 → 0.379; tahmini satır: 1 → 1
- Eski planın index'leri
- perf.QdsRuntimeStats.PK_QdsRuntimeStats
- Yeni planın index'leri
- perf.QdsRuntimeStats.PK_QdsRuntimeStats
4. Neden adayları
ölçüm ve eşikle; kesin değildir| Kod | Ölçülen | Eşik | Sonuç | Açıklama |
|---|---|---|---|---|
| WORKLOAD | çalışma başına satır 2117.18 → 96.13 (22.02×) | ≥ 2× | destekliyor | Planlar farklı iş yükü görüyor: çalışma başına satır 2117.18 → 96.13. Planlar farklı parametre/parti büyüklüğü için derlenmiş olabilir. |
| PARAM | baskın plan 27 kez el değiştirdi | ≥ 3 | destekliyor | İki plan aynı dönemde sırayla kullanılıyor (27 el değiştirme): plan seçimi bir olaydan çok parametre değerine bağlı (parametre duyarlılığı). |
5. Karşı kanıtlar
- WORK_PROPORTIONAL (güçlü): Çalışma başına satır 0.05×, süre 0.05× değişti; satır başına süre 0.0522 → 0.0625 ms: süre farkı işlenen veri miktarından, plandan değil.
- HIGH_VARIANCE (zayıf): Eski planın süre sapması ortalamanın %165'i: ortalama güvenilir değil.
- LOW_SAMPLE (zayıf): Eski plan yalnız 28 kez çalışmış: örnek az, ortalama zayıf.
- HIGH_VARIANCE (zayıf): Yeni planın süre sapması ortalamanın %253'i: ortalama güvenilir değil.
- METADATA_GAP (zayıf): Metadata toplama 2026-10-01 tarihinde başladı, değişim 2026-09-28: index/istatistik/modül olayları değerlendirilemedi (olay yok değil, veri yok).
6. Korpus metni önizlemesi
onaylanınca RAG hafızasına bu metin girer (başlığa onaylayan eklenir)Plan change case #P401 | DB: DB-12 | Improvement | Confidence: Low (review pending) Query: (@ServerID int,@DatabaseName nvarchar(?))INSERT perf.QdsRuntimeStats SELECT g.* FROM perf.Stg_QdsRuntimeStats AS g WHERE g.ServerID = @ServerID AND g.DatabaseName = @DatabaseName AND NOT EXISTS (SELECT ? FROM perf.QdsRuntimeStats AS r WHERE r.ServerID = g.ServerID AND r.DatabaseName = g.DatabaseName AND r.plan_id = g.plan_id AND r.runtime_stats_interval_id = g.runtime_stats_interval_id AND r.execution_type = g.execution_type AND r.IntervalStartUtc = g.IntervalStartUtc) Change: 2026-09-28 13:00 UTC, plan 4448 → 5955, pattern: Alternating (27 switches) Impact (Query Store, per execution): duration 110.4 → 6 ms (-95%); CPU 81.4 → 4.6 ms (-94%); reads 14,863 → 1,056 (-93%); rows 2117.18 → 96.13 (-95%) Plan difference: Join only in the old plan: Hash Match (Left Anti Semi Join); Join only in the new plan: Nested Loops (Left Anti Semi Join); Estimated cost: 0.902 → 0.379; estimated rows: 1 → 1 Candidate cause: WORKLOAD — The plans see a different workload: rows per execution 2117.18 → 96.13. The plans may have been compiled for different parameters or batch sizes. Candidate cause: PARAM — The two plans alternate in the same period (27 switches): plan choice depends on the parameter value rather than an event (parameter sensitivity). Counter-evidence: WORK_PROPORTIONAL — Rows per execution changed 0.05× and duration 0.05×; duration per row 0.0522 → 0.0625 ms: the duration difference comes from the amount of data processed, not the plan. Counter-evidence: HIGH_VARIANCE — The old plan's duration standard deviation is 165% of the average: the average is not reliable. Counter-evidence: LOW_SAMPLE — The old plan ran only 28 times: the sample is small and the average is weak. Counter-evidence: HIGH_VARIANCE — The new plan's duration standard deviation is 253% of the average: the average is not reliable. Counter-evidence: METADATA_GAP — Metadata collection started on 2026-10-01 and the change was on 2026-09-28: index, statistics and module events could not be evaluated (no data, not no events). Confidence rationale: Low: strong counter-evidence (WORK_PROPORTIONAL). Note: this is a candidate cause, not proof of the root cause.
7. Karar
Karar vermek için Analyst rolü gerekir.
Karar geçmişi
Kayıt yok
Henüz karar yok.