Plan değişimi P437
Orta İyileşme 30,8× BekliyorDB-11 · query_id 64487 · rag.usp_EmbedQueue_Dequeue · değişim 6.10.2026 06:00 · plan 64598 → 64696 · Geçiş · Sorgu detayı ve analizleri
Güven gerekçesiOrta: birden fazla aday (STATS, WORKLOAD) — rakip açıklamalar. Zayıf karşı kanıt: HIGH_VARIANCE.
Sorgu metni
(@BatchSize int,@LeaseSeconds int)WITH c AS (
SELECT TOP (@BatchSize) *
FROM rag.EmbedQueue WITH (READPAST, UPDLOCK, ROWLOCK)
WHERE Status = 'Queued' OR (Status = 'Running' AND LeaseUntilUtc < DBA.fn_Now())
-- Vaka/KB önce: bekçi her gün binlerce profili kuyruğa alır, onaydan sonra gelen vaka onların ardında beklemesin
ORDER BY CASE SourceType WHEN 'Profile' THEN 1 ELSE 0 END, QueueID
)
UPDATE c SET Status = 'Running', Attempt = Attempt + 1, LeaseUntilUtc = DATEADD(second, @LeaseSeconds, DBA.fn_Now())
OUTPUT inserted.QueueID, inserted.SourceType, inserted.SourceRef, inserted.Attempt1. Etki özeti
| Metrik | Eski plan (64598) | Yeni plan (64696) | Değişim |
|---|---|---|---|
| Çalışma | 2.132 | 3.813 | |
| İptal / hata | 0 / 0 | 0 / 0 | |
| Süre ort. (ms) | 15,3 | 0,5 | -97% |
| Süre maks. (ms) | 57,4 | 25,3 | -56% |
| Süre sapma (ms) | 4,5 | 2,7 | -40% |
| CPU ort. (ms) | 15,2 | 0,5 | -97% |
| CPU maks. (ms) | 57,4 | 25,3 | -56% |
| Mantıksal okuma ort. | 1.258,2 | 199,7 | -84% |
| Mantıksal okuma maks. | 3.905,0 | 13.764,0 | +252% |
| Fiziksel okuma | 0,5 | 0,0 | -100% |
| Yazma | 0,5 | 0,0 | -93% |
| Bellek (KB) | 1.024,0 | 1.024,0 | 0% |
| Tempdb (KB) | 14,6 | 1,2 | -92% |
| DOP | 1,0 | 1,0 | 0% |
| Satır ort. | 4,9 | 0,3 | -93% |
| Satır maks. | 100,0 | 20,0 | -80% |
| Dönem | 6.10.2026 05:00 → 7.10.2026 14:00 | 6.10.2026 06:00 → 6.10.2026 22:00 |
Bekleme kategorileri
ms / çalışma| Bekleme kategorisi | Eski plan (64598) | Yeni plan (64696) |
|---|---|---|
| Memory | 0,0 | 0,0 |
| CPU | 0,0 | 0,0 |
| Preemptive | 0,0 | – |
| Lock | 0,0 | – |
2. Zaman çizelgesi
Eski planYeni plan
┆ değişim anı (kesik çizgi)░ olay (bant: zamanı aralık olarak bilinen)
Olaylar
| Olay | Nesne | Zaman | Önce → sonra | Eski plan kullanıyor | Yeni plan kullanıyor | |
|---|---|---|---|---|---|---|
| StatsUpdated | rag.EmbedQueue.PK_EmbedQueue | 4.10.2026 09:05 | → 29955/29955 | evet | evet | |
| StatsUpdated | rag.EmbedQueue.PK_EmbedQueue | 5.10.2026 09:43 | → 35554/35554 | evet | evet | |
| StatsUpdated | rag.EmbedQueue.PK_EmbedQueue | 5.10.2026 21:01 | → 40090/40090 | evet | evet | |
| StatsUpdated | rag.EmbedQueue.PK_EmbedQueue | 6.10.2026 06:03 | → 46550/46550 | evet | evet | sıra belirsiz |
| StatsUpdated | rag.EmbedQueue.IX_EmbedQueue_Status | 4.10.2026 08:37 | → 29933/29933 | evet | evet | |
| StatsUpdated | rag.EmbedQueue.IX_EmbedQueue_Status | 5.10.2026 09:58 | → 36904/36904 | evet | evet | |
| StatsUpdated | rag.EmbedQueue.IX_EmbedQueue_Status | 6.10.2026 00:17 | → 44164/44164 | evet | evet | |
| StatsUpdated | rag.EmbedQueue.UX_EmbedQueue_Pending | 4.10.2026 08:16 | → 3912/3912 | evet | evet | |
| StatsUpdated | rag.EmbedQueue.UX_EmbedQueue_Pending | 5.10.2026 20:20 | → 1/1 | evet | evet | |
| StatsUpdated | rag.EmbedQueue._WA_Sys_00000003_50D1B250 | 4.10.2026 09:05 | → 29955/29955 | hayır | hayır | |
| StatsUpdated | rag.EmbedQueue._WA_Sys_00000003_50D1B250 | 5.10.2026 09:43 | → 35554/35554 | hayır | hayır | |
| StatsUpdated | rag.EmbedQueue._WA_Sys_00000003_50D1B250 | 5.10.2026 21:01 | → 40090/40090 | hayır | hayır | |
| StatsUpdated | rag.EmbedQueue._WA_Sys_00000003_50D1B250 | 6.10.2026 06:03 | → 46550/46550 | hayır | hayır | sıra belirsiz |
| StatsUpdated | rag.EmbedQueue._WA_Sys_00000002_50D1B250 | 4.10.2026 09:05 | → 29955/29955 | hayır | hayır | |
| StatsUpdated | rag.EmbedQueue._WA_Sys_00000002_50D1B250 | 5.10.2026 09:43 | → 35554/35554 | hayır | hayır | |
| StatsUpdated | rag.EmbedQueue._WA_Sys_00000002_50D1B250 | 5.10.2026 21:01 | → 40090/40090 | hayır | hayır | |
| StatsUpdated | rag.EmbedQueue._WA_Sys_00000002_50D1B250 | 6.10.2026 06:03 | → 46550/46550 | hayır | hayır | sıra belirsiz |
| StatsUpdated | rag.EmbedQueue._WA_Sys_00000005_50D1B250 | 4.10.2026 08:15 | → 27382/27382 | hayır | hayır | |
| StatsUpdated | rag.EmbedQueue._WA_Sys_00000005_50D1B250 | 4.10.2026 08:30 | → 29933/29933 | hayır | hayır | |
| StatsUpdated | rag.EmbedQueue._WA_Sys_00000005_50D1B250 | 5.10.2026 07:50 | → 32492/32492 | hayır | hayır | |
| StatsUpdated | rag.EmbedQueue._WA_Sys_00000005_50D1B250 | 5.10.2026 09:49 | → 36841/36841 | hayır | hayır | |
| StatsUpdated | rag.EmbedQueue._WA_Sys_00000005_50D1B250 | 6.10.2026 00:18 | → 45427/45427 | hayır | hayır | |
| StatsUpdated | rag.EmbedQueue._WA_Sys_00000006_50D1B250 | 4.10.2026 08:15 | → 27382/27382 | hayır | hayır | |
| StatsUpdated | rag.EmbedQueue._WA_Sys_00000006_50D1B250 | 4.10.2026 08:37 | → 29933/29933 | hayır | hayır | |
| StatsUpdated | rag.EmbedQueue._WA_Sys_00000006_50D1B250 | 5.10.2026 09:01 | → 32520/32520 | hayır | hayır | |
| StatsUpdated | rag.EmbedQueue._WA_Sys_00000007_50D1B250 | 5.10.2026 10:55 | → 37058/37058 | hayır | hayır | |
| StatsUpdated | rag.EmbedQueue._WA_Sys_00000007_50D1B250 | 6.10.2026 05:27 | → 45559/45559 | hayır | hayır |
3. Plan karşılaştırması
- Yalnız eski planda erişim: rag.EmbedQueue Clustered Index Scan [PK_EmbedQueue]
- Yalnız yeni planda erişim: rag.EmbedQueue Index Seek [IX_EmbedQueue_Status]; rag.EmbedQueue Clustered Index Seek [PK_EmbedQueue] (lookup)
- Yalnız yeni planda join: Nested Loops (Inner Join) ×2
- Tahmini maliyet: 0.942 → 0.195; tahmini satır: 100 → 20
- Eski planın index'leri
- rag.EmbedQueue.UX_EmbedQueue_Pending, rag.EmbedQueue.PK_EmbedQueue
- Yeni planın index'leri
- rag.EmbedQueue.UX_EmbedQueue_Pending, rag.EmbedQueue.PK_EmbedQueue, rag.EmbedQueue.IX_EmbedQueue_Status
4. Neden adayları
ölçüm ve eşikle; kesin değildir| Kod | Ölçülen | Eşik | Sonuç | Açıklama |
|---|---|---|---|---|
| STATS | rag.EmbedQueue.PK_EmbedQueue güncellendi 2026-10-05 21:01 (örnekleme %100); pencerede 4 güncelleme | değişimden önceki 48 saat | destekliyor | İstatistik rag.EmbedQueue.PK_EmbedQueue 2026-10-05 21:01 güncellendi (örnekleme %100); pencerede 4 güncelleme; planlar bu istatistiği kullanıyor. |
| STATS | rag.EmbedQueue.IX_EmbedQueue_Status güncellendi 2026-10-06 00:17 (örnekleme %100); pencerede 3 güncelleme | değişimden önceki 48 saat | destekliyor | İstatistik rag.EmbedQueue.IX_EmbedQueue_Status 2026-10-06 00:17 güncellendi (örnekleme %100); pencerede 3 güncelleme; planlar bu istatistiği kullanıyor. |
| STATS | rag.EmbedQueue.UX_EmbedQueue_Pending güncellendi 2026-10-05 20:20 (örnekleme %100); pencerede 2 güncelleme | değişimden önceki 48 saat | destekliyor | İstatistik rag.EmbedQueue.UX_EmbedQueue_Pending 2026-10-05 20:20 güncellendi (örnekleme %100); pencerede 2 güncelleme; planlar bu istatistiği kullanıyor. |
| STATS | 5 istatistik güncellendi, planlar kullanmıyor | desteklemiyor | Pencerede güncellenen ama iki planın da kullanmadığı istatistikler aday değil: rag.EmbedQueue._WA_Sys_00000003_50D1B250, rag.EmbedQueue._WA_Sys_00000002_50D1B250, rag.EmbedQueue._WA_Sys_00000005_50D1B250, rag.EmbedQueue._WA_Sys_00000006_50D1B250, rag.EmbedQueue._WA_Sys_00000007_50D1B250. | |
| WORKLOAD | çalışma başına satır 4.91 → 0.34 (14.38×) | ≥ 2× | destekliyor | Planlar farklı iş yükü görüyor: çalışma başına satır 4.91 → 0.34. Planlar farklı parametre/parti büyüklüğü için derlenmiş olabilir. |
| PARAM | baskın plan 2 kez el değiştirdi | ≥ 3 | desteklemiyor | Planlar dönüşümlü değil: yeni plan eskisinin yerini aldı. |
5. Karşı kanıtlar
- HIGH_VARIANCE (zayıf): Yeni planın süre sapması ortalamanın %548'i: ortalama güvenilir değil.
6. Korpus metni önizlemesi
onaylanınca RAG hafızasına bu metin girer (başlığa onaylayan eklenir)Plan change case #P437 | DB: DB-11 | Improvement | Confidence: Medium (review pending) Query: (@BatchSize int,@LeaseSeconds int)WITH c AS ( SELECT TOP (@BatchSize) * FROM rag.EmbedQueue WITH (READPAST, UPDLOCK, ROWLOCK) WHERE Status = ? OR (Status = ? AND LeaseUntilUtc < DBA.fn_Now()) ORDER BY CASE SourceType WHEN ? THEN ? ELSE ? END, QueueID ) UPDATE c SET Status = ?, Attempt = Attempt + ?, LeaseUntilUtc = DATEADD(second, @LeaseSeconds, DBA.fn_Now()) OUTPUT inserted.QueueID, inserted.SourceType, inserted.SourceRef, inserted.Attempt Change: 2026-10-06 06:00 UTC, plan 64598 → 64696, pattern: Transition Impact (Query Store, per execution): duration 15.3 → 0.5 ms (-97%); CPU 15.2 → 0.5 ms (-97%); reads 1,258 → 200 (-84%); rows 4.91 → 0.34 (-93%) Plan difference: Access only in the old plan: rag.EmbedQueue Clustered Index Scan [PK_EmbedQueue]; Access only in the new plan: rag.EmbedQueue Index Seek [IX_EmbedQueue_Status]; rag.EmbedQueue Clustered Index Seek [PK_EmbedQueue] (lookup); Join only in the new plan: Nested Loops (Inner Join) ×2; Estimated cost: 0.942 → 0.195; estimated rows: 100 → 20 Candidate cause: STATS — Statistic rag.EmbedQueue.PK_EmbedQueue was updated 2026-10-05 21:01 (sampled 100%); 4 updates in the window; the plans use this statistic. Candidate cause: STATS — Statistic rag.EmbedQueue.IX_EmbedQueue_Status was updated 2026-10-06 00:17 (sampled 100%); 3 updates in the window; the plans use this statistic. Candidate cause: STATS — Statistic rag.EmbedQueue.UX_EmbedQueue_Pending was updated 2026-10-05 20:20 (sampled 100%); 2 updates in the window; the plans use this statistic. Candidate cause: WORKLOAD — The plans see a different workload: rows per execution 4.91 → 0.34. The plans may have been compiled for different parameters or batch sizes. Counter-evidence: HIGH_VARIANCE — The new plan's duration standard deviation is 548% of the average: the average is not reliable. Confidence rationale: Medium: more than one candidate (STATS, WORKLOAD) — competing explanations. Weak counter-evidence: HIGH_VARIANCE. 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.