12.18 Shared tables

In the case of a HiRDB/Parallel Server, when multiple tables are joined, table data is read from the back-end servers where individual tables are located and then matching is performed at a separate back-end server. This means that multiple servers are connected to transfer data. If the range of data to be searched for matches is located on a single back-end server, matching can be completed at a single back-end server by creating that data as a shared table. A shared table is a table stored in a shared RDAREA that can be referenced by all back-end servers. An index defined for a shared table is called a shared index. Only an updatable back-end server can update shared tables. Other back-end servers are referred to as reference-only back-end servers. Because there are limitations on updating a shared table, it is important that you do not update shared tables during online operations. For details about updating shared tables, see 12.18.3 Manipulating shared tables. Figure 12-30 shows join processing without using a shared table, and Figure 12-31 shows join processing using a shared table.

Figure 12-30 Join processing without using a shared table

[Figure]

Explanation:
This example joins tables A and B.
BES1, BES2: Retrieve data from table A and transfer it to BES5 and BES6 for matching.
BES3, BES4: Retrieve data from table B and transfer it to BES5 and BES6 for matching.
BES5, BES6: Perform matching and join processing and then transfer data to the FES.
FES: Merges the joined data and sends the result to the user.

Figure 12-31 Join processing using a shared table

[Figure]
Explanation:
This example joins tables A and B. Table B is a shared table that contains shared data. The search ranges are located in back-end servers BES2 and BES3.
BES1, BES4, BES5, BES6: No processing.
BES2, BES3: Retrieve data from tables A and B, perform merge processing, and then transfer the data to the FES.
FES: Sends the results to the user.

Shared tables and shared indexes can also be defined for a HiRDB/Single Server. This provides SQL and UAP compatibility with a HiRDB/Parallel Server. Shared tables and shared indexes are usually used with a HiRDB/Parallel Server because they are especially effective in HiRDB/Parallel Servers. The following subsections describe the use of shared tables with a HiRDB/Parallel Server. For details about using shared tables with a HiRDB/Single Server, see 12.18.7 Using shared tables with a HiRDB/Single Server.

Organization of this section
12.18.1 Effects and criteria
12.18.2 Definition method
12.18.3 Manipulating shared tables
12.18.4 Limitations on shared tables
12.18.5 Rules used to allocate back-end servers that search shared tables
12.18.6 Notes about execution of definition SQL statements, utilities, and operation commands
12.18.7 Using shared tables with a HiRDB/Single Server