tag:blogger.com,1999:blog-11646261.post3315255080314226433..comments2024-01-02T00:43:44.344-08:00Comments on OakLeaf Systems: LINQ to SQL Query Execution with LoadOptions SpecifiedRoger Jennings (--rj)http://www.blogger.com/profile/01700526164060680385noreply@blogger.comBlogger5125tag:blogger.com,1999:blog-11646261.post-50718617892642565792007-11-21T07:24:00.000-08:002007-11-21T07:24:00.000-08:00"...you'll learn that the LoadOptions is pretty mu..."...you'll learn that the LoadOptions is pretty much broken...<BR/>It simply doesn't work as you'd expect..."<BR/><BR/>@Frans: Maybe your expectations are broken, but it does work as advertised. You can only specify load options from one table to the other, nowhere can you specify a complete path. It _is_ by design, and you need to adjust your expectations.<BR/><BR/>The correct way to criticize Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-11646261.post-18572568139836260132007-08-21T11:17:00.000-07:002007-08-21T11:17:00.000-07:00I wasn't arguing the merits of LINQ to SQL's lazy/...I wasn't arguing the merits of LINQ to SQL's lazy/eager-loading technology with Dave, I objected to his characterization of the SQL Visualizer as "deceptive."<BR/><BR/>It appears to me that eager-loading uses a single query with joins for 1:1 associations (EntityRefs) and one query with joins per node for 1:many associations (EntitySets). I'll be conducting a few tests in the next day or two and Roger Jennings (--rj)https://www.blogger.com/profile/01700526164060680385noreply@blogger.comtag:blogger.com,1999:blog-11646261.post-6127764566367983962007-08-21T01:46:00.000-07:002007-08-21T01:46:00.000-07:00Roger: Dave is correct, the LoadOptions totally fa...Roger: Dave is correct, the LoadOptions totally fails to create an efficient set of queries. A graph to fetch eagerly (prefetched) has to have 1 query per node, tops. You could optimize it out with a join between a graph path if all relations on that path are 1(fk):1(pk) or m:1 so the join would result in no duplicates, however that's pretty limiting because you then have to implement custom Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-11646261.post-38831127267973032782007-08-20T12:16:00.000-07:002007-08-20T12:16:00.000-07:00The "context" object remains missing because the u...The "context" object remains missing because the using expression creates a new "NorthwindDataContext" object.<BR/><BR/>See my update to the post.<BR/><BR/>-rjRoger Jennings (--rj)https://www.blogger.com/profile/01700526164060680385noreply@blogger.comtag:blogger.com,1999:blog-11646261.post-42680297652516001462007-08-20T11:13:00.000-07:002007-08-20T11:13:00.000-07:00I did include the LoadOptions when running the cod...I did include the LoadOptions when running the code, but I forgot to include it in the post. It is there now.<BR/><BR/>Your query is totally different, so of course you won't get 40+ queries.<BR/><BR/>The key is that the visualizer does not show the additional queries it runs to do the prefetching.<BR/><BR/>DaveAnonymousnoreply@blogger.com