可以帮助我优化下面的LINQ声明。我使用NHibernate作为ORM。此声明需要一分多钟才能执行。它不应该花那么多时间。请帮我优化这个Linq声明
var inValidIntroductionDates = environment.IntroductionDateInfo.IntroductionDateDetails
.OrderByDescending(x => x.ApplicationDate)
.Where(x => x.VaccineDetail.Id == vaccine.Id &&
x.ViewInfo.Id == viewInfoDetail.ViewInfo.Id &&
x.MasterForecastInfo.Id == scenarioId &&
x.IsIntroductionDateValid == false)
.ToList();
感谢
拉出从日志中生成的SQL和运行SQL数据库上查询excecution计划。我怀疑大量的行和不正确的索引 – Rippo 2013-04-26 13:46:58