Demo modu

Plan değişimi P420

Düşük İyileşme 1,4× Bekliyor

DB-11 · query_id 36219 · değişim 6.10.2026 15:00 · plan 64705 → 64734 · Geçiş · Sorgu detayı ve analizleri

Güven gerekçesiDüşük: güçlü karşı kanıt (WORK_PROPORTIONAL).

Sorgu metni

SQL
(@incTest bit,@types1 nvarchar(4000),@sid int,@dbName nvarchar(4000),@model nvarchar(4000),@q vector(1024),@top int)SELECT TOP (@top) c.ChunkId, c.DocId, d.SourceType, d.SourceRef, d.Title, c.Heading, c.Text,
       VECTOR_DISTANCE('cosine', c.Embedding, @q) AS Score
FROM rag.Chunk AS c
JOIN rag.Document AS d ON d.DocId = c.DocId
WHERE (d.IsActive = 1 OR (@incTest = 1 AND d.ExclusionReason = 'TestDb')) AND d.SourceType IN (@types1)
AND (@sid IS NULL OR d.ServerID = @sid) AND (@dbName IS NULL OR d.DatabaseName = @dbName) AND c.Embedding IS NOT NULL AND c.EmbeddingModel = @model
ORDER BY Score, c.ChunkId

1. Etki özeti

MetrikEski plan (64705)Yeni plan (64734)Değişim
Çalışma8612.493
İptal / hata0 / 00 / 0
Süre ort. (ms)39,828,4-29%
Süre maks. (ms)1.000,0357,2-64%
Süre sapma (ms)104,631,5-70%
CPU ort. (ms)29,128,4-2%
CPU maks. (ms)80,3174,4+117%
Mantıksal okuma ort.6.169,913.119,6+113%
Mantıksal okuma maks.7.327,036.138,0+393%
Fiziksel okuma18,61,4-93%
Yazma0,00,0+51%
Bellek (KB)23.511,013.079,9-44%
Tempdb (KB)235,9346,2+47%
DOP1,01,00%
Satır ort.20,013,4-33%
Satır maks.20,020,00%
Dönem6.10.2026 06:00 → 6.10.2026 07:00 6.10.2026 15:00 → 6.10.2026 16:00

Bekleme kategorileri

ms / çalışma
Bekleme kategorisiEski plan (64705)Yeni plan (64734)
Memory0,70,5
CPU0,00,0
Buffer IO–0,0
Other Disk IO–0,0
Idle10,7–

2. Zaman çizelgesi

