Skip to content

Commit 20a017f

Browse files
Merge pull request #713 from erikdarlingdata/fix/hi-plan-apply-pk-seek
sp_QuickieStore: use plan_id PK seek in final OUTER APPLY
2 parents 5fffeb8 + 38b631b commit 20a017f

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

sp_QuickieStore/sp_QuickieStore.sql

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5606,10 +5606,10 @@ OUTER APPLY
56065606
qsp.last_execution_time DESC
56075607
),
56085608
qsp.query_plan
5609-
FROM #hi_id_staging_queries AS sq
5609+
FROM #hi_id_staging_plans AS sp
56105610
JOIN ' + @database_name_quoted + N'.sys.query_store_plan AS qsp
5611-
ON qsp.query_id = sq.query_id
5612-
WHERE sq.query_hash = o.query_hash
5611+
ON qsp.plan_id = sp.plan_id
5612+
WHERE sp.query_hash = o.query_hash
56135613
) AS qp0
56145614
WHERE qp0.n = 1
56155615
) AS qp

0 commit comments

Comments
 (0)