我正在尝试在特定条件下获取数据,我只希望使用entuity框架异步获取最新的一个数据,我编写了查询语句,它适用于特定的id,而对于其他对象,它给出了timeput错误。
await _context.Data
.Where(m => m.Thumb== thumb)
.OrderByDescending(m => m.ReceivedTime)
.FirstAsync();
不,它们不是索引列
所以,解决这个问题;以下任何一项:
create nonclustered index NCI_Data_Thumb_ReceivedTime on [Data] (Thumb, ReceivedTime)
create nonclustered index NCI_Data_Thumb_ReceivedTime on [Data] (Thumb, ReceivedTime desc)
create nonclustered index NCI_Data_Thumb on [Data] (Thumb)
应该帮助((注意:请遵循您自己的本地命名约定)]