sessionId 行がインデックス付けされている定義済みの (長い) sessionId を含むデータベース テーブルからすべての行を選択する必要があります。しかし、遅いし、アクセスするコードが非常に単純なので、どこに問題があるのだろうと思っています。3 つのレイヤーのコードは次のとおりです。
var localPath = BusinessClient.Instance.Tracker.GetSpecifiedMilestonesInSessionObjects(milestonesInSession.SessionId).ToList();
public IQueryable<MilestonesInSession> GetSpecifiedMilestonesInSessionObjects(long sessionId)
{
var query = from m in _milestonesInSessionRepository.GetAll()
where m.SessionId == sessionId
select m;
return query;
}
public IQueryable<Model.Tracker.MilestonesInSession> GetAll()
{
var query = from milestoneSession in _dataContext.Repository<Linq.TrackerMilestonesInSession>()
select new Model.Tracker.MilestonesInSession
{
MilestoneId = milestoneSession.MilestoneId,
CreatedDate = milestoneSession.CreatedDate,
SessionId = milestoneSession.SessionId,
ProductId = milestoneSession.ProductId,
TrackerId = milestoneSession.TrackerId,
StatusId = milestoneSession.StatusId,
BankId = milestoneSession.BankId
};
return query;
}
ANTS を使用したパフォーマンスのスクリーンショットを添付します。
プレゼンテーション層
ビジネスレイヤー
データ アクセス層