Skip to content

Commit

Permalink
Allow finding variables within more complex nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
MarkMpn committed Jun 13, 2023
1 parent 506c6de commit 6d4da57
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion MarkMpn.Sql4Cds.Engine/ExecutionPlanBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3223,7 +3223,7 @@ private void InsertCorrelatedSubquerySpool(ISingleSourceExecutionPlanNode node,

// If the last correlated step has a source which we couldn't step into because it's not an ISingleSourceExecutionPlanNode
// but it uses an outer reference we can't spool it
if (lastCorrelatedStep.Source.GetVariables(false).Intersect(outerReferences).Any())
if (lastCorrelatedStep.Source.GetVariables(true).Intersect(outerReferences).Any())
return;

// Check the estimated counts for the outer loop and the source at the point we'd insert the spool
Expand Down

0 comments on commit 6d4da57

Please sign in to comment.