18.1.4 Amount of system log information output during table data updating

If you manipulate rows in a table, the system outputs the system log information listed in Table 18-1.

Table 18-1 Types of system log information that are output when table rows are manipulated

Type of system log informationDescription
Base row log informationThis log information is output when a table's row data is added, deleted, or updated.
Branch row log informationThis log information is output when row data is manipulated in columns with the following data types:
  • VARCHAR1
  • NVARCHAR2
  • MVARCHAR1
  • Repetition columns
  • Abstract data type
  • BINARY type3
Index log informationThis 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 18-2.
Event logThis log information is output when HiRDB Datareplicator is used or when row data containing repetition columns is added, deleted, or updated.
1 Branch row log information is output if either one of the following conditions is satisfied:
  • The no-split option is not specified and the actual data length is 256 bytes or greater.
  • The no-split option is specified and the actual total length of data per row exceeds the page length.
2 Branch row log information is output if either one of the following conditions is satisfied:
  • The no-split option is not specified and the actual data length is 128 bytes or greater.
  • The no-split option is specified and the actual total length of data per row exceeds the page length.
3 If the actual total length of data per row exceeds the page length, branch row log information is output.

Table 18-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.

ConditionFormula (bytes)
Amount of system log information that is output to add (INSERT) or delete (DELETE) n rows in a table(a + b + c) [Figure] n
Amount of system log information that is output to update (UPDATE) n rows in a table(a1 + d2 + e3) [Figure] n
a: Amount of base row log information (bytes)
b: Total amount of all branch row log information (bytes)
c: Total amount of all index log information (bytes)
d: Total amount of all branch row log information subject to update processing (bytes)
e: Total amount of all index log information subject to update processing (bytes)
n: Number of rows manipulated
1 This value is added when the column value to be updated (UPDATE) is in the base row.
2 This value is added when the column value to be updated (UPDATE) is in the branch row.
3 This value is added when an index is defined for the column being updated (UPDATE).
Organization of this subsection
(1) Determining the amount of base row log information
(2) Determining the amount of branch row log information
(3) Determining the amount of index log information
(4) Determining the size of event log information

(1) Determining the amount of base row log information

Table 18-3 shows the formulas for determining the amount of base row log information per data item.

Table 18-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[Figure] 12f
[Figure] di +
i=1
f
[Figure] dj + 4[Figure]f + 152
j=1
Non-FIX table or f > 12k1 + k2 + 160
[Figure]If LOCK is specified in the pd_nowait_scan_option operand, add:
314 [Figure] 2
Row interface used2 [Figure] k1 + 160
k: Length of row to be added or deleted
k1: Length of row before updating
k2: Length of row after updating
f: Number of columns to be updated
di: Data length of column before updating
dj: Data length of column after updating
Note 1
The values of k, k1, and k2 depend on the specification of FIX, as shown as follows.
Note 2
If HiRDB Datareplicator is being used, or if updatable online reorganization is executing, then the same amount will be output to the log file for updating 12 or fewer columns of the FIX table as for updating 13 or more columns.
Note 3
If a BLOB column is defined for the table, 9 bytes must be used as the row length shown in Table 18-3 for a BLOB column, and the amount of log information shown in Table 18-4 must be added.

Table 18-4 Formulas for determining the amount of log information per BLOB column data item

Type of data manipulation (SQL statement)Specification of recoveryAmount of log information output (bytes)
Data addition
(INSERT statement)
Not specified or partial specified1176
All specified2348 + p1 + 8340 [Figure] p2
+ (148 + lt) [Figure] p3
Not specified300
Data deletion
(DELETE statement)
Not specified or partial specified1052
All specified
Not specified468
Data updating
(UPDATE statement)
Not specified or partial specified1324
All specified2496 + p1 + 8334 [Figure] p2
+ (148 + lt) [Figure] p3
Not specified312
Data concatenation operation
(UPDATE statement)
Bb[Figure]7168
Not specified or partial specified2344
All specified8340[Figure]a + 1600 + d + 8340[Figure]p4 + (148 + lt2) [Figure]p3
Not specified428
Data concatenation operation
(UPDATE statement)
Bb>7168
Not specified or partial specified2772
All specified2772 + Ba + 8340[Figure]p4 + (148 + lt2) [Figure]p3
Not specified428
Bi: BLOB data length (bytes)
Ba: One of the following values:
  • Bb > 7168: 8192-{(Bb - 7168)- [Figure](Bb - 7168) [Figure]8192[Figure][Figure]8192}
  • Bb[Figure]7168: 0
Bb: BLOB data length before update (bytes)
Bc: BLOB added data length (bytes)
lt: One of the following values:
  • Bi > 7168: Bi - 7168- [Figure](Bi - 7168) [Figure] 8192 [Figure][Figure] 8192
  • Bi[Figure]7168: 0
lt2: One of the following values:
  • Bc + Bb > 7168: (Bc + Bb - Ba - 7168)- [Figure](Bc + Bb - Ba - 7168) [Figure] 8192 [Figure][Figure] 8192
  • Bc + Bb[Figure]7168: 0
