动态数据网站因速度缓慢而无法使用
我使用实体框架创建了一个小型“动态数据网站”。我确实没有这方面的经验,但它看起来很有趣。无论如何,我有一个表显示在一个网页上。该表包含超过 21000 行,页面限制为每页 10 条记录,这一切都很好。
我的问题是该页面非常慢。我猜想,每当我尝试导航时,表中的每一行都可能会被加载,但我不能确定这是原因。
如何提高页面的性能?我希望能够快速、轻松地点击结果页面。目前点击下一组结果需要超过 60 秒的时间。
I have created a small "Dynamic Data Web Site" using the Entity Framework. I've no experience with this really, but it looks very interesting. Anyway, I have a single table being displayed on a single web page. The table contains over 21000 rows and the page limits me to 10 records per page, which is all fine.
My problem is that the page is incredibly slow. I'm guessing that maybe every row in the table is being loaded whenever I try to navigate, but I can't be sure this is the cause.
How can I increase the performance of the page? I want to be able to click through pages of results quickly and easily. It currently takes more than 60 seconds to click to the next set of results.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这通常是由表上的过滤器引起的,其中过滤器有很多行,您可以使用自动完成过滤器来修复此问题,该过滤器会预先过滤用户输入的数据库。
您可以从 ny NuGet 包 动态数据自定义过滤器
this is usually caused by filters on a table where the filter has MANY rows you could fix this using the Autocomplete filter which prefilters the data base what the user types in.
You can get this filter and other from ny NuGet package Dynamic Data Custom Filters
还可以尝试使用 Ayende 的 EFProf 查看它。它是一个商业产品,但有 30 天的免费试用期。有时我可以指出您正在做的愚蠢的事情,并建议一些优化数据访问的方法
Also try having a look in it using Ayende's EFProf. It is a commercial product but it has a free 30 day trial. I can sometimes point out silly things you are doing and suggest some ways to optimise your data access