Re: Question about concurrent synchronous and asynchronous commits

From: Vick Khera <vivek(at)khera(dot)org>
To: Dan Birken <birken(at)gmail(dot)com>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Question about concurrent synchronous and asynchronous commits
Date: 2011-01-14 16:49:33
Message-ID: AANLkTi=qMbDp4pmx-nF3rQk9e3Kbk8__8pNZHhRU2YCy@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, Jan 13, 2011 at 6:55 PM, Dan Birken <birken(at)gmail(dot)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.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tom Lane 2011-01-14 17:14:21 Re: tsearch (or related) question
Previous Message Pavel Stehule 2011-01-14 16:43:38 Re: Record with a field consisting of table rows