Im looking for an optimization.
When I call the Count method in the Entity Framework, does it process all columns or only one or what?
If you also have an official website talking about this, I would appreciate it.
Thanks.
A few years ago I did some tests and found out that EF does the counting on the server, it sends a request using SELECT COUNT, so it does not load all the records exactly.
about columns, if you mean the difference between COUNT(*) or COUNT(Id) or COUNT(1) , which I read somewhere a while ago, that there is no difference for SQL Server, COUNT(*) optimized as COUNT(1) in any case.
COUNT(*)
COUNT(Id)
COUNT(1)
you could read a lot of articles on the Internet or a question here on SO ... not 100% thrilled by what you asked, but similar topics on EF and ORM ...
How to specify strings inside EntityFramework without loading content?
http://ayende.com/blog/4387/what-happens-behind-the-scenes-nhibernate-linq-to-sql-entity-framework-scenario-analysis
How to optimize Entity platform queries
Source: https://habr.com/ru/post/898244/More articles:How is insertAdjacentHTML much faster than innerHTML? - performanceHow to save directory structure when compiling CoffeeScript? - javascriptZend: ViewScript decorator and array designator - zend-frameworkAvoid multiple columns when printing FlowDocument - printingAnt: how to display target file name in application - echodisable jQuery.toggle () method - jqueryHaving a dependency on a particular nuget package - nugetMagic: Database Design Gathering - databaseAndroid: AsyncTask, how to update the ProgressDialog step - androidCenter a .jpg image in a PDF using Imagemagick? - centerAll Articles