Re: WAL logging of SELECT ... INTO command

From: "Jim C(dot) Nasby" <jnasby(at)pervasive(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Simon Riggs <simon(at)2ndquadrant(dot)com>, pgsql-performance(at)postgresql(dot)org
Subject: Re: WAL logging of SELECT ... INTO command
Date: 2006-03-22 15:14:34
Message-ID: 20060322151434.GG15742@pervasive.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches pgsql-performance

On Wed, Mar 22, 2006 at 10:06:05AM -0500, Tom Lane wrote:
> "Jim C. Nasby" <jnasby(at)pervasive(dot)com> writes:
> >> PITR wants all changes. Without PITR we can optimize certain logging
> >> actions.
>
> > The only change here is that we're creating a new table based on the
> > results of a SELECT. If that SELECT doesn't use anything that's
> > non-deterministic, then the machine doing the recovery should already
> > have all the data it needs, provided that we log the SELECT that was
> > used in the CTAS.
>
> This is based on a fundamental misconception about the way PITR
> log-shipping works. We log actions at the physical level (put this
> tuple here), not the logical here's-the-statement-we-executed level.
> The two approaches cannot mix, because as soon as there's any physical
> discrepancy at all, physical-level actions would be incorrectly applied
> to the slave database.

Oh, so in other words, SELECT * INTO temp FROM table is inherently
non-deterministic at the physical level, so the only way to be able to
allow PITR to work is to duplicate all the physical changes. Darn.
--
Jim C. Nasby, Sr. Engineering Consultant jnasby(at)pervasive(dot)com
Pervasive Software http://pervasive.com work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2006-03-22 15:35:26 Re: WAL logging of SELECT ... INTO command
Previous Message Tom Lane 2006-03-22 15:06:05 Re: WAL logging of SELECT ... INTO command

Browse pgsql-performance by date

  From Date Subject
Next Message ashah 2006-03-22 15:32:10 Massive Inserts Strategies
Previous Message Tom Lane 2006-03-22 15:06:05 Re: WAL logging of SELECT ... INTO command