Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 987801093AC0 for ; Mon, 14 Nov 2011 13:11:23 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 58771-04 for ; Mon, 14 Nov 2011 17:11:17 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0-rc2 Received: from mail-yw0-f46.google.com (mail-yw0-f46.google.com [209.85.213.46]) by mail.postgresql.org (Postfix) with ESMTP id 4575A1093ABF for ; Mon, 14 Nov 2011 13:11:17 -0400 (AST) Received: by ywt32 with SMTP id 32so2399157ywt.19 for ; Mon, 14 Nov 2011 09:11:16 -0800 (PST) Received: by 10.146.190.21 with SMTP id n21mr3622566yaf.39.1321290357502; Mon, 14 Nov 2011 09:05:57 -0800 (PST) Received: from AnibalVAIO ([200.85.32.68]) by mx.google.com with ESMTPS id 8sm62844024anv.16.2011.11.14.09.05.53 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 14 Nov 2011 09:05:55 -0800 (PST) From: "Anibal David Acosta" To: "'Sergey Konoplev'" , "'Richard Huxton'" Cc: "'Stephen Frost'" , References: <005501cca0ad$b9478440$2bd68cc0$@devshock.com> <20111111201822.GN24234@tamriel.snowman.net> <4EC0D827.8090601@archonet.com> <4EC0EAD6.9010302@archonet.com> In-Reply-To: Subject: Re: unlogged tables Date: Mon, 14 Nov 2011 14:05:51 -0300 Message-ID: <00ea01cca2ef$abcf3a30$036dae90$@devshock.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Outlook 14.0 Thread-Index: AQG0h8c2HxwgVHVwA7Oudni7xLo/1gKNzE9QAZGzEw4Bc7WZpAHcxNALAamzBiMCHqGblZWDDJWA Content-Language: es-py X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-10 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201111/161 X-Sequence-Number: 45672 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=20 In case of crash postgres recover content from the file. :) -----Mensaje original----- De: Sergey Konoplev [mailto:gray.ru@gmail.com]=20 Enviado el: lunes, 14 de noviembre de 2011 07:39 a.m. Para: Richard Huxton CC: Stephen Frost; Anibal David Acosta; pgsql-performance@postgresql.org Asunto: Re: [PERFORM] unlogged tables On 14 November 2011 14:17, Richard Huxton wrote: > On 14/11/11 10:08, Sergey Konoplev wrote: >> >> On 14 November 2011 12:58, Richard Huxton =A0wrote: > Let's say you were doing something like "UPDATE unlogged_table SET = x=3D1=20 > WHERE y=3D2". If a crash occurs during this command, there's no=20 > guarantee that the affected disk pages were all updated. Worse, a=20 > single page might be partially updated or even have rubbish in it=20 > (depending on the nature of the crash). > > Without the WAL there's no way to check whether the table is good or=20 > not, or even to know what the last updates were. So - the only safe=20 > 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. > > -- > =A0Richard Huxton > =A0Archonet 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