Skip to content

EF Core 10 queries much slower than EF Core 9 with a larger number of parameters #37152

@PhyxionNL

Description

@PhyxionNL

Bug description

A workaround is to go back to the old OPENJSON method of querying:
optionsBuilder.UseParameterizedCollectionMode(ParameterTranslationMode.Parameter);

Your code

// Fill a Test table with ~100k entries.

List<int> items = [];

for (int i = 0; i < 4000; i++)
{
    items.Add(i);

    _ = await context.Test.Where(x => items.Contains(x.Id)).Select(x => x.Id).ToListAsync();
}

Stack traces


Verbose output


EF Core version

10.0.0

Database provider

SqlServer

Target framework

.NET 1.0

Operating system

No response

IDE

No response

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions