Estimating storage when using the LOAD utility
You must complete several calculations to estimate the storage that is required for a table to be loaded by the LOAD utility.
About this task
For a table to be loaded by the LOAD utility, assume the
following values:
- Let FLOOR be the operation of discarding the decimal portion of a real number.
- Let CEILING be the operation of rounding a real number up to the next highest integer.
- Let number of records be the total number of records to be loaded.
- Let average record size be the sum of
the lengths of the fields in each record, using an average value for
varying-length fields, and including the following amounts for overhead:
- 8 bytes for the total record
- 1 byte for each field that allows nulls
- 2 bytes for each varying-length field
- Let percsave be the percentage of kilobytes saved by compression (as reported by the DSN1COMP utility in message DSN1940I)
- Let compression ratio be percsave/100
Procedure
To calculate the storage required when using the LOAD utility, complete the following steps:
Example
For example, consider a table space containing a single
table with the following characteristics:
- Number of records = 100000
- Average record size = 80 bytes
- Page size = 4 KB
- PCTFREE = 5 (5% of space is left free on each page)
- FREEPAGE = 20 (one page is left free for each 20 pages used)
- MAXROWS = 255
If the data is not compressed, you get the following results:
- Usable page size = 4056 × 0.95 = 3853 bytes
- Records per page = MIN(MAXROWS, FLOOR(3853 / 80)) = 48
- Pages used = 2 + CEILING(100000 / 48) = 2085
- Total pages = FLOOR(2085 × 21 / 20) = 2189
- Estimated number of kilobytes = 2189 × 4 = 8756
If the data is compressed, multiply the estimated number of kilobytes for an uncompressed table by (1 - compression ratio) for the estimated number of kilobytes required for the compressed table.