简体   繁体   English

SQL Server 2005-表中的行数(推荐)

[英]SQL Server 2005 - Number of rows (recommended) in a table

Recently we started to get some performance issues on our SQL Server. 最近,我们开始在SQL Server上遇到一些性能问题。

On analysis I found the DBA has got 800 millions rows in ONE TABLE (300 GB in size) 经过分析,我发现DBA在一张表中有8亿行(大小为300 GB)

No partitioning, no proper indexes - lead to performance going down. 没有分区,没有适当的索引-导致性能下降。

ADVICE: 忠告:

How many number of rows would one recommended for a table in SQL Server 2005 对于SQL Server 2005中的一个表,建议多少行

There is no "recommended" number. 没有“推荐”编号。

You should only hold data the you use. 您只应保留您使用的数据。 If you don't use it, archive it. 如果您不使用它,请将其存档。

If you do need it and you have performance problems, you DBA should be able to tune the DB. 如果确实需要它并且遇到性能问题,则DBA应该能够调整数据库。 With that number of rows (not unusual), indexing and ensuring the SAN is working properly should do the trick. 有了这样的行数(不寻常),索引并确保SAN正常工作就可以解决问题。 Horizontal scaling is another option. 水平缩放是另一种选择。

Oracle user here (never used MS SQL server with such large number of rows) Oracle用户在这里(从未使用过具有如此大量行的MS SQL Server)

I can say that in all the systems I've worked with, all the tables having hundreds of millions of rows just had to be partitioned . 我可以说,在我使用过的所有系统中,所有具有数亿行的表都必须进行分区

According to this document you should also have such big table partitioned in MS SQL as well. 根据本文档,您还应该在MS SQL中对这样的大表进行分区。 http://msdn.microsoft.com/en-us/library/ms345146(v=sql.90).aspx http://msdn.microsoft.com/en-us/library/ms345146(v=sql.90).aspx

There should be no real limit on the number of rows in a single table as long as it is properly indexed - 800 million doesn't strike me as that many. 只要正确索引索引,单个表中的数就没有真正的限制-8亿行对我来说没有那么多。

What counts as "properly indexed" will depend completely on the application and the table. 算作“正确索引”的内容将完全取决于应用程序和表。

I see alot of "no limit" answers, but I'm going to disagree. 我看到很多“没有限制”的答案,但是我会不同意。 Unless you have megabucks worth of hardware, this table should be partitioned. 除非您拥有价值百万美元的硬件,否则应该对该表进行分区。 The fact that there are 800 million rows tells me that either a.) this is a fact table in the data warehouse (and should be partitioned anyway) OR b.) the dba has been asleep at the wheel. 有8亿行的事实告诉我,要么a。)这是数据仓库中的一个事实表(无论如何应该对其进行分区),或者b。)dba睡着了。

I'm thinking b (or maybe collectively a and b). 我在想b(或者可能是a和b)。 I can't imagine being the dba and letting a table get to 800 million records without some sort of intervention. 我无法想象成为dba并允许表在没有某种干预的情况下获得8亿条记录。 I like to be proactive and this is a big red flag that the dba has no plan for aging the data. 我喜欢主动,这是一个很大的危险信号,即dba没有计划老化数据。 It's either growing very quickly or is completely unmanaged. 它要么增长很快,要么完全不受管理。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM