Commit f922d0e
sp_QuickieStore: use EXISTS pattern in final plan OUTER APPLY
The JOIN pattern in the OUTER APPLY wasn't getting a good plan.
EXISTS with the semi-join against #hi_id_staging_plans lets the
optimizer pick a better strategy for the correlated subquery.
Tested on SQL2022.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 20a017f commit f922d0e
1 file changed
Lines changed: 9 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5606 | 5606 | | |
5607 | 5607 | | |
5608 | 5608 | | |
5609 | | - | |
5610 | | - | |
5611 | | - | |
5612 | | - | |
| 5609 | + | |
| 5610 | + | |
| 5611 | + | |
| 5612 | + | |
| 5613 | + | |
| 5614 | + | |
| 5615 | + | |
| 5616 | + | |
| 5617 | + | |
5613 | 5618 | | |
5614 | 5619 | | |
5615 | 5620 | | |
| |||
0 commit comments