dotnet / dotnet/efcore

Missed opportunity for IN instead of EXISTS in ExecuteDelete

Open
#32,359 0 comments 0 reactions 0 assignees View on GitHub
area-perf area-query
Dominant language
C#
Stars
14.8k
Forks
3.4k
PR merge metrics
PR metrics pending

Description

LINQ:

```c#
await ctx.Blogs
.Where(b => b.Posts.Any(p => p.Title == "foo"))
.ExecuteDeleteAsync();
```

SQL:

```sql
DELETE FROM [b]
FROM [Blogs] AS [b]
WHERE EXISTS (
SELECT 1
FROM [Post] AS [p]
WHERE [b].[Id] = [p].[BlogId] AND [p].[Title] = N'foo')
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.