Plan değişimi P480
Orta Kötüleşme 23,9× BekliyorDB-11 · query_id 46265 · rag.usp_EmbedQueue_Dequeue · değişim 5.10.2026 09:00 · plan 45488 → 46765 · Dönüşümlü (4 el değiştirme) · Sorgu detayı ve analizleri
Güven gerekçesiOrta: birden fazla aday (STATS, WORKLOAD + PARAM) — rakip açıklamalar. Zayıf karşı kanıt: LOW_SAMPLE.
Sorgu metni
(@MaxAttempts int,@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() AND Attempt < @MaxAttempts)
-- 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 (45488) | Yeni plan (46765) | Değişim |
|---|---|---|---|
| Çalışma | 27 | 1.411 | |
| İptal / hata | 0 / 0 | 0 / 0 | |
| Süre ort. (ms) | 0,6 | 15,4 | +2286% |
| Süre maks. (ms) | 0,9 | 133,0 | +14578% |
| Süre sapma (ms) | 0,1 | 8,8 | +7017% |
| CPU ort. (ms) | 0,6 | 15,3 | +2285% |
| CPU maks. (ms) | 0,9 | 133,0 | +14610% |
| Mantıksal okuma ort. | 24,9 | 990,2 | +3885% |
| Mantıksal okuma maks. | 27,0 | 3.090,0 | +11344% |
| Fiziksel okuma | 0,0 | 0,5 | +1354% |
| Yazma | 0,2 | 0,7 | +206% |
| Bellek (KB) | 1.024,0 | 1.024,0 | 0% |
| Tempdb (KB) | 59,3 | 18,5 | -69% |
| DOP | 1,0 | 1,0 | 0% |
| Satır ort. | 1,0 | 7,9 | +686% |
| Satır maks. | 1,0 | 100,0 | +9900% |
| Dönem | 5.10.2026 09:00 → 6.10.2026 06:00 | 5.10.2026 09:00 → 6.10.2026 06:00 |
Bekleme kategorileri
ms / çalışma| Bekleme kategorisi | Eski plan (45488) | Yeni plan (46765) |
|---|---|---|
| CPU | – | 0,1 |
| Memory | – | 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 | hayır | evet | |
| StatsUpdated | rag.EmbedQueue.PK_EmbedQueue | 5.10.2026 09:43 | → 35554/35554 | hayır | evet | sıra belirsiz |
| StatsUpdated | rag.EmbedQueue.IX_EmbedQueue_Status | 4.10.2026 08:37 | → 29933/29933 | hayır | evet | |
| StatsUpdated | rag.EmbedQueue.IX_EmbedQueue_Status | 5.10.2026 09:58 | → 36904/36904 | hayır | evet | sıra belirsiz |
| StatsUpdated | rag.EmbedQueue.UX_EmbedQueue_Pending | 4.10.2026 08:16 | → 3912/3912 | hayır | 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 | 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 | sıra belirsiz |
| StatsUpdated | rag.EmbedQueue._WA_Sys_00000005_50D1B250 | 4.10.2026 08:15 | → 27382/27382 | hayır | evet | |
| StatsUpdated | rag.EmbedQueue._WA_Sys_00000005_50D1B250 | 4.10.2026 08:30 | → 29933/29933 | hayır | evet | |
| StatsUpdated | rag.EmbedQueue._WA_Sys_00000005_50D1B250 | 5.10.2026 07:50 | → 32492/32492 | hayır | evet | |
| StatsUpdated | rag.EmbedQueue._WA_Sys_00000005_50D1B250 | 5.10.2026 09:49 | → 36841/36841 | hayır | evet | sıra belirsiz |
| 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 | 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]
- Yalnız yeni planda uyarı: UnmatchedIndexes
- Tahmini maliyet: 0.038 → 0.777; tahmini satır: 1 → 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-04 09:05 (örnekleme %100); pencerede 2 güncelleme | değişimden önceki 48 saat | destekliyor | İstatistik rag.EmbedQueue.PK_EmbedQueue 2026-10-04 09:05 güncellendi (örnekleme %100); pencerede 2 güncelleme; planlar bu istatistiği kullanıyor. |
| STATS | rag.EmbedQueue.IX_EmbedQueue_Status güncellendi 2026-10-04 08:37 (örnekleme %100); pencerede 2 güncelleme | değişimden önceki 48 saat | destekliyor | İstatistik rag.EmbedQueue.IX_EmbedQueue_Status 2026-10-04 08:37 güncellendi (örnekleme %100); pencerede 2 güncelleme; planlar bu istatistiği kullanıyor. |
| STATS | rag.EmbedQueue.UX_EmbedQueue_Pending güncellendi 2026-10-04 08:16 (örnekleme %100) | değişimden önceki 48 saat | destekliyor | İstatistik rag.EmbedQueue.UX_EmbedQueue_Pending 2026-10-04 08:16 güncellendi (örnekleme %100); planlar bu istatistiği kullanıyor. |
| STATS | rag.EmbedQueue._WA_Sys_00000005_50D1B250 güncellendi 2026-10-05 07:50 (örnekleme %100); pencerede 4 güncelleme | değişimden önceki 48 saat | destekliyor | İstatistik rag.EmbedQueue._WA_Sys_00000005_50D1B250 2026-10-05 07:50 güncellendi (örnekleme %100); pencerede 4 güncelleme; planlar bu istatistiği kullanıyor. |
| STATS | 3 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_00000006_50D1B250. | |
| WORKLOAD | çalışma başına satır 1 → 7.86 (7.86×) | ≥ 2× | destekliyor | Planlar farklı iş yükü görüyor: çalışma başına satır 1 → 7.86. Planlar farklı parametre/parti büyüklüğü için derlenmiş olabilir. |
| PARAM | baskın plan 4 kez el değiştirdi | ≥ 3 | destekliyor | İki plan aynı dönemde sırayla kullanılıyor (4 el değiştirme): plan seçimi bir olaydan çok parametre değerine bağlı (parametre duyarlılığı). |
5. Karşı kanıtlar
- LOW_SAMPLE (zayıf): Eski plan yalnız 27 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 #P480 | DB: DB-11 | Regression | Confidence: Medium (review pending) Query: (@MaxAttempts int,@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() AND Attempt < @MaxAttempts) 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-05 09:00 UTC, plan 45488 → 46765, pattern: Alternating (4 switches) Impact (Query Store, per execution): duration 0.6 → 15.4 ms (+2286%); CPU 0.6 → 15.3 ms (+2285%); reads 25 → 990 (+3885%); rows 1 → 7.86 (+686%) 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]; Warning only in the new plan: UnmatchedIndexes; Estimated cost: 0.038 → 0.777; estimated rows: 1 → 100 Candidate cause: STATS — Statistic rag.EmbedQueue.PK_EmbedQueue was updated 2026-10-04 09:05 (sampled 100%); 2 updates in the window; the plans use this statistic. Candidate cause: STATS — Statistic rag.EmbedQueue.IX_EmbedQueue_Status was updated 2026-10-04 08:37 (sampled 100%); 2 updates in the window; the plans use this statistic. Candidate cause: STATS — Statistic rag.EmbedQueue.UX_EmbedQueue_Pending was updated 2026-10-04 08:16 (sampled 100%); the plans use this statistic. Candidate cause: STATS — Statistic rag.EmbedQueue._WA_Sys_00000005_50D1B250 was updated 2026-10-05 07:50 (sampled 100%); 4 updates in the window; the plans use this statistic. Candidate cause: WORKLOAD — The plans see a different workload: rows per execution 1 → 7.86. The plans may have been compiled for different parameters or batch sizes. Candidate cause: PARAM — The two plans alternate in the same period (4 switches): plan choice depends on the parameter value rather than an event (parameter sensitivity). Counter-evidence: LOW_SAMPLE — The old plan ran only 27 times: the sample is small and the average is weak. Confidence rationale: Medium: more than one candidate (STATS, WORKLOAD + PARAM) — competing explanations. 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.