This is important for joins. For example, if you look at the sample for leftOuterJoin
:
query {
for student in db.Student do
leftOuterJoin selection in db.CourseSelection on
(student.StudentID = selection.StudentID) into result
for selection in result.DefaultIfEmpty() do
select (student, selection)
}
The order determines what happens when "missing" values occur. The key is this line in the docs:
If any group is empty, a group with a single default value is used instead.
With the current order, every StudentID
within db.Student
will be represented, even if db.CourseSelection
doesn't have a matching element. If you reverse the order, the opposite is true - every "course selection" will be represented, with missing students
getting the default value. This would mean that, in the above, if you switched the order, any students without a course selection would have no representation in the results, where the current order always shows every student.