15.1.2 Calculation of required memory

The required memory used by HiRDB/Single Server is the sum of all the terms shown in the following table.

Table 15-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 x (u + 1)) x (value of pd_max_server_process - b - 3) + w } [Figure] 1,024[Figure]
  • 64-bit mode
E + [Figure]{(64 + 64 x (u + 1)) x (value of pd_max_server_process - b - 3) + w } [Figure] 1,024[Figure]
  • When using plug-ins, add:
+ 1,400
  • When using the asynchronous READ facility, add:
+ r
  • When fixed was specified in the pd_process_terminator operand, add:
+ F x (value of pd_process_terminator_max - 1)
  • When performing in-memory data processing, add:
+ [Figure]{K x (value of pd_max_users x 2 + 7)} [Figure] 1,024[Figure]
  • When changing the maximum number of communication traces stored, add:
+ [Figure]M[Figure] 1,024[Figure]
Process private area used by single server process#1pd_work_buff_
mode=each specified
  • 32-bit mode
{G + g + (a + 9) x c + h + i + m + p + q + s}x (b + 3) + [Figure](64 + 48 x (b + 1)) [Figure] 1,024[Figure] x (v + 3) + J
  • 64-bit mode
{G + g + (a + 9) x c + h + i + m + p + q + s} x (b + 3) + [Figure](64 + 64 x (b + 1)) [Figure] 1,024[Figure] x (v + 3) + J
  • When performing in-memory data processing, add:
+ [Figure]{K x (value of pd_max_users + 3)} [Figure] 1,024[Figure]
  • When changing the maximum number of communication traces stored, add:
+ [Figure]P[Figure] 1,024[Figure]
pd_work_buff_
mode=pool specified or omitted
  • 32-bit mode
(G + g + a + 9 + [Figure] a[Figure] 128 x 0.1[Figure] + 11 + h + i + m + p + q + s) x (b + 3) + n + [Figure](64 + 48 x (b + 1)) [Figure] 1,024[Figure] x (v + 3) + J
  • 64-bit mode
(G + g + a + 9 + [Figure] a[Figure] 128 x 0.1[Figure] + 15 + h + i + p + q + s) x (b + 3) + n + [Figure](64 + 64 x (b + 1)) [Figure] 1,024[Figure] x (v + 3) + J
  • When performing in-memory data processing, add:
+ [Figure]{K x (value of pd_max_users + 3)} [Figure] 1,024[Figure]
  • When changing the maximum number of communication traces stored, add:
+ [Figure]P[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 the Single Server in the unit controller shared memoryE
Global buffer shared memoryF
In-memory data processing shared memoryL
Utility shared memoryT
Security audit information buffer shared memory[Figure]For automatic calculation by the system:
[Figure]0.3 + MAX{(H + 100), (H 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#2j x k
#1: If you are using plug-ins, add 300 per single server process.
#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 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
c: Maximum number of work tables
Obtain the number of work tables for each SQL statement from Table 15-3 Procedure for obtaining the number of work tables for each SQL statement. Use the largest value obtained from Table 15-3 as the maximum number of work tables.
d: Value obtained from 15.1.3 Formulas for shared memory used by a unit controller.
e: Value obtained from 15.1.4 Formulas for shared memory used by a single server.
f: Value obtained from 15.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 15.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 15.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 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 join, subquery hash execution, 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.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 15.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
x 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 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.
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 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: 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
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
  • If commit is specified in the pd_dbsync_point operand, add:
+ 112 x (value of pd_max_users x 2 + 7)
  • If the number of HiRDB file system areas that store RDAREAs created in a HiRDB file system area that uses the raw I/O facility is 1,001 or more, 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
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}
Bb1 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 [Figure] 3,400: 1
When 3,401 [Figure] number of RDAREAs [Figure] 6,800: 2
When 6,801 [Figure] number of RDAREAs: 3
b2: When the record length of the server status file < 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 [Figure] 10,200: 0
When 10,201 [Figure] number of RDAREAs [Figure] 5,672,510: 1
When 5,672,511 [Figure] number of RDAREAs [Figure] 11,334,820: 2
When 11,334,821 [Figure] number of RDAREAs: 3
D
  • 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])
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
Windows (32-bit mode)207,10011,10014,100
Windows Server 2003 (IPF)167,0005,40011,700
Windows (x64)155,5005,20012,400
H: The number of objects specified in a narrowed search using the security audit facility audit trail
J: 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 omitted, 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
K: 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
L: Memory required by in-memory data processing
For the applicable formulas, see 15.1.10 Memory required by in-memory data processing.
M: Memory required by communication trace processing
32-bit mode
(16 x (N - 1,024) x 2) x (value of pd_max_server_process - value of pd_max_users - 3)
64-bit mode
(32 x (N - 1,024) x 2) x (value of pd_max_server_process - value of pd_max_users - 3)
N: Value of pd_pth_trace_max enabled as unit control information definition
The value specified for the operand rounded up to a power of two.
P: Memory required by communication trace processing
32-bit mode
(16 x (Q - 1,024) x 2) x (value of pd_max_users + 3)
64-bit mode
(32 x (Q - 1,024) x 2) x (value of pd_max_users + 3)
Q: Value of pd_pth_trace_max enabled as a single server definition
The value specified for the operand rounded up to a power of two.

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