15.2.2 Calculation of required memory

The size of the memory required for each unit of a HiRDB/Parallel Server is the sum of the items listed in the following table.

Table 15-7 Size of memory required for each unit of a HiRDB/Parallel Server

ItemRequired memory (KB)
Process private areaProcess private area used by all unit controller processes
  • 32-bit mode
J + K x Number of FESs in unit + L x (Number of BESs in unit + Number of DSs in unit) + [Figure]{(64 + 48 x (v + 1)) x (value of pd_max_server_process - w) + z} [Figure] 1,024[Figure]
  • 64-bit mode
J + K x Number of FESs in unit + L x (Number of BESs in unit + Number of DSs in unit) + [Figure]{(64 + 64 x (v + 1)) x (value of pd_max_server_process - w) + z} [Figure] 1,024[Figure]
  • If a plug-in is used, add:
+ 1,400
  • If the asynchronous READ facility is used, add:
+ s
  • If fixed is specified in the pd_process_terminator operand, add:
+ M x (value of pd_process_terminator_max - 1)
  • If you are performing in-memory data processing, add:
+ [Figure]{T x (value of pd_max_bes_process x 2 + 7) x number of BESs in unit} [Figure] 1,024[Figure]
  • If you are changing the maximum number of communication traces stored, add:
+ [Figure]V[Figure] 1,024[Figure]
Process private area used by each server process#1, #2Front-end server(N + h + m + p + q) x (b + 3) + 100 + y
  • If you are changing the maximum number of communication traces stored, add:
+ [Figure]W[Figure] 1,024[Figure]
Dictionary serverpd_work_buff_mode=each specified{(P + i + m + r + t) x (b + 3)} +
(a + 9) x 2 + 100 + y + S
  • If you are changing the maximum number of communication traces stored, add:
+ [Figure]W[Figure] 1,024[Figure]
pd_work_buff_ mode=pool specified or omitted{(P + i + m + r + t) x (b + 3)}
+ a + 9 + [Figure] a [Figure] 128 x 0.1[Figure] + 100 + n + y + S
  • If you are changing the maximum number of communication traces stored, add:
+ [Figure]W[Figure] 1,024[Figure]
Back-end serverpd_work_buff_ mode=each specified{Q + g + (a + 9) x c + i + m + r + t}
x (b + 3) + 100 + y + S
  • If you are performing in-memory data processing, add:
+ [Figure]{T x (value of pd_max_users + 3)} [Figure] 1,024[Figure]
  • If you are changing the maximum number of communication traces stored, add:
+ [Figure]W[Figure] 1,024[Figure]
pd_work_buff_ mode=pool specified or omitted
  • 32-bit mode
(Q + g + a + 9
+ [Figure] a [Figure] 128 x 0.1 + 11[Figure] + i + m + r + t)
x (b + 3) + 100 + n + y + S
  • 64-bit mode
(Q + g + a + 9
+ [Figure] a [Figure] 128 x 0.1 + 15[Figure] + i + r + t)
x (b + 3) + 100 + n + y + S
  • If you are performing in-memory data processing, add:
+ [Figure]{T x (value of pd_max_users + 3)} [Figure] 1,024[Figure]
  • If you are changing the maximum number of communication traces stored, add:
+ [Figure]W[Figure] 1,024[Figure]
Shared memorySpace used by the unit controller in the unit controller shared memory[Figure]d[Figure] 1,024[Figure]
Space used by each server in the unit controller shared memory#1E
Global buffer shared memoryF
In-memory data processing shared memoryU
Utility shared memoryU
Security audit information buffer shared memory[Figure]For automatic calculation by the system:
[Figure]0.3 + MAX{(R + 100), (R x 1.2)} x 0.25[Figure]
[Figure] For user-specified values (specify the pd_audit_def_buffer_size operand):
Value specified for pd_audit_def_buffer_size
Inter-process memory communication shared memory#3j x k
#1: If the unit contains multiple servers (excluding the system manager), obtain the value for each server.
#2: When using plug-ins, add 300 per server process.

#3: 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 HiRDB Version 9 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
  • For a dictionary server, the value is value of the pd_max_dic_process operand.
  • For a back-end server, the value is value of the pd_max_bes_process operand.
  • If the pd_max_dic_process or pd_max_bes_process operand is omitted, the value is value of the pd_max_users operand.
