Re: Skip WAL in ALTER TABLE

From: Simon Riggs <simon(at)2ndQuadrant(dot)com>
To: Itagaki Takahiro <itagaki(dot)takahiro(at)oss(dot)ntt(dot)co(dot)jp>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Skip WAL in ALTER TABLE
Date: 2009-10-15 07:19:46
Message-ID: 1255591186.30088.1060.camel@ebony
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, 2009-10-15 at 13:18 +0900, Itagaki Takahiro wrote:
> Simon Riggs <simon(at)2ndQuadrant(dot)com> wrote:
>
> > > Is it possible to use WAL-skipping and BulkInsertState in ATRewriteTable() ?
> > > If ok, I'll submit a patch for the next commitfest.
> >
> > Yes
>
> Patch attached.
> This patch skip WAL writes during table rewrites from ALTER TABLE.

Looks fine to me, apart from

if (!XLogArchivingActive() || newrel->rd_istemp)
hi_options |= HEAP_INSERT_SKIP_WAL;

I think the second condition is unnecessary, so just

if (!XLogArchivingActive())
hi_options |= HEAP_INSERT_SKIP_WAL;

which is what COPY does. Temp tables are excluded in heap_insert()

--
Simon Riggs www.2ndQuadrant.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2009-10-15 07:33:21 Hot standby status
Previous Message Heikki Linnakangas 2009-10-15 06:27:05 Re: CommitFest 2009-09, two weeks on