In the column definition (column_definition), the memory requirement of a column value depends on the data_type. You can get a rough idea of the memory requirement using the following table. Please note that these values are intended as guidance values and are applicable in most cases but may vary depending on your system configuration.
If the database parameter COLUMNCOMPRESSION=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:
Concepts of the Database System, Support Database
Parameters
If, however, the lead column is not the last lead column, then the maximum space requirement is in fact required.
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) |
Maximum Space Requirement in the Database (Bytes) |
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 |
LONG |
9 |
9 |
41 |
41 |
CHAR(n) ASCII |
n+1 |
n+1 |
n+1 |
2*n+1 |
CHAR(n) ASCII |
n+2 |
n+1 |
n+1 |
2*n+1 |
CHAR(n) ASCII |
n+2 |
n+2 |
n+1 |
2*n+1 |
CHAR(n) ASCII |
n+3 |
n+3 |
n+1 |
2*n+1 |
CHAR(n) BYTE |
n+1 |
n+1 |
n+1 |
n+1 |
CHAR(n) BYTE |
n+2 |
n+1 |
n+1 |
n+1 |
CHAR(n) BYTE |
n+2 |
n+2 |
n+1 |
n+1 |
CHAR(n) BYTE |
n+3 |
n+3 |
n+1 |
n+1 |
CHAR(n) UNICODE |
2*n+1 |
2*n+1 |
2*n+1 |
2*n+1 |
CHAR(n) UNICODE |
2*n+2 |
2*n+1 |
2*n+1 |
2*n+1 |
CHAR(n) U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