Re: unlogged tables

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Andy Colson <andy(at)squeakycode(dot)net>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: unlogged tables
Date: 2010-12-07 18:44:00
Message-ID: AANLkTimxC+G9M9_s0dXa_huoAeZpkCmoWCo5S-7DsLi=@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Dec 7, 2010 at 1:17 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Robert Haas <robertmhaas(at)gmail(dot)com> writes:
>> I'm also going to go through and change all instances of the word
>> "unlogged" to "volatile", per previous discussion.  If this seems like
>> a bad idea to anyone, please object now rather than afterwards.
>
> Hm... I thought there had been discussion of a couple of different
> flavors of table volatility.  Is it really a good idea to commandeer
> the word "volatile" for this particular one?

So far I've come up with the following possible behaviors we could
theoretically implement:

1. Any crash or shutdown truncates the table.
2. Any crash truncates the table, but a clean shutdown does not.
3. A crash truncates the table only if it's been written since the
last checkpoint; a clean shutdown does not truncate it.

The main argument for doing #1 rather than #2 is that we'd rather not
have to include unlogged table data in checkpoints. Andres Freund
made the argument that we could avoid that anyway, though, by just
doing an fsync() on every unlogged table file in the cluster at
shutdown time. If that's acceptable, then ISTM there's no benefit to
implementing #1 and we should just go with #2. If it's not
acceptable, then we have to think about whether and how to have both
of those behaviors.

#3 seems like a lot of work relative to #1 and #2 for a pretty
marginal increase in durability.

Thoughts?

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jan Urbański 2010-12-07 19:17:57 pl/python improvements
Previous Message Josh Berkus 2010-12-07 18:31:22 Re: Final(?) proposal for wal_sync_method changes