Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id CF88364FD15 for ; Thu, 4 Sep 2008 16:35:41 -0300 (ADT) Received: from postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 76884-10 for ; Thu, 4 Sep 2008 16:35:38 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from westnet.com (westnet.com [216.187.52.2]) by postgresql.org (Postfix) with ESMTP id 762DB64FCEF for ; Thu, 4 Sep 2008 16:35:38 -0300 (ADT) Received: from westnet.com (localhost [127.0.0.1]) by westnet.com (8.14.0/8.14.0) with ESMTP id m84JZaiW015653; Thu, 4 Sep 2008 15:35:36 -0400 (EDT) Received: from localhost (gsmith@localhost) by westnet.com (8.14.0/8.13.2/Submit) with ESMTP id m84JZaBp015646; Thu, 4 Sep 2008 15:35:36 -0400 (EDT) X-Authentication-Warning: westnet.com: gsmith owned process doing -bs Date: Thu, 4 Sep 2008 15:35:36 -0400 (EDT) From: Greg Smith X-X-Sender: gsmith@westnet.com To: Thomas Finneid cc: pgsql-performance@postgresql.org Subject: Re: slow update of index during insert/copy In-Reply-To: <48BFA118.9010701@ifi.uio.no> Message-ID: References: <48BA9D65.2020001@ifi.uio.no> <48BB4A2D.9080404@postnewspapers.com.au> <48BBD22E.4090308@ifi.uio.no> <48BCDF9C.5020906@ifi.uio.no> <48BFA118.9010701@ifi.uio.no> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200809/61 X-Sequence-Number: 31374 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_50_spindles_testing_for_postgresql/ 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