Skip site navigation (1) Skip section navigation (2)

Re: WAL Log Size

From: Greg Smith <gsmith(at)gregsmith(dot)com>
To: Sam Mason <sam(at)samason(dot)me(dot)uk>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: WAL Log Size
Date: 2008-02-29 07:08:13
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-general
On Fri, 29 Feb 2008, Sam Mason wrote:

> Just out of interest, why doesn't it do the following?
>  create table xlog_switch as
>    select '0123456789ABCDE' from generate_series(1,1000000);

I'm not 100% sure here what happens when you do the above, and it depends 
on version, but there are cases where creating a new or empty table in a 
transaction is optimized to not create any WAL as a performance 
improvement.  This has become a common idiom for that reason:

truncate table t;
copy t from '/fdsa/fds/afds.csv' with csv;

To take advantage of this loading without WAL feature.

I wish I had more details here, never have found a more formal definition 
of how this works than suggestions on the list.

* Greg Smith gsmith(at)gregsmith(dot)com Baltimore, MD

In response to


pgsql-general by date

Next:From: Scott MarloweDate: 2008-02-29 07:25:13
Subject: Re: WAL Log Size
Previous:From: Klint GoreDate: 2008-02-29 06:00:59
Subject: Re: rule question

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group