I changed the code like the below. Then it is working fine. I moved the commodityId condition from query1 to query2. I do not see any reason for it to be timed out because of the commodityid condition. It's just an integer column. Thanks all for your help.
public virtual List<TradeView> GetTradeViewByDatesDataSourceAndCommodityId(DateTime fromDate, DateTime toDate, int commodityId, int originId, int dataSourceId)
{
var context = GetTradeEntities();
var query1 = (from tradeView in context.TradeViews
where
(tradeView.OriginId == originId)
&& (tradeView.DataSourceId == dataSourceId)
select tradeView);
var theList = query1.ToList();
var query2 = (from tradeView in theList
where (tradeView.MonthStartDate >= fromDate)
&& (tradeView.MonthEndDate <= toDate)
&& (tradeView.CommodityId == commodityId)
select tradeView);
return query2.ToList();
}