再会!
List<TotalServiseCalls> TSC = (
from scall in contextOMNIDB.UserFields698.AsEnumerable()
where scall.f2_creationd >= referenceDate
group scall by scall.f2_creationd.Month into scalls
select new TotalServiseCalls
{
mountN = (from sc in contextOMNIDB.UserFields698.AsEnumerable()
where sc.f2_creationd.Month == scalls.Key
select sc.f2_creationd).FirstOrDefault(),
date = (from sc in contextOMNIDB.UserFields698.AsEnumerable()
where sc.f2_creationd.Month == scalls.Key
select sc.f2_creationd.ToString("MMMM yyyy")).FirstOrDefault(),
totalCount = scalls.Count()
}).OrderBy(p => p.mountN).ToList();
MSSQL 服务器有很多应用程序,它的负载非常高。此查询执行四十秒。这是因为服务器上的拥塞还是查询的复杂性?
这些表有大约一万条记录,大小为 1 兆字节。