Re: Unlogged tables, persistent kind - Mailing list pgsql-hackers

From Simon Riggs
Subject Re: Unlogged tables, persistent kind
Date
Msg-id BANLkTinDSXW60tkzB4Ubetuy57_NE3YiAA@mail.gmail.com
Whole thread Raw
In response to Re: Unlogged tables, persistent kind  (Robert Haas <robertmhaas@gmail.com>)
Responses Re: Unlogged tables, persistent kind  (Robert Haas <robertmhaas@gmail.com>)
List pgsql-hackers
On Mon, Apr 25, 2011 at 8:14 AM, Robert Haas <robertmhaas@gmail.com> wrote:
> On Apr 24, 2011, at 1:22 PM, Simon Riggs <simon@2ndQuadrant.com> wrote:
>> Unlogged tables are a good new feature.
>
> Thanks.
>
>> I noticed Bruce had mentioned they were the equivalent of NoSQL, which
>> I don't really accept.
>
> Me neither. I thought that was poorly said.
>
>> Heap blocks would be zeroed if they were found to be damaged, following a crash.
>
> The problem is not so much the blocks that are damaged (e.g. half-written, torn page) but the ones that were never
writtenat all. For example, read page A, read page B, update tuple on page A putting new version on page B, write one
butnot both of A and B out to the O/S, crash.  Everything on disk is a valid page, but they are not coherent taken as a
whole. It's normally XLOG replay that fixes this type of situation... 

Not really sure it matters what the cause of data loss is, does it?
The zeroing of the blocks definitely causes data loss but the
intention is to bring the table back to a consistent physical state,
not to in any way repair the data loss.

Repeating my words above, this proposed option trades potential minor
data loss for performance.

The amount of data loss on a big table will be <1% of the data loss
caused by truncating the whole table.

This is important on big tables where reloading from a backup might
take a long time.

--
 Simon Riggs                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services


pgsql-hackers by date:

Previous
From: Simon Riggs
Date:
Subject: Re: Unlogged tables, persistent kind
Next
From: Shigeru Hanada
Date:
Subject: wrong hint message for ALTER FOREIGN TABLE