Top
Symfoware Server V12.1.0  Installation and Setup Guide for Server
FUJITSU Software

I.1 Estimating Table Size Requirements

The following tables provide the formulas for estimating table size requirements.

Table I.1 Estimation formula when the record length is 2032 bytes or less

Item

Estimation formula (bytes)

(1) Record length

27(*1) + NULL map + OID + column data

NULL map: Number of columns / 8 (*2)
OID: 4 for a table "WITH OID". The default is 0.
Column data: Sum of column lengths

*1: Record head section

*2: Round the result up to the next integer.

  • Because the column data is placed in boundaries of 8 bytes, you need to make an adjustment so that the sum of the record head section, NULL map and OID is a multiple of 8.
    For example, if the calculated length is 27 + 1 / 8 (rounded up) + 0 = 28 bytes, add 4 to make the length 32 bytes.

  • Because the data of each column is placed in boundaries of the defined data type, take the boundary of each data type into account for the length of the column data.
    For example, the length of the column data in the table below will not be the sum of the data types, which is 37 bytes, but will instead be 64 bytes following boundary adjustment.
      Definition: create table tb1(c1 char(1), c2 long, c3 int, c4 box)
      Estimation: CHAR type 1 byte + boundary adjustment of 7 bytes for LONG type 8 bytes + LONG type 8 bytes + INT type 4 bytes + boundary adjustment of 12 bytes for BOX type 32 bytes + BOX type 32 bytes = 64 bytes

  • Because each record is placed in boundaries of 8 bytes, you need to make an adjustment so that the length of the column data is a multiple of 8.

  • If the calculated record length exceeds 2,032 bytes, the variable length data in the record might be compressed automatically. If so, use the estimation formulas in "Table I.2 Estimation formula when the record length exceeds 2032 bytes" to estimate the table size.

(2) Number of records per page

8168 (*1) / ((1) record length + 4 (*2))

*1: Page length (8192) - page head (24)

*2: Pointer length (4)

  • The result will be rounded down to the next integer.

(3)Number of pages required for storing records

Total number of records / (2) number of records per page

  • The result will be rounded up to the next integer.

(4) Amount of space

(3) Number of pages required for storing records x page length x safety factor (*1)

*1: Specify 2.0 or higher.

  • This is the safety factor assumed if vacuuming is performed for garbage collection in tables and indexes.

Table I.2 Estimation formula when the record length exceeds 2032 bytes

Item

Estimation formula (bytes)

(4) Amount of space

Total number of records x (1) record length x safety factor (*1)

*1: Specify 2.0 or higher.

  • This is the safety factor assumed if vacuuming is performed for garbage collection in tables and indexes.