16.1.2 Calculation of required memory

The size of the memory required for a HiRDB/Single Server is the sum of the items listed in Table 16-2.

For details about the value specified in the shmmax operating system parameter (for Solaris, shmsys:shminfo_shmmax; for Linux, SHMMAX), see 21. Specifying OS Parameters.

Table 16-2 Size of memory required for a HiRDB/Single Server

ItemRequired memory (KB)
Process private areaProcess private area used by all unit controller processes
  • 32-bit mode
E + [Figure]{(64 + 48 [Figure] (u + 1)) [Figure] (value of pd_max_server_process - b - 3) + w } [Figure] 1024[Figure]
  • 64-bit mode
E + [Figure]{(64 + 64 [Figure] (u + 1)) [Figure] (value of pd_max_server_process - b - 3) + w } [Figure] 1024[Figure]
  • When using plug-ins, add:
+ 1400
  • When using the asynchronous READ facility, add:
+ r
  • When using Real Time SAN Replication, add:
+ [Figure]425 [Figure] (2 [Figure] b + 7) [Figure] 1024[Figure]
  • When fixed was specified in the pd_process_terminator operand, add:
+ F[Figure] (value of pd_process_terminator_max - 1)
Process private area used by single server process1pd_work_buff_
mode=each specified
  • 32-bit mode
{G + g + (a + 9) [Figure] c + h + i + m + p + q + s}[Figure] (b + 3) + [Figure](64 + 48 [Figure] (b + 1)) [Figure] 1024[Figure][Figure] (v + 3)
  • 64-bit mode
{G + g + (a + 9) [Figure] c + h + i + m + p + q + s} [Figure] (b + 3) + [Figure](64 + 64 [Figure] (b + 1)) [Figure] 1024[Figure][Figure] (v + 3)
pd_work_buff_
mode=pool specified or omitted
  • 32-bit mode
(G + g + a + 9 + [Figure] a[Figure] 128 [Figure] 0.1[Figure] + 11 + h + i + m + p + q + s) [Figure] (b + 3) + n + [Figure](64 + 48 [Figure] (b + 1)) [Figure] 1024[Figure][Figure] (v + 3)
  • 64-bit mode
(G + g + a + 9 + [Figure] a[Figure] 128 [Figure] 0.1[Figure] + 15 + h + i + p + q + s) [Figure] (b + 3) + n + [Figure](64 + 64 [Figure] (b + 1)) [Figure] 1024[Figure][Figure] (v + 3)
Shared memorySpace used by the unit controller in the unit controller shared memory[Figure]d[Figure] 1024[Figure]
Space used by the Single Server in the unit controller shared memorye
Global buffer shared memoryf
Utility shared memoryt
Security audit information buffer shared memory[Figure]For automatic calculation by the system:
[Figure]0.3 + MAX{(H + 100) , (H[Figure] 1.2)} [Figure] 0.25[Figure]
[Figure] For user -specified values (specify the pd_audit_def_buffer_size operand):
[Figure]0.3 + H[Figure] 0.25[Figure]
Inter-process memory communication shared memory2j [Figure]k
1 Add a value of 300 per process if you use plug-ins.
2 Add this value if you have specified PDIPC=MEMORY in the client environment definition. For details about the inter-process memory communication facility and client environment definitions, see the manual HiRDB Version 8 UAP Development Guide. If either the HiRDB server or the HiRDB client is in 32-bit mode, the system allocates the shared memory for the inter-process memory communication facility in the 32-bit address space.
a: Value of pd_work_buff_size operand
b: Value of pd_max_users operand + value of pd_max_reflect_process_count operand
c: Maximum number of work tables
Obtain the number of work tables for each SQL statement from Table 16-3 Procedure for obtaining the number of work tables for each SQL statement. Use the largest value obtained from Table 16-3 as the maximum number of work tables.
d: Value obtained from 16.1.3 Formulas for shared memory used by a unit controller.
e: Value obtained from 16.1.4 Formulas for shared memory used by a single server.
f: Value obtained from 16.1.5 Formula for size of shared memory used by global buffers.
g: Size of memory required during SQL execution
For details about the formula, see 16.1.6 Formulas for size of memory required during SQL execution.
h: Size of memory required during SQL preprocessing
For details about the formula, see 16.1.7 Formula for size of memory required during SQL preprocessing.
i: LOB buffer batch input/output work memory
Add 62 KB if a LOB global buffer is specified in the global buffer definition (-b specified in the pdbuffer operand of the system common definition).
j: Maximum number of concurrently executable clients that use the inter-process memory communication facility.
If you are not sure about the value, specify the number of all clients that use the inter-process memory communication facility or the value of the pd_max_users operand.
k: Average memory size for data transfer performed by all clients that use the inter-process memory communication facility (value of PDSENDMEMSIZE + value of PDRECVMEMSIZE in the client environment definition).
m: Memory requirement for Java virtual machine
If you use Java stored procedures or Java stored functions, add the size of memory used by the Java virtual machine. This value depends on the Java virtual machine's options (-Xms, -Xmx, and -Xmn options for Hewlett-Packard JRE 1.2.2.04) and version. For details about the memory requirement for your Java virtual machine, see the applicable manual. Following are the guidelines for the memory required for HP-UX:
  • Eight MB of memory is required to start a Java virtual machine.
  • Add the maximum memory size for the Java virtual machine (value of the -Xmx option). Note that some Java virtual machines may use more memory than the size specified in the -Xmx option.
