SQLSERVER 的资源限制
https://docs.microsoft.com/en-us/sql/sql-server/maximum-capacity-specifications-for-sql-server?view=sql-server-2017
一个数据库的最大对象是 2的31次方减1个..
Maximum Capacity Specifications for SQL Server
APPLIES TO:
SQL Server
Azure SQL Database
Azure SQL Data Warehouse
Parallel Data Warehouse
For content related to previous versions of SQL Server, see Maximum Capacity Specifications for SQL Server.
The following tables specify maximum sizes and numbers of various objects defined in SQL Server components. To navigate to the table for a SQL Server technology, click on its link:
SQL Server Database Engine Objects
SQL Server Data-tier Application Objects
SQL Server Replication Objects
Database Engine Objects
Maximum sizes and numbers of various objects defined in SQL Server databases or referenced in Transact-SQL statements.
| SQL Server Database Engine object | Maximum sizes/numbers SQL Server (64-bit) | Additional Information | |
|---|---|---|---|
| Batch size | 65,536 * Network Packet Size | Network Packet Size is the size of the tabular data stream (TDS) packets used to communicate between applications and the relational Database Engine. The default packet size is 4 KB, and is controlled by the network packet size configuration option. | |
| Bytes per short string column | 8,000 | ||
| Bytes per GROUP BY, ORDER BY | 8,060 | ||
| Bytes per index key | 900 bytes for a clustered index. 1,700 for a nonclustered index. | The maximum number of bytes in a clustered index key cannot exceed 900 in SQL Server. For a nonclustered index key, the maximum is 1700 bytes.
You can define a key using variable-length columns whose maximum sizes add up to more than the limit. However, the combined sizes of the data in those columns can never exceed the limit. In a nonclustered index, you can include extra non-key columns, and they do not count against the size limit of the key. The non-key columns might help some queries perform better. |
|
| Bytes per index key for memory-optimized tables | 2500 bytes for a nonclustered index. No limit for a hash index, as long as all index keys fit in-row. | On a memory-optimized table, a nonclustered index cannot have key columns whose maximum declared sizes exceed 2500 bytes. It is irrelevant whether the actual data in the key columns would be shorter than the maximum declared sizes.
For a hash index key there is no hard limit on size. For indexes on memory-optimized tables, there is no concept of included columns, since all indexes inherently cover of all columns. For a memory-optimized table, even though the row size is 8060 bytes, some variable-length columns can be physically stored outside those 8060 bytes. However, the maximum declared sizes of all key columns for all indexes on a table, plus any additional fixed-length columns in the table, must fit in the 8060 bytes. |
|
| Bytes per foreign key | 900 | ||
| Bytes per primary key | 900 | ||
| Bytes per row | 8,060 | SQL Server supports row-overflow storage which enables variable length columns to be pushed off-row. Only a 24-byte root is stored in the main record for variable length columns pushed out of row; because of this, the effective row limit is higher than in previous releases of SQL Server. For more information, see the "Row-Overflow Data Exceeding 8 KB" topic in SQL Server Books Online. | |
| Bytes per row in memory-optimized tables | 8,060 | Starting SQL Server 2016 (13.x) memory-optimized tables support off-row storage. Variable length columns are pushed off-row if the maximum sizes for all the columns in the table exceeds 8060 bytes; this is a compile-time decision. Only an 8-byte reference is stored in-row for columns stored off-row. For more information, see Table and Row Size in Memory-Optimized Tables. | |
| Bytes in source text of a stored procedure | Lesser of batch size or 250 MB | ||
| Bytes per varchar(max), varbinary(max), xml, text, or image column | 2^31-1 | ||
| Characters per ntext or nvarchar(max) column | 2^30-1 | ||
| Clustered indexes per table | 1 | ||
| Columns in GROUP BY, ORDER BY | Limited only by number of bytes | ||
| Columns or expressions in a GROUP BY WITH CUBE or WITH ROLLUP statement | 10 | ||
| Columns per index key | 32 | If the table contains one or more XML indexes, the clustering key of the user table is limited to 31 columns because the XML column is added to the clustering key of the primary XML index. In SQL Server, you can include nonkey columns in a nonclustered index to avoid the limitation of a maximum of 32 key columns. For more information, see Create Indexes with Included Columns. | |
| Columns per foreign key | 32 | ||
| Columns per primary key | 32 | ||
| Columns per nonwide table | 1,024 | ||
| Columns per wide table | 30,000 | ||
| Columns per SELECT statement | 4,096 | ||
| Columns per INSERT statement | 4,096 | ||
| Connections per client | Maximum value of configured connections | ||
| Database size | 524,272 terabytes | ||
| Databases per instance of SQL Server | 32,767 | ||
| Filegroups per database | 32,767 | ||
| Filegroups per database for memory-optimized data | 1 | ||
| Files per database | 32,767 | ||
| File size (data) | 16 terabytes | ||
| File size (log) | 2 terabytes | ||
| Data files for memory-optimized data per database | 4,096 in SQL Server 2014 (12.x). Later versions of SQL Server do not impose such a strict limit. | ||
| Delta file per data file for memory-optimized data | 1 | ||
| Foreign key table references per table | Outgoing = 253. Incoming = 10,000. | For restrictions, see Create Foreign Key Relationships. | |
| Identifier length (in characters) | 128 | ||
| Instances per computer | 50 instances on a stand-alone server.
25 instances on a failover cluster when using a shared cluster disk as the stored option for you cluster installation SQL Server supports 50 instances on a failover cluster if you choose SMB file shares as the storage option for your cluster installation. |
||
| Indexes per memory-optimized table | 999 starting SQL Server 2017 (14.x) and in Azure SQL Database 8 in SQL Server 2014 (12.x) and SQL Server 2016 (13.x) |
||
| Length of a string containing SQL statements (batch size) | 65,536 * Network packet size | Network Packet Size is the size of the tabular data stream (TDS) packets used to communicate between applications and the relational Database Engine. The default packet size is 4 KB, and is controlled by the network packet size configuration option. | |
| Locks per connection | Maximum locks per server | ||
| Locks per instance of SQL Server | Limited only by memory | This value is for static lock allocation. Dynamic locks are limited only by memory. | |
| Nested stored procedure levels | 32 | If a stored procedure accesses more than 64 databases, or more than 2 databases in interleaving, you will receive an error. | |
| Nested subqueries | 32 | ||
| Nested trigger levels | 32 | ||
| Nonclustered indexes per table | 999 | ||
| Number of distinct expressions in the GROUP BY clause when any of the following are present: CUBE, ROLLUP, GROUPING SETS, WITH CUBE, WITH ROLLUP | 32 | ||
| Number of grouping sets generated by operators in the GROUP BY clause | 4,096 | ||
| Parameters per stored procedure | 2,100 | ||
| Parameters per user-defined function | 2,100 | ||
| REFERENCES per table | 253 | ||
| Rows per table | Limited by available storage | ||
| Tables per database | Limited by number of objects in a database | Database objects include objects such as tables, views, stored procedures, user-defined functions, triggers, rules, defaults, and constraints. The sum of the number of all objects in a database cannot exceed 2,147,483,647. | |
| Partitions per partitioned table or index | 15,000 | ||
| Statistics on non-indexed columns | 30,000 | ||
| Tables per SELECT statement | Limited only by available resources | ||
| Triggers per table | Limited by number of objects in a database | Database objects include objects such as tables, views, stored procedures, user-defined functions, triggers, rules, defaults, and constraints. The sum of the number of all objects in a database cannot exceed 2,147,483,647. | |
| Columns per UPDATE statement (Wide Tables) | 4096 | ||
| User connections | 32,767 | ||
| XML indexes | 249 |
SQL Server Utility Objects
Maximum sizes and numbers of various objects that were tested in the SQL Server Utility.
| SQL Server Utility object | Maximum sizes/numbers SQL Server (64-bit) | |
|---|---|---|
| Computers (physical computers or virtual machines) per SQL Server Utility | 100 | |
| Instances of SQL Server per computer | 5 | |
| Total number of instances of SQL Server per SQL Server Utility | 200* | |
| User databases per instance of SQL Server, including data-tier applications | 50 | |
| Total number of user databases per SQL Server Utility | 1,000 | |
| File groups per database | 1 | |
| Data files per file group | 1 | |
| Log files per database | 1 | |
| Volumes per computer | 3 |
*The maximum number of managed instances of SQL Server supported by SQL Server Utility may vary based on the hardware configuration of the server. For getting started information, see SQL Server Utility Features and Tasks. SQL Server Utility control point is not available in every edition of SQL Server 2017. For a list of features that are supported by the editions of SQL Server, see Features Supported by the Editions of SQL Server 2016.
SQL Server Data-tier Application Objects
Maximum sizes and numbers of various objects that were tested in the SQL Server data-tier applications (DAC).
| SQL Server DAC object | Maximum sizes/numbers SQL Server (64-bit) | |
|---|---|---|
| Databases per DAC | 1 | |
| Objects per DAC* | Limited by the number of objects in a database, or available memory. |
*The types of objects included in the limit are users, tables, views, stored procedures, user-defined functions, user-defined data type, database roles, schemas, and user-defined table types.
Replication Objects
Maximum sizes and numbers of various objects defined in SQL Server Replication.
| SQL Server Replication object | Maximum sizes/numbers SQL Server (64-bit) | |
|---|---|---|
| Articles (merge publication) | 2048 | |
| Articles (snapshot or transactional publication) | 32,767 | |
| Columns in a table* (merge publication) | 246 | |
| Columns in a table** ( SQL Server snapshot or transactional publication) | 1,000 | |
| Columns in a table** (Oracle snapshot or transactional publication) | 995 | |
| Bytes for a column used in a row filter (merge publication) | 1,024 | |
| Bytes for a column used in a row filter (snapshot or transactional publication) | 8,000 |
*If row tracking is used for conflict detection (the default), the base table can include a maximum of 1,024 columns, but columns must be filtered from the article so that a maximum of 246 columns is published. If column tracking is used, the base table can include a maximum of 246 columns.
**The base table can include the maximum number of columns allowable in the publication database (1,024 for SQL Server), but columns must be filtered from the article if they exceed the maximum specified for the publication type.
SQLSERVER 的资源限制的更多相关文章
- sqlserver的资源调控器
参考SQL Server2014管理最佳实战,所做的笔记. 1:创建资源池 use master go create resource pool poolAdhoc with ( min_cpu_pe ...
- 【转】怎样查出SQLServer的性能瓶颈
怎样查出SQLServer的性能瓶颈 --王成辉翻译整理,转贴请注明出自微软BI开拓者[url]www.windbi.com[/url]--原帖地址 如果你曾经做了很长时间的DBA,那么你会了解到SQ ...
- 怎样查出SQLServer的性能瓶颈
怎样查出SQLServer的性能瓶颈 --王成辉翻译整理,转贴请注明出自微软BI开拓者[url]www.windbi.com[/url]--原帖地址 如果你曾经做了很长时间的DBA,那么你会了解到SQ ...
- NHibernate动态加载资源文件
最近做项目,又用到了以前做过的ORM框架--NHibernate. 此次想要实现的目标: 1.简单SQL用NHibernate的Session的CRUD方法实现 2.复杂SQL用Native SQL实 ...
- ogg-oracle to sqlserver
环境: source: 54 Centos7 oracle12.2 ogg12.3 target : 52 Windows sqlserver2012 ...
- 001.SQLServer高可用简介
一 SQLServer高可用集群相关概念 1.1 Windows故障转移群集 Windows故障转移群集是由多个服务器组成的共同提供某高可用服务,该服务用于防止单台服务器故障导致服务失效.故障转移群集 ...
- 软-RAID 5组建
图文版raid5组建之软RAID [复制链接] 发表于 2007-3-6 09:19 | 来自 51CTO网页 [只看他] 楼主 硬件raid5的组建和使用,基本上说完 ...
- 硬盘-RAID 5组建
没发正文之前本人先声明一下----本文是转载 这篇文章简直是太精彩了,呵呵 ,实在是忍不住了,一定要贴出来,让大家分享! 原作者:唐华 责任编辑:xiexiaojin 我们生活在一个历史记录在硬盘上的 ...
- 分享一下SQLSERVER技术交流QQ群里的群共享资源
分享一下SQLSERVER技术交流QQ群里的群共享资源 SQLSERVER技术交流QQ群已经开了一段时间了,人数已经有了100多号人, 而群里面很多SQLSERVER爱好者上传了他们宝贵的SQLSER ...
随机推荐
- CodeForces 593D Happy Tree Party [LCA+并查集]
题意:给一棵树,每条边有一个权值,给两种操作,第一种是询问y向下整除从a到b的最短路径中每条边的权值后y的值,第二种是改变某条边的权值. 思路:y的最大值为1e18,最多除大于等于2的数不超过60次即 ...
- python之进程池与线程池
一.进程池与线程池介绍 池子使用来限制并发的任务数目,限制我们的计算机在一个自己可承受的范围内去并发地执行任务 当并发的任务数远远超过了计算机的承受能力时,即无法一次性开启过多的进程数或线程数时就应该 ...
- 【oracle查询】oracle查询字段显示#号 (井号)
客户反映字段查询为井号,我自己没有遇到这种情况,于是上网百度了一下. 下面的答案很好地解决了问题,哈哈哈.
- H5拖拽 构造拖拽及缩放 pdf文件转换为html预览
前言: 协助项目需要实现一个签名的功能. 功能说明:1.有文本签名和头像签名.2.头像签名需要实现可拖拽功能.3.需要展示的是pdf的文件并需要获取签名位于pdf文件的相对位置. 功能一:实现拖拽 思 ...
- Tomcat学习(一)------部署Web应用方法总结
Tomcat部署Web应用方法总结 在Tomcat中部署Java Web应用程序有两种方式:静态部署和动态部署. 在下文中$CATALINA_HOME指的是Tomcat根目录. 一.静态部署 静态部署 ...
- Linux入门基础(二):Linux磁盘及文件管理系统
磁盘管理 fdisk分区工具 只支持MBR分区 fdisk命令只有root用户能用 fdisk -l 列出所有安装磁盘及分区信息 fdisk /dev/sda (操作磁盘,按m可列出帮助界面,常用的操 ...
- 记一次eslint规则配置
{ // 环境定义了预定义的全局变量. "env": { //环境定义了预定义的全局变量.更多在官网查看 "browser": true, "node ...
- python数据分析系列(2)--numpy
NumPy(Numerical Python的简称)是Python数值计算最重要的基础包.大多数提供科学计算的包都是用NumPy的数组作为构建基础. NumPy的部分功能如下: ndarray,一个具 ...
- Erlang数据类型的表示和实现(1)——数据类型回顾
本文介绍 Erlang 语言中使用的各种数据类型以及这些数据类型在 Erlang 虚拟机内部的表示和实现.了解数据类型的实现可以帮助大家在实际开发过程中正确选择数据类型,并且可以更好更高效地操作这些数 ...
- JVM调优(2)
堆大小设置JVM 中最大堆大小有三方面限制:相关操作系统的数据模型(32-bt还是64-bit)限制:系统的可用虚拟内存限制:系统的可用物理内存限制.32位系统下,一般限制在1.5G~2G:64为操作 ...