c: Maximum number of work tables
Find the number of work tables for each SQL statement in Table 15-8 Procedure for obtaining the number of work tables for each SQL statement. Use the largest number of work tables obtained from Table 15-8 as the maximum number of work tables.
d: Value obtained from 15.2.3 Formulas for shared memory used by a unit controller.
e: Value obtained from 15.2.4 Formulas for shared memory used by each server.
f: Value obtained from 15.2.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 15.2.6 Formulas for size of memory required during SQL execution.
h: Size of memory required during SQL preprocessing
For details about the formula, see 15.2.7 Formula for size of memory required during SQL preprocessing.
i: LOB buffer batch input/output work memory
Add 62 KB if LOB global buffer is specified for the LOB RDAREA for the corresponding server (-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 a 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 and version. For details about the memory requirement for your Java virtual machine, see the applicable manual.
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) x 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) } x number of concurrently executing users executing hash join, subquery hash execution
    For details about determining the work table extended buffer size when executing hash joins, subquery hash executions, see the HiRDB Version 9 UAP Development Guide.
  • Work table extended buffer size based on the increase in the number of work tables = MIN{ (number of work tables used x 128 - value of the pd_work_buff_size operand), (value of pd_work_buff_expand_limit operand - value of pd_work_buff_size operand) } x (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 18.3 Determining the maximum number of files (pdfmkfs -l command).
p: Memory requirements required for BLOB data type
For details about the formula, see 15.2.8 Formula for size of memory required during BLOB data retrieval or updating (front-end server).
q: Memory requirements required for server-side block transfer or array FETCH
For details about the formula, see 15.2.10 Formula for size of memory required during block transfer or array FETCH (front-end server).
r: Memory requirements required for BLOB data type
For details about the formula, see 15.2.9 Formula for size of memory required during BLOB data retrieval or updating (back-end server or dictionary server).
s: 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
x value of pd_max_ard_process
For the memory used by the RDAREA for management of the HiRDB file system area, use the largest 90 areas in descending order of the values. 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 files#1 + number of extensions#2)[Figure]64} x 1.5#3
#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 2,048.
t: 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 the largest 90 areas in descending order of the values. If the number of areas used by the server is fewer than 90, use as many areas as are used for the calculation.
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 files#1 + number of extensions#2)[Figure]64} x 1.5#3
#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 2,048.
u: When value of pd_utl_exec_mode is 0: 0
When value of pd_utl_exec_mode is 1: [Figure]{(b x 2,000 + 136)[Figure] 1,024}[Figure] x 1,024
v: Value of pd_module_trace_max that is valid as the unit control information definition
w: Sum of (maximum number of processes that can be started + 3) for all server processes in the unit
For details about the maximum number of processes that can be started, see the manual HiRDB Version 9 System Definition.
y: Sum of the values obtained by the following formula for each server process in the unit:
In the 32-bit mode:
[Figure]{(64 + 48 x (value of pd_module_trace_max + 1)) x (maximum number of processes that can be started + 3)} [Figure] 1,024[Figure]
In the 64-bit mode:
[Figure]{(64 + 64 x (value of pd_module_trace_max + 1)) x (maximum number of processes that can be started + 3)} [Figure] 1,024[Figure]
For details about the maximum number of processes that can be started, see the manual HiRDB Version 9 System Definition.
z: 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):
(D + E + F) x number of dictionary servers + (D + E + F) x number of back-end servers + [Figure]H
Use the following variables for the formula to calculate the size of memory used by HiRDB to restart:
VariableValue
D
  • 32-bit mode