n: Work table extended memory size
When the pd_work_buff_expand_limit operand is specified, add the work table extended memory size. The work table extended memory size is determined from the following formula:
Work table extended memory size (kilobytes) = work table extended buffer size + [Figure](work table extended buffer size [Figure] 128) [Figure] 0.1[Figure]
  • Work table extended buffer size (kilobytes) = MAX(0, work table extended buffer size based on hash join, subquery hash execution) + MAX(0, work table extended buffer size based on the increase in the number of work tables)
  • Work table extended buffer size based on hash join, subquery hash execution = MIN{ (work table extended buffer size based on hash join, subquery hash execution - value of the pd_work_buff_size operand), (value of the pd_work_buff_expand_limit operand - value of the pd_work_buff_size operand) } [Figure] number of concurrently executing users executing hash join, subquery hash execution
    For details about determining the work table extended buffer size when executing hash join, subquery hash execution, see the manual HiRDB Version 8 UAP Development Guide.
  • Work table extended buffer size based on the increase in the number of work tables = MIN{ (number of work tables used [Figure] 128 - value of the pd_work_buff_size operand), (value of pd_work_buff_expand_limit operand - value of pd_work_buff_size operand) }[Figure](number of users such that the number of work tables is greater than the value of the pd_work_buff_size operand[Figure]128)
    Number of work tables used = MAX(number of work table files used per SQL statement, number of work table files used by the ASSIGN LIST statement)
    For details about determining the number of work table files used per SQL statement and the number of work table files used by the ASSIGN LIST statement, see 19.3 Determining the maximum number of files (pdfmkfs -l command).
