Demo modu

Plan değişimi P437

Orta İyileşme 30,8× Bekliyor

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

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

1. Etki özeti

MetrikEski plan (64598)Yeni plan (64696)Değişim
Çalışma2.1323.813
İptal / hata0 / 00 / 0
Süre ort. (ms)15,30,5-97%
Süre maks. (ms)57,425,3-56%
Süre sapma (ms)4,52,7-40%
CPU ort. (ms)15,20,5-97%
CPU maks. (ms)57,425,3-56%
Mantıksal okuma ort.1.258,2199,7-84%
Mantıksal okuma maks.3.905,013.764,0+252%
Fiziksel okuma0,50,0-100%
Yazma0,50,0-93%
Bellek (KB)1.024,01.024,00%
Tempdb (KB)14,61,2-92%
DOP1,01,00%
Satır ort.4,90,3-93%
Satır maks.100,020,0-80%
Dönem6.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 kategorisiEski plan (64598)Yeni plan (64696)
Memory0,00,0
CPU0,00,0
Preemptive0,0–
Lock0,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.PK_EmbedQueue (2026-10-05 21:01)StatsUpdated rag.EmbedQueue.PK_EmbedQueue (2026-10-06 06:03)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.IX_EmbedQueue_Status (2026-10-06 00:17)StatsUpdated rag.EmbedQueue.UX_EmbedQueue_Pending (2026-10-04 08:16)StatsUpdated rag.EmbedQueue.UX_EmbedQueue_Pending (2026-10-05 20:20)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_00000003_50D1B250 (2026-10-05 21:01)StatsUpdated rag.EmbedQueue._WA_Sys_00000003_50D1B250 (2026-10-06 06:03)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_00000002_50D1B250 (2026-10-05 21:01)StatsUpdated rag.EmbedQueue._WA_Sys_00000002_50D1B250 (2026-10-06 06:03)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_00000005_50D1B250 (2026-10-06 00:18)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)StatsUpdated rag.EmbedQueue._WA_Sys_00000007_50D1B250 (2026-10-05 10:55)StatsUpdated rag.EmbedQueue._WA_Sys_00000007_50D1B250 (2026-10-06 05:27)Değişim: 6.10.2026 06:00Eski plan 6.10.2026 05:00: 50,9 msEski plan 6.10.2026 06:00: 20,8 msEski plan 6.10.2026 21:00: 22,7 msEski plan 6.10.2026 22:00: 17,9 msEski plan 7.10.2026 08:00: 17,2 msEski plan 7.10.2026 09:00: 14,4 msEski plan 7.10.2026 10:00: 14,1 msEski plan 7.10.2026 11:00: 13,5 msEski plan 7.10.2026 12:00: 13,4 msEski plan 7.10.2026 13:00: 14,0 msYeni plan 6.10.2026 06:00: 0,2 msYeni plan 6.10.2026 07:00: 0,1 msYeni plan 6.10.2026 08:00: 0,1 msYeni plan 6.10.2026 09:00: 0,1 msYeni plan 6.10.2026 10:00: 0,1 msYeni plan 6.10.2026 11:00: 0,1 msYeni plan 6.10.2026 12:00: 0,1 msYeni plan 6.10.2026 13:00: 0,1 msYeni plan 6.10.2026 14:00: 0,2 msYeni plan 6.10.2026 15:00: 0,2 msYeni plan 6.10.2026 16:00: 0,1 msYeni plan 6.10.2026 19:00: 0,5 msYeni plan 6.10.2026 21:00: 21,2 msmax 50,9 ms 10-04 08:15 10-07 13: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 evetevet
StatsUpdatedrag.EmbedQueue.PK_EmbedQueue5.10.2026 09:43 → 35554/35554 evetevet
StatsUpdatedrag.EmbedQueue.PK_EmbedQueue5.10.2026 21:01 → 40090/40090 evetevet
StatsUpdatedrag.EmbedQueue.PK_EmbedQueue6.10.2026 06:03 → 46550/46550 evetevet sıra belirsiz
StatsUpdatedrag.EmbedQueue.IX_EmbedQueue_Status4.10.2026 08:37 → 29933/29933 evetevet
StatsUpdatedrag.EmbedQueue.IX_EmbedQueue_Status5.10.2026 09:58 → 36904/36904 evetevet
StatsUpdatedrag.EmbedQueue.IX_EmbedQueue_Status6.10.2026 00:17 → 44164/44164 evetevet
StatsUpdatedrag.EmbedQueue.UX_EmbedQueue_Pending4.10.2026 08:16 → 3912/3912 evetevet
StatsUpdatedrag.EmbedQueue.UX_EmbedQueue_Pending5.10.2026 20:20 → 1/1 evetevet
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
StatsUpdatedrag.EmbedQueue._WA_Sys_00000003_50D1B2505.10.2026 21:01 → 40090/40090 hayırhayır
StatsUpdatedrag.EmbedQueue._WA_Sys_00000003_50D1B2506.10.2026 06:03 → 46550/46550 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
StatsUpdatedrag.EmbedQueue._WA_Sys_00000002_50D1B2505.10.2026 21:01 → 40090/40090 hayırhayır
StatsUpdatedrag.EmbedQueue._WA_Sys_00000002_50D1B2506.10.2026 06:03 → 46550/46550 hayırhayır sıra belirsiz
StatsUpdatedrag.EmbedQueue._WA_Sys_00000005_50D1B2504.10.2026 08:15 → 27382/27382 hayırhayır
StatsUpdatedrag.EmbedQueue._WA_Sys_00000005_50D1B2504.10.2026 08:30 → 29933/29933 hayırhayır
StatsUpdatedrag.EmbedQueue._WA_Sys_00000005_50D1B2505.10.2026 07:50 → 32492/32492 hayırhayır
StatsUpdatedrag.EmbedQueue._WA_Sys_00000005_50D1B2505.10.2026 09:49 → 36841/36841 hayırhayır
StatsUpdatedrag.EmbedQueue._WA_Sys_00000005_50D1B2506.10.2026 00:18 → 45427/45427 hayırhayır
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
StatsUpdatedrag.EmbedQueue._WA_Sys_00000007_50D1B2505.10.2026 10:55 → 37058/37058 hayırhayır
StatsUpdatedrag.EmbedQueue._WA_Sys_00000007_50D1B2506.10.2026 05:27 → 45559/45559 hayırhayı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çülenEşikSonuçAçıklama
STATS rag.EmbedQueue.PK_EmbedQueue güncellendi 2026-10-05 21:01 (örnekleme %100); pencerede 4 güncellemedeğ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üncellemedeğ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üncellemedeğ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

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 #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.