skip to main content
Configuring the OpenAccess SDK SQL Engine : Configuring Disk Cache : CacheData File Size
 

CacheData File Size

To estimate the CacheData file size, you need to know the overhead of storing records on disk. Use the following overhead factors when estimating the total size:
*Overhead per record: 2 bytes, if record size is less than 65536 bytes. 6 bytes for larger size record.
*Overhead per column: 3 to 6 bytes depending upon column type and total columns in the record.
The following table shows the overhead for each column in a record.
Table 10. Overhead for Each Column in a Record
Data Type
Less than 255 Total Columns in Record
More than 255 Total Columns in Record
CHAR(254)
3 bytes
5 bytes
DATE
3 bytes
5 bytes
DOUBLE
3 bytes
5 bytes
FLOAT
3 bytes
5 bytes
INTEGER
3 bytes
5 bytes
LONGVARBINARY
6 bytes
8 bytes
NUMERIC
3 bytes
5 bytes
REAL
3 bytes
5 bytes
SMALLINT
3 bytes
5 bytes
TIME
3 bytes
5 bytes
TIMESTAMP
3 bytes
5 bytes
VARCHAR
4 bytes
6 bytes
Example 1
If the record has 5 CHAR fields, each with a width of 20 bytes, then the record area size is 117 bytes (2 + 5 * (3 + 20)).
The space overhead for 5 fields is 17%. This means 3.4% space overhead per field.
Example 2
If the record has 5 INTEGER fields, then the record area size is 37 bytes (2 + 5 * (3 + 4)).
The space overhead for 5 fields is 85%. This means 17% space overhead per field.