Recently I have a small headache with Linq. I have one big table(more than 100 fields and for the test purpose more than 40000 rows), lets call it Products.
There is about 60 queries to Products table - that I have to show on Grid - queries are IQueryable objects, and I'm doing Count() on every of them.
Every query takes about 100ms(about 7s for all of them), so it takes lots of time to show the result to the user. Should I use StoredProcedure, or is there any other solution to this issue?
Best regards
EDIT: One of my query: var result = (from f in this.Context.Products where f.Period == currPeriod && (f.TYPE == 1 || f.TYPE == 2) && f.FLAGA > 0 && f.DATE_OK != null && UsersList.Contains(f.UsersId) select new ProductLista {});
In select new ProductList I take 10 fields from Products table. Also I know that Contains gives me big issue performance