如何在10秒内从表中选择10000条记录 [英] how to select 10000 records from a table in 10 seconds

查看:110
本文介绍了如何在10秒内从表中选择10000条记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我在一张桌子上有100000条记录,



i想要选择10000条记录在0秒内,



如果我使用选择查询,如

hi all,

I have 100000 record in a table,

i want select 10000 records with in 0 seconds,

If i use select query like

select top 10000 * from table1

它花了我25到50秒



你可以帮我吗



感谢提前。

it takes me 25 to 50 seconds

can you help me

thanks advance.

推荐答案

你不能在0秒内选择任何东西,通常需要花费一些时间> 0。



要从100,000条记录中选择10,000条记录,您可以执行以下操作(如果您没有要使用的过滤器):

You cannot select anything in 0 seconds, usually it will take some amount of time >0.

To select 10,000 records from 100,000 records you can do the following (if you don't have a filter to work with):
select top 10000 * from table1 



为了让你的速度更快可以为你的表添加索引。


To make things faster you can add indexes to your table.


我想说加载大部分数据是一个非常糟糕的主意!



您有没有听说过分页 [ ^ ]?< br $>


看看这里:

教程25:有效地分析大量数据 [ ^ ]

分页SQL Server结果集 [ ^ ]



Mor e on CP KB [ ^ ]。
I'd like to say it's a very poor idea to load large portion of data!

Have you ever heard about paging[^]?

Have a look here:
Tutorial 25: Efficiently Paging Through Large Amounts of Data[^]
Paging SQL Server result sets[^]

More on CP KB[^].


这篇关于如何在10秒内从表中选择10000条记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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