2.20.1 Memory used by the HADB server
The HADB server uses shared memory and process memory. The following bullet points explain the memory used by the HADB server.
- ■ Shared memory
-
The following types of memory are allocated in shared memory:
-
Process common memory
Process common memory stores the information needed for starting and controlling the HADB server processes.
-
Memory for managing shared memory
Memory for managing shared memory stores management information for the shared memory that is used by the HADB server.
-
Memory for global buffers
Memory for global buffers stores the following buffers:
• Global buffers used for database input/output processing
• Global buffers for global work tables that are used for global work table input/output processing
- Note
-
When multiple processing real threads are used to process one SQL statement, a global work table is created so that the data in the work table can be shared among those processing real threads.
-
Real thread private memory
Real thread private memory stores the information needed by the processing real threads that process an SQL statement or a command. One real thread private memory area is allocated to each processing real thread. Multiple processing real threads are run within an HADB server process, and the information required for each of those processing real threads is stored in real thread private memory.
-
- ■ Process memory
-
Heap memory is allocated in process memory. The HADB server uses heap memory during command execution.
The following figure shows the memory structure of the HADB server.
- Explanation
-
-
Multiple real thread private memory areas are allocated within shared memory.
-
Multiple processing real threads are used to process one SQL statement or one command. Each of these processing real threads uses one real thread private memory.
-
In addition to the real thread private memory areas that are used when SQL statements and commands are executed, one real thread private memory area is allocated for use by the system.
-
The following bullet points explain the areas and buffers that are allocated in real thread private memory.
-
Hash grouping area
A hash grouping area stores hash tables that are used for local hash grouping. When an SQL statement to which local hash grouping is applied is executed, a hash grouping area is allocated in each real thread private memory area.
-
Hash table area
A hash table area stores the hash tables that are shared among multiple processing real threads. A hash table area is allocated if any of the following types of processing occur when an SQL statement is executed:
-
Hash join as a table joining method
-
Global hash grouping as a grouping method
-
Hash execution as a method for processing subqueries
-
Hash execution as a method for processing SELECT DISTINCT
-
Hash execution as a method for processing the set operation
-
-
Hash filter area
A hash filter area stores the hash filters that are used for hash retrieval and are shared among multiple processing real threads. A hash filter area is allocated if any of the following types of processing occur when an SQL statement is executed:
-
Hash join as a table joining method
-
Hash execution as a method for processing subqueries
- Note
-
For details about hash filters, see Table joining methods or How to process subqueries in the HADB Application Development Guide.
-
-
Buffer for the local work table
A buffer for the local work table is used for input/output processing on local work tables. A local work table is a work table created for each processing real thread. A local work table is created if the ORDER BY clause is specified or when local hash grouping is performed.
- Note
-
For details about the following types of processing, see the relevant sections in the HADB Application Development Guide.
-
Local hash grouping and global hash grouping: Grouping methods
-
Hash join: Table joining methods
-
Hash execution as a method for processing subqueries: How to process subqueries
-
Hash execution as a method for processing SELECT DISTINCT: Method for processing SELECT DISTINCT
-
Hash execution as a method for processing the set operation: Methods for processing set operations
-