Re: unlogged tables - Mailing list pgsql-performance

From Sergey Konoplev
Subject Re: unlogged tables
Date
Msg-id CAL_0b1sSyTgMUxcRi+2ibTHHV4-qH3fvacsQUCbbeBsu0jYGAQ@mail.gmail.com
Whole thread Raw
In response to Re: unlogged tables  (Richard Huxton <dev@archonet.com>)
Responses Re: unlogged tables
List pgsql-performance
On 14 November 2011 14:17, Richard Huxton <dev@archonet.com> wrote:
> On 14/11/11 10:08, Sergey Konoplev wrote:
>>
>> On 14 November 2011 12:58, Richard Huxton<dev@archonet.com>  wrote:
> Let's say you were doing something like "UPDATE unlogged_table SET x=1 WHERE
> y=2". If a crash occurs during this command, there's no guarantee that the
> affected disk pages were all updated. Worse, a single page might be
> partially updated or even have rubbish in it (depending on the nature of the
> crash).
>
> Without the WAL there's no way to check whether the table is good or not, or
> even to know what the last updates were. So - the only safe thing to do is
> truncate the unlogged tables.
>
> In the event of a normal shutdown, we can flush all the writes to disk so we
> know all the data has been written, so there is no need to truncate.

Thank you for the explanation. Now I understand it.

>
> --
>  Richard Huxton
>  Archonet Ltd
>



--
Sergey Konoplev

Blog: http://gray-hemp.blogspot.com
LinkedIn: http://ru.linkedin.com/in/grayhemp
JID/GTalk: gray.ru@gmail.com Skype: gray-hemp

pgsql-performance by date:

Previous
From: Richard Huxton
Date:
Subject: Re: unlogged tables
Next
From: "Anibal David Acosta"
Date:
Subject: Re: unlogged tables