Re: Question about concurrent synchronous and asynchronous commits - Mailing list pgsql-general

From Vick Khera
Subject Re: Question about concurrent synchronous and asynchronous commits
Date
Msg-id AANLkTi=qMbDp4pmx-nF3rQk9e3Kbk8__8pNZHhRU2YCy@mail.gmail.com
Whole thread Raw
In response to Re: Question about concurrent synchronous and asynchronous commits  (Dan Birken <birken@gmail.com>)
List pgsql-general
On Thu, Jan 13, 2011 at 6:55 PM, Dan Birken <birken@gmail.com> wrote:
> When you begin a transaction, all your changes write to the in-memory WAL
> buffer, and that buffer flushes to disk when:
> a) Somebody commits a synchronous transaction
> b) The WAL buffer runs out of space
> Please correct me if I'm wrong.

I don't think there is an explicit in-memory WAL -- it is just the
file's I/O buffer.  What the commit causes is that disk file to be
flushed to disk using the sync file system call, ensuring the
durability of the transaction.  The call to sync() is very expensive
and is what is optimized out for the asynchronous transaction mode.

This is my understanding as a user. I do not write the code that does this.

pgsql-general by date:

Previous
From: Pavel Stehule
Date:
Subject: Re: Record with a field consisting of table rows
Next
From: Tom Lane
Date:
Subject: Re: tsearch (or related) question