以下是花的时间过长 -LINQ查询是需要长时间
using (var db = new Agreements_DBEntities())
{
bool isProfileExist = (from ua in db.UserAgreementDetails
where ua.uID == uID &&
ua.uMailId == uMailId &&
ua.uType == uType &&
ua.UProfile.HasValue && ua.UProfile.Value
select true).Any();
}
上面一行bool isProfileExist
时间过长....什么是错的呢?
这是什么意思'太久'? “多久”可以接受? **生成的SQL查询是什么?**你有索引吗? SQL Server端的执行计划是什么样的?这是一个“冷”查询,还是至少已经执行过一次? –