p1: One of the following values:
  • Bi > 7168: 7168
  • Bi[Figure]7168: Bi
p2: One of the following values:
  • Bi > 7168: [Figure](Bi - 7168) [Figure] 8192 [Figure]
  • Bi[Figure]7168: 0
p3: One of the following values:
  • lt = 0 or lt2 = 0: 0
  • lt > 0 or lt2 > 0: 1
p4: One of the following values:
  • Bc + Bb > 7168: [Figure](Bc + Bb - Ba - 7168) [Figure] 8192 [Figure]
  • Bc + Bb[Figure]7168: 0
a: One of the following values:
  • Bb > 0: 1
  • Bb = 0: 0
d: One of the following values:
  • Bc + Bb[Figure] 7168: Bc + Bb
  • Bc + Bb > 7168: 7168

(2) Determining the amount of branch row log information

(a) Branch row log information for VARCHAR, NVARCHAR, and MVARCHAR, when the no-split option is not specified

Calculate the amount of branch row log information that will be generated. Table 18-5 shows the formulas for determining the amount of log information per branch row.

Table 18-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 processingk2 + 160
Updating a branch rowk1 + k2 + 160
Deleting a branch row by update processingk1 + 160
k: Length of one branch row to be added or deleted
k1: Length of one branch row before updating
k2: Length of one branch row after updating
Note
The following formula is used to obtain the row lengths k, k1, and k2:
8 + MIN (average length of actual data, page length of RDAREA - 48)
(b) Branch row log information for abstract data columns, repetition columns, BINARY columns, and VARCHAR, NVARCHAR, and MVARCHAR when the no-split option is specified

Calculate the amount of branch row log information that will be generated. Table 18-6 shows the formulas for obtaining the amount of log information for one 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 18-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[Figure] (b + 152)
Data deletion (DELETE statement)
Data updating (UPDATE statement)SPN[Figure] (b + 160)
Data concatenation operation (UPDATE statement) *(b + 160) + (SPN - 1)[Figure](b + 152)
[Figure]If the pd_rpl_hdepath operand is specified, add:
160
* For BINARY type columns only.
b: Page length of an RDAREA
SPN: The following shows how to obtain this value:
If there is a branch row (for the branch condition, see 5 in Table 17-1 List of data lengths), obtain the value of SPN for all columns that constitute the table for the INSERT and DELETE statements and the value for the columns subject to updating for the UPDATE statement. However, for concatenation operations on BINARY columns, calculate di as the length of data to be added.
SPN = SPN1 + SPN2 + SPN3 + SPN4
[Figure] Other than BINARY columns
SPN1 =
f
[Figure][Figure]Value of branch di[Figure] (b - 61) [Figure][Figure] SF
i=1
SPN1 =
[Figure]BINARY columns
[Figure]Number of branch pages due to INSERT
SPN2 =
f
{[Figure][Figure]Value of branch di[Figure] (b - 59) [Figure] + 1} [Figure] SF
i=1
[Figure]Number of branch pages due to pdload or pdrorg
When value of branch di > (b - 2853) [Figure]255
SPN3 =
f
[Figure]{[Figure](branch di + 11) } [Figure] (b - 48) [Figure][Figure] SF
i=1
When value of branch di[Figure](b - 2853) [Figure]255
SPN4 = SF
f: Number of branch columns
SF: 1.3
Use a value greater than 1.3 in the following cases:
  • A large number of columns with the abstract data type will be updated.
  • A large number of repetition columns will be updated in such a manner that the elements' data lengths increase or the number of elements increases.
  • A large number of columns with VARCHAR, NVARCHAR, MVARCHAR, or BINARY data type will be updated in such a manner that the elements' data lengths increase
  • A large number of columns with BINARY data type will be updated in such a manner that the elements' data lengths increase
  • A large number of columns with data suppressed will be updated in such a manner that their data lengths increase.
  • A large number of columns other than the above will be updated in such a manner that the NULL values are changed to non-NULL values.
(c) Additional log information output with updatable online reorganization

Estimation of the log information output during UAP access to an RDAREA subject to updatable online reorganization (online reorganization shutdown status) must consider not only the normal log information, but in addition the event log information for the target online reorganization process. This section explains the additional log information.

(3) Determining the amount of index log information

Table 18-10 shows the formulas for determining the amount of index log information that is output per index when manipulating a row.

Table 18-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 keyk1 + 156 or (k1 + 156) [Figure] 2*
Adding the same key as for existing rowd[Figure] 200k1 + 156
d > 200k1 + 292
Key deletion
(DELETE statement)
Deleting a key valuek2 + 156
Deleting the same key value as for existing rowd[Figure] 200k2 + 156
d > 200k2 + 292
Key updating (UPDATE statement)Amount of log information for key deletion + amount of log information for key addition
d: Number of duplicated key values
k1: Length of key to be added (bytes)
k2: Length of key to be deleted (bytes)
* Use this formula for indexes with UNIQUE specified using the index key no-lock option.
(a) Determining the amount of index log information for index page splitting

