Understanding the Logical Log Usage
Posted in 2008
Topics: Stored Procedures & SPL, Data Types & Schema Design, Logging & Checkpoints
Am using version 10.00.UC7X1 and have a few *basic* questions on the
usage of the logical log file.
The database has a logging mode of unbuffered logging with a page size
is 2048 bytes (as returned by onstat -b). I have 3 log files with each
file being 5000 KB in size.
I have a table with the following definition:
sizetbl (i lvarchar(255), j lvarchar(3000), k lvarchar(255), m
lvarchar(2500));
I observe that for an insert of a single row, one page is used in the
logical log (based on onstat -l). The insert just inserts single
characters:
insert into sizetbl values ('1','2','3','4');
1. Why does one page get used in the logical log for each insert?
onstat -l displays parameters called numrecs and numpages. Thedocumentation says: numrecs: Is the number of records written;
numpages: Is the number of pages written
For the above operation, I observe that for each insert the numrecs
gets incremented by three whereas the numpages gets incremented by 1.
What does the term "records" mean in this context?
2. onlog displays a length of 44 (for begin) + 64 (for hinsert) + 40
(for commit) for a transaction involving a single insert. What does
this length mean? The length of the logical record in bytes?
Thanks a lot in advance!
On May 27, 7:05 am, Krishna <calvinkri...@gmail.com> wrote:
> Am using version 10.00.UC7X1 and have a few *basic* questions on the
> usage of the logical log file.
> The database has a logging mode of unbuffered logging with a page size
> is 2048 bytes (as returned by onstat -b). I have 3 log files with each
> file being 5000 KB in size.
>
> I have a table with the following definition:
> sizetbl (i lvarchar(255), j lvarchar(3000), k lvarchar(255), m
> lvarchar(2500));
>
> I observe that for an insert of a single row, one page is used in the
> logical log (based on onstat -l). The insert just inserts single
> characters:
>
> insert into sizetbl values ('1','2','3','4');>
> 1. Why does one page get used in the logical log for each insert?
> onstat -l displays parameters called numrecs and numpages. The> documentation says: numrecs: Is the number of records written;
> numpages: Is the number of pages written
The key to the answer of this question is the fact that you are using
unbuffered logging. So that as soon as a commit work is hit, it
forces the logical log buffer to be flushed to disk. When this
occurs, it will only use the portion of a page that is needed, so you
will possibly end up with non-full logical log pages.
>
> For the above operation, I observe that for each insert the numrecs
> gets incremented by three whereas the numpages gets incremented by 1.
> What does the term "records" mean in this context?
Logical log records. As you mention below, you have 3 log records, 1
for the begin, 1 for the hinsert and 1 for the commit.
>
> 2. onlog displays a length of 44 (for begin) + 64 (for hinsert) + 40
> (for commit) for a transaction involving a single insert. What does
> this length mean? The length of the logical record in bytes?
Yes
>
> Thanks a lot in advance!
Related threads
- onbar -c -F in Windows Informix instance
- Anyone... SQLCODE=-668, ISAM error=-1
- Not using the 100% logical log page size alloacted to informix