db2 V8的有关SQL limits

来源:互联网 发布:windows 内存清理工具 编辑:程序博客网 时间:2024/05/21 10:33

The following tables describe certain SQL limits. Adhering to the most restrictive case can help the programmer design application programs that are easily portable.

Table 7. Identifier Length LimitsDescriptionLimit in BytesLongest authorization name (can only be single-byte characters)30Longest constraint name18Longest correlation name128Longest condition name64Longest cursor name18Longest unqualified column name (nickname)128Longest data source index name128Longest data source name128Longest data source table name (remote-table-name)128Longest external program name8Longest host identifiera255Longest identifier of a data source user (remote-authorization-name)30Longest label name64Longest method name18Longest parameter nameb128Longest password to access a data source32Longest savepoint name128Longest schema namec30Longest server (database alias) name8Longest SQL variable name64Longest statement name18Longest transform. group name18Longest unqualified column name30Longest unqualified package name8Longest unqualified user-defined type, user-defined function, user-defined method, buffer pool, table space, database partition group, trigger, index, or index specification name18Longest unqualified table name, view name, stored procedure name, sequence name, nickname, or alias128Longest wrapper name128
Notes:
  1. aIndividual host language compilers may have a more restrictive limit on variable names.
  2. bParameter names in an SQL procedure are limited to 64 bytes.
  3. cThe schema name for a user-defined type is limited to 8 bytes.

Table 8. Numeric LimitsDescriptionLimitSmallest INTEGER value-2 147 483 648Largest INTEGER value+2 147 483 647Smallest BIGINT value-9 223 372 036 854 775 808Largest BIGINT value+9 223 372 036 854 775 807Smallest SMALLINT value-32 768Largest SMALLINT value+32 767Largest decimal precision31Smallest DOUBLE value-1.79769E+308Largest DOUBLE value+1.79769E+308Smallest positive DOUBLE value+2.225E-307Largest negative DOUBLE value-2.225E-307Smallest REAL value-3.402E+38Largest REAL value+3.402E+38Smallest positive REAL value+1.175E-37Largest negative REAL value-1.175E-37

Table 9. String LimitsDescriptionLimitMaximum length of CHAR (in bytes)254Maximum length of VARCHAR (in bytes)32 672Maximum length of LONG VARCHAR (in bytes)32 700Maximum length of CLOB (in bytes)2 147 483 647Maximum length of GRAPHIC (in characters)127Maximum length of VARGRAPHIC (in characters)16 336Maximum length of LONG VARGRAPHIC (in characters)16 350Maximum length of DBCLOB (in characters)1 073 741 823Maximum length of BLOB (in bytes)2 147 483 647Maximum length of character constant32 672Maximum length of graphic constant16 336Maximum length of concatenated character string2 147 483 647Maximum length of concatenated graphic string1 073 741 823Maximum length of concatenated binary string2 147 483 647Maximum number of hex constant digits16 336Maximum size of a catalog comment (in bytes)254Largest instance of a structured type column object at run time (in gigabytes)1

Table 10. Datetime LimitsDescriptionLimitSmallest DATE value0001-01-01Largest DATE value9999-12-31Smallest TIME value00:00:00Largest TIME value24:00:00Smallest TIMESTAMP value0001-01-01-00.00.00.000000Largest TIMESTAMP value9999-12-31-24.00.00.000000

