在不使用数组的情况下处理数百万行 [英] Handling millions of rows without using arrays

查看:89
本文介绍了在不使用数组的情况下处理数百万行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我正在从表中获取数百万行并将其存储到数组中.虽然我尝试处理数组,但系统性能太慢.我尝试了链表",但也没有帮助.还有其他更好的方法来处理数百万行而不是数组而不影响系统性能.

Hi,
I am fetching around millions of rows from table and its stored into arrays.While i trying to handling arrays, the System performance is too slow . I tried Linked List but it also not helped me. Is there any other better way to handling millions of rows instead of arrays without affecting System performance .

thanks.

推荐答案

老实说,我认为问题不在于技术,而在于设计.您的用户很可能不想看到数百万行,所以为什么要提取它们.

如果获取数据,则正确的方法是分页数据.

如果这是另一种情况,那么我认为您将更多地利用数据库.例如,如果要获取行以了解外键值等,为什么现在在插入/更新数据时查询它们.
To be honest I don''t think that the problem is in the technology but in the design. Most likely your users don''t want to see millions of rows so why are you fetching them.

If you fetch the data, the proper way to go would be to page the data.

If this is some other kind of scenario, then I would think that you would utilize the database more. For example, if you''re fetching the rows in order to know foreign key values etc, why now query them as you insert/update data.


+5来回答Mika的答案.要添加一些解决方案:

您应该使用一些线程处理将数据方面的操作与GUI分开.这样,当您在后台与服务器交互时,GUI仍然可以使用.

线程处理简介 [
+5 for Mika''s answer. To add in some solution:

You should use some Thread Handling to separate the action in the data side from the GUI. This way the GUI remains usable while you interact in the background with the server.

INtroduction to Thread Handling[^]

some frameworks have a better handling, but for that I would need to know if and what kind of framework you are using.

You should also think about fetching not all but a limited number of data rows. I don''t think that the user can handle "million of sets" at a time. I would suggest to fetch 200 rows and then let the user request for more.


这篇关于在不使用数组的情况下处理数百万行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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