查询具有大量数据的SQL表 [英] Querying SQL tables with large amount of data

查看:70
本文介绍了查询具有大量数据的SQL表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个SQL数据库,其中包含大量数据,这些数据在工作时间内不断添加.我需要能够在不限制输入的情况下运行大型查询.

最好的方法是什么?

我是否应该在一夜之间查询另一台服务器并使用副本?

解决方案

镜像到另一个数据库肯定是一个选择,它取决于您需要的实时"程度查询要
的数据
SQL Server复制 [事务复制 [
我们在谈论多少行?

如果只有几百万个,那么精心设计的索引+数据访问计划应该能够处理查询负载

例如不仅要让用户链接到您的表中并执行他们想要的任何查询,还必须让他们使用已被调整索引和分析计划的查询"存储过程.


I have a SQL database with a large amount of data that is added to constantly during working hours. I need to be able to run large queries without restricting input.

What is the best way to do this?

Should I query overnight into another server and use the copy?

Mirroring into another database is certainly an option, it depends how ''real time'' you need your query data to be

SQL Server Replication[] is something that might help you here.

Transactional Replication[^] is near real-time ... otherwise, simply creating a nightly ''snapshot'' of your data for query purposes might be acceptable

How many rows are we talking about?

If it''s only a few million, well designed indexes + a data access plan should be able to handle the query load

e.g. Don''t just let users link into your tables and perform any queries they want, force them to use a ''query'' stored procedure that has been indexed tuned and the plans analysed.


这篇关于查询具有大量数据的SQL表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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