full table scan
A database reading every row of a table to answer a query, instead of using an index to jump to the rows it needs.
In more detail
On a large table it is slow and grows slower as the table grows. Calling ToList before Where in EF Core forces something worse: every row is fetched into the application and filtered in C#.
Related terms
- index — A separate, sorted structure a database keeps alongside a table so it can find matching rows without reading them all.
- terminal operator — A LINQ call such as ToList, First, Count or Sum that actually runs a deferred query and produces a result.
- IQueryable<T> — The .NET interface for a query that a provider such as EF Core translates and runs elsewhere, typically as SQL in a database.
Taught in
- Collections, Generics, and LINQ — Modern .NET Core, C# & Enterprise Microservices