Demo modu

Plan değişimi P480

Orta Kötüleşme 23,9× Bekliyor

DB-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

SQL
(@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.Attempt

1. Etki özeti

MetrikEski plan (45488)Yeni plan (46765)Değişim
Çalışma271.411
İptal / hata0 / 00 / 0
Süre ort. (ms)0,615,4+2286%
Süre maks. (ms)0,9133,0+14578%
Süre sapma (ms)0,18,8+7017%
CPU ort. (ms)0,615,3+2285%
CPU maks. (ms)0,9133,0+14610%
Mantıksal okuma ort.24,9990,2+3885%
Mantıksal okuma maks.27,03.090,0+11344%
Fiziksel okuma0,00,5+1354%
Yazma0,20,7+206%
Bellek (KB)1.024,01.024,00%
Tempdb (KB)59,318,5-69%
DOP1,01,00%
Satır ort.1,07,9+686%
Satır maks.1,0100,0+9900%
Dönem5.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 kategorisiEski plan (45488)Yeni plan (46765)
CPU–0,1
Memory–0,0

2. Zaman çizelgesi

StatsUpdated rag.EmbedQueue.PK_EmbedQueue (2026-10-04 09:05)StatsUpdated rag.EmbedQueue.PK_EmbedQueue (2026-10-05 09:43)StatsUpdated rag.EmbedQueue.IX_EmbedQueue_Status (2026-10-04 08:37)StatsUpdated rag.EmbedQueue.IX_EmbedQueue_Status (2026-10-05 09:58)StatsUpdated rag.EmbedQueue.UX_EmbedQueue_Pending (2026-10-04 08:16)StatsUpdated rag.EmbedQueue._WA_Sys_00000003_50D1B250 (2026-10-04 09:05)StatsUpdated rag.EmbedQueue._WA_Sys_00000003_50D1B250 (2026-10-05 09:43)StatsUpdated rag.EmbedQueue._WA_Sys_00000002_50D1B250 (2026-10-04 09:05)StatsUpdated rag.EmbedQueue._WA_Sys_00000002_50D1B250 (2026-10-05 09:43)StatsUpdated rag.EmbedQueue._WA_Sys_00000005_50D1B250 (2026-10-04 08:15)StatsUpdated rag.EmbedQueue._WA_Sys_00000005_50D1B250 (2026-10-04 08:30)StatsUpdated rag.EmbedQueue._WA_Sys_00000005_50D1B250 (2026-10-05 07:50)StatsUpdated rag.EmbedQueue._WA_Sys_00000005_50D1B250 (2026-10-05 09:49)StatsUpdated rag.EmbedQueue._WA_Sys_00000006_50D1B250 (2026-10-04 08:15)StatsUpdated rag.EmbedQueue._WA_Sys_00000006_50D1B250 (2026-10-04 08:37)StatsUpdated rag.EmbedQueue._WA_Sys_00000006_50D1B250 (2026-10-05 09:01)Değişim: 5.10.2026 09:00Eski plan 5.10.2026 09:00: 0,5 msEski plan 5.10.2026 10:00: 0,6 msEski plan 5.10.2026 12:00: 0,7 msEski plan 5.10.2026 13:00: 0,9 msEski plan 5.10.2026 17:00: 0,6 msEski plan 5.10.2026 18:00: 0,6 msEski plan 5.10.2026 20:00: 0,7 msEski plan 5.10.2026 21:00: 0,6 msEski plan 5.10.2026 22:00: 0,7 msEski plan 5.10.2026 23:00: 0,5 msEski plan 6.10.2026 00:00: 0,8 msEski plan 6.10.2026 01:00: 0,5 msEski plan 6.10.2026 05:00: 0,7 msYeni plan 5.10.2026 09:00: 27,1 msYeni plan 5.10.2026 10:00: 15,5 msYeni plan 5.10.2026 11:00: 11,9 msYeni plan 5.10.2026 12:00: 11,3 msYeni plan 5.10.2026 13:00: 13,6 msYeni plan 5.10.2026 21:00: 24,5 msYeni plan 5.10.2026 22:00: 15,8 msYeni plan 6.10.2026 00:00: 26,7 msYeni plan 6.10.2026 01:00: 28,6 msYeni plan 6.10.2026 05:00: 50,1 msmax 50,1 ms 10-04 08:15 10-06 05:00
Eski planYeni plan ┆ değişim anı (kesik çizgi)░ olay (bant: zamanı aralık olarak bilinen)

Olaylar

OlayNesneZamanÖnce → sonra Eski plan kullanıyorYeni plan kullanıyor
StatsUpdatedrag.EmbedQueue.PK_EmbedQueue4.10.2026 09:05 → 29955/29955 hayırevet
StatsUpdatedrag.EmbedQueue.PK_EmbedQueue5.10.2026 09:43 → 35554/35554 hayırevet sıra belirsiz
StatsUpdatedrag.EmbedQueue.IX_EmbedQueue_Status4.10.2026 08:37 → 29933/29933 hayırevet
StatsUpdatedrag.EmbedQueue.IX_EmbedQueue_Status5.10.2026 09:58 → 36904/36904 hayırevet sıra belirsiz
StatsUpdatedrag.EmbedQueue.UX_EmbedQueue_Pending4.10.2026 08:16 → 3912/3912 hayırevet
StatsUpdatedrag.EmbedQueue._WA_Sys_00000003_50D1B2504.10.2026 09:05 → 29955/29955 hayırhayır
StatsUpdatedrag.EmbedQueue._WA_Sys_00000003_50D1B2505.10.2026 09:43 → 35554/35554 hayırhayır sıra belirsiz
StatsUpdatedrag.EmbedQueue._WA_Sys_00000002_50D1B2504.10.2026 09:05 → 29955/29955 hayırhayır
StatsUpdatedrag.EmbedQueue._WA_Sys_00000002_50D1B2505.10.2026 09:43 → 35554/35554 hayırhayır sıra belirsiz
StatsUpdatedrag.EmbedQueue._WA_Sys_00000005_50D1B2504.10.2026 08:15 → 27382/27382 hayırevet
StatsUpdatedrag.EmbedQueue._WA_Sys_00000005_50D1B2504.10.2026 08:30 → 29933/29933 hayırevet
StatsUpdatedrag.EmbedQueue._WA_Sys_00000005_50D1B2505.10.2026 07:50 → 32492/32492 hayırevet
StatsUpdatedrag.EmbedQueue._WA_Sys_00000005_50D1B2505.10.2026 09:49 → 36841/36841 hayırevet sıra belirsiz
StatsUpdatedrag.EmbedQueue._WA_Sys_00000006_50D1B2504.10.2026 08:15 → 27382/27382 hayırhayır
StatsUpdatedrag.EmbedQueue._WA_Sys_00000006_50D1B2504.10.2026 08:37 → 29933/29933 hayırhayır
StatsUpdatedrag.EmbedQueue._WA_Sys_00000006_50D1B2505.10.2026 09:01 → 32520/32520 hayırhayı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çülenEşikSonuçAçıklama
STATS rag.EmbedQueue.PK_EmbedQueue güncellendi 2026-10-04 09:05 (örnekleme %100); pencerede 2 güncellemedeğ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üncellemedeğ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üncellemedeğ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

6. Korpus metni önizlemesi

onaylanınca RAG hafızasına bu metin girer (başlığa onaylayan eklenir)
6. Korpus metni önizlemesi
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.