Nonstop Database, HiRDB Version 9 Installation and Design Guide
When you manipulate rows in tables, the system logs shown below are output.
For a HiRDB single server configuration, add the amount of system log information calculated here to the amount of log information output by a single server. For a HiRDB parallel server configuration, add the amount of system log information calculated here to, respectively, the amounts of log information output by the back-end server and dictionary server that manage the RDAREAs that store the tables and indexes being updated.
Table 17-1 Types of system log information that are output when table rows are manipulated
| Type of system log information | Description |
|---|---|
| Base row log information | This log information is output when a table's row data is added, deleted, or updated. |
| Branch row log information | This log information is output when row data is manipulated in columns with the following data types:
|
| Index log information | This log information is output when index keys are added, deleted, or updated. Determine the amount of index log information on the basis of the type of database manipulation (INSERT, DELETE, or UPDATE statement), as shown in Table 17-2 Amount of log information depending on type of database manipulation. |
| Event log | This log information is output when HiRDB Datareplicator is used or when row data containing repetition columns is added, deleted, or updated. |
Table 17-2 Amount of log information depending on type of database manipulation
| Type of data manipulation (SQL statement) | Amount of log information |
|---|---|
| Key addition (INSERT statement) | Amount of addition log information |
| Key deletion (DELETE statement) | Amount of deletion log information |
| Key updating (UPDATE statement) | Amount of deletion log information for the key before updating + amount of addition log information for the key after updating |
The amount of system log information that is output when a database is updated (INSERT, DELETE, or UPDATE) can be obtained from Formulas 1 and 2 as follows, depending on the type of operation (INSERT, DELETE, or UPDATE).
The amount of system log information that is output during UAP execution that does collect log is 460 bytes, which is based on the fact that segment allocations occur.
| Condition | Formula (bytes) |
|---|---|
| Amount of system log information that is output to add (INSERT) or delete (DELETE) n rows in a table | (a + b + c) |
| Amount of system log information that is output to update (UPDATE) n rows in a table | (a#1 + d#2 + e#3) |
The following table lists the formulas for determining the amount of base row log information per data item.
Table 17-3 Formulas for determining the amount of base row log information per data item
| Type of data manipulation (SQL statement) | Amount of log information output (bytes) | |
|---|---|---|
| Data addition (INSERT statement) | k + 152 | |
| Data deletion (DELETE statement) | ||
| Data updating (UPDATE statement) | FIX table with f |
f i=1 f j=1 |
| Non-FIX table or f > 12 | k1 + k2 + 160 314 |
|
| Row interface used | 2 |
|
Table 17-4 Formulas for determining the amount of log information per BLOB column data item
| Type of data manipulation (SQL statement) | Specification of recovery | Amount of log information output (bytes) |
|---|---|---|
| Data addition (INSERT statement) |
Not specified or partial specified | 604 + 180 |
| All specified | 2,348 + p1 + 8,340 + (148 + lt) |
|
| Not specified | 300 | |
| Data deletion (DELETE statement) |
Not specified or partial specified | 460 + 180 |
| All specified | ||
| Not specified | 468 | |
| Data updating (UPDATE statement) |
Not specified or partial specified | 604 + 180 |
| All specified | 2,496 + p1 + 8,334 + (148 + lt) |
|
| Not specified | 312 | |
| Data concatenation operation (UPDATE statement) Bb |
Not specified or partial specified | 2,344 |
| All specified | 8,340 |
|
| Not specified | 428 | |
| Data concatenation operation (UPDATE statement) Bb > 7,168 |
Not specified or partial specified | 2,772 |
| All specified | 2,772 + Ba + 8,340 |
|
| Not specified | 428 | |
| Backward deletion/updating of data (UPDATE statement) Bb |
Not specified or partial specified | 2,344 |
| All | 9,512 | |
| No | 428 | |
| Backward deletion/updating of data (UPDATE statement) Bb > 7,168 |
Not specified or partial specified | 2,492 + 180 |
| All | 2,492 + 180 |
|
| No | 428 + 180 |
Calculate the amount of branch row log information that will be generated. The following table lists the formulas for determining the amount of log information per branch row.
Table 17-5 Formulas for determining the amount of log information per branch row (1)
| Type of data manipulation (SQL statement) | Amount of log information output (bytes) | |
|---|---|---|
| Data addition (INSERT statement) | k + 152 | |
| Data deletion (DELETE statement) | ||
| Data updating (UPDATE statement) |
Creating a new branch row by update processing | k2 + 160 |
| Updating a branch row | k1 + k2 + 160 | |
| Deleting a branch row by update processing | k1 + 160 | |
Calculate the amount of branch row log information that will be generated. The table below lists the formulas for determining the amount of log information per branch row.
If there is more than one table storage RDAREA and the page length varies from one RDAREA to another, obtain the amount of branch row log information for each RDAREA with the same page length, then use their sum as the amount of branch row log information.
Table 17-6 Formulas for determining the amount of log information per branch row (2)
| Type of data manipulation (SQL statement) | Amount of log information output (bytes) |
|---|---|
| Data addition (INSERT statement) | SPN |
| Data deletion (DELETE statement) | |
| Data updating (UPDATE statement) | SPN |
| Data concatenation operation (UPDATE statement)#1 | (b + 160) + (SPN - 1) 160 |
| Backward deletion/updating of data (UPDATE statement)#1, #2 | (b 160 |
SPN = SPN1 + SPN2 |
To determine the amount of log information that is output when a UAP accesses an RDAREA for the purpose of updatable online reorganization (while accessing subordinate RDAREAs that are in online reorganization hold), you must add the amount of event log information for the pdorend application process to the amount of log information that is ordinarily output. This section explains the additional log information.
Table 17-7 System log information added per item of data with updatable online reorganization
| Type of data manipulation (SQL statement) | Additional log information output (bytes) |
|---|---|
| INSERT | 320 |
| DELETE | |
| UPDATE | 320 + c#1 + 160#2 |
| INSERT rollback | 320 |
| DELETE rollback | |
| UPDATE rollback | 496 + data length before row update + c#1 + 160#2 |
Table 17-8 System log information added per item of BLOB data with updatable online reorganization
| Type of data manipulation (SQL statement) | Additional log information output (bytes) |
|---|---|
| INSERT | 0 |
| DELETE | 224 |
| UPDATE | 224 + 160#2 |
| INSERT rollback | 0 |
| DELETE rollback | 148 + p1 + 8,340 |
| UPDATE rollback | 148 + p1 + 8,340 |
Table 17-9 System log information added per item of data that includes a repetition column with updatable online reorganization
| Type of data manipulation (SQL statement) | Additional log information output (bytes) |
|---|---|
| UPDATE-SET (column specification) | 164 |
| UPDATE-ADD (element specification) (when new elements are added by updating) |
N i=1 |
| UPDATE-DELETE (element specification) (when new elements are deleted by updating) |
M i=1 |
| UPDATE-SET (element specification) (when only the specified elements are updated) |
N i=1 |
| DELETE | 156 |
| UPDATE-SET (column specification) rollback | 156 |
| Rollback of UPDATE-ADD (element specification) (when new elements are deleted by updating) |
N i=1 |
| Rollback of UPDATE-DELETE (element specification) (when new elements are added by updating) |
M i=1 |
| Rollback of UPDATE-SET (element specification) (when only the specified elements are updated) |
N i=1 |
| DELETE rollback | 156 |
Use the formulas shown in the following table to determine the amount of index log information that is output for each row operated on in an index.
Table 17-10 Amount of index log information per index
| Type of data manipulation (SQL statement) | Amount of log information output (bytes) | ||
|---|---|---|---|
| Key addition (INSERT statement) |
Adding a new key | k1 + 156 or (k1 + 156) |
|
| Adding the same key as for existing row | d |
k1 + 156 | |
| d > 200 | k1 + 292 | ||
| Key deletion (DELETE statement) |
Deleting a key value | k2 + 156 | |
| Deleting the same key value as for existing row | d |
k2 + 156 | |
| d > 200 | k2 + 292 | ||
| Key updating (UPDATE statement) | Amount of log information for key deletion + amount of log information for key addition | ||
The following figure illustrates the concept of index page splitting.
Figure 17-1 Concept of index page splitting
When a page that stores an index is split, HiRDB uses one of the two methods explained below to store the key value.
The following table lists the amount of index log information output per instance by split type.
Table 17-11 Amount of index log information by split type
| Split type | Condition | Amount of log information output (bytes) | ||
|---|---|---|---|---|
| Page splitting containing the maximum key value | Adding a key value that is different from any key value already in the index | There is enough unused area to add the key in upper-level page | 2 |
2 |
| 2 |
2 |
|||
| There is not enough unused area to add the key in upper-level page | 2 |
n-1 i=2 + 2 8 |
||
| 2 |
n-1 i=2 + 2 8 |
|||
| Adding the same key value as one already in the index | d1 |
There is enough unused area to add the key in upper-level page | 2 |
|
| There is not enough unused area to add the key in upper-level page | n-1 i=2 + 2 8 |
|||
| d1 > 200 | There is enough unused area to add the key in lower-level page | k1 + 472 + a | ||
| There is not enough unused area to add the key in lower-level page | k1 + 462 + 2 |
|||
| Page splitting without the maximum key value | There is not enough unused area to add the key | There is enough unused area to add the key in upper-level page | 2 |
2 |
| 2 |
2 |
|||
| There is not enough unused area to add the key in upper-level page | 2 |
n-1 i=2 + 2 8 |
||
| 2 |
n-1 i=2 + 2 8 |
|||
Table 17-12 Amount of log information for page allocation and segment allocation
| Condition | Amount of log information output (bytes) |
|---|---|
| Allocation of a new page for storing rows resulting from data addition (INSERT) or updating (UPDATE) | 440 |
| Index page splitting resulting from data addition (INSERT) or updating (UPDATE) | 544 |
| Segment allocation resulting from the above page allocation (each time as many pages are allocated as the segment size) | 1,940 |
The event log information is output when row data containing repetition columns is added, deleted, or updated using HiRDB Datareplicator. The following table shows the amount of event log information that is output when a single row is manipulated.
Table 17-13 Amount of event log information that is output when a single row is manipulated
| Type of data manipulation | Amount of event log information (bytes) | |
|---|---|---|
| Data addition (INSERT statement) | 156 |
|
| Data updating (UPDATE statement) | New elements added by updating (UPDATE ADD) | 164 |
| Elements deleted by updating (UPDATE DELETE) |
n i = 1 |
|
| Only specified elements updated (UPDATE SET) |
n i = 1 |
|
| Specified repetition columns updated (UPDATE SET) |
164 |
|
All Rights Reserved. Copyright (C) 2012, 2015, Hitachi, Ltd.