当1000000条记录时,网络应用程序快速 [英] web aplication fast when 1000000 records

查看:106
本文介绍了当1000000条记录时,网络应用程序快速的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好



我的Microsoft .net visual studio框架是2010.

和sql 2008.



我从sql server获取数据我的行10,000



但是当我提取数据时需要花费很多时间



我定义了commandtimeout = 0但是花了这么多时间





什么我应该不从sql中获取数据。?



如何从sql server快速获取数据?



bcoz我的数据和行将增加1,00,000到2,00,000



这个过程我这样做我可以快速获取2,00,000条记录





plz help

hello

my Microsoft .net visual studio framework is 2010. and
and sql 2008 .

I am fetching data from sql server my rows 10,000

but when I am fetching data it will take so much time

I defined commandtimeout = 0 but it is taking so much time


what should I do without fetching data from sql.?

how can fast fetching data from sql server?

bcoz my data and rows will increment by 1,00,000 to 2,00,000

which process I do so I can fetch 2,00,000 records fast


plz help

推荐答案

没有用户会在页面上查看这些记录。

所以,你可以做的是,只需要获取你想要在页面上显示的记录数。

同时实现自定义分页 ,这意味着你将设计一个 SQL Procedu re 将输入作为页码和您需要的记录数量并相应地返回。



您可以看到一个示例 - 使用SQL Server存储过程在ASP.Net GridView中进行自定义分页 [ ^ ]。



如你所说,是的,您可以实现 jQuery Ajax 获取数据并绑定到 GridView

您也可以使用 jQGrids
No user would look at these much of records on a page.
So, what you can do is, just fetch the number of records you want to show on a page.
Also implement Custom Paging, that means you will design one SQL Procedure which will take input as Page Number and the Number of Records you need and return you accordingly.

You can see one Example - Custom Paging in ASP.Net GridView using SQL Server Stored Procedure[^].

And yes as you said, you can implement jQuery Ajax to get the Data and bind to GridView.
You can also use jQGrids.


建议



一如既往地说,你不需要获取这么多数据,你要去哪里提出那么多数据?例如,假设您获得了所有数据。你打算怎么把它呈现给用户?这将花费大量时间,大多数用户没有像开发团队那样的快速计算机系统。因此用户有可能体验到糟糕的用户体验(用户体验)。



您最好加载这一数据的千分之一,一次约200条记录,然后显示它们,如果用户想要更多记录,则获取下一条记录。



这样,您的问题将被最小化,您的用户也不必面对时间膨胀和其他问题。



解决方案



既然您在这里寻求解决方案,那么这是一个。增加系统上的RAM和CPU数量,并添加缓存功能。 Facebook和其他巨头使用此功能来确保他们的服务快速,用户不必等待他们的响应(HTTP响应;不是面向用户的响应)。



https://en.wikipedia.org/wiki / Cache_(计算) [ ^ ]



阅读上面的维基百科文章以了解有关缓存的更多信息。



因此,让这件事情发生的唯一方法就是增加RAM,CPU并确保所有进程都完成并缓存,以便尽快当用户请求数据时。拾取缓存的响应并将其传输到流中,这样他就可以轻松读取数据而无需等待。



注意:如前所述,渲染输出也需要时间。所以这也不适合作为最佳方式。没有任何最佳解决方案。
Advice

As always it is said, there is no need for you to fetch this much data, where are you going to present that much data? Suppose, for instance, you got all that data. How are you going to present it to the user? That would take a lot of time again, most of the users don't have fast computer systems like the development teams have. So there is a chance that the user has to experience a bad UX (User Experience).

It will be better for you to load thousand-th part of this data, ~200 records at a time, and then display them, if user wants more records, fetch next ones.

This way, your problem will be minimized, and your user won't have to face time dilation and other problems too.

Solution

Since you're here for a solution, so here is one. Increase the amount of RAM and CPU on your system, and add the feature of caching. Facebook and other giants use this feature to make sure that their service is fast and the users don't have to wait for their response (HTTP response; not user oriented responses).

https://en.wikipedia.org/wiki/Cache_(computing)[^]

Read above Wikipedia article to learn more about Caching.

So, the only way of letting this thing happen, is to increase the RAM, CPU and making sure all of the processes are done and caches, so that as soon as the user requests for data. Response from the cache is picked up and transferred to the stream, so that he can easily read the data without having to wait.

Note: As already mentioned, rendering of the output also takes time. So this also doesn't fit as the best possible way. There isn't any best solution.


这篇关于当1000000条记录时,网络应用程序快速的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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