Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[release/8.x] Produce uncorrelated IN for Contains with nullable item (#32575) #32764

Merged
merged 1 commit into from
Jan 12, 2024

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
@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
7 checks passed
@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