We have two tables A and B with a many-to-many relationship. This is realized via a simple link table containing the IDs of each table.
Only table A contains some 500 rows - the link table and table B are completely empty. If we now try to access the data with
var result = from x in scope.Extent<A>() select x;
List<A> resultlist = result.ToList();
everything works fine. But trying to fill an ObjectContainer afterwards by
ObjectContainer oc = new ObjectContainer();
oc.CopyFrom(scope, "MyNamedList", result, null);
the CopyFrom takes an extremely long time to complete (approx. 3 minutes for 500-1000 rows in A).
Looking at the log output it shows that for each row in A a JOINed query is performed on B.
In our case the DB is accessed by an internet connection - running against a local SQLExpress DB the effect might not be that noticeable.