如何检测选择N + 1问题,LINQ to SQL的? [英] How to Detect Select n+1 problems in Linq to SQL?
问题描述
什么是,如果我使用LINQ to SQL来选择检测N + 1问题的最佳途径,现在我们正在研究一个项目,它似乎是pretty缓慢显示一些列表。
什么是检测这个的最好方法?
What is the best way to detect Select n+1 problems if i am using linq to SQL, right now we are working on a project and it seem to be pretty slow to display some lists. What is the best method to detect this?
推荐答案
也许这将帮助:
的http://ayende.com/Blog/archive/2009/11/13/linq-to-sql-profiler-is-now-on-public-beta.aspx
的http://weblogs.asp.net/scottgu/archive/2007/07/31/linq-to-sql-debug-visualizer.aspx
的http://visualstudiogallery.msdn.microsoft.com/ru-ru/d5a64d5a-174a-4357-ad84-dbeeec030f23
或者你可以使用SQL事件探查器,当你访问各个列表项只是检查,如果查询被执行。
Or you can use SQL Profiler and just check if queries are executed when you access individual list items.
这篇关于如何检测选择N + 1问题,LINQ to SQL的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!