p: Memory requirements required for BLOB data type
For details about the formula, see 16.1.8 Formula for size of memory required during BLOB data retrieval or updating (HiRDB/Single Server).
q: Memory requirements required for server-side block transfer or array FETCH
For details about the formula, see 16.1.9 Formula for size of memory required during block transfer or array FETCH.
r: Memory size used by asynchronous READ
This is applicable when the asynchronous READ facility is used; use the following formula (in kilobytes) for the calculation:
(90 +
90
[Figure]Memory used by the RDAREA for management of the HiRDB file system area)
i=1
[Figure]value of pd_max_ard_process
For the memory used by the RDAREA for management of the HiRDB file system area, use 90 areas as the maximum in the calculation. If the number of areas used by the server is fewer than 90, assume that amount anyway.
The memory used by the RDAREA for management of the HiRDB file system area (in kilobytes) is calculated from the following formula based on the initial settings:
{(Number of files1 + number of extensions2)[Figure]64}[Figure]1.53
1 Value specified by pdfmkfs -l.
2 Value specified by pdfmkfs -e.
3 Multiply when the area size (value specified in pdfmkfs -n) is at least 2048.
s: HiRDB file system memory size
Determine with the following formula (in kilobytes):
347 + Memory used by the work tables for management of the HiRDB file system area + Memory used by the system logs for management of the HiRDB file system area +
90
[Figure]Memory used by the RDAREA for management of the HiRDB file system area
i=1
The memory used by the HiRDB file system area for management of work tables and system logs uses the maximum value calculated for the memory used by the HiRDB file system area for management used by the server. For RDAREAs, use 90 areas as the maximum calculation value. If the number of areas used by the server is fewer than 90, assume that amount anyway.
The memory used by the RDAREA for management of the HiRDB file system area (in kilobytes) is calculated with the following formula based on the initial settings:
{(Number of files1 + number of extensions2)[Figure]64}[Figure]1.53
1 Value specified by pdfmkfs -l.
2 Value specified by pdfmkfs -e.
3 Multiply when the area size (value specified in pdfmkfs -n) is at least 2048.
t: When value of pd_utl_exec_mode is 0: 0
When value of pd_utl_exec_mode is 1: [Figure]{(b[Figure]2000 + 136)[Figure]1024}[Figure][Figure]1024
u: Valid value of pd_module_trace_max for the unit control information definition
v: Valid value of pd_module_trace_max for the single server definition
w: Memory size for restarting HiRDB
If this memory size cannot be allocated, HiRDB restart fails. Use the following formula to determine the size (in bytes):
A + B
[Figure] If commit is specified in the pd_dbsync_point operand, add:
+ 112 [Figure] (value of pd_max_users[Figure] 2 + 7)
[Figure]If 1 or a greater value is specified in the pd_inner_replica_control operand, add:
+ C
[Figure] If the number of RDAREA storage areas created in a character special file is 1001 or greater, add:
+ D
Use the following variables in the formula to calculate the size of memory used by HiRDB to restart:
VariableValue
A
  • 32-bit mode
291722 + 4 [Figure] value of pd_max_rdarea_no
+ {48 [Figure] (value of pd_max_rdarea_no + number of tables) + 304} [Figure] (value of pd_max_users[Figure] 2 + 7)
  • 64-bit mode
370682 + 8 [Figure] value of pd_max_rdarea_no
+ {64 [Figure] (value of pd_max_rdarea_no + number of tables) + 512} [Figure] (value of pd_max_users[Figure] 2 + 7)
Number of tables: Number of data dictionary tables + MAX {value of pd_max_access_tables, 500}
Bb1[Figure] X + b2[Figure] Y
b1: When the record length of the server status file < 4096
MAX(([Figure](3400 [Figure] (([Figure]((record length - 40) - 308) [Figure] 20[Figure])
+ ([Figure](record length - 40) [Figure] 20[Figure]) [Figure] (MAX([Figure]4096 [Figure] record length[Figure],2) - 1))
+ 0.7)[Figure]),1) [Figure] MAX([Figure]4096 [Figure] record length[Figure],2) [Figure] (record length - 40)
When 4096 [Figure] record length of server status file < 12288
MAX([Figure](3400 [Figure] ([Figure](((record length - 40) - 308) [Figure] 20)[Figure]) + 0.7)[Figure],1)
[Figure](record length - 40)
When 12288 [Figure] record length of server status file
MAX([Figure](3400 [Figure] ([Figure](((record length - 40) - 836) [Figure] 20)[Figure]) + 0.7)[Figure],1)
[Figure](record length - 40)
X: When the number of RDAREAs [Figure] 3400: 1
When 3401 [Figure] number of RDAREAs [Figure] 6800: 2
When 6801 [Figure] number of RDAREAs: 3
b2: When the record length of the server status file < 4096
([Figure](5662310​ [Figure] (([Figure]((record length - 40) - 308) [Figure] 20[Figure])
+ ([Figure](record length - 40) [Figure] 20[Figure]) [Figure] (MAX([Figure]4096 [Figure] record length[Figure],2) - 1))
+ 0.7)[Figure]) [Figure] MAX([Figure]4096 [Figure] record length[Figure],2) [Figure] (record length - 40)
When 4096 [Figure] record length of server status file < 12288
[Figure](5662310​ [Figure] ([Figure](((record length - 40) - 308) [Figure] 20)[Figure]) + 0.7)[Figure]
[Figure] (record length - 40)
When 12288 [Figure] record length of server status file
[Figure](5662310​ [Figure] ([Figure](((record length - 40) - 836) [Figure] 20)[Figure]) + 0.7)[Figure]
[Figure] (record length - 40)
Y: When the number of RDAREAs [Figure] 10200: 0
When 10201 [Figure] number of RDAREAs [Figure] 5672510​: 1
When 5672511​ [Figure] number of RDAREAs [Figure] 11334820​: 2
When 11334821​ [Figure] number of RDAREAs: 3
C
  • 32-bit mode
