Plan değişimi P441
Orta Kötüleşme 26,8× BekliyorDB-11 · query_id 66255 · rag.usp_EmbedQueue_Dequeue · değişim 7.10.2026 13:00 · plan 65163 → 65713 · Geçiş · Sorgu detayı ve analizleri
Güven gerekçesiOrta: tek aday (STATS), mekanik değil (plan ile doğrudan bağ kanıtlanmıyor). Zayıf karşı kanıt: LOW_SAMPLE.
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 (65163) | Yeni plan (65713) | Değişim |
|---|---|---|---|
| Çalışma | 28 | 4.417 | |
| İptal / hata | 0 / 0 | 0 / 0 | |
| Süre ort. (ms) | 0,7 | 18,4 | +2584% |
| Süre maks. (ms) | 1,1 | 240,0 | +20954% |
| Süre sapma (ms) | 0,1 | 8,8 | +6850% |
| CPU ort. (ms) | 0,7 | 18,3 | +2564% |
| CPU maks. (ms) | 1,1 | 133,3 | +11607% |
| Mantıksal okuma ort. | 29,9 | 1.383,8 | +4524% |
| Mantıksal okuma maks. | 40,0 | 4.433,0 | +10983% |
| Fiziksel okuma | 0,0 | 0,0 | |
| Yazma | 0,1 | 0,3 | +138% |
| Bellek (KB) | 1.024,0 | 1.029,7 | +1% |
| Tempdb (KB) | 52,6 | 7,6 | -86% |
| DOP | 1,0 | 1,0 | 0% |
| Satır ort. | 2,0 | 2,6 | +30% |
| Satır maks. | 2,0 | 100,0 | +4900% |
| Dönem | 7.10.2026 13:00 → 8.10.2026 20:00 | 7.10.2026 13:00 → 8.10.2026 21:00 |
Bekleme kategorileri
ms / çalışma| Bekleme kategorisi | Eski plan (65163) | Yeni plan (65713) |
|---|---|---|
| CPU | – | 0,2 |
| Memory | – | 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 | 5.10.2026 21:01 | → 40090/40090 | hayır | evet | |
| StatsUpdated | rag.EmbedQueue.PK_EmbedQueue | 6.10.2026 06:03 | → 46550/46550 | hayır | evet | |
| StatsUpdated | rag.EmbedQueue.PK_EmbedQueue | 7.10.2026 10:26 | → 51466/53274 | hayır | evet | |
| StatsUpdated | rag.EmbedQueue.IX_EmbedQueue_Status | 6.10.2026 00:17 | → 44164/44164 | hayır | evet | |
| StatsUpdated | rag.EmbedQueue.IX_EmbedQueue_Status | 6.10.2026 21:58 | → 50752/50752 | hayır | evet | |
| StatsUpdated | rag.EmbedQueue.IX_EmbedQueue_Status | 6.10.2026 22:15 | → 52622/52622 | hayır | evet | |
| StatsUpdated | rag.EmbedQueue.UX_EmbedQueue_Pending | 5.10.2026 20:20 | → 1/1 | hayır | evet | |
| 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 | |
| StatsUpdated | rag.EmbedQueue._WA_Sys_00000003_50D1B250 | 7.10.2026 10:26 | → 52179/53274 | 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 | |
| StatsUpdated | rag.EmbedQueue._WA_Sys_00000002_50D1B250 | 7.10.2026 10:26 | → 52179/53274 | 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_00000005_50D1B250 | 6.10.2026 16:35 | → 46568/46568 | hayır | hayır | |
| StatsUpdated | rag.EmbedQueue._WA_Sys_00000005_50D1B250 | 7.10.2026 08:41 | → 52716/53142 | hayır | hayır | |
| StatsUpdated | rag.EmbedQueue._WA_Sys_00000007_50D1B250 | 6.10.2026 05:27 | → 45559/45559 | hayır | hayır | |
| StatsUpdated | rag.EmbedQueue._WA_Sys_00000007_50D1B250 | 7.10.2026 13:53 | → 52178/53273 | hayır | hayır | sıra belirsiz |
| ModuleChanged | rag.usp_EmbedQueue_Dequeue | 6.10.2026 22:14 – 7.10.2026 20:39 | bilinmiyor | bilinmiyor | sıra belirsiz |
3. Plan karşılaştırması
- Yalnız eski planda erişim: rag.EmbedQueue Table Update; rag.EmbedQueue Table Scan
- Yalnız yeni planda erişim: rag.EmbedQueue Index Update [UX_EmbedQueue_Pending]; rag.EmbedQueue Clustered Index Update [PK_EmbedQueue]; rag.EmbedQueue Clustered Index Scan [PK_EmbedQueue]
- Tahmini maliyet: 0.038 → 1.129; tahmini satır: 2 → 100
- Eski planın index'leri
- yok
- Yeni planın index'leri
- rag.EmbedQueue.UX_EmbedQueue_Pending, rag.EmbedQueue.PK_EmbedQueue
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-07 10:26 (örnekleme %96.6); pencerede 3 güncelleme | değişimden önceki 48 saat | destekliyor | İstatistik rag.EmbedQueue.PK_EmbedQueue 2026-10-07 10:26 güncellendi (örnekleme %96.6); pencerede 3 güncelleme; planlar bu istatistiği kullanıyor. |
| STATS | rag.EmbedQueue.IX_EmbedQueue_Status güncellendi 2026-10-06 22:15 (örnekleme %100); pencerede 3 güncelleme | değişimden önceki 48 saat | destekliyor | İstatistik rag.EmbedQueue.IX_EmbedQueue_Status 2026-10-06 22:15 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) | değişimden önceki 48 saat | destekliyor | İstatistik rag.EmbedQueue.UX_EmbedQueue_Pending 2026-10-05 20:20 güncellendi (örnekleme %100); planlar bu istatistiği kullanıyor. |
| STATS | 4 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_00000007_50D1B250. | |
| MODULE | rag.usp_EmbedQueue_Dequeue değişti 2026-10-06 22:14 – 2026-10-07 20:39 arasında | değişimden önceki 48 saat | desteklemiyor | Sorgunun modülü rag.usp_EmbedQueue_Dequeue 2026-10-06 22:14 – 2026-10-07 20:39 arasında değişti (yeniden derleme tetikler). |
| WORKLOAD | çalışma başına satır 2 → 2.59 (1.3×) | ≥ 2× | desteklemiyor | Çalışma başına satır benzer (2 → 2.59): iş yükü farkı yok. |
| PARAM | baskın plan 0 kez el değiştirdi | ≥ 3 | desteklemiyor | Planlar dönüşümlü değil: yeni plan eskisinin yerini aldı. |
5. Karşı kanıtlar
- ORDER_UNCERTAIN (aday için güçlü): MODULE adayı elendi: rag.usp_EmbedQueue_Dequeue olayının zamanı (2026-10-06 22:14 – 2026-10-07 20:39 arasında) değişim anını kapsıyor, önce mi sonra mı olduğu bilinmiyor.
- LOW_SAMPLE (zayıf): Eski plan yalnız 28 kez çalışmış: örnek az, ortalama zayıf.
6. Korpus metni önizlemesi
onaylanınca RAG hafızasına bu metin girer (başlığa onaylayan eklenir)Plan change case #P441 | DB: DB-11 | Regression | 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-07 13:00 UTC, plan 65163 → 65713, pattern: Transition Impact (Query Store, per execution): duration 0.7 → 18.4 ms (+2584%); CPU 0.7 → 18.3 ms (+2564%); reads 30 → 1,384 (+4524%); rows 2 → 2.59 (+30%) Plan difference: Access only in the old plan: rag.EmbedQueue Table Update; rag.EmbedQueue Table Scan; Access only in the new plan: rag.EmbedQueue Index Update [UX_EmbedQueue_Pending]; rag.EmbedQueue Clustered Index Update [PK_EmbedQueue]; rag.EmbedQueue Clustered Index Scan [PK_EmbedQueue]; Estimated cost: 0.038 → 1.129; estimated rows: 2 → 100 Candidate cause: STATS — Statistic rag.EmbedQueue.PK_EmbedQueue was updated 2026-10-07 10:26 (sampled 96.6%); 3 updates in the window; the plans use this statistic. Candidate cause: STATS — Statistic rag.EmbedQueue.IX_EmbedQueue_Status was updated 2026-10-06 22:15 (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%); the plans use this statistic. Counter-evidence: ORDER_UNCERTAIN — MODULE candidate ruled out: the time of the rag.usp_EmbedQueue_Dequeue event (between 2026-10-06 22:14 and 2026-10-07 20:39) spans the change, so whether it happened before or after is unknown. Counter-evidence: LOW_SAMPLE — The old plan ran only 28 times: the sample is small and the average is weak. Confidence rationale: Medium: a single candidate (STATS), not mechanical (no direct link to the plan is proven). Weak counter-evidence: LOW_SAMPLE. 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.