Linq-to-entities query too slow I am fairly new to Entity Framework and I am not sure I am really using it to it's max potential.  I have this query, that IMHO seems to take a little longer than I feel it should.  I have tried various combinations to retrieve all the data I need making as few connections as possible and so far this query yeilds the best results with an average of about 320 ms.  Is there anything I can do to make this query faster?

Something to note is that the include for Awe_PageContainerBlurb is a many-to-many relationship based on 3 tables.

var roles = from role in db.aspnet_Roles
            join userRole in db.aspnet_UsersInRoles on role.RoleId equals userRole.RoleId
            where userRole.UserId == userID
            select role;

var awePageData = ((ObjectQuery&lt;Awe_Page&gt;)(from page in db.AweBjects.OfType&lt;Awe_Page&gt;()
                                           join app in db.aspnet_Applications on page.ApplicationId equals app.ApplicationId
                                           where app.ApplicationName == user.ApplicationName
                                               &amp;&amp; page.Active &amp;&amp; page.Name == pageName
                                           from pageRole in page.aspnet_Roles
                                           where roles.Contains(pageRole)
                                           select page))
                                           .Include("Awe_PageContainerBlurb.Awe_Container")
                                           .Include("Awe_PageContainerBlurb.Awe_Blurb");

var menuItems = from menu in db.AweBjects.OfType&lt;Awe_Menu&gt;()
                join app in db.aspnet_Applications on menu.ApplicationId equals app.ApplicationId
                where app.ApplicationName == user.ApplicationName
                    &amp;&amp; menu.Active 
                from menuRole in menu.aspnet_Roles
                where roles.Contains(menuRole)
                select menu;
First things first. Since we are talking about an SQL backend (unless I'm mistaken) - you need to profile SQL and take each (sub)query seperately, then determine which query takes the longest. It would simply be pure guess work, taking answers out of thin air otherwise, since we have no reference for what the bottleneck actually is.

Next, what are you SQL indexes? You have many joins and where clauses. If you don't have your indexes set up correctly, then - there's your problem!

Finally compare your c# query to the actual SQL query. Sometimes your LINQ can look beautiful, but the actual code generated for the query is utter BS. I deal with LINQ2SQL myself and have many times been forced to make a list (ToList()) from the sub-queries, forcing the data into the client, into the realm of c# and doing the final query on top of those lists instead. I may use more memory for a brief period of time, but I gain orders of magnitude more speed...