Table 11. Database Manager LimitsDescriptionLimitMost columns in a tableg1 012Most columns in a viewa5 000Maximum length of a row including all overheadbg32 677Maximum size of a table per partition (in gigabytes)cg512Maximum size of an index per partition (in gigabytes)512Most rows in a table per partition4 x 109Longest index key including all overhead (in bytes)1 024Most columns in an index key16Most indexes on a table32 767 or storageMost tables referenced in an SQL statement or a viewstorageMost host variable declarations in a precompiled programcstorageMost host variable references in an SQL statement32 767Longest host variable value used for insert or update (in bytes)2 147 483 647Longest SQL statement (in bytes)72 097 152Most elements in a select listg1 012Most predicates in a WHERE or HAVING clausestorageMaximum number of columns in a GROUP BY clauseg1 012Maximum total length of columns in a GROUP BY clause (in bytes)g32 677Maximum number of columns in an ORDER BY clauseg1 012Maximum total length of columns in an ORDER BY clause (in bytes)g32 677Maximum size of an SQLDA (in bytes)storageMaximum number of prepared statementsstorageMost declared cursors in a programstorageMaximum number of cursors opened at one timestorageMost tables in an SMS table space65 534Maximum number of constraints on a tablestorageMaximum level of subquery nestingstorageMaximum number of subqueries in a single statementstorageMost values in an INSERT statementg1 012Most SET clauses in a single UPDATE statementg1 012Most columns in a UNIQUE constraint (supported via a UNIQUE index)16Maximum combined length of columns in a UNIQUE constraint (supported via a UNIQUE index) (in bytes)1 024Most referencing columns in a foreign key16Maximum combined length of referencing columns in a foreign key (in bytes)1 024Maximum length of a check constraint specification (in bytes)65 535Maximum number of columns in a partitioning keye500Maximum number of rows changed in a unit of workstorageMaximum number of packagesstorageMost constants in a statementstorageMaximum concurrent users of serverd64 000Maximum number of parameters in a stored procedure32 767Maximum number of parameters in a user defined function90Maximum run-time depth of cascading triggers16Maximum number of simultaneously active event monitors32Maximum size of a regular DMS table space (in gigabytes)cg512Maximum size of a long DMS table space (in terabytes)c2Maximum size of a temporary DMS table space (in terabytes)c2Maximum number of databases per instance concurrently in use256Maximum number of concurrent users per instance64 000Maximum number of concurrent applications per database60 000Maximum number of connections per process within a DB2 client512Maximum depth of cascaded triggers16Maximum partition number999Most table objects in DMS table spacef51 000Longest variable index key part (in bytes)h1022 or storageMaximum number of columns in a data source table or view that is referenced by a nickname5 000Maximum NPAGES in a buffer pool for 32-bit releases1 048 576Maximum NPAGES in a buffer pool for 64-bit releases2 147 483 647Maximum total size of all buffer pool slots (4K)2 147 483 646Maximum number of nested levels for stored procedures161Maximum number of table spaces in a database132 768Maximum number of attributes in a structured type4082Maximum number of simultaneously opened LOB locators in a transaction32 100
Notes:
  1. aThis maximum can be achieved using a join in the CREATE VIEW statement. Selecting from such a view is subject to the limit of most elements in a select list.
  2. bThe actual data for BLOB, CLOB, LONG VARCHAR, DBCLOB, and LONG VARGRAPHIC columns is not included in this count. However, information about the location of that data does take up some space in the row.
  3. cThe numbers shown are architectural limits and approximations. The practical limits may be less.
  4. dThe actual value will be the value of the MAXAGENTS configuration parameter.
  5. eThis is an architectural limit. The limit on the most columns in an index key should be used as the practical limit.
  6. fTable objects include data, indexes, LONG VARCHAR or VARGRAPHIC columns, and LOB columns. Table objects that are in the same table space as the table data do not count extra toward the limit. However, each table object that is in a different table space than the table data does contribute one toward the limit for each table object type per table in the table space in which the table object resides.
  7. gFor page size-specific values, seeTable 12.
  8. hThis is limited only by the longest index key, including all overhead (in bytes). As the number of index key parts increases, the maximum length of each key part decreases.

Table 12. Database Manager Page Size Specific LimitsDescription4K page size limit8K page size limit16K page size limit32K page size limitMost columns in a table5001 0121 0121 012Maximum length of a row including all overhead4 0058 10116 29332 677Maximum size of a table per partition (in gigabytes)64128256512Maximum size of an index per partition (in gigabytes)64128256512Most elements in a select list5001 0121 0121 012Maximum number of columns in a GROUP BY clause5001 0121 0121 012Maximum total length of columns in a GROUP BY clause (in bytes)4 0058 10116 29332 677Maximum number of columns in an ORDER BY clause5001 0121 0121 012Maximum total length of columns in an ORDER BY clause (in bytes)4 0058 10116 29332 677Most values in an INSERT statement5001 0121 0121 012Most SET clauses in a single UPDATE statement5001 0121 0121 012Maximum size of a regular DMS table space (in gigabytes)64128256512
原创粉丝点击
热门问题 老师的惩罚 人脸识别 我在镇武司摸鱼那些年 重生之率土为王 我在大康的咸鱼生活 盘龙之生命进化 天生仙种 凡人之先天五行 春回大明朝 姑娘不必设防,我是瞎子 微信的视频打不开怎么办 公众号被取消了怎么办 合同上不写工资怎么办 已经上班了想考个大专文凭怎么办 微信小程序违规暂停服务怎么办 程序锁密码忘了怎么办 忘了应用锁密码怎么办 毕业后发现论文有错误怎么办 柯丽尔打胶片时胶片卡住了怎么办 闽教英语要收费怎么办 高一学生英语差怎么办 高一英语基础差怎么办 老师教育学生学生跑出教室怎么办 研究生课题难出论文怎么办 一审过了上诉期怎么办 民事判决赔偿不给钱怎么办 民事申诉期过了怎么办 过了两年申诉期怎么办 微快递下单不能定位怎么办 网上打字兼职被骗了怎么办 微信银行卡转错怎么办 在支付宝被诈骗怎么办 发现被骗了报警不理怎么办 投稿投错了网站怎么办 六个月宝宝吃辅食便秘怎么办 六个月宝宝加辅食后便秘怎么办 婴儿6个月便秘怎么办 7个月的孩子便秘怎么办 四个月宝宝喜欢吃手怎么办 博瑞智教育是上当了怎么办 我43岁记忆力差怎么办 艾灸灸出的湿疹怎么办 饭店合同到期房东不租怎么办 极端暴力控制不住自己怎么办 苹果已停止访问该网页怎么办 qq登陆后隐藏了怎么办 易班密码忘记了怎么办 老师上课讲错了怎么办 专升本差了一分怎么办 登录不上学信网怎么办 steam被好友删了怎么办