客户端分页可以在获取记录时提高性能吗? [英] Can Client Side Paging increase performance while fetching records?

查看:94
本文介绍了客户端分页可以在获取记录时提高性能吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我是MVC数据分页的新手,我有一个页面可以呈现5000条记录,它会抛出一个错误,如下所示: - < br $>


System.Data.SqlClient.SqlException(0x80131904):超时已过期。操作完成之前经过的超时时间或服务器没有响应。



解决此问题我想应用分页所以我只想知道我可以应用客户端分页来解决我的问题或者我必须应用服务器端分页?



提前谢谢。

Hi All,

I am new on data paging in MVC, i have a page which renders 5000 records it thrown an error which is given below:-

System.Data.SqlClient.SqlException (0x80131904): Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.

to resolve this problem i want to apply paging so i just want to know can i apply client side paging to resolve my problem or i have to apply server side paging?

Thanks in advance.

推荐答案

首先,您需要了解一些事情。



1)任何带来1条记录的查询也可以从数据库中带来5000条记录。如果计数超过lac大约那么可能需要优化,但我仍然没有想到,根据我的想法,如果它获取超过5行的行,那么我们可能需要优化它。这完全取决于服务器配置。



检查你的查询是否有一个行限制你的查询能够在没有超时的情况下获取记录,让我们说检查5行左右。如果是,那么你的查询需要优化,如果没有那么它也很容易就能获得5000条记录。



2)现在回到你的第二个问题,即处理巨大的问题通过使用分页概念,前端级别的记录将有所帮助。

答案:这取决于,如果您的查询成本高昂且需要时间来获取数据,那么分页将降低您的数据库性能甚至会使用户每次点击页面更改按钮都要等待。

如果您的查询成本不高,那么您可以使用分页概念作为加载这么多记录在浏览器上将使客户端系统(浏览器)非常慢。



我希望我能回答你的问题。
First of all you need to understand few things.

1) Any query which is bringing 1 record will also be able to bring 5000 records from the database. If the count is more than a lac or so then might need an optimization but still I don't think and as per my thinking if it is fetching more than 5 lacs rows then we might need to optimize it. It totally depends upon the server configuration.

Check your query if with putting a row limit your query is able to fetch the record without a timeout, let's say check with 5 rows or so. If yes then your query need to optimize and if not then it will very easily able to fetch 5000 record also.

2) Now coming to your second question that handling huge records at front-end level will help or not by using paging concept.
Answer : It depends, if your query is costly and taking time to fetch data then paging will decrease your database performance and even will make user to wait every time he clicks on page change button.
If your query is not costly then you can use paging concept as loading so much record at once on the browser will make client system(browser) very slow.

I hope I was able to answer your question.


这篇关于客户端分页可以在获取记录时提高性能吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