Log Buffering [ ALLBASE/SQL Performance Guidelines ] MPE/iX 5.0 Documentation
ALLBASE/SQL Performance Guidelines
Log Buffering
For operations involving a change to data, ALLBASE/SQL writes log records
to a log file, so that these operations can be rolled back if necessary
or reapplied in the event of a system failure. In logging, the
transaction enters log records into the log buffer, which is periodically
flushed (written to disk). The log buffer pool consists of a number of
512-byte pages configured with the START DBE statement or with the
SQLUtil ALTDBE command.
Regardless of log type, the log buffer pool is used as the collection
point for log records. The maximum log buffer size is 1024 pages, but
120 pages is generally recommended. For detailed information about
creating and manipulating log files, refer to the "Backup and Recovery"
chapter in the ALLBASE/SQL Database Administration Guide.
No-Log Pages
Some operations that change data in a DBEnvironment allocate new pages
for insertion in a DBEFile. These new pages are often called no-log
pages. The use of no-log pages provides a performance benefit in
non-archive mode. In non-archive mode, no-log pages are not logged; only
a log record is created for the allocation of the page. If the operation
must be rolled back, then the page can simply be de-allocated. If a
savepoint is defined following the allocation of a no-log page, the page
is marked for logging, since rollback of a no-log page is an
all-or-nothing operation; that is, the page could be deallocated, but not
partially unfilled. Since the content of a no-log page is not logged,
the page is forced to disk at COMMIT WORK time.
No-log pages include the following:
* Pages allocated at INSERT time in non-archive logging. When you
are inserting rows, your transaction obtains an exclusive lock on
the page being allocated, so other transactions cannot write on
that page. Thus it is possible to log only the allocation of the
page, not the data being inserted by your transaction.
* Pages allocated at CREATE INDEX time during non-archive logging.
* Pages allocated in a B-tree split during non-archive logging, if
your transaction has obtained an exclusive lock on the table. If
you must insert a large number of rows into a table that already
has an index defined on it, B-tree index pages will split as they
begin to fill up. If your transaction has locked the table in
exclusive mode, it is only necessary to log the allocation of new
pages in non-archive mode. In the event of a rollback, those
pages can simply be deallocated.
This behavior of no-log pages makes it possible to save considerable
logging activity in non-archive mode for LOAD and INSERT operations that
lock the table in exclusive mode. However, there may be an increase in
I/O activity as pages are forced to disk at COMMIT WORK time.
No-log pages are not created in archive mode. In archive mode, all
changes to the DBEnvironment are logged.
MPE/iX 5.0 Documentation