StatsUpdated rag.Chunk.PK_Chunk (2026-10-05 08:59)StatsUpdated rag.Chunk.PK_Chunk (2026-10-05 09:59)StatsUpdated rag.Chunk.PK_Chunk (2026-10-05 22:47)StatsUpdated rag.Chunk.UQ_Chunk_DocSeq (2026-10-05 08:59)StatsUpdated rag.Chunk.UQ_Chunk_DocSeq (2026-10-05 09:59)StatsUpdated rag.Chunk.UQ_Chunk_DocSeq (2026-10-05 22:47)StatsUpdated rag.Chunk._WA_Sys_00000007_49309088 (2026-10-05 09:59)StatsUpdated rag.Chunk._WA_Sys_00000007_49309088 (2026-10-05 22:47)StatsUpdated rag.Chunk._WA_Sys_00000003_49309088 (2026-10-05 08:59)StatsUpdated rag.Chunk._WA_Sys_00000003_49309088 (2026-10-05 09:59)StatsUpdated rag.Chunk._WA_Sys_00000003_49309088 (2026-10-05 22:47)StatsUpdated rag.Document.PK_Document (2026-10-04 21:41)StatsUpdated rag.Document.PK_Document (2026-10-06 01:16)StatsUpdated rag.Document.UQ_Document_Source (2026-10-04 22:07)StatsUpdated rag.Document.UQ_Document_Source (2026-10-05 11:42)StatsUpdated rag.Document.UQ_Document_Source (2026-10-06 04:00)StatsUpdated rag.Document._WA_Sys_0000000A_428392F9 (2026-10-05 09:04)StatsUpdated rag.Document._WA_Sys_0000000A_428392F9 (2026-10-05 22:57)StatsUpdated rag.Document._WA_Sys_00000003_428392F9 (2026-10-04 21:41)StatsUpdated rag.Document._WA_Sys_00000003_428392F9 (2026-10-06 01:16)StatsUpdated rag.Document._WA_Sys_00000005_428392F9 (2026-10-05 09:07)StatsUpdated rag.Document._WA_Sys_00000005_428392F9 (2026-10-05 22:46)StatsUpdated rag.Document._WA_Sys_0000000D_428392F9 (2026-10-05 09:08)StatsUpdated rag.Document._WA_Sys_0000000D_428392F9 (2026-10-05 22:52)StatsUpdated rag.Document._WA_Sys_00000008_428392F9 (2026-10-05 20:06)StatsUpdated rag.Document._WA_Sys_00000008_428392F9 (2026-10-06 06:13)StatsUpdated rag.Document._WA_Sys_0000000E_428392F9 (2026-10-04 22:07)StatsUpdated rag.Document._WA_Sys_0000000E_428392F9 (2026-10-05 21:02)StatsUpdated rag.Document._WA_Sys_0000000E_428392F9 (2026-10-06 05:48)StatsUpdated rag.Document._WA_Sys_00000006_428392F9 (2026-10-05 09:24)StatsUpdated rag.Document._WA_Sys_00000006_428392F9 (2026-10-05 22:46)StatsUpdated rag.Document._WA_Sys_0000000F_428392F9 (2026-10-05 08:58)StatsUpdated rag.Document._WA_Sys_0000000F_428392F9 (2026-10-05 09:59)StatsUpdated rag.Document._WA_Sys_0000000F_428392F9 (2026-10-05 22:47)StatsUpdated rag.Document._WA_Sys_0000000F_428392F9 (2026-10-06 06:10)Değişim: 6.10.2026 15:00Eski plan 6.10.2026 06:00: 39,8 msYeni plan 6.10.2026 15:00: 28,4 msmax 39,8 ms 10-04 21:41 10-06 15: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.Chunk.PK_Chunk5.10.2026 08:59 → 2167/4745 evetevet
StatsUpdatedrag.Chunk.PK_Chunk5.10.2026 09:59 → 2399/5069 evetevet
StatsUpdatedrag.Chunk.PK_Chunk5.10.2026 22:47 → 2545/5367 evetevet
StatsUpdatedrag.Chunk.UQ_Chunk_DocSeq5.10.2026 08:59 → 2593/4745 evetevet
StatsUpdatedrag.Chunk.UQ_Chunk_DocSeq5.10.2026 09:59 → 2658/5069 evetevet
StatsUpdatedrag.Chunk.UQ_Chunk_DocSeq5.10.2026 22:47 → 2720/5367 evetevet
StatsUpdatedrag.Chunk._WA_Sys_00000007_493090885.10.2026 09:59 → 2651/5069 evetevet
StatsUpdatedrag.Chunk._WA_Sys_00000007_493090885.10.2026 22:47 → 2733/5413 evetevet
StatsUpdatedrag.Chunk._WA_Sys_00000003_493090885.10.2026 08:59 → 2167/4745 evetevet
StatsUpdatedrag.Chunk._WA_Sys_00000003_493090885.10.2026 09:59 → 2399/5069 evetevet
StatsUpdatedrag.Chunk._WA_Sys_00000003_493090885.10.2026 22:47 → 2545/5367 evetevet
StatsUpdatedrag.Document.PK_Document4.10.2026 21:41 → 3980/3980 evetevet
StatsUpdatedrag.Document.PK_Document6.10.2026 01:16 → 4700/4700 evetevet
StatsUpdatedrag.Document.UQ_Document_Source4.10.2026 22:07 → 3982/3982 evetevet
StatsUpdatedrag.Document.UQ_Document_Source5.10.2026 11:42 → 4303/4303 evetevet
StatsUpdatedrag.Document.UQ_Document_Source6.10.2026 04:00 → 4474/4474 evetevet
StatsUpdatedrag.Document._WA_Sys_0000000A_428392F95.10.2026 09:04 → 4189/4189 evetevet
StatsUpdatedrag.Document._WA_Sys_0000000A_428392F95.10.2026 22:57 → 4701/4701 evetevet
StatsUpdatedrag.Document._WA_Sys_00000003_428392F94.10.2026 21:41 → 3980/3980 hayırhayır
StatsUpdatedrag.Document._WA_Sys_00000003_428392F96.10.2026 01:16 → 4700/4700 hayırhayır
StatsUpdatedrag.Document._WA_Sys_00000005_428392F95.10.2026 09:07 → 4189/4189 evetevet
StatsUpdatedrag.Document._WA_Sys_00000005_428392F95.10.2026 22:46 → 4286/4286 evetevet
StatsUpdatedrag.Document._WA_Sys_0000000D_428392F95.10.2026 09:08 → 4189/4189 hayırhayır
StatsUpdatedrag.Document._WA_Sys_0000000D_428392F95.10.2026 22:52 → 4699/4699 hayırhayır
StatsUpdatedrag.Document._WA_Sys_00000008_428392F95.10.2026 20:06 → 4304/4304 hayırhayır
StatsUpdatedrag.Document._WA_Sys_00000008_428392F96.10.2026 06:13 → 4187/4187 hayırhayır
StatsUpdatedrag.Document._WA_Sys_0000000E_428392F94.10.2026 22:07 → 3984/3984 evetevet
StatsUpdatedrag.Document._WA_Sys_0000000E_428392F95.10.2026 21:02 → 4274/4274 evetevet
StatsUpdatedrag.Document._WA_Sys_0000000E_428392F96.10.2026 05:48 → 4480/4480 evetevet
StatsUpdatedrag.Document._WA_Sys_00000006_428392F95.10.2026 09:24 → 4189/4189 hayırhayır
StatsUpdatedrag.Document._WA_Sys_00000006_428392F95.10.2026 22:46 → 4286/4286 hayırhayır
StatsUpdatedrag.Document._WA_Sys_0000000F_428392F95.10.2026 08:58 → 3981/3981 hayırhayır
StatsUpdatedrag.Document._WA_Sys_0000000F_428392F95.10.2026 09:59 → 4333/4333 hayırhayır
StatsUpdatedrag.Document._WA_Sys_0000000F_428392F95.10.2026 22:47 → 4524/4524 hayırhayır
StatsUpdatedrag.Document._WA_Sys_0000000F_428392F96.10.2026 06:10 → 4224/4224 hayırhayır

