When designing files on the iSeries™ server, you should keep in mind the sizes for database files.
The following table lists the maximum values for database files:
|
These are maximum values. There are situations where the actual limit you experience will be less than the stated maximum. For example, certain high-level languages can have more restrictive limits than those described above.
Keep in mind that performance can suffer as you approach some of these maximums. For example, the more logical files you have built over a physical file, the greater the chance that system performance can suffer (if you are frequently changing data in the physical file that causes a change in many logical file access paths).
Normally, an iSeries database file can grow until it reaches the maximum size allowed on the system. The system normally will not allocate all the file space at once. Rather, the system will occasionally allocate additional space as the file grows larger. This method of automatic storage allocation provides the best combination of good performance and effective auxiliary storage space management.
If you want to control the size of the file, the storage allocation, and whether the file should be connected to auxiliary storage, you can use the SIZE, ALLOCATE, and CONTIG parameters on the Create Physical File (CRTPF) and the Create Source Physical File (CRTSRCPF) commands.
Disk size = (number of valid and deleted records + 1) x
(record length + 1) + 20480 x (number of members) + 8192
Disk size = (number of valid and deleted records + 1) x
(record length + 1) + 20480 x (number of members) +
8192 + ((number of fields in format ÷ 8) rounded up) x
(number of valid and deleted records + 1)
Disk size = (12288) x (number of members) + 8192
let a = (LimbPageUtilization - LogicalPageHeaderSize) *
(LogicalPageHeaderSize - LeafPageUtilization - 2 * NodeSize)
let b = NumKeys * (TerminalTextPerKey + 2 * NodeSize) *
(LimbPageUtilization - LogicalPageHeaderSize + 2 * NodeSize)
+ CommonTextPerKey * [ LimbPageUtilization + LeafPageUtilization
- 2 * (LogicalPageHeaderSize - NodeSize) ]
- 2 * NodeSize * (LeafPageUtilization - LogicalPageHeaderSize
+ 2 * NodeSize)
let c = CommonTextPerKey * [ 2 * NodeSize - CommonTextPerKey
- NumKeys * (TerminalTextPerKey + 2 * NodeSize) ]
then NumberLogicalPages = ceil( [ -b - sqrt(b ** 2 - 4 * a * c) ]
/ (2 * a))
and TotalIndexSize = NumberLogicalPages * LogicalPageSize
Constant | Three-byte index | Four-byte index |
---|---|---|
NodeSize | 3 | 4 |
LogicalPageHeaderSize | 16 | 64 |
LimbPageUtilization | .75 * LogicalPageSize | .75 * LogicalPageSize |
LeafPageUtilization | .75 * LogicalPageSize | .80 * LogicalPageSize |
CommonTextPerKey = [ min(max(NumKeys - 256,0),256)
+ min(max(NumKeys - 256 * 256,0),256 * 256)
+ min(max(NumKeys - 256 * 256 * 256,0),
256 * 256 * 256)
+ min(max(NumKeys - 256 * 256 * 256 * 256,0),
256 * 256 * 256 * 256) ]
* (NodeSize + 1) / NumKeys
TerminalTextPerKey = KeySizeInBytes - CommonTextPerKey
This should reduce everything needed to calculate the index size to the type of index (that is, 3 or 4 byte), the total key size, and the number of keys. The estimate should be greater than the actual index size because the common text estimate is minimal.
Key Length | *MAX4GB (3-byte) LogicalPageSize | *MAX1TB (4-byte) LogicalPageSize |
---|---|---|
1 - 500 | 4096 bytes | 8192 bytes |
501 - 1000 | 8192 bytes | 16 384 bytes |
1001 - 2000 | 16 384 bytes | 32 768 bytes |
2001 - 10 000 | N/A | 65 536 bytes |
10 001 - 18 000 | N/A | 131 072 bytes |
18 001 - 26 000 | N/A | 262 144 bytes |
26 001 - 32 768 | N/A | 524 288 bytes |
Key Length | *MAX4GB (3-byte) LimbPageUtilization | *MAX1TB (4-byte) LimbPageUtilization |
---|---|---|
1 - 500 | 3072 bytes | 6144 bytes |
501 - 1000 | 6144 bytes | 12 288 bytes |
1001 - 2000 | 12 288 bytes | 24 576 bytes |
2001 - 10 000 | N/A | 49 152 bytes |
10 001 - 18 000 | N/A | 98 304 bytes |
18 001 - 26 000 | N/A | 196 608 bytes |
26 001 - 32 768 | N/A | 393 216 bytes |
Key Length | *MAX4GB (3-byte) LeafPageUtilization | *MAX1TB (4-byte) LeafPageUtilization |
---|---|---|
1 - 500 | 3072 bytes | 6554 bytes |
501 - 1000 | 6144 bytes | 13 107 bytes |
1001 - 2000 | 12 288 bytes | 26 214 bytes |
2001 - 10 000 | N/A | 52 428 bytes |
10 001 - 18 000 | N/A | 104 857 bytes |
18 001 - 26 000 | N/A | 209 715 bytes |
26 001 - 32 768 | N/A | 419 430 bytes |
CommonTextPerKey = 0
which would cause:
TerminalTextPerKey = KeySizeInBytes
b = NumKeys * (KeySizeInBytes + 2 * NodeSize) *
(LimbPageUtilization - LogicalPageHeaderSize + 2 * NodeSize)
- 2 * NodeSize * (LeafPageUtilization - LogicalPageHeaderSize
+ 2 * NodeSize)
c = 0
NumberLogicalPages = ceil( [ -b - sqrt(b ** 2 ) ]
/ (2 * a))
= ceil[ (-2 * b) / (2 * a) ]
= ceil[ -b/a ]