title: How could I improve my below LINQ query?
body: <p>How could I improve my below LINQ query to have a better performance. What is the better way of writing this:</p>
  
  <pre><code>result = (from cd in dataContext.vRetailerWeeks
            where cd.MasterTrackingGroupID == masterTrackingGroupId
               &amp;&amp; cd.RetailerWeek &lt;= (from cd1 in dataContext.vCalendarDates
                                      where
                                          cd1.MasterTrackingGroupID == masterTrackingGroupId &amp;&amp;
                                          cd1.CalendarDate == retailerWeekDateTime
                                      select cd1.RetailerWeek).FirstOrDefault()
            orderby cd.RetailerWeek descending 
            select cd.RetailerWeek).Take(weekNo).ToList();
  </code></pre>