On Tue, 09 Sep 2003 06:32:19 -0400, Suket wrote:
Quote:
What is significance of Informix database buffered log or unbuffered log
parameter. |
Gorazd almost got it. Informix ALWAYS write logical log records to one of the
three logical log buffers (sized with the LOGBUFF onconfig parameter). If the
database for which a logical log record is being written is UNBUFFERED LOG the
whenever a COMMIT or ROLLBACK record is written to the log buffer is it
immediately flushed to disk. If the database is BUFFERED LOG then the buffer is
ONLY flushed when it fills.
In the BUFFERED case if the system crashes before the logical log buffer is
flushed then the transaction, which the user thought was completed and committed
successfully, is considered incomplete and will be rolled back when the engine
is restarted and goes through 'fast recovery'. In the UNBUFFERED case this
cannot happen, once the user gets the transaction committed response the logical
log buffer has been flushed to disk and all is safe (barring the disk controller
cache problems discussed on this list last week).
Another possible problem when using BUFFERED LOG is that some transactions
require multiple logical log records to be written as part of the commit. In
the BUFFERED case it is possible for the first few of these to be written to an
almost full log buffer which would then flush while the final record(s) is
written to the next buffer and is not flushed immediately. If the system
crashes at this point the engine will not restart as fast recovery will find the
partial commit record and not know whether to commit or rollback. When this
happens one must call tech support to log in and truncate the last logical log
at a point before the partial COMMIT possible causing other transactions to
rollback as well when the engine is finally brought online.
I NEVER use BUFFERED log. Yes it is a bit faster, but I like my data. Besides
<grinn from ear to ear> I figure the DBAs using BUFFERED LOG are the same ones
using RAID5. Since I only use RAID10 I figure I'm still running faster than
they are <snicker>. ;-)
Art S. Kagel