11.1.4 Global buffer allocation procedures

Organization of this subsection
(1) Index global buffer
(2) Data global buffer
(3) LOB global buffer
(4) Example of global buffer definition

(1) Index global buffer

Use the authorization-identifier.index-identifier format to specify the index to which the index global buffer is allocated in the pdbuffer operand's -i option in the system common definition.

For a cluster key, HiRDB determines the index identifier. Therefore, after you have defined the table that specifies the cluster key, search the INDEX_NAME column of the SQL_INDEXES table (a dictionary table) to confirm the index identifier. The cluster key's index identifier is displayed as follows.

(CLUSTER table-number)

For details about dictionary table retrieval and the SQL_INDEXES table, see the HiRDB Version 9 UAP Development Guide.

When an index global buffer is allocated to the defined index, terminate HiRDB normally, and then specify the pdbuffer operand to allocate the index global buffer. If you omit this task, the defined index will use the data global buffer allocated to the index storage RDAREA.

[Figure]Approaches to calculating the global buffer sector count
The general rule is to make the global buffer sector count greater than the total page count of the index (the value calculated as the number of pages stored in the index). From that count, reduce the global buffer sector count according to the importance of the index.
The number of index pages in use can be checked with the database condition analysis utility (pddbst).

(2) Data global buffer

The name of the RDAREA for which a global buffer is to be allocated is specified in the -r option of the pdbuffer operand in the system common definition.

(3) LOB global buffer

To allocate a LOB global buffer, use the following procedure:

  1. Specify in the -r option of the pdbuffer operand in the system common definition the name of the LOB RDAREA for which a global buffer is to be allocated.
  2. Specify in the -b option of the pdbuffer operand in the system common definition the name of the LOB RDAREA for which a global buffer is to be allocated.

(4) Example of global buffer definition

Organization of RDAREAs

The following shows the organization of the RDAREAs:

Type of RDAREARDAREA name
Master directory RDAREARDMAST
Data directory RDAREARDDIR
Data dictionary RDAREARDDIC
User RDAREAsUSER01, USER02, USER03
User LOB RDAREAULOB03
Data dictionary LOB RDAREAsDICLOB01, DICLOB02
List RDAREALIST01
Definition example

The following shows an example of global buffer definition:

pdbuffer -a DGB1 -n 1000 -r RDMAST,RDDIR,RDDIC              1
pdbuffer -a DGB2 -n 1000 -r USER01,USER02
pdbuffer -a DGB3 -n 1000 -r USER03
pdbuffer -a DGB4 -n 1000 -r ULOB03
pdbuffer -a DGB5 -n 1000 -r DICLOB01
pdbuffer -a DGB6 -n 1000 -r DICLOB02
pdbuffer -a DGB7 -n 1000 -r LIST01

pdbuffer -a LGB1 -n 1000 -b ULOB03                          2
pdbuffer -a LGB2 -n 1000 -b DICLOB01
pdbuffer -a LGB3 -n 1000 -b DICLOB02

pdbuffer -a IGB1 -n 1000 -i USER1.INDX01                    3
pdbuffer -a IGB2 -n 1000 -i USER1.INDX02

Explanation:
  1. This is a definition of data global buffer. It uses the -r option to specify all RDAREAs to be created.
  2. This is a definition of LOB global buffer. The RDAREAs specified with the -b option must also be specified with the -r option.
  3. This is a definition of index global buffer. It uses the -i option to specify the index authorization identifier and index identifier.
The following provides a brief explanation of the pdbuffer operand's options that are used in this example:
-a: Specifies the name of the global buffer.
-n: Specifies the number of global buffer sectors.
-r: Specifies the RDAREAs to be allocated to the data global buffer.
-b: Specifies the LOB RDAREAs to be allocated to the LOB global buffer.
-i: Specifies the indexes to which the index global buffer is to be allocated.