2
'from'절 또는 'join'절을 사용할 때 많은 테이블을 조인 할 때 차이가 있습니까? 되돌아 오는 결과 집합은 같습니다. (접합 테이블을 포함하여) 많은 관계로 많은 예를 들면 세 개의 테이블을대 Linq to 대입
가지고 : 학생, StudentCourses, 코스 :
var query = from student in context.Students
from studentcourse in student.StudentCourses
where studentcourse.CourseID == 4
select student;
var query = from student in context.Students
join studentcourse in context.StudentCourses
on student.StudentID equals studentcourse.StudentID
where studentcourse.CourseID == 4
select student;
- 그들 중 하나가 가장 좋은 방법이 될 것인가?
- 성능? 하나가 다른 것보다 낫습니까? SQL 프로파일 러 중 하나에 대한 기회가 없었습니다. 나는 두 가지 이유로 포함하여 피할 수있어
는 :
- 나는 조건은 따라서 두 가지 기술 위, 종종 이상 포함해야합니다.
- 내가 읽은 것으로부터, Include는 전체 관련 테이블을 반환하고, 성능에 대해 과세 할 수 있습니다.