Ir al contenido

Missing index (ARCH207)

Esta página aún no está disponible en tu idioma.

Key dotnet.ef.missing-index · Severity info · Category ef

Columns frequently used in filters or joins without an index cause full table scans.

modelBuilder.Entity<User>(e =>
{
e.Property(u => u.Email).IsRequired();
});
// queried by Email constantly, but no index
modelBuilder.Entity<User>(e =>
{
e.Property(u => u.Email).IsRequired();
e.HasIndex(u => u.Email);
});

Define an index on the property with HasIndex.