天地不仁,以万物为刍狗!

db2 V8的有关SQL limits

上一篇 / 下一篇  2008-08-06 10:34:35 / 个人分类:db2

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 identifiera255
Longest identifier of a data source user (remote-authorization-name)30
Longest label name64
Longest method name18
Longest parameter nameb128
Longest password to access a data source32
Longest savepoint name128
Longest schema namec30
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. 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 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 tableg1 012
Most columns in a viewa5 000
Maximum length of a row including all overheadbg32 677
Maximum size of a table per partition (in gigabytes)cg512
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 programcstorage
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)72 097 152
Most elements in a select listg1 012
Most predicates in a WHERE or HAVING clausestorage
Maximum number of columns in a GROUP BY clauseg1 012
Maximum total length of columns in a GROUP BY clause (in bytes)g32 677
Maximum number of columns in an ORDER BY clauseg1 012
Maximum total length of columns in an ORDER BY clause (in bytes)g32 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 statementg1 012
Most SET clauses in a single UPDATE statementg1 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 keye500
Maximum number of rows changed in a unit of workstorage
Maximum number of packagesstorage
Most constants in a statementstorage
Maximum concurrent users of serverd64 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)cg512
Maximum size of a long DMS table space (in terabytes)c2
Maximum size of a temporary DMS table space (in terabytes)c2
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 spacef51 000
Longest variable index key part (in bytes)h1022 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
1Maximum number of table spaces in a database132 768
Maximum number of attributes in a structured type4082
Maximum 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 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

TAG:

 

评分:0

我来说两句

显示全部

:loveliness: :handshake :victory: :funk: :time: :kiss: :call: :hug: :lol :'( :Q :L ;P :$ :P :o :@ :D :( :)

日历

« 2008-11-24  
      1
2345678
9101112131415
16171819202122
23242526272829
30      

数据统计

  • 访问量: 12228
  • 日志数: 273
  • 图片数: 1
  • 文件数: 2
  • 建立时间: 2007-12-01
  • 更新时间: 2008-11-19

RSS订阅

Open Toolbar