RE: WAL article - Mailing list pgsql-general

From Hartwig Jens
Subject RE: WAL article
Date
Msg-id 819FEEAC94E6DC459F1FDC83C0C1611F1BCC9C@mail2000.b3.dsh.de
Whole thread Raw
In response to WAL article  (Phuong Ma <pma@commandprompt.com>)
List pgsql-general
Hello Phuong,

you asked for a review of your article about WAL. The article sounds
good. I have some few annotations (to everybody: please correct me, if I
am wrong):

1. The data is not written to permanent data (to the database) when a
commit OR a checkpoint occurs but only if a checkpoint occurs. When a
commit is done the data are flushed from the memory into the log-files.
Uncommitted changes need not to be recovered after a crash.

2. Precisely, a user cannot continue from the point before the crash but
he can continue from the last COMMITTED point before the crash.

3. You do not create an exact number of segments by using WAL_FILES but
you create a number (max. 64) of files in advance. Unused logfiles will
be removed after setting a savepoint and a number of new segments will
be created.

Best regards, Jens Hartwig

-----------------------------------------------------

T-Systems
Project Manager
debis Systemhaus GEI GmbH
Address: Eichhornstra�e 3, 10785 Berlin
Postal Address: 10785 Berlin
Phone: (004930) 25 54-32 82
Fax: (004930) 25 54-31 87
Mobile: (0170) 167 26 48
E-Mail: jens.hartwig@t-systems.de
Internet: http://www.t-systems.de


> -----Previous Message -----
> From: Phuong Ma [mailto:pma@commandprompt.com]
> Sent: Freitag, 8. Juni 2001 01:07
> To: Postgres-general
> Subject: [GENERAL] WAL article
>
>
> Hello everyon,
>
>   I'm writing a section about Write Ahead Logging.  I would appreciate
> it if you can read this and give me some feedback.  Such as:  Is it
> correct?  Clear? Precise?
>
>   If there is anything wrong, please email me.
>
> Thank you ALL.
> --------------------------------------
> Write Ahead Logging (WAL)
>
>   This Postgres feature enables database administrators to increase
> database performance.  It does this through writing log records of all
> modifications before the commit is performed.  When the
> commit occurs or
> when a checkpoint is reached, the log files are then written to
> permanent data.  Therefore, the file modified does not change until it
> is logged.
>
>   The advantage of using Write Ahead Logging is when a crash occurs
> before the commit is executed, the log will still exist and
> the changes
> are not lost.  The modifications can then be retrieved from the log
> files. A user can continue to work from the point they were at before
> the crash occurred.
>
> WAL consists of the following main elements:
>
> Segments
>          These memory buffer segments are files which are
> 16MB in size.
> When the usage level reaches 75% of the segment, then a new segment is
> then created.  To create an exact number of segments, modify the
> WAL_FILES parameters.
>
> log files
>         These files contain an ordered list of REDO/UNDO
> actions.  They
> also contain the new and old data.  These log files are written
> consecutively, one after the other.  This causes the WAL to access the
> log in sequential order, making the WAL process even faster.
>
> checkpoints
>        These are points in a sequence of transactions.  When these
> points are reached, the log files created before these points are
> ensured to have been committed.
>
>
>  WAL enables the system to avoid the process of writing to
> disk on every
> transaction commit.  There is a decrease in the number of disk writes
> happening, causing the disk access to speed up.
>
> ---------------------------(end of
> broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster
>


pgsql-general by date:

Previous
From: "Prasanth Kumar"
Date:
Subject: Re: Maximum Limit of the database for no. of records.
Next
From: "Willis, Ian (Ento, Canberra)"
Date:
Subject: RE: PostgreSQL 7.1 and ORACLE 8.x