Re: unlogged tables

From: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Kevin Grittner <Kevin(dot)Grittner(at)wicourts(dot)gov>, Simon Riggs <simon(at)2ndquadrant(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, Andy Colson <andy(at)squeakycode(dot)net>
Subject: Re: unlogged tables
Date: 2010-12-11 20:18:02
Message-ID: AANLkTingkjEMHPkry=KnX0fYH1Tp5H8r2SXMrBNcpznb@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, Dec 10, 2010 at 8:16 PM, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
>
> As I was working on the hash index support, it occurred to me that at
> some point in the future, we might want to allow an unlogged index on
> a permanent table.

That is the feature I would be most excited about.

> With the current patch, an index is unlogged if
> and only if the corresponding table is unlogged, and both the table
> and the index are reset to empty on restart.  But we could have a
> slightly different flavor of index that, instead of being reset to
> empty, just gets marked invalid, perhaps by truncating the file to
> zero-length (and adding some code to treat that as something other
> than a hard error).  Perhaps you could even arrange for autovacuum to
> kick off an automatic rebuild,

Or just have rebuilding the index as part of crash recovery. I
wouldn't use the feature anyway on indexes that would take more than a
few seconds to rebuild, And wouldn't want to advertise the database as
being available when it is essentially crippled from missing indexes.
I'd rather bite the bullet up front.

I would think of it is as declaring that, instead of making the index
recoverable via WAL logging and replay, instead make it recoverable by
rebuilding. So in that way it is quit unlike unlogged tables, in that
we are not risking any data, just giving the database a hint about
what the most expeditious way to maintain the index might be. Well,
more of an order than a hint, I guess.

Cheers,

Jeff

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Florian Pflug 2010-12-11 20:25:44 Re: proposal: auxiliary functions for record type
Previous Message Dimitri Fontaine 2010-12-11 20:09:19 Re: ALTER EXTENSION ... UPGRADE;