score:3
See http://msdn.microsoft.com/en-us/library/bb357513.aspx#1
Skip method is very useful with LINQ to SQL to organize server-side results paging, and some more things. But there are performance issues in some cases, because LINQ can build too difficult SQL queries from specified LINQ expressions. I touched this problem with MS SQL Server 2008. (...)
(...) if there are 1000000 records in the Orgs table this query will be executed very long time because DB server will sort records in memory (unlikely you have an appropriate index with all columns ordering). And even so simple query
orgs.Skip(10).Count() requires a significant amount of time, while
orgs.Count()-10 performes much more quickly :)
Perhaps that's the root of the problem.
Source: stackoverflow.com
Related Query
- What LINQ operation related to Paging could be slowing down my query?
- VerificationException Operation could destabilize the runtime on Simple LINQ Query
- What SQL query or LINQ code would get the following data?
- Linq Query Slowing Down Global Asax
- What is the Linq Query expression to get all the department Id , Name in a select list variable for drop down
- Could not find an implementation of the query pattern for source type 'System.Data.Entity.DbSet'
- LINQ query to perform a projection, skipping or wrapping exceptions where source throws on IEnumerable.GetNext()
- What is the difference between LINQ query expressions and extension methods
- The LINQ expression could not be translated. Either rewrite the query in a form that can be translated, or switch to client evaluation EF Core 3.1
- The LINQ expression could not be translated. Either rewrite the query in a form that can be translated, or switch to client evaluation
- Is there any way to create a LINQ query as a variable without having the data source (yet)?
- What is the best way to cast each item in a LINQ to Entities query to an interface?
- LINQ to XML: What is the most effective way to move nodes up and down
- What is the easiest way to save a LINQ query for later use?
- LINQ Source Code Available
- What does this LINQ query do?
- What is the return type for a anonymous linq query select? What is the best way to send this data back?
- LINQ query on DataTable - Could not find an implementation of the query pattern
- linq - how do you do a query for items in one query source that are not in another one?
- What is the LINQ query to get a Cartesian Product even when one set is EMPTY?
- How can I write the following code more elegantly using LINQ query syntax?
- The LINQ expression could not be translated. Eiither rewrite the query in a form that can be translated
- How to dynamic add filters to a LINQ query against an Odata Source in C#
- what is the mechanism for performing an intersect in a Mongo Linq query
- Avoid extra loop and could not find implementation of query pattern for source type int Select not found
- C# Linq query help removing foreach loops creating cleaner code
- c# linq generated query length over the limit. Is there any way we could up lift this limit?
- What Linq query can I use to return a count of all products by Category?
- Use a linq query as microsoft local report Data Source (WinForms)
- Determine the source DataContext for a Linq to Sql query
More Query from same tag
- Uppercase a List of object with LINQ
- Use LINQ to count the number of combinations existing in two lists
- Problems with passing two models to one view
- Combine two Convert Expressions
- How to check string for null and assign its value in the same line
- Method result in groupby
- Narrowing LINQ query to one column
- Sort My class by two values
- Rewrite foreach statement to linq
- How to use IGrouping enumeration in C#
- Entity Framework with LINQ query
- Custom (derived) List<T>
- How can I skip loop for first and last element of array and set them to constant value?
- Checking available dates - LINQ
- Select only members in anonymous with a certain attribute
- Nested Query in Fluent nHibernate
- Executing a certain action for all elements in an Enumerable<T>
- How to assign "var" inside if statement
- Linq to foreach without intermediate select (Cartesian Product)
- EF6 - Include objects with List<Func<T, object>>
- C# + linq(concat) rewrite to java
- Get System Date when passing System.DateTime.Now in a Textbox as an string variable
- How to break an object into chunks based on some property?
- How to change the data layout of a data table with LINQ
- Explain "unpredictable behavior" of enumerable when mutating property during foreach
- How to assign SortableBindingList to LINQ query
- LINQ Join On Multiple Columns With Different Data Types
- json.net deserialize using linq
- Issue with adding Linq Where clause containing a string Contains test
- Populate a selected list from another selected list in one View