3. Plan karşılaştırması

  • Yalnız eski planda erişim: rag.Document Clustered Index Scan [PK_Document]; rag.Chunk Clustered Index Scan [PK_Chunk]
  • Yalnız yeni planda erişim: rag.Document Index Scan [UQ_Document_Source]; rag.Document Clustered Index Seek [PK_Document] (lookup); rag.Chunk Index Seek [UQ_Chunk_DocSeq]; rag.Chunk Clustered Index Seek [PK_Chunk] (lookup)
  • Yalnız eski planda join: Hash Match (Inner Join)
  • Yalnız yeni planda join: Nested Loops (Inner Join) ×3
  • Tahmini maliyet: 50.045 → 0.095; tahmini satır: 20 → 1
Eski planın index'leri
rag.Document.PK_Document, rag.Chunk.PK_Chunk
Yeni planın index'leri
rag.Document.UQ_Document_Source, rag.Document.PK_Document, rag.Chunk.UQ_Chunk_DocSeq, rag.Chunk.PK_Chunk

4. Neden adayları

ölçüm ve eşikle; kesin değildir
KodÖlçülenEşikSonuçAçıklama
STATS rag.Chunk.PK_Chunk güncellendi 2026-10-05 22:47 (örnekleme %47.4); pencerede 3 güncellemedeğişimden önceki 48 saat destekliyor İstatistik rag.Chunk.PK_Chunk 2026-10-05 22:47 güncellendi (örnekleme %47.4); pencerede 3 güncelleme; planlar bu istatistiği kullanıyor.
STATS rag.Chunk.UQ_Chunk_DocSeq güncellendi 2026-10-05 22:47 (örnekleme %50.7); pencerede 3 güncellemedeğişimden önceki 48 saat destekliyor İstatistik rag.Chunk.UQ_Chunk_DocSeq 2026-10-05 22:47 güncellendi (örnekleme %50.7); pencerede 3 güncelleme; planlar bu istatistiği kullanıyor.
STATS rag.Chunk._WA_Sys_00000007_49309088 güncellendi 2026-10-05 22:47 (örnekleme %50.5); pencerede 2 güncellemedeğişimden önceki 48 saat destekliyor İstatistik rag.Chunk._WA_Sys_00000007_49309088 2026-10-05 22:47 güncellendi (örnekleme %50.5); pencerede 2 güncelleme; planlar bu istatistiği kullanıyor.
STATS rag.Chunk._WA_Sys_00000003_49309088 güncellendi 2026-10-05 22:47 (örnekleme %47.4); pencerede 3 güncellemedeğişimden önceki 48 saat destekliyor İstatistik rag.Chunk._WA_Sys_00000003_49309088 2026-10-05 22:47 güncellendi (örnekleme %47.4); pencerede 3 güncelleme; planlar bu istatistiği kullanıyor.
STATS rag.Document.PK_Document güncellendi 2026-10-06 01:16 (örnekleme %100); pencerede 2 güncellemedeğişimden önceki 48 saat destekliyor İstatistik rag.Document.PK_Document 2026-10-06 01:16 güncellendi (örnekleme %100); pencerede 2 güncelleme; planlar bu istatistiği kullanıyor.
STATS rag.Document.UQ_Document_Source güncellendi 2026-10-06 04:00 (örnekleme %100); pencerede 3 güncellemedeğişimden önceki 48 saat destekliyor İstatistik rag.Document.UQ_Document_Source 2026-10-06 04:00 güncellendi (örnekleme %100); pencerede 3 güncelleme; planlar bu istatistiği kullanıyor.
STATS rag.Document._WA_Sys_0000000A_428392F9 güncellendi 2026-10-05 22:57 (örnekleme %100); pencerede 2 güncellemedeğişimden önceki 48 saat destekliyor İstatistik rag.Document._WA_Sys_0000000A_428392F9 2026-10-05 22:57 güncellendi (örnekleme %100); pencerede 2 güncelleme; planlar bu istatistiği kullanıyor.
STATS rag.Document._WA_Sys_00000005_428392F9 güncellendi 2026-10-05 22:46 (örnekleme %100); pencerede 2 güncellemedeğişimden önceki 48 saat destekliyor İstatistik rag.Document._WA_Sys_00000005_428392F9 2026-10-05 22:46 güncellendi (örnekleme %100); pencerede 2 güncelleme; planlar bu istatistiği kullanıyor.
STATS rag.Document._WA_Sys_0000000E_428392F9 güncellendi 2026-10-06 05:48 (örnekleme %100); pencerede 3 güncellemedeğişimden önceki 48 saat destekliyor İstatistik rag.Document._WA_Sys_0000000E_428392F9 2026-10-06 05:48 güncellendi (örnekleme %100); pencerede 3 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.Document._WA_Sys_00000003_428392F9, rag.Document._WA_Sys_0000000D_428392F9, rag.Document._WA_Sys_00000008_428392F9, rag.Document._WA_Sys_00000006_428392F9, rag.Document._WA_Sys_0000000F_428392F9.
WORKLOAD çalışma başına satır 20 → 13.36 (1.5×)≥ 2× desteklemiyor Çalışma başına satır benzer (20 → 13.36): iş yükü farkı yok.
PARAM baskın plan 1 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 #P420 | DB: DB-11 | Improvement | Confidence: Low (review pending)
Query: (@incTest bit,@types1 nvarchar(?),@sid int,@dbName nvarchar(?),@model nvarchar(?),@q vector(?),@top int)SELECT TOP (@top) c.ChunkId, c.DocId, d.SourceType, d.SourceRef, d.Title, c.Heading, c.Text, VECTOR_DISTANCE(?, c.Embedding, @q) AS Score FROM rag.Chunk AS c JOIN rag.Document AS d ON d.DocId = c.DocId WHERE (d.IsActive = ? OR (@incTest = ? AND d.ExclusionReason = ?)) AND d.SourceType IN (@types1) AND (@sid IS NULL OR d.ServerID = @sid) AND (@dbName IS NULL OR d.DatabaseName = @dbName) AND c.Embedding IS NOT NULL AND c.EmbeddingModel = @model ORDER BY Score, c.ChunkId
Change: 2026-10-06 15:00 UTC, plan 64705 → 64734, pattern: Transition
Impact (Query Store, per execution): duration 39.8 → 28.4 ms (-29%); CPU 29.1 → 28.4 ms (-2%); reads 6,170 → 13,120 (+113%); rows 20 → 13.36 (-33%)
Plan difference: Access only in the old plan: rag.Document Clustered Index Scan [PK_Document]; rag.Chunk Clustered Index Scan [PK_Chunk]; Access only in the new plan: rag.Document Index Scan [UQ_Document_Source]; rag.Document Clustered Index Seek [PK_Document] (lookup); rag.Chunk Index Seek [UQ_Chunk_DocSeq]; rag.Chunk Clustered Index Seek [PK_Chunk] (lookup); Join only in the old plan: Hash Match (Inner Join); Join only in the new plan: Nested Loops (Inner Join) ×3
Candidate cause: STATS — Statistic rag.Chunk.PK_Chunk was updated 2026-10-05 22:47 (sampled 47.4%); 3 updates in the window; the plans use this statistic.
Candidate cause: STATS — Statistic rag.Chunk.UQ_Chunk_DocSeq was updated 2026-10-05 22:47 (sampled 50.7%); 3 updates in the window; the plans use this statistic.
Candidate cause: STATS — Statistic rag.Chunk._WA_Sys_00000007_49309088 was updated 2026-10-05 22:47 (sampled 50.5%); 2 updates in the window; the plans use this statistic.
Candidate cause: STATS — Statistic rag.Chunk._WA_Sys_00000003_49309088 was updated 2026-10-05 22:47 (sampled 47.4%); 3 updates in the window; the plans use this statistic.
Candidate cause: STATS — Statistic rag.Document.PK_Document was updated 2026-10-06 01:16 (sampled 100%); 2 updates in the window; the plans use this statistic.
Candidate cause: STATS — Statistic rag.Document.UQ_Document_Source was updated 2026-10-06 04:00 (sampled 100%); 3 updates in the window; the plans use this statistic.
Candidate cause: STATS — Statistic rag.Document._WA_Sys_0000000A_428392F9 was updated 2026-10-05 22:57 (sampled 100%); 2 updates in the window; the plans use this statistic.
Candidate cause: STATS — Statistic rag.Document._WA_Sys_00000005_428392F9 was updated 2026-10-05 22:46 (sampled 100%); 2 updates in the window; the plans use this statistic.
Candidate cause: STATS — Statistic rag.Document._WA_Sys_0000000E_428392F9 was updated 2026-10-06 05:48 (sampled 100%); 3 updates in the window; the plans use this statistic.
Counter-evidence: WORK_PROPORTIONAL — Rows per execution changed 0.67× and duration 0.71×; duration per row 1.9894 → 2.1276 ms: the duration difference comes from the amount of data processed, not the plan.
Counter-evidence: HIGH_VARIANCE — The old plan's duration standard deviation is 263% of the average: the average is not reliable.
Counter-evidence: HIGH_VARIANCE — The new plan's duration standard deviation is 111% of the average: the average is not reliable.
Confidence rationale: Low: strong counter-evidence (WORK_PROPORTIONAL).
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.