Re: "Unlogged indexes"

From: Yang Zhang <yanghatespam(at)gmail(dot)com>
To: Thom Brown <thom(at)linux(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: "Unlogged indexes"
Date: 2013-05-03 20:53:10
Message-ID: CAKxBDU-pAQxGqMWOTVBtYL043RKMpsSs-L-Kns5OxWZEn2rEyw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Yeah, I know that indexes for unlogged tables are unlogged. I was
just wondering if you could do this for logged tables. (Safely, such
that on crash recovery WAL replay won't throw up, these can be omitted
from base backups, etc.)

On Fri, May 3, 2013 at 1:46 PM, Thom Brown <thom(at)linux(dot)com> wrote:
> On 3 May 2013 21:06, Yang Zhang <yanghatespam(at)gmail(dot)com> wrote:
>> Guessing the answer's no, but is there any way to construct indexes
>> such that I can safely put them on (faster) volatile storage? (Just to
>> be clear, I'm asking about indexes for *logged* tables.)
>
> Yes:
>
> CREATE INDEX ... TABLESPACE tablespacename;
> ALTER INDEX ... SET TABLESPACE tablespacename;
>
> Although there's a disparity between your email subject and main text.
> Indexes for logged tables are always logged. If you want an unlogged
> index you can only create it for an unlogged table.
>
> And putting indexes on a separate tablespace is probably not as
> advantageous as you're thinking. Might be worth testing.
>
> --
> Thom

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Karel Riveron Escobar 2013-05-04 23:40:48 Associative array in Pl/PgSQL
Previous Message Thom Brown 2013-05-03 20:46:04 Re: "Unlogged indexes"