Demo modu

Plan değişimi P422

Orta Kötüleşme 40,6× Bekliyor

DB-11 · query_id 36325 · rag.usp_EmbedQueue_Dequeue · değişim 2.10.2026 17:00 · plan 35406 → 35408 · Geçiş · Sorgu detayı ve analizleri

Güven gerekçesiOrta: birden fazla aday (STATS, WORKLOAD) — rakip açıklamalar. Zayıf karşı kanıt: LOW_SAMPLE, METADATA_GAP.

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 < SYSUTCDATETIME() 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, SYSUTCDATETIME())
    OUTPUT inserted.QueueID, inserted.SourceType, inserted.SourceRef, inserted.Attempt

1. Etki özeti

MetrikEski plan (35406)Yeni plan (35408)Değişim
Çalışma302.550
İptal / hata0 / 00 / 0
Süre ort. (ms)0,416,9+3964%
Süre maks. (ms)0,987,8+9228%
Süre sapma (ms)0,14,0+2762%
CPU ort. (ms)0,416,9+3955%
CPU maks. (ms)0,987,0+9159%
Mantıksal okuma ort.13,0683,1+5155%
Mantıksal okuma maks.13,02.053,0+15692%
Fiziksel okuma0,00,0
Yazma0,00,1+91%
Bellek (KB)1.024,01.030,5+1%
Tempdb (KB)0,00,7
DOP1,01,00%
Satır ort.2,04,2+109%
Satır maks.2,0100,0+4900%
Dönem2.10.2026 17:00 → 5.10.2026 10:00 2.10.2026 17:00 → 5.10.2026 10:00

Bekleme kategorileri

ms / çalışma
Bekleme kategorisiEski plan (35406)Yeni plan (35408)
CPU–0,1
Preemptive–0,0
Memory–0,0

2. Zaman çizelgesi

