Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id 4CAD89FB46D for ; Mon, 23 Oct 2006 19:13:02 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) with ESMTP id 26108-09 for ; Mon, 23 Oct 2006 22:11:40 +0000 (UTC) X-Greylist: delayed 00:20:28.759206 by SQLgrey- Received: from svr4.postgresql.org (svr4.postgresql.org [66.98.251.159]) by postgresql.org (Postfix) with ESMTP id 8755B9FB436 for ; Mon, 23 Oct 2006 19:11:26 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.3 Received: from kingcheetah.tanabi.org (nc-67-76-229-82.sta.embarqhsd.net [67.76.229.82]) by svr4.postgresql.org (Postfix) with ESMTP id 38BE55AF94C for ; Mon, 23 Oct 2006 21:51:00 +0000 (GMT) Received: from kingcheetah.tanabi.org (localhost [127.0.0.1]) by kingcheetah.tanabi.org (8.13.8/8.13.8) with ESMTP id k9NLpe1Y004952 for ; Mon, 23 Oct 2006 17:51:40 -0400 (EDT) Received: from localhost (cheetah@localhost) by kingcheetah.tanabi.org (8.13.8/8.13.8/Submit) with ESMTP id k9NLpeOP004948 for ; Mon, 23 Oct 2006 17:51:40 -0400 (EDT) X-Authentication-Warning: kingcheetah.tanabi.org: cheetah owned process doing -bs Date: Mon, 23 Oct 2006 17:51:40 -0400 (EDT) From: Steve To: pgsql-performance@postgresql.org Subject: Copy database performance issue Message-ID: 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.135 tagged_above=0 required=5 tests=FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200610/494 X-Sequence-Number: 21623 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? 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: shared_buffers = 300000 work_mem = 102400 maintenance_work_mem = 1024000 bgwriter_lru_maxpages=0 bgwriter_lru_percent=0 fsync = off wal_buffers = 128 checkpoint_segments = 64 Thank you! Steve Conley