Re: shared_buffers, wal_buffers, WAL files, data files

From: Guillaume Lelarge <guillaume(at)lelarge(dot)info>
To: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: shared_buffers, wal_buffers, WAL files, data files
Date: 2007-12-07 14:56:05
Message-ID: 47595F05.50508@lelarge.info
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Alvaro Herrera a écrit :
> Guillaume Lelarge wrote:
>> Tom Lane a écrit :
>>> Guillaume Lelarge <guillaume(at)lelarge(dot)info> writes:
>>>> I try to answer a simple question : what happens when I do a simple
>>>> "INSERT" on a just started PostgreSQL server.
>>>> From what I understand with the INSERT statement, here is what happens :
>>>> * backend loads first (and only) block from footable file into a shared
>>>> buffer
>>>> * it modifies this block on the shared buffer, and sets it as dirty
>>> Right, and it also makes a WAL log entry about this action.
>>>
>> The WAL log entry is made on the wal buffers (in memory). As soon as
>> this statement is commited (in my example, it's right now, but in a
>> BEGIN ... COMMIT statement, at COMMIT time), the wal buffer is flushed
>> on WAL files. It can be flushed before if wal buffer is not big enough
>> to contain all the current transactions. Am I right ?
>
> That's correct. WAL buffers are obviously shared; when one transaction
> commits it will flush not only its own entries, but also those that any
> other transaction could have written.
>

OK, thanks. I'll probably have more questions but I need to think a bit
more about all your answers.

Anyways, thanks.

Regards.

--
Guillaume.
http://www.postgresqlfr.org
http://dalibo.com

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Mark Cave-Ayland 2007-12-07 15:27:02 Possible PostgreSQL 8.3beta4 bug with MD5 authentication in psql?
Previous Message Dave Page 2007-12-07 14:31:21 Re: Problem with ControlFileData structure being ABI depe ndent