SQL Server响应缓慢 [英] SQL Server slow response

查看:156
本文介绍了SQL Server响应缓慢的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用C#2.0和sql server 2005为贸易公司开发了一个项目..
该项目运行完美.关于代码部分没有问题.

但是我怕一件事.

他们每天要输入大量记录,一天中要在不同的表中输入大约3000条记录.

硬盘大小为1TB.
我想几个月后会有几百万条记录,那么我的软件会变慢吗?否则它会像现在一样工作.

如果工作缓慢,那将是可以解决的方法.
[我在某些表中不是全部实现主键索引,请给我其他解决方案].
[网络连接不是问题.]

请回答我.
预先表示感谢.

I am developed a project for a trading Company using C# 2.0 and sql server 2005.
The project is working perfectly. No issue regarding code part.

But I am afraid of one thing.

They are entering huge number of records daily, around 3000 records are entering in different tables in a day.

There hard disk size is 1TB.
I am Thinking after few month there will be some million of records, then will my Software work slow? or it will work as it is now.

If it will work slow then what will be remedy.
[I implement Primary key index in some tables not all-Please give me any other solution].
[Network connection is not the issue.]

Please answer me.
Thanks in advance.

推荐答案

您可能应该考虑的一件事是,在表变大时使用CTE执行分页-看看
One thing you should probably consider is to use CTEs to perform paging when the table gets bigger - have a look at Data Paging Using CTE (Common Table Expression)[^]

This will allow you to browse the full table, even if you end up having a 100 million records or more.

Best regards
Espen Harlinn


一个拥有一百万行的表(在我看来)并不大,也不应该引起任何白发.您应考虑的事物至少包括(无特定顺序):

  • 适当的索引编制,不仅是主键,而且还要满足各种频繁/重要的操作
  • 避免过度索引编制,以确保修改工作顺利进行
  • 数据库,适当的规范化等
  • 使用正确的数据类型
  • 避免强制转换
  • 设计并测试SQL语句
  • 监控用法
  • 不时地频繁更新统计信息
  • ,对数据库进行碎片整理
  • 在可能的情况下利用数据库来照顾逻辑,这意味着需要触发器,程序限制等
A table havin a million rows isn''t big (in my opinion) and shouldn''t cause any gray hair. The things you should consider include at least (in no specific order):

  • proper indexing, not just the primary key but to satisfy different kinds of frequent/important operations
  • avoid over indexing to keep the modifications running smoothly
  • using a good design in the database, proper normalization and so on
  • use correct data types
  • avoid casts
  • design and test the SQL statements well
  • monitor the usage
  • update the statistics frequently enough
  • from time to time, defragment the database
  • utilize the database to take care about the logic when possible, meaning having triggers, procedures constraints etc


如果这些人能使它起作用,我想你也可以:
http://aws.amazon.com/rds/sqlserver/ [ http://support.microsoft.com/kb/319942 [
If these guy could make it work I would guess you could too:
http://aws.amazon.com/rds/sqlserver/[^]

as for SQL server there are number of different ways you can configure it so that it is not a problem:
http://support.microsoft.com/kb/319942[^]

Hope that would help you :)


这篇关于SQL Server响应缓慢的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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