You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Hashset contains becomes a traditional IN statement instead of the new OpenJSON parameter #32365
The following code generates the new parameterized query but it seems like an unnecessary ToList and an easy place to miss adding the ToList and end up with a performance degradation.
Came here to report this. It seems it works correctly with List, IEnumerable and arrays. It doesn't work with HashSet, ImmutableList, ImmutableArray, ImmutableHashSet, FrozenSet, etc.
Hello everyone. Is there an ETA when this will be released? We are currently using a custom implementation of OPENJSON and we cannot remove it nor upgrade to EF 8 because of the bug.
SELECT [p].[Id], [p].[ProductId], [p].[ReactivateIfSubProductsReappear], [p].[Version], [p0].[Id], [p0].[IsMainProduct], [p0].[ProductId], [p0].[ProductSetId], [p0].[Quantity]
FROM [externaldata].[ProductSet] AS [p]
LEFT JOIN [externaldata].[ProductSetProduct] AS [p0] ON [p].[Id] = [p0].[ProductSetId]
WHERE [p].[ProductId] IN (CAST(213171ASbigint), CAST(234107ASbigint), CAST(254039ASbigint), CAST(252018ASbigint), CAST(257030ASbigint), CAST(282759ASbigint), CAST(290215ASbigint), CAST(352284ASbigint), CAST(354318ASbigint), CAST(354179ASbigint))
ORDER BY [p].[Id]
SELECT [p].[Id], [p].[ProductId], [p].[ReactivateIfSubProductsReappear], [p].[Version], [p0].[Id], [p0].[IsMainProduct], [p0].[ProductId], [p0].[ProductSetId], [p0].[Quantity]
FROM [externaldata].[ProductSet] AS [p]
LEFT JOIN [externaldata].[ProductSetProduct] AS [p0] ON [p].[Id] = [p0].[ProductSetId]
WHERE [p].[ProductId] IN (
SELECT [i].[value]
FROM OPENJSON(@__ids_0) WITH ([value] bigint'$') AS [i]
)
ORDER BY [p].[Id]
Activity
AlexeiScherbakov commentedon Nov 20, 2023
roji commentedon Nov 20, 2023
AlexeiScherbakov commentedon Nov 21, 2023
roji commentedon Nov 21, 2023
Thanks for reporting this, I've confirmed the bug and will investigate.
Repro
dggmez commentedon Nov 22, 2023
Came here to report this. It seems it works correctly with
List,IEnumerableand arrays. It doesn't work withHashSet,ImmutableList,ImmutableArray,ImmutableHashSet,FrozenSet, etc.ibrahim33 commentedon Jan 11, 2024
Hello everyone. Is there an ETA when this will be released? We are currently using a custom implementation of OPENJSON and we cannot remove it nor upgrade to EF 8 because of the bug.
LINQ with HashSet:
QUERY with HashSet:
LINQ with List:
QUERY with List:
10 remaining items
cincuranet commentedon Jun 4, 2024
Note to self (from design): We should handle
Containson any "ICollection", not onlyHashSet.OndrejUzovic commentedon Jun 10, 2024
Since by fixing this bug the workaround for #32147 will not work anymore.
Are there any plans to fix also #32147?
roji commentedon Jun 10, 2024
@OndrejUzovic yeah, we're definitely planning on fixing that (or providing a better workaround) for 9.0.