(48 [Figure] value of pd_inner_replica_control + 80) [Figure] (value of pd_max_users[Figure] 2 + 7)
  • 64-bit mode
(64 [Figure] value of pd_inner_replica_control + 160) [Figure] (value of pd_max_users[Figure] 2 + 7)
D
  • 32-bit mode
12012 [Figure] ([Figure](number of RDAREA storage areas created in a character special file - 1000) [Figure] 1000[Figure])
  • 64-bit mode
16016 [Figure] ([Figure](number of RDAREA storage areas created in a character special file - 1000) [Figure] 1000[Figure])
E, F, G: Fixed value
These values depend on the OS being used. The following table presents the values for each OS (in kilobytes):
OSValue of EValue of FValue of G
HP-UX (32-bit mode)84,1002,7004,800
HP-UX (32-bit-mode POSIX library version)129,6002,8004,900
HP-UX (64-bit mode)86,8002,8005,300
HP-UX (IPF)161,3002,8005,100
AIX 5L (32-bit mode)71,8002,2005,100
AIX 5L (32-bit-mode POSIX library version)131,4004,9008,000
AIX 5L (64-bit mode)82,1002,7006,700
Solaris (32-bit mode)74,8001,5003,100
Solaris (32-bit-mode POSIX library version)12,2001,7003,300
Solaris (64-bit mode)86,6001,9003,800
Linux (32-bit mode)96,3003,3005,100
Linux (IPF)168,8004,6006,900
Linux (EM64T)150,5008,00011,200
H: The number of objects specified in a narrowed search using the security audit facility audit trail

Table 16-3 Procedure for obtaining the number of work tables for each SQL statement

SQL statementProcedure for obtaining the number of work tables
SELECT statement
INSERT(-SELECT) statement
When none of 1-8 as follows are applicable: 0
When any of 1-8 as follows are applicable: Sum of the applicable values from 1-8
  1. When multiple tables are joined for retrieval
    Number of additional work tables = (Number of joined tables - 1) [Figure] 2 + 1
  2. When specifying the ORDER BY clause
    Number of additional work tables = 2
  3. When specifying the GROUP BY clause
    Number of additional work tables = Number of GROUP BY clauses specified
  4. When specifying the DISTINCT clause
    Number of additional work tables = Number of DISTINCT clauses specified
  5. When specifying the UNION, UNION ALL, or EXCEPT[ALL] clause
    Number of additional work tables = (Number of UNION or UNION ALL clauses specified) [Figure] 2 + 1
  6. When search condition contains columns with index defined
    Number of additional work tables = Number of columns with index defined in the search condition
  7. When specifying the FOR UPDATE or FOR READ ONLY clause
    Number of additional work tables = 1
  8. When specifying a subquery (quantified predicate)
    Number of additional work tables = Number of subqueries specified
UPDATE statement
DELETE statement
Number of columns with index defined in the search condition + 1
DROP SCHEMA statement
DROP TABLE statement
DROP INDEX statement
CREATE INDEX statement
REVOKE statement to revoke access privilege
2