StatsUpdated rag.EmbedQueue.PK_EmbedQueue (2026-09-30 22:00)StatsUpdated rag.EmbedQueue.PK_EmbedQueue (2026-10-01 21:13)StatsUpdated rag.EmbedQueue.PK_EmbedQueue (2026-10-02 17:24)StatsUpdated rag.EmbedQueue.IX_EmbedQueue_Status (2026-09-30 22:00)StatsUpdated rag.EmbedQueue.IX_EmbedQueue_Status (2026-10-01 21:13)StatsUpdated rag.EmbedQueue.IX_EmbedQueue_Status (2026-10-02 01:06)StatsUpdated rag.EmbedQueue.IX_EmbedQueue_Status (2026-10-02 16:27)StatsUpdated rag.EmbedQueue.IX_EmbedQueue_Status (2026-10-02 17:27)StatsUpdated rag.EmbedQueue.UX_EmbedQueue_Pending (2026-09-30 21:00)StatsUpdated rag.EmbedQueue.UX_EmbedQueue_Pending (2026-10-02 16:25)StatsUpdated rag.EmbedQueue._WA_Sys_00000003_50D1B250 (2026-09-30 22:00)StatsUpdated rag.EmbedQueue._WA_Sys_00000003_50D1B250 (2026-10-01 21:13)StatsUpdated rag.EmbedQueue._WA_Sys_00000003_50D1B250 (2026-10-02 17:24)StatsUpdated rag.EmbedQueue._WA_Sys_00000002_50D1B250 (2026-09-30 22:00)StatsUpdated rag.EmbedQueue._WA_Sys_00000002_50D1B250 (2026-10-01 21:13)StatsUpdated rag.EmbedQueue._WA_Sys_00000002_50D1B250 (2026-10-02 17:24)StatsUpdated rag.EmbedQueue._WA_Sys_00000005_50D1B250 (2026-09-30 22:37)StatsUpdated rag.EmbedQueue._WA_Sys_00000005_50D1B250 (2026-10-01 20:55)StatsUpdated rag.EmbedQueue._WA_Sys_00000005_50D1B250 (2026-10-02 00:08)StatsUpdated rag.EmbedQueue._WA_Sys_00000005_50D1B250 (2026-10-02 16:25)StatsUpdated rag.EmbedQueue._WA_Sys_00000005_50D1B250 (2026-10-02 17:24)StatsUpdated rag.EmbedQueue._WA_Sys_00000006_50D1B250 (2026-09-30 22:00)StatsUpdated rag.EmbedQueue._WA_Sys_00000006_50D1B250 (2026-10-01 20:56)StatsUpdated rag.EmbedQueue._WA_Sys_00000006_50D1B250 (2026-10-02 01:06)StatsUpdated rag.EmbedQueue._WA_Sys_00000006_50D1B250 (2026-10-02 16:27)StatsUpdated rag.EmbedQueue._WA_Sys_00000006_50D1B250 (2026-10-02 17:27)StatsUpdated rag.EmbedQueue._WA_Sys_00000008_50D1B250 (2026-10-01 20:56)StatsUpdated rag.EmbedQueue._WA_Sys_00000008_50D1B250 (2026-10-02 00:59)StatsUpdated rag.EmbedQueue._WA_Sys_00000008_50D1B250 (2026-10-02 17:26)Değişim: 2.10.2026 17:00Eski plan 2.10.2026 17:00: 0,5 msEski plan 2.10.2026 18:00: 0,3 msEski plan 4.10.2026 08:00: 0,5 msEski plan 4.10.2026 13:00: 0,5 msEski plan 4.10.2026 22:00: 0,4 msEski plan 5.10.2026 00:00: 0,3 msEski plan 5.10.2026 02:00: 0,4 msEski plan 5.10.2026 08:00: 0,3 msEski plan 5.10.2026 09:00: 0,4 msYeni plan 2.10.2026 17:00: 16,6 msYeni plan 2.10.2026 18:00: 15,6 msYeni plan 2.10.2026 20:00: 14,1 msYeni plan 4.10.2026 08:00: 18,6 msYeni plan 4.10.2026 09:00: 16,7 msYeni plan 4.10.2026 10:00: 16,1 msYeni plan 4.10.2026 13:00: 18,8 msYeni plan 4.10.2026 14:00: 16,2 msYeni plan 4.10.2026 15:00: 16,1 msYeni plan 4.10.2026 20:00: 17,4 msYeni plan 4.10.2026 21:00: 21,1 msYeni plan 4.10.2026 22:00: 15,7 msYeni plan 4.10.2026 23:00: 18,8 msYeni plan 5.10.2026 00:00: 21,2 msYeni plan 5.10.2026 01:00: 15,0 msYeni plan 5.10.2026 02:00: 15,3 msYeni plan 5.10.2026 07:00: 19,3 msYeni plan 5.10.2026 08:00: 21,8 msYeni plan 5.10.2026 09:00: 19,3 msmax 21,8 ms 09-30 21:00 10-05 09: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_EmbedQueue30.09.2026 22:00 → 11580/11580 hayırevet
StatsUpdatedrag.EmbedQueue.PK_EmbedQueue1.10.2026 21:13 → 17648/17648 hayırevet
StatsUpdatedrag.EmbedQueue.PK_EmbedQueue2.10.2026 17:24 → 25153/25153 hayırevet sıra belirsiz
StatsUpdatedrag.EmbedQueue.IX_EmbedQueue_Status30.09.2026 22:00 → 11580/11580 hayırevet
StatsUpdatedrag.EmbedQueue.IX_EmbedQueue_Status1.10.2026 21:13 → 17185/17185 hayırevet
StatsUpdatedrag.EmbedQueue.IX_EmbedQueue_Status2.10.2026 01:06 → 17648/17648 hayırevet
StatsUpdatedrag.EmbedQueue.IX_EmbedQueue_Status2.10.2026 16:27 → 21389/21389 hayırevet
StatsUpdatedrag.EmbedQueue.IX_EmbedQueue_Status2.10.2026 17:27 → 25153/25153 hayırevet sıra belirsiz
StatsUpdatedrag.EmbedQueue.UX_EmbedQueue_Pending30.09.2026 21:00 → 900/900 hayırevet
StatsUpdatedrag.EmbedQueue.UX_EmbedQueue_Pending2.10.2026 16:25 → 3734/3734 hayırevet
StatsUpdatedrag.EmbedQueue._WA_Sys_00000003_50D1B25030.09.2026 22:00 → 11580/11580 hayırhayır
StatsUpdatedrag.EmbedQueue._WA_Sys_00000003_50D1B2501.10.2026 21:13 → 17648/17648 hayırhayır
StatsUpdatedrag.EmbedQueue._WA_Sys_00000003_50D1B2502.10.2026 17:24 → 25153/25153 hayırhayır sıra belirsiz
StatsUpdatedrag.EmbedQueue._WA_Sys_00000002_50D1B25030.09.2026 22:00 → 11580/11580 hayırhayır
StatsUpdatedrag.EmbedQueue._WA_Sys_00000002_50D1B2501.10.2026 21:13 → 17648/17648 hayırhayır
StatsUpdatedrag.EmbedQueue._WA_Sys_00000002_50D1B2502.10.2026 17:24 → 25153/25153 hayırhayır sıra belirsiz
StatsUpdatedrag.EmbedQueue._WA_Sys_00000005_50D1B25030.09.2026 22:37 → 11659/11659 hayırevet
StatsUpdatedrag.EmbedQueue._WA_Sys_00000005_50D1B2501.10.2026 20:55 → 12987/12987 hayırevet
StatsUpdatedrag.EmbedQueue._WA_Sys_00000005_50D1B2502.10.2026 00:08 → 17648/17648 hayırevet
StatsUpdatedrag.EmbedQueue._WA_Sys_00000005_50D1B2502.10.2026 16:25 → 21384/21384 hayırevet
StatsUpdatedrag.EmbedQueue._WA_Sys_00000005_50D1B2502.10.2026 17:24 → 25155/25155 hayırevet sıra belirsiz
StatsUpdatedrag.EmbedQueue._WA_Sys_00000006_50D1B25030.09.2026 22:00 → 11655/11655 hayırevet
StatsUpdatedrag.EmbedQueue._WA_Sys_00000006_50D1B2501.10.2026 20:56 → 14265/14265 hayırevet
StatsUpdatedrag.EmbedQueue._WA_Sys_00000006_50D1B2502.10.2026 01:06 → 17648/17648 hayırevet
StatsUpdatedrag.EmbedQueue._WA_Sys_00000006_50D1B2502.10.2026 16:27 → 21389/21389 hayırevet
StatsUpdatedrag.EmbedQueue._WA_Sys_00000006_50D1B2502.10.2026 17:27 → 25153/25153 hayırevet sıra belirsiz
StatsUpdatedrag.EmbedQueue._WA_Sys_00000008_50D1B2501.10.2026 20:56 → 12987/12987 hayırhayır
StatsUpdatedrag.EmbedQueue._WA_Sys_00000008_50D1B2502.10.2026 00:59 → 17648/17648 hayırhayır
StatsUpdatedrag.EmbedQueue._WA_Sys_00000008_50D1B2502.10.2026 17:26 → 25153/25153 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.025 → 0.62; 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çülenEşikSonuçAçıklama
STATS rag.EmbedQueue.PK_EmbedQueue güncellendi 2026-10-01 21:13 (örnekleme %100); pencerede 3 güncellemedeğişimden önceki 48 saat destekliyor İstatistik rag.EmbedQueue.PK_EmbedQueue 2026-10-01 21:13 güncellendi (örnekleme %100); pencerede 3 güncelleme; planlar bu istatistiği kullanıyor.
STATS rag.EmbedQueue.IX_EmbedQueue_Status güncellendi 2026-10-02 16:27 (örnekleme %100); pencerede 5 güncellemedeğişimden önceki 48 saat destekliyor İstatistik rag.EmbedQueue.IX_EmbedQueue_Status 2026-10-02 16:27 güncellendi (örnekleme %100); pencerede 5 güncelleme; planlar bu istatistiği kullanıyor.
STATS rag.EmbedQueue.UX_EmbedQueue_Pending güncellendi 2026-10-02 16:25 (örnekleme %100); pencerede 2 güncellemedeğişimden önceki 48 saat destekliyor İstatistik rag.EmbedQueue.UX_EmbedQueue_Pending 2026-10-02 16:25 güncellendi (örnekleme %100); pencerede 2 güncelleme; planlar bu istatistiği kullanıyor.
STATS rag.EmbedQueue._WA_Sys_00000005_50D1B250 güncellendi 2026-10-02 16:25 (örnekleme %100); pencerede 5 güncellemedeğişimden önceki 48 saat destekliyor İstatistik rag.EmbedQueue._WA_Sys_00000005_50D1B250 2026-10-02 16:25 güncellendi (örnekleme %100); pencerede 5 güncelleme; planlar bu istatistiği kullanıyor.
STATS rag.EmbedQueue._WA_Sys_00000006_50D1B250 güncellendi 2026-10-02 16:27 (örnekleme %100); pencerede 5 güncellemedeğişimden önceki 48 saat destekliyor İstatistik rag.EmbedQueue._WA_Sys_00000006_50D1B250 2026-10-02 16:27 güncellendi (örnekleme %100); pencerede 5 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_00000008_50D1B250.
WORKLOAD çalışma başına satır 2 → 4.17 (2.09×)≥ 2× destekliyor Planlar farklı iş yükü görüyor: çalışma başına satır 2 → 4.17. Planlar farklı parametre/parti büyüklüğü için derlenmiş olabilir.
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

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 #P422 | 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 < SYSUTCDATETIME() AND Attempt < @MaxAttempts) ORDER BY CASE SourceType WHEN ? THEN ? ELSE ? END, QueueID ) UPDATE c SET Status = ?, Attempt = Attempt + ?, LeaseUntilUtc = DATEADD(second, @LeaseSeconds, SYSUTCDATETIME()) OUTPUT inserted.QueueID, inserted.SourceType, inserted.SourceRef, inserted.Attempt
Change: 2026-10-02 17:00 UTC, plan 35406 → 35408, pattern: Transition
Impact (Query Store, per execution): duration 0.4 → 16.9 ms (+3964%); CPU 0.4 → 16.9 ms (+3955%); reads 13 → 683 (+5155%); rows 2 → 4.17 (+109%)
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.025 → 0.62; estimated rows: 2 → 100
Candidate cause: STATS — Statistic rag.EmbedQueue.PK_EmbedQueue was updated 2026-10-01 21:13 (sampled 100%); 3 updates in the window; the plans use this statistic.
Candidate cause: STATS — Statistic rag.EmbedQueue.IX_EmbedQueue_Status was updated 2026-10-02 16:27 (sampled 100%); 5 updates in the window; the plans use this statistic.
Candidate cause: STATS — Statistic rag.EmbedQueue.UX_EmbedQueue_Pending was updated 2026-10-02 16:25 (sampled 100%); 2 updates in the window; the plans use this statistic.
Candidate cause: STATS — Statistic rag.EmbedQueue._WA_Sys_00000005_50D1B250 was updated 2026-10-02 16:25 (sampled 100%); 5 updates in the window; the plans use this statistic.
Candidate cause: STATS — Statistic rag.EmbedQueue._WA_Sys_00000006_50D1B250 was updated 2026-10-02 16:27 (sampled 100%); 5 updates in the window; the plans use this statistic.
Candidate cause: WORKLOAD — The plans see a different workload: rows per execution 2 → 4.17. The plans may have been compiled for different parameters or batch sizes.
Counter-evidence: LOW_SAMPLE — The old plan ran only 30 times: the sample is small and the average is weak.
Counter-evidence: METADATA_GAP — Metadata collection started on 2026-10-01 and the change was on 2026-10-02: index, statistics and module events could not be evaluated (no data, not no events).
Confidence rationale: Medium: more than one candidate (STATS, WORKLOAD) — competing explanations. Weak counter-evidence: LOW_SAMPLE, METADATA_GAP.
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.