Figure 18-1 shows the concept of index page splitting.

Figure 18-1 Concept of index page splitting

[Figure]

Explanation:
  1. Splitting a page in two by adding a key to the rightmost leaf page (containing the maximum key value in the figure) is called page splitting containing the maximum key value.
  2. Splitting a page in two by adding a key to any other leaf page is called page splitting without the maximum key value.

When a page that stores an index is split, HiRDB uses one of the two methods explained below to store the key value.

Table 18-11 shows the formulas for determining by split type the amount of index log information that is output at any one time.

Table 18-11 Amount of index log information by split type

Split typeConditionAmount of log information output (bytes)
Page splitting containing the maximum key valueAdding a key value that is different from any key value already in the indexThere is enough unused area to add the key in upper-level page2 [Figure] k1 + a + 8 [Figure] (m + 1) [Figure] 315162 [Figure] k1 + 472 + a + 8
[Figure](m + 1)
2 [Figure] k1 + a + 8 [Figure] (m + 1) > 315162 [Figure] k1 + 632 + a + 8
[Figure](m + 1)
There is not enough unused area to add the key in upper-level page2 [Figure] k1 + a + 8 [Figure] (m + 1) [Figure] 31516n-1
[Figure](288 + a)
i=2
+ 2 [Figure] k1 + 472 + a +
8 [Figure] (m + 1)
2 [Figure] k1 + a + 8 [Figure] (m + 1) > 31516n-1
[Figure](288 + a)
i=2
+ 2 [Figure] k1 + 628 + a +
8 [Figure] (m + 1)
Adding the same key value as one already in the indexd1[Figure] 200There is enough unused area to add the key in upper-level page2 [Figure] k1 + 472 + a + 8
[Figure](m + 1)
There is not enough unused area to add the key in upper-level pagen-1
[Figure](288 + a)
i=2
+ 2 [Figure] k1 + 472 + a +
8 [Figure] (m + 1)
d1 > 200There is enough unused area to add the key in lower-level pagek1 + 472 + a
There is not enough unused area to add the key in lower-level pagek1 + 462 + 2 [Figure] a
Page splitting without the maximum key valueThere is not enough unused area to add the keyThere is enough unused area to add the key in upper-level page2 [Figure] k1 + a + 8 [Figure] (m + 1) [Figure] 315162 [Figure] k1 + 332 + a + 8
[Figure](m + 1)
2 [Figure] k1 + a + 8 [Figure] (m + 1) > 315162 [Figure] k1 + 492 + a + 8
[Figure](m + 1)
There is not enough unused area to add the key in upper-level page2 [Figure] k1 + a + 8 [Figure] (m + 1) [Figure] 31516n-1
[Figure](288 + a)
i=2
+ 2 [Figure] k1 + 332 + a +
8 [Figure] (m + 1)
2 [Figure] k1 + a + 8 [Figure] (m + 1) > 31516n-1
[Figure](288 + a)
i=2
+ 2 [Figure] k1 + 492 + a +
8 [Figure] (m + 1)
a: Page length of RDAREA storing the index (bytes)
d1: Number of duplicated key values
k1: Length of key value to be added (bytes)
m: Number of index levels where split occurred
n: Number of upper page levels affected by splitting
If an upper-level page affected by leaf page splitting is also split, the value of n is 3 (n[Figure] 3).
Note
These formulas are used to estimate the amount of update log information for each row and index part. The derived value does not include the amount of log information related to system management that is output when a new page or segment is allocated during addition or update processing. Therefore, if a large amount of data is handled, the amount of log information shown in Table 18-12 must be added.

Table 18-12 Amount of log information for page allocation and segment allocation

ConditionAmount 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 [Figure] n + 272
Segment allocation resulting from the above page allocation (each time as many pages are allocated as the segment size)1940
n
Number of index levels when page splitting occurred

(4) Determining the size of event log information

The event log information is output when row data containing repetition columns is added, deleted, or updated using HiRDB Datareplicator. Table 18-13 shows the amount of event log information that is output when a single row is manipulated.

Table 18-13 Amount of event log information that is output when a single row is manipulated

Type of data manipulationAmount of event log information (bytes)
Data addition (INSERT statement)156 [Figure] n
Data updating (UPDATE statement)New elements added by updating (UPDATE ADD)164 [Figure] n
Elements deleted by updating
(UPDATE DELETE)
n
[Figure] (p5 +160)i
i = 1
Only specified elements updated
(UPDATE SET)
n
[Figure] (p5 +160)
i = 1
Specified repetition columns updated
(UPDATE SET)
164 [Figure] n
n: Number of repetition columns being updated
p5: [Figure]{[Figure](average of the largest subscript number that is specified - average of the smallest subscript number that is specified + 1) [Figure] 8[Figure]} [Figure] 4[Figure][Figure] 4