Linq to Entities and LEFT OUTER JOIN issue with MANY:1 relations

Posted by Robert Koritnik on Stack Overflow See other posts from Stack Overflow or by Robert Koritnik
Published on 2010-03-22T09:03:29Z Indexed on 2010/03/22 22:41 UTC
Read the original article Hit count: 427

Can somebody tell me, why does Linq to Entities translate many to 1 relationships to left outer join instead of inner join? Because there's referential constraint on DB itself that ensures there's a record in the right table, so inner join should be used instead (and it would work much faster)

If relation was many to 0..1 left outer join would be correct.

Question

Is it possible to write LINQ in a way so it will translate to inner join rather than left outer join. It would speed query execution a lot... I haven't used eSQL before, but would it be wise to use it in instead of LINQ?

Edit

I updated my tags to include technology I'm using in the background:

  • Entity Framework V1
  • Devart dotConnect for Mysql
  • MySql database

If someone could test if the same is true on Microsoft SQL server it would also give me some insight if this is Devart's issue or it's a general L2EF functionality... But I suspect EF is the culprit here.

© Stack Overflow or respective owner

Related posts about linq-to-entities

Related posts about outer-join