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.0] Allow opting out of new subquery translation for Contains #32434

Merged
merged 1 commit into from
Jan 3, 2024

Conversation

roji
Copy link
Member

@roji roji commented Nov 28, 2023

Fixes #31552, backports #32412.

Description

As part of the new primitive collections support, EF8 translates the LINQ Contains operator using SQL subqueries (with e.g. OPENJSON on SQL Server) rather than the older and inefficient IN+constants translation. Although the new query shape is preferable, some edge cases have been flagged with it in terms of functionality and performance. This allows users to opt-out of the new translation on a per-query basis, going back to the old translation when needed.

Customer impact

In some edge cases, the new 8.0 Contains translation may be considerably less performant (#32394), or not supported by a specific database (#32374).

How found

Customer reported on 8.0

Regression

Yes

Testing

Added.

Risk

Very low; quirk added.

@roji roji requested a review from a team November 28, 2023 12:25
@roji roji changed the title [release/8.0] Implement EF.Constant [release/8.0] Allow opting out of new subquery translation for Contains Nov 28, 2023
@roji roji changed the base branch from main to release/8.0 November 28, 2023 12:29
src/EFCore/EF.cs Outdated Show resolved Hide resolved
Closes dotnet#31552

(cherry picked from commit 484a3ed)
Copy link

@dhudec dhudec left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm 👍

@armsteadj1
Copy link

Is there an ETA on releasing this?

@AndriySvyryd
Copy link
Member

Is there an ETA on releasing this?

Feb 2024. Consider using EF9 daily builds until then.

@jmezach
Copy link

jmezach commented Dec 1, 2023

@AndriySvyryd We were expecting this to be released as a patch on EF Core 8. Is that no longer the case?

@ajcvickers
Copy link
Member

@jmezach The patch is scheduled for Feb 2024. Unfortunately, there are no patch builds available publicly until release day; this is outside of our control. Hence if you need the fix before then, then you'll need to use the daily builds of EF9.

@ErikEJ
Copy link
Contributor

ErikEJ commented Dec 1, 2023

@jmezach And the daily builds for EF9 are basically at this point in time the latest bug fixes for EF 8 and nothing else.

@stevendarby
Copy link
Contributor

stevendarby commented Dec 1, 2023

@ajcvickers won’t there be 8.0.1 this month, 8.0.2 in January, 8.0.3 in February? So are EF patches being deliberately held back?

@ErikEJ
Copy link
Contributor

ErikEJ commented Dec 1, 2023

@stevendarby I think it is 8.0.1 in January (December is skipped)

@ajcvickers
Copy link
Member

Management decisions:

  • No December patch
  • January patch completed in November and in the can--nothing else can go in
  • February patch is the first time current fixed 8.0.2 issues will be shipped

@wtgodbe wtgodbe merged commit f2a4d4a into dotnet:release/8.0 Jan 3, 2024
7 checks passed
@roji roji deleted the EfConstant8 branch January 3, 2024 22:59
@clement911
Copy link
Contributor

Is this in the 8.0.2 package?

@ErikEJ
Copy link
Contributor

ErikEJ commented Feb 20, 2024

@clement911 Yes, as you can see from the milestone of #31552

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.

Adding EF.Constant to prevent parameterization in query