Re: WAL logging of SELECT ... INTO command

From: "Qingqing Zhou" <zhouqq(at)cs(dot)toronto(dot)edu>
To: pgsql-performance(at)postgresql(dot)org
Subject: Re: WAL logging of SELECT ... INTO command
Date: 2006-03-22 06:20:39
Message-ID: dvqqi5$1nmv$1@news.hub.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches pgsql-performance


"Simon Riggs" <simon(at)2ndquadrant(dot)com> wrote
> On Tue, 2006-03-21 at 06:22 -0600, Jim C. Nasby wrote:
> > Currently, it appears that SELECT * INTO new_table FROM old_table logs
> > each page as it's written to WAL. Is this actually needed? Couldn't the
> > database simply log that the SELECT ... INTO statement was executed
> > instead? Doing so would likely result in a large performance improvement
> > in most installs. Is there no provision for writing anything but data
> > page changes (or whole pages) to WAL?
>
> AFAIK it takes the same code path as CREATE TABLE AS SELECT, which
> already does exactly what you suggest (except when using PITR).
>

As I read, they did take the same code path, but did they "simply log that
the SELECT ... INTO statement was executed"? If so, how can we rely on the
unreliable content of the old_table to do recovery?

Regards,
Qingqing

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Simon Riggs 2006-03-22 07:48:19 Re: Automatically setting work_mem
Previous Message Tom Lane 2006-03-21 23:06:30 Re: Automatically setting work_mem

Browse pgsql-performance by date

  From Date Subject
Next Message Guillaume Cottenceau 2006-03-22 08:04:29 Re: planner with index scan cost way off actual cost,
Previous Message Tom Lane 2006-03-22 04:31:43 Re: Poor performance o