I have been playing around with left joins in linq and found that it is necessary to use DefaultIfEmpty()
in order to change the join from an inner
to a left
.
Looking at the return type of DefaultIfEmpty()
, I became concerned from a performance perspective as I see that it's returning an IEnumerable
, which we know caches the data locally. In my scenario, I am further processing the data post left joining and would ideally like to preserve the type as IQueryable
instead, however when I deployed the solution as is to my dev environment, I was surprised to see a counter-intuitive/minimal performance impact.
Why is it that the DefaultIfEmpty()
does not seem to have a significant performance impact, or am I not understanding the situation properly?