246,762 + 4 x value of pd_max_rdarea_no
+ {48 x (value of pd_max_rdarea_no + number of tables) + 304} x (value of pd_max_users# x 2 + 7)
  • 64-bit mode
305,274 + 8 x value of pd_max_rdarea_no
+ {64 x (value of pd_max_rdarea_no + number of tables) + 512} x (value of pd_max_users# x 2 + 7)
Number of tables: 62 + MAX {value of pd_max_access_tables, 500}
Eb1 x X + b2 x Y
b1: When the record length of the server status file < 4,096
MAX(([Figure](3,400 [Figure] (([Figure]((record length - 40) - 308) [Figure] 20[Figure])
+ ([Figure](record length - 40) [Figure] 20[Figure]) x (MAX([Figure]4,096 [Figure] record length[Figure],2) - 1))
+ 0.7)[Figure]),1) x MAX([Figure]4,096 [Figure] record length[Figure],2) x (record length - 40)
When 4,096 [Figure] record length of server status file < 12,288
MAX([Figure](3,400 [Figure] ([Figure](((record length - 40) - 308) [Figure] 20)[Figure]) + 0.7)[Figure],1)
x (record length - 40)
When 12,288 [Figure] record length of server status file
MAX([Figure](3,400 [Figure] ([Figure](((record length - 40) - 836) [Figure] 20)[Figure]) + 0.7)[Figure],1)
x (record length - 40)
X: When the number of RDAREAS in server [Figure] 3,400: 1
When 3,401 [Figure] number of RDAREAS in server [Figure] 6,800: 2
When 6,801 [Figure] number of RDAREAS in server: 3
b2: When the record length of the status file for server < 4,096
([Figure](5,662,310 [Figure] (([Figure]((record length - 40) - 308) [Figure] 20[Figure])
+ ([Figure](record length - 40) [Figure] 20[Figure]) x (MAX([Figure]4,096 [Figure] record length[Figure],2) - 1))
+ 0.7)[Figure]) x MAX([Figure]4,096 [Figure] record length[Figure],2) x (record length - 40)
When 4,096 [Figure] record length of server status file < 12,288
[Figure](5,662,310 [Figure] ([Figure](((record length - 40) - 308) [Figure] 20)[Figure]) + 0.7)[Figure]
x (record length - 40)
When 12,288 [Figure] record length of server status file
[Figure](5,662,310 [Figure] ([Figure](((record length - 40) - 836) [Figure] 20)[Figure]) + 0.7)[Figure]
x (record length - 40)
Y: When the number of RDAREAS in server [Figure] 10,200: 0
When 10,201 [Figure] number of RDAREAS in server [Figure] 5,672,510: 1
When 5,672,511 [Figure] number of RDAREAS in server [Figure] 11,334,820: 2
When 11,334,821 [Figure] number of RDAREAS in server: 3
FIf commit is specified in the pd_dbsync_point operand, add:
+ 112 x (value of pd_max_users# x 2 + 7)
HFor back-end servers in which the number of HiRDB file system areas that store RDAREAs created in a HiRDB file system area that uses the raw I/O facility in a server is 1,001 or more, add:
  • 32-bit mode
12,012 x ([Figure](number of HiRDB file system areas that store RDAREAs created in a HiRDB file system area that uses the raw I/O facility - 1,000) [Figure] 1,000[Figure])
  • 64-bit mode
16,016 x ([Figure](number of HiRDB file system areas that store RDAREAs created in a HiRDB file system area that uses the raw I/O facility - 1,000) [Figure] 1,000[Figure])
#
For a dictionary server, use the value of pd_max_dic_process. For a back-end server, use the value of pd_max_bes_process. However, if both pd_max_dic_process and pd_max_bes_process are omitted, use the value of pd_max_users
J, K, L, M, N, P, Q: Fixed value
These values depend on the OS being used. The following table presents the values for each OS (in kilobytes):
OSValue of JValue of KValue of LValue of MValue of NValue of PValue of Q
Windows (32-bit mode)128,20024,60032,2007,4009,5008,3008,300
Windows Server 2003 (IPF)180,40018,00023,3005,40011,60012,90015,300
Windows (x64)170,30039,20052,50013,00012,20012,20014,000
R: The number of objects specified in a narrowed search using the security audit facility audit trail
S: Memory required when using the facility for acquiring syncpoint output synchronization control information (bytes)
If 1 is specified in the pd_dbbuff_trace_level operand and the pd_dfw_awt_process operand is not specified, add:
32-bit mode
320 x number of global buffers defined in Single Server
64-bit mode
640 x number of global buffers defined in Single Server
T: If 1 or a greater value is specified in the pd_max_resident_rdarea_no operand, add:
1,648 + 16 x value of pd_max_resident_rdarea_no + 16 x value of pd_max_resident_rdarea_shm_no
U: Memory required by in-memory data processing
For the applicable formulas, see 15.2.11 Memory required by in-memory data processing.
V: Memory required by communication trace processing
32-bit mode
(16 x (Z - 1,024) x 2) x (value of pd_max_server_process - w)
64-bit mode
(32 x (Z - 1,024) x 2) x (value of pd_max_server_process - w)
W: Memory required by communication trace processing
This is either of the following values calculated for each server process within the unit.
32-bit mode
(16 x (aa - 1,024) x 2) x (maximum number of startup processes + 3)
64-bit mode
(32 x (aa - 1,024) x 2) x (maximum number of startup processes + 3)
For details about the maximum number of startup processes, see the manual HiRDB Version 9 System Definition.
Z: The value of pd_pth_trace_max enabled as the unit control information definition.
The value specified for the operand rounded up to a power of two.
aa: The value of pd_pth_trace_max enabled as each server definition.
The value specified for the operand rounded up to a power of two.

Table 15-8 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) x 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) x 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