Re: WAL logging volume and CREATE TABLE - Mailing list pgsql-hackers

From Bruce Momjian
Subject Re: WAL logging volume and CREATE TABLE
Date
Msg-id 201108031852.p73Iq1h23402@momjian.us
Whole thread Raw
In response to Re: WAL logging volume and CREATE TABLE  (Alvaro Herrera <alvherre@commandprompt.com>)
Responses Re: WAL logging volume and CREATE TABLE
List pgsql-hackers
Alvaro Herrera wrote:
> Excerpts from Bruce Momjian's message of mar ago 02 22:46:55 -0400 2011:
>
> > I have created a documentation patch to clarify this, and to mention
> > CREATE TABLE AS which also has this optimization.
>
> It doesn't seem particularly better to me.  How about something like
>
> In minimal level, WAL-logging of some operations can be safely skipped,
> which can make those operations much faster (see <blah>).  Operations on
> which this optimization can be applied include:
> <simplelist>
>  <item>CREATE INDEX</item>
>  <item>CLUSTER</item>
>  <item>CREATE TABLE AS</item>
>  <item>COPY, when tables that were created or truncated in the same
>  transaction
> </simplelist>
>
> Minimal WAL does not contain enough information to reconstruct the data
> from a base backup and the WAL logs, so either <literal>archive</> or
> <literal>hot_standby</> level must be used to enable ...

Good idea --- updated patch attached.

--
  Bruce Momjian  <bruce@momjian.us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + It's impossible for everything to be true. +
diff --git a/doc/src/sgml/config.sgml b/doc/src/sgml/config.sgml
new file mode 100644
index 4fadca9..aac6c3b
*** a/doc/src/sgml/config.sgml
--- b/doc/src/sgml/config.sgml
*************** SET ENABLE_SEQSCAN TO OFF;
*** 1451,1461 ****
          This parameter can only be set at server start.
         </para>
         <para>
!         In <literal>minimal</> level, WAL-logging of some bulk operations, like
!         <command>CREATE INDEX</>, <command>CLUSTER</> and <command>COPY</> on
!         a table that was created or truncated in the same transaction can be
!         safely skipped, which can make those operations much faster (see
!         <xref linkend="populate-pitr">). But minimal WAL does not contain
          enough information to reconstruct the data from a base backup and the
          WAL logs, so either <literal>archive</> or <literal>hot_standby</>
          level must be used to enable
--- 1451,1468 ----
          This parameter can only be set at server start.
         </para>
         <para>
!         In <literal>minimal</> level, WAL-logging of some bulk
!         operations can be safely skipped, which can make those
!         operations much faster (see <xref linkend="populate-pitr">).
!         Operations in which this optimization can be applied include:
!         <simplelist>
!          <item>CREATE INDEX</item>
!          <item>CLUSTER</item>
!          <item>CREATE TABLE AS</item>
!          <item>COPY into tables that were created or truncated in the same
!          transaction
!         </simplelist>
!         But minimal WAL does not contain
          enough information to reconstruct the data from a base backup and the
          WAL logs, so either <literal>archive</> or <literal>hot_standby</>
          level must be used to enable

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: mosbench revisited
Next
From: Grzegorz Jaskiewicz
Date:
Subject: Re: Further news on Clang - spurious warnings