db2 V8的有关SQL limits

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 Limits
DescriptionLimit in Bytes
Longest authorization name (can only be single-byte characters)30
Longest constraint name18
Longest correlation name128
Longest condition name64
Longest cursor name18
Longest unqualified column name (nickname)128
Longest data source index name128
Longest data source name128
Longest data source table name (remote-table-name )128
Longest external program name8
Longest host identifiera 255
Longest identifier of a data source user (remote-authorization-name )30
Longest label name64
Longest method name18
Longest parameter nameb 128
Longest password to access a data source32
Longest savepoint name128
Longest schema namec 30
Longest server (database alias) name8
Longest SQL variable name64
Longest statement name18
Longest transform. group name18
Longest unqualified column name30
Longest unqualified package name8
Longest unqualified user-defined type, user-defined function, user-defined method, buffer pool, table space, database partition group, trigger, index, or index specification name18
Longest unqualified table name, view name, stored procedure name, sequence name, nickname, or alias128
Longest wrapper name128
Notes:
  1. a Individual host language compilers may have a more restrictive limit on variable names.
  2. b Parameter names in an SQL procedure are limited to 64 bytes.
  3. c The schema name for a user-defined type is limited to 8 bytes.

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

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

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

Table 11. Database Manager Limits
DescriptionLimit
Most columns in a tableg 1 012
Most columns in a viewa 5 000
Maximum length of a row including all overheadb g 32 677
Maximum size of a table per partition (in gigabytes)c g 512
Maximum size of an index per partition (in gigabytes)512
Most rows in a table per partition4 x 109
Longest index key including all overhead (in bytes)1 024
Most columns in an index key16
Most indexes on a table32 767 or storage
Most tables referenced in an SQL statement or a viewstorage
Most host variable declarations in a precompiled programc storage
Most host variable references in an SQL statement32 767
Longest host variable value used for insert or update (in bytes)2 147 483 647
Longest SQL statement (in bytes)7 2 097 152
Most elements in a select listg 1 012
Most predicates in a WHERE or HAVING clausestorage
Maximum number of columns in a GROUP BY clauseg 1 012
Maximum total length of columns in a GROUP BY clause (in bytes)g 32 677
Maximum number of columns in an ORDER BY clauseg 1 012
Maximum total length of columns in an ORDER BY clause (in bytes)g 32 677
Maximum size of an SQLDA (in bytes)storage
Maximum number of prepared statementsstorage
Most declared cursors in a programstorage
Maximum number of cursors opened at one timestorage
Most tables in an SMS table space65 534
Maximum number of constraints on a tablestorage
Maximum level of subquery nestingstorage
Maximum number of subqueries in a single statementstorage
Most values in an INSERT statementg 1 012
Most SET clauses in a single UPDATE statementg 1 012
Most columns in a UNIQUE constraint (supported via a UNIQUE index)16
Maximum combined length of columns in a UNIQUE constraint (supported via a UNIQUE index) (in bytes)1 024
Most referencing columns in a foreign key16
Maximum combined length of referencing columns in a foreign key (in bytes)1 024
Maximum length of a check constraint specification (in bytes)65 535
Maximum number of columns in a partitioning keye 500
Maximum number of rows changed in a unit of workstorage
Maximum number of packagesstorage
Most constants in a statementstorage
Maximum concurrent users of serverd 64 000
Maximum number of parameters in a stored procedure32 767
Maximum number of parameters in a user defined function90
Maximum run-time depth of cascading triggers16
Maximum number of simultaneously active event monitors32
Maximum size of a regular DMS table space (in gigabytes)c g 512
Maximum size of a long DMS table space (in terabytes)c 2
Maximum size of a temporary DMS table space (in terabytes)c 2
Maximum number of databases per instance concurrently in use256
Maximum number of concurrent users per instance64 000
Maximum number of concurrent applications per database60 000
Maximum number of connections per process within a DB2 client512
Maximum depth of cascaded triggers16
Maximum partition number999
Most table objects in DMS table spacef 51 000
Longest variable index key part (in bytes)h 1022 or storage
Maximum number of columns in a data source table or view that is referenced by a nickname5 000
Maximum NPAGES in a buffer pool for 32-bit releases1 048 576
Maximum NPAGES in a buffer pool for 64-bit releases2 147 483 647
Maximum total size of all buffer pool slots (4K)2 147 483 646
Maximum number of nested levels for stored procedures16
1 Maximum number of table spaces in a database1 32 768
Maximum number of attributes in a structured type4082
Maximum number of simultaneously opened LOB locators in a transaction32 100
Notes:
  1. a This 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. b The 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. c The numbers shown are architectural limits and approximations. The practical limits may be less.
  4. d The actual value will be the value of the MAXAGENTS configuration parameter.
  5. e This is an architectural limit. The limit on the most columns in an index key should be used as the practical limit.
  6. f Table 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. g For page size-specific values, seeTable 12 .
  8. h This 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 Limits
Description4K page size limit8K page size limit16K page size limit32K page size limit
Most columns in a table5001 0121 0121 012
Maximum length of a row including all overhead4 0058 10116 29332 677
Maximum size of a table per partition (in gigabytes)64128256512
Maximum size of an index per partition (in gigabytes)64128256512
Most elements in a select list5001 0121 0121 012
Maximum number of columns in a GROUP BY clause5001 0121 0121 012
Maximum total length of columns in a GROUP BY clause (in bytes)4 0058 10116 29332 677
Maximum number of columns in an ORDER BY clause5001 0121 0121 012
Maximum total length of columns in an ORDER BY clause (in bytes)4 0058 10116 29332 677
Most values in an INSERT statement5001 0121 0121 012
Most SET clauses in a single UPDATE statement5001 0121 0121 012
Maximum size of a regular DMS table space (in gigabytes)64128256512
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值