Nonstop Database, HiRDB Version 9 UAP Development Guide

[Contents][Index][Back][Next]

18.17.5 Estimating the ResultSet object size

The following shows the formulas for estimating the ResultSet object size.

Formula (for 32-bit mode)

ResultSet object size =
16000 + (900 + locator access object length + receive buffer size)
x number of ResultSet instances + retrieval results accumulation area size x number of ResultSet instances 2
(bytes)
 

Formula (for 64-bit mode)

ResultSet object size =
17000 + (1300 + locator access object length + receive buffer size)
x number of ResultSet instances + retrieval results accumulation area size x number of ResultSet instances 2
(bytes)
 
Locator access object length: If the locator facility is used (LOCATOR specified in the url argument of DriverManager.getConnection or in the LONGVARBINARY_ACCESS user property, or LOCATOR specified by the setLONGVARBINARY_Access method of a DataSource interface), add 1,600.
Receive buffer size: Use the following formula to determine the value:

MAX(32768,
[Figure](240 + data length of retrieved row x number of rows for block transfer) [Figure] 4096[Figure] x 4096)
 
Data length of retrieved row: Use the following formula to determine the value:

[Figure]

Definition length of column data: If the data is BLOB or BINARY and a locator is used, the value is 4. If a locator is not used, the value is one of the following:
  • If HiRDB_for_Java_MAXBINARYSIZE is omitted:
    8 + definition length
  • If HiRDB_for_Java_MAXBINARYSIZE is specified:
    MIN(8 + definition length, 8 + HiRDB_for_Java_MAXBINARYSIZE value)
Number of rows for block transfer: If the block transfer facility is not used, the value is 1.
Retrieval results accumulation area size: Use the following formula to determine the value:

[Figure]

Real length of column data: See the following table:
Output data attribute Real length of column data
INTEGER 4
SMALLINT 2
DECIMAL(m, n) [Figure]m [Figure] 2[Figure] + 1
FLOAT 8
SMALLFLT 4
BLOB or BINARY If the locator facility is used, the value is 4; if not, the value is one of the following:
  • If HiRDB_for_Java_MAXBINARYSIZE is omitted:
    8 + real length
  • If HiRDB_for_Java_MAXBINARYSIZE is specified:
    MIN(8 + real length, 8 + MAXBINARYSIZE value)
Other Real length
Number of ResultSet instances 2: Number of ResultSet instances whose result set type is ResultSet.TYPE_SCROLL_INSENSITIVE or ResultSet.TYPE_SCROLL_SENSITIVE