Re: unlogged tables

From: "Anibal David Acosta" <aa(at)devshock(dot)com>
To: "'Sergey Konoplev'" <gray(dot)ru(at)gmail(dot)com>, "'Richard Huxton'" <dev(at)archonet(dot)com>
Cc: "'Stephen Frost'" <sfrost(at)snowman(dot)net>, <pgsql-performance(at)postgresql(dot)org>
Subject: Re: unlogged tables
Date: 2011-11-14 17:05:51
Message-ID: 00ea01cca2ef$abcf3a30$036dae90$@devshock.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Maybe an option like "Recover from file " will be useful
So, for example, daily some process do a COPY of entire table to a file

In case of crash postgres recover content from the file.

:)

-----Mensaje original-----
De: Sergey Konoplev [mailto:gray(dot)ru(at)gmail(dot)com]
Enviado el: lunes, 14 de noviembre de 2011 07:39 a.m.
Para: Richard Huxton
CC: Stephen Frost; Anibal David Acosta; pgsql-performance(at)postgresql(dot)org
Asunto: Re: [PERFORM] unlogged tables

On 14 November 2011 14:17, Richard Huxton <dev(at)archonet(dot)com> wrote:
> On 14/11/11 10:08, Sergey Konoplev wrote:
>>
>> On 14 November 2011 12:58, Richard Huxton<dev(at)archonet(dot)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(dot)ru(at)gmail(dot)com Skype: gray-hemp

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Kevin Grittner 2011-11-14 17:26:32 Re: unlogged tables
Previous Message Sergey Konoplev 2011-11-14 10:39:03 Re: unlogged tables