pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Greg Smith <gsmith@gregsmith.com>
To: Thomas Finneid <tfinneid@student.matnat.uio.no>
Cc: pgsql-performance@postgresql.org
Subject: Re: slow update of index during insert/copy
Date: Thu, 4 Sep 2008 15:35:36 -0400 (EDT)
Message-ID: <Pine.GSO.4.64.0809041520500.210@westnet.com> (raw)
In-Reply-To: <48BFA118.9010701@ifi.uio.no>
References: <48BA9D65.2020001@ifi.uio.no>
	<48BB4A2D.9080404@postnewspapers.com.au>
	<48BBD22E.4090308@ifi.uio.no>
	<Pine.GSO.4.64.0809011558080.10428@westnet.com>
	<48BCDF9C.5020906@ifi.uio.no>
	<Pine.GSO.4.64.0809020340370.17733@westnet.com>
	<48BFA118.9010701@ifi.uio.no>

On Thu, 4 Sep 2008, Thomas Finneid wrote:

> I am unsure if I need a journal in the fs or if the db covers that problem.

There are some theoretical cases where the guarantees of ext3 seems a 
little weak unless you've turned the full journal on even in a database 
context (we just had a long thread on this last month; see 
http://archives.postgresql.org/pgsql-performance/2008-08/msg00136.php for 
the part that dives into this subject).  In practice, the "ordered" mode 
(the default for ext3) seems sufficient to prevent database corruption. 
There is a substantial performance hit to running in full journal mode 
like you're doing; 
http://www.commandprompt.com/blogs/joshua_drake/2008/04/is_that_performance_i_smell_ext2_vs_ext3_on_... 
shows ordered mode as nearly 3X faster.

You should always do your own stress testing on your hardware anyway, 
including a few rounds of powering off the server abruptly and making sure 
it recovers from that.

> With regards to that, do I then need to set some linux setting to force inode 
> syncing (dont rememver the name for the filesystem structure in unix memory). 
> The same question can be asked about the async option.

In the default mode, the database speaks to the filesystem in terms of 
writes followed by fsync, which forces both the data and associated 
metadata out.  It works similarly if you switch to sync writes. 
PostgreSQL is very precise about what data really needs to be written to 
disk and what can sit in the cache until later, you shouldn't need to 
worry about the sync parts at the filesystem level (as long as said 
filesystem implementation is sane).

--
* Greg Smith gsmith@gregsmith.com http://www.gregsmith.com Baltimore, MD



view thread (22+ messages)  latest in thread

Message-ID: <Pine.GSO.4.64.0809041520500.210@westnet.com>
Permalink:  ../Pine.GSO.4.64.0809041520500.210@westnet.com/
Also on:    postgresql.org/message-id/Pine.GSO.4.64.0809041520500.210@westnet.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-performance@postgresql.org
  Cc: gsmith@gregsmith.com, tfinneid@student.matnat.uio.no
  Subject: Re: slow update of index during insert/copy
  In-Reply-To: <Pine.GSO.4.64.0809041520500.210@westnet.com>
  References: <48BA9D65.2020001@ifi.uio.no> <48BB4A2D.9080404@postnewspapers.com.au> <48BBD22E.4090308@ifi.uio.no> <Pine.GSO.4.64.0809011558080.10428@westnet.com> <48BCDF9C.5020906@ifi.uio.no> <Pine.GSO.4.64.0809020340370.17733@westnet.com> <48BFA118.9010701@ifi.uio.no> <Pine.GSO.4.64.0809041520500.210@westnet.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox