I have some complex queries with LINQ which behind the scenes do around 7-9 joins. I am in the process of optimizing the queries.Now I am little confused about a couple of things here -
Should I just have a stored procedure doing maybe dynamic sql instead of having it as a LINQ query.When should have a stored procedure doing something instead of having a LINQ query? I guess it depends..but what are the best practices? When should have a stored procedure? I see sometimes LINQ does do some weird inefficient stuff behind the scenes? That is my concern..
There are place where I do multiple selects...as compared when I can join with the tables but if get into joining them it gets little more complex(say 7-9 joins as compared to 3-5 Selects). I think personally join would be efficient right ? since only one request to database? Whereas with multiple selects it has to make multiple requests? What are your thoughts on it ?