Skip to content

Conversation

@roji
Copy link
Member

@roji roji commented Jan 10, 2024

Fixes #32574, backports #32575

Description

As a result of the primitive collections changes in 8.0, when Contains is used with a nullable item over a parameterized list, a correlated EXISTS subquery is generated in the SQL. This changes the SQL to contain an uncorrelated IN subquery instead.

Customer impact

The correlated subquery can be the cause of very serious perf regressions; for example, one user reported that a query that previously completed in milliseconds now times out.

How found

Customer reported on 8.

Regression

Yes, considerable perf regression from 7.

Testing

The new SQL is asserted in tests.

Risk

Medium, the change has been quirked.

@roji roji requested a review from maumar January 10, 2024 08:02
@roji roji force-pushed the DestroyAllCorrelation8 branch from 70e8f30 to ca927cd Compare January 10, 2024 15:53
@AndriySvyryd AndriySvyryd added this to the 8.0.2 milestone Jan 12, 2024
@roji roji merged commit 239c86a into dotnet:release/8.0 Jan 12, 2024
@roji roji deleted the DestroyAllCorrelation8 branch January 12, 2024 18:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants