Plan değişimi P422
Orta Kötüleşme 40,6× BekliyorDB-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
(@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.Attempt1. Etki özeti
| Metrik | Eski plan (35406) | Yeni plan (35408) | Değişim |
|---|---|---|---|
| Çalışma | 30 | 2.550 | |
| İptal / hata | 0 / 0 | 0 / 0 | |
| Süre ort. (ms) | 0,4 | 16,9 | +3964% |
| Süre maks. (ms) | 0,9 | 87,8 | +9228% |
| Süre sapma (ms) | 0,1 | 4,0 | +2762% |
| CPU ort. (ms) | 0,4 | 16,9 | +3955% |
| CPU maks. (ms) | 0,9 | 87,0 | +9159% |
| Mantıksal okuma ort. | 13,0 | 683,1 | +5155% |
| Mantıksal okuma maks. | 13,0 | 2.053,0 | +15692% |
| Fiziksel okuma | 0,0 | 0,0 | |
| Yazma | 0,0 | 0,1 | +91% |
| Bellek (KB) | 1.024,0 | 1.030,5 | +1% |
| Tempdb (KB) | 0,0 | 0,7 | |
| DOP | 1,0 | 1,0 | 0% |
| Satır ort. | 2,0 | 4,2 | +109% |
| Satır maks. | 2,0 | 100,0 | +4900% |
| Dönem | 2.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 kategorisi | Eski plan (35406) | Yeni plan (35408) |
|---|---|---|
| CPU | – | 0,1 |
| Preemptive | – | 0,0 |
| 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 | 30.09.2026 22:00 | → 11580/11580 | hayır | evet | |
| StatsUpdated | rag.EmbedQueue.PK_EmbedQueue | 1.10.2026 21:13 | → 17648/17648 | hayır | evet | |
| StatsUpdated | rag.EmbedQueue.PK_EmbedQueue | 2.10.2026 17:24 | → 25153/25153 | hayır | evet | sıra belirsiz |
| StatsUpdated | rag.EmbedQueue.IX_EmbedQueue_Status | 30.09.2026 22:00 | → 11580/11580 | hayır | evet | |
| StatsUpdated | rag.EmbedQueue.IX_EmbedQueue_Status | 1.10.2026 21:13 | → 17185/17185 | hayır | evet | |
| StatsUpdated | rag.EmbedQueue.IX_EmbedQueue_Status | 2.10.2026 01:06 | → 17648/17648 | hayır | evet | |
| StatsUpdated | rag.EmbedQueue.IX_EmbedQueue_Status | 2.10.2026 16:27 | → 21389/21389 | hayır | evet | |
| StatsUpdated | rag.EmbedQueue.IX_EmbedQueue_Status | 2.10.2026 17:27 | → 25153/25153 | hayır | evet | sıra belirsiz |
| StatsUpdated | rag.EmbedQueue.UX_EmbedQueue_Pending | 30.09.2026 21:00 | → 900/900 | hayır | evet | |
| StatsUpdated | rag.EmbedQueue.UX_EmbedQueue_Pending | 2.10.2026 16:25 | → 3734/3734 | hayır | evet | |
| StatsUpdated | rag.EmbedQueue._WA_Sys_00000003_50D1B250 | 30.09.2026 22:00 | → 11580/11580 | hayır | hayır | |
| StatsUpdated | rag.EmbedQueue._WA_Sys_00000003_50D1B250 | 1.10.2026 21:13 | → 17648/17648 | hayır | hayır | |
| StatsUpdated | rag.EmbedQueue._WA_Sys_00000003_50D1B250 | 2.10.2026 17:24 | → 25153/25153 | hayır | hayır | sıra belirsiz |
| StatsUpdated | rag.EmbedQueue._WA_Sys_00000002_50D1B250 | 30.09.2026 22:00 | → 11580/11580 | hayır | hayır | |
| StatsUpdated | rag.EmbedQueue._WA_Sys_00000002_50D1B250 | 1.10.2026 21:13 | → 17648/17648 | hayır | hayır | |
| StatsUpdated | rag.EmbedQueue._WA_Sys_00000002_50D1B250 | 2.10.2026 17:24 | → 25153/25153 | hayır | hayır | sıra belirsiz |
| StatsUpdated | rag.EmbedQueue._WA_Sys_00000005_50D1B250 | 30.09.2026 22:37 | → 11659/11659 | hayır | evet | |
| StatsUpdated | rag.EmbedQueue._WA_Sys_00000005_50D1B250 | 1.10.2026 20:55 | → 12987/12987 | hayır | evet | |
| StatsUpdated | rag.EmbedQueue._WA_Sys_00000005_50D1B250 | 2.10.2026 00:08 | → 17648/17648 | hayır | evet | |
| StatsUpdated | rag.EmbedQueue._WA_Sys_00000005_50D1B250 | 2.10.2026 16:25 | → 21384/21384 | hayır | evet | |
| StatsUpdated | rag.EmbedQueue._WA_Sys_00000005_50D1B250 | 2.10.2026 17:24 | → 25155/25155 | hayır | evet | sıra belirsiz |
| StatsUpdated | rag.EmbedQueue._WA_Sys_00000006_50D1B250 | 30.09.2026 22:00 | → 11655/11655 | hayır | evet | |
| StatsUpdated | rag.EmbedQueue._WA_Sys_00000006_50D1B250 | 1.10.2026 20:56 | → 14265/14265 | hayır | evet | |
| StatsUpdated | rag.EmbedQueue._WA_Sys_00000006_50D1B250 | 2.10.2026 01:06 | → 17648/17648 | hayır | evet | |
| StatsUpdated | rag.EmbedQueue._WA_Sys_00000006_50D1B250 | 2.10.2026 16:27 | → 21389/21389 | hayır | evet | |
| StatsUpdated | rag.EmbedQueue._WA_Sys_00000006_50D1B250 | 2.10.2026 17:27 | → 25153/25153 | hayır | evet | sıra belirsiz |
| StatsUpdated | rag.EmbedQueue._WA_Sys_00000008_50D1B250 | 1.10.2026 20:56 | → 12987/12987 | hayır | hayır | |
| StatsUpdated | rag.EmbedQueue._WA_Sys_00000008_50D1B250 | 2.10.2026 00:59 | → 17648/17648 | hayır | hayır | |
| StatsUpdated | rag.EmbedQueue._WA_Sys_00000008_50D1B250 | 2.10.2026 17:26 | → 25153/25153 | 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.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çülen | Eşik | Sonuç | Açıklama |
|---|---|---|---|---|
| STATS | rag.EmbedQueue.PK_EmbedQueue güncellendi 2026-10-01 21:13 (örnekleme %100); pencerede 3 güncelleme | değ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üncelleme | değ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üncelleme | değ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üncelleme | değ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üncelleme | değ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
- LOW_SAMPLE (zayıf): Eski plan yalnız 30 kez çalışmış: örnek az, ortalama zayıf.
- METADATA_GAP (zayıf): Metadata toplama 2026-10-01 tarihinde başladı, değişim 2026-10-02: index/istatistik/modül olayları değerlendirilemedi (olay yok değil, veri yok).
6. Korpus metni önizlemesi
onaylanınca RAG hafızasına bu metin girer (başlığa onaylayan eklenir)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.