In the column definition (column_definition), the memory requirement of a column value depends on the data type. You can get an approximate idea of the memory requirement using the following table. Please note that these values are intended as guidance values. Though applicable in most cases, they may vary depending on your system configuration.
Note
If the database parameter UseColumnCompression=YES is set, then the space that is actually required is often smaller than the maximum memory requirement. This difference depends on the actual size of the saved column value. See also: Database Administration, Support database parameters
However, if the lead column is not the last lead column, then the actual required space corresponds to the maximum space requirement.
If the column is the last lead column then the actual required space is smaller than the maximum space requirement.
Data type |
Maximum Space Requirement in the Database (Bytes) UseColumnCompression=YES |
Maximum Space Requirement in the Database (Bytes) UseColumnCompression=NO |
Space Requirement in Communication (Bytes) when an ASCII Client is Used |
Space Requirement in Communication (Bytes) when a UNICODE Client is Used |
---|---|---|---|---|
FIXED(p,s) |
(p+1) DIV 2 + 3 |
(p+1) DIV 2 + 2 |
(p+1) DIV 2 + 2 |
(p+1) DIV 2 + 2 |
FLOAT(p) |
(p+1) DIV 2 + 3 |
(p+1) DIV 2 + 2 |
(p+1) DIV 2 + 2 |
(p+1) DIV 2 + 2 |
BOOLEAN |
3 |
2 |
2 |
2 |
DATE |
10 |
9 |
11 |
21 |
TIME |
10 |
9 |
9 |
19 |
TIMESTAMP |
22 |
21 |
27 |
53 |
CLOB/BLOB |
9 |
9 |
41 |
41 |
CHAR(n) ASCII 0<n<=1023 Key column |
n+1 |
n+1 |
n+1 |
2*n+1 |
CHAR(n) ASCII n<=30 Not a key column |
n+2 |
n+1 |
n+1 |
2*n+1 |
CHAR(n) ASCII 30<n<=254 Not a key column |
n+2 |
n+2 |
n+1 |
2*n+1 |
CHAR(n) ASCII 254<n Not a key column |
n+3 |
n+3 |
n+1 |
2*n+1 |
CHAR(n) BYTE 0<n<=1023 Key column |
n+1 |
n+1 |
n+1 |
n+1 |
CHAR(n) BYTE n<=30 Not a key column |
n+2 |
n+1 |
n+1 |
n+1 |
CHAR(n) BYTE 30<n<=254 Not a key column |
n+2 |
n+2 |
n+1 |
n+1 |
CHAR(n) BYTE 254<n Not a key column |
n+3 |
n+3 |
n+1 |
n+1 |
CHAR(n) UNICODE 0<n<=511 Key column |
2*n+1 |
2*n+1 |
2*n+1 |
2*n+1 |
CHAR(n) UNICODE n<=15 Not a key column |
2*n+2 |
2*n+1 |
2*n+1 |
2*n+1 |
CHAR(n) UNICODE 15<n<=127 Not a key column |
2*n+2 |
2*n+2 |
2*n+1 |
2*n+1 |
CHAR(n) UNICODE 127<n Not a key column |
2*n+3 |
2*n+3 |
2*n+1 |
2*n+1 |
VARCHAR(n) ASCII 0<n<=1023 Key column |
n+1 |
n+1 |
n+1 |
2*n+1 |
VARCHAR(n) ASCII n<=30 Not a key column |
n+2 |
n+2 |
n+1 |
2*n+1 |
VARCHAR(n) ASCII 30<n<=254 Not a key column |
n+2 |
n+2 |
n+1 |
2*n+1 |
VARCHAR(n) ASCII 254<n Not a key column |
n+3 |
n+3 |
n+1 |
2*n+1 |
VARCHAR(n) BYTE 0<n<=1023 Key column |
n+1 |
n+1 |
n+1 |
n+1 |
VARCHAR(n) BYTE n<=30 Not a key column |
n+2 |
n+2 |
n+1 |
n+1 |
VARCHAR(n) BYTE 30<n<=254 Not a key column |
n+2 |
n+2 |
n+1 |
n+1 |
VARCHAR(n) BYTE 254<n Not a key column |
n+3 |
n+3 |
n+1 |
n+1 |
VARCHAR(n) UNICODE 0<n<=511 Key column |
2*n+1 |
2*n+1 |
2*n+1 |
2*n+1 |
VARCHAR(n) UNICODE n<=15 Not a key column |
2*n+2 |
2*n+2 |
2*n+1 |
2*n+1 |
VARCHAR(n) UNICODE 15<n<=127 Not a key column |
2*n+2 |
2*n+2 |
2*n+1 |
2*n+1 |
VARCHAR(n) UNICODE 127<n Not a key column |
2*n+3 |
2*n+3 |
2*n+1 |
2*n+1 |