-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
Query: Apply optimizations to composite predicates in all parts of the query #7608
Comments
See Tests Assert.Equal(
@"SELECT CASE
WHEN NOT EXISTS (
SELECT 1
FROM [CogTag] AS [t]
LEFT JOIN (
SELECT [t.Gear].[Nickname], [t.Gear].[SquadId], [t.Gear].[AssignedCityName], [t.Gear].[CityOrBirthName], [t.Gear].[Discriminator], [t.Gear].[FullName], [t.Gear].[HasSoulPatch], [t.Gear].[LeaderNickname], [t.Gear].[LeaderSquadId], [t.Gear].[Rank]
FROM [Gear] AS [t.Gear]
WHERE ([t.Gear].[Discriminator] = N'Officer') OR ([t.Gear].[Discriminator] = N'Gear') //<--- BAD LINE
) AS [t0] ON ([t].[GearNickName] = [t0].[Nickname]) AND ([t].[GearSquadId] = [t0].[SquadId])
WHERE (([t].[Note] <> N'K.I.A.') OR [t].[Note] IS NULL) AND ([t0].[HasSoulPatch] = 0))
THEN CAST(1 AS BIT) ELSE CAST(0 AS BIT)
END",
Sql); |
Can I poach this? |
This is already fixed in latest dev. The issue in above query was, we had to go inside of ExistExpression. It was missing proper VisitChildren method. Which was done in #7646 Thanks @tuespetre |
Currently CompositePredicateExpressionVisitor is only applied to predicates. Perhaps some of the work we do there could be applied in other places (e.g projections)
The text was updated successfully, but these errors were encountered: