EntityFramework中使用.Include()做饥饿加载可能产生的性能问题
这几天在码新版博客程序,因为文章表字段太多,手贱把几个相关列拆分到了1-1的表中。比如Post 1-1 PostPublish,Post 1-1 PostExtension。但是性能突然比以前差了一点。 和这两张相关表直接交互的是这么一段代码: var query = Repository.Select().Include(p => p.PostExtension).Include(p => p.PostPublish) .Where(p => p.PostPublish.IsPublished && (authorName == null || String.Compare(p.Author, …