Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id C77DB9FB2F3 for ; Tue, 24 Oct 2006 21:25:20 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 87192-02 for ; Tue, 24 Oct 2006 21:25:17 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from noel.decibel.org (noel.decibel.org [67.100.216.10]) by postgresql.org (Postfix) with ESMTP id BA60E9FA5D8 for ; Tue, 24 Oct 2006 21:25:16 -0300 (ADT) Received: by noel.decibel.org (Postfix, from userid 1001) id 8BEE956423; Tue, 24 Oct 2006 19:25:15 -0500 (CDT) Received: (hashcash-sendmail, from uid 1001); Tue, 24 Oct 2006 19:25:13 -0500 Date: Tue, 24 Oct 2006 19:25:13 -0500 From: "Jim C. Nasby" To: Steve Cc: pgsql-performance@postgresql.org Subject: Re: Copy database performance issue Message-ID: <20061025002513.GC26892@nasby.net> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Operating-System: FreeBSD 6.1-RELEASE-p10 amd64 X-Distributed: Join the Effort! http://www.distributed.net User-Agent: Mutt/1.5.13 (2006-08-11) X-Hashcash: 1:20:061025:cheetah@tanabi.org::OSLMFVOmfAY20/OW:0000000000000000000 0000000000000000000000002Guy X-Hashcash: 1:20:061025:pgsql-performance@postgresql.org::XgCQXizrpsRASCyK:00000 0000000000000000000000004AW6 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.074 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200610/507 X-Sequence-Number: 21636 On Mon, Oct 23, 2006 at 05:51:40PM -0400, Steve wrote: > Hello there; > > I've got an application that has to copy an existing database to a new > database on the same machine. > > I used to do this with a pg_dump command piped to psql to perform the > copy; however the database is 18 gigs large on disk and this takes a LONG > time to do. > > So I read up, found some things in this list's archives, and learned that > I can use createdb --template=old_database_name to do the copy in a much > faster way since people are not accessing the database while this copy > happens. > > > The problem is, it's still too slow. My question is, is there any way I > can use 'cp' or something similar to copy the data, and THEN after that's > done modify the database system files/system tables to recognize the > copied database? AFAIK, that's what initdb already does... it copies the database, essentially doing what cp does. > For what it's worth, I've got fsync turned off, and I've read every tuning > thing out there and my settings there are probably pretty good. It's a > Solaris 10 machine (V440, 2 processor, 4 Ultra320 drives, 8 gig ram) and > here's some stats: I don't think any of the postgresql.conf settings will really come into play when you're doing this... -- Jim Nasby jim@nasby.net EnterpriseDB http://enterprisedb.com 512.569.9461 (cell)