X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 802CA11F6237 for ; Fri, 7 Apr 2006 12:49:21 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 66263-05 for ; Fri, 7 Apr 2006 12:49:19 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from exchange.g2switchworks.com (mail.g2switchworks.com [63.87.162.25]) by postgresql.org (Postfix) with ESMTP id 65DCB11F623B for ; Fri, 7 Apr 2006 12:49:16 -0300 (ADT) Received: from 10.10.1.37 ([10.10.1.37]) by exchange.g2switchworks.com ([10.10.1.2]) with Microsoft Exchange Server HTTP-DAV ; Fri, 7 Apr 2006 15:49:14 +0000 Received: from state.g2switchworks.com by mail.g2switchworks.com; 07 Apr 2006 10:49:14 -0500 Subject: Re: Loading the entire DB into RAM From: Scott Marlowe To: Matt Davies | Postgresql List Cc: "Charles A. Landemaine" , pgsql-performance@postgresql.org In-Reply-To: <44367D22.9060007@mattdavies.net> References: <44367D22.9060007@mattdavies.net> Content-Type: text/plain Content-Transfer-Encoding: 7bit Message-Id: <1144424954.32266.129.camel@state.g2switchworks.com> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 (1.4.6-2) Date: Fri, 07 Apr 2006 10:49:14 -0500 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.121 required=5 tests=[AWL=0.120, UNPARSEABLE_RELAY=0.001] X-Spam-Score: 0.121 X-Spam-Level: X-Archive-Number: 200604/141 X-Sequence-Number: 18225 On Fri, 2006-04-07 at 09:54, Matt Davies | Postgresql List wrote: > If memory serves me correctly I have seen several posts about this in > the past. > > I'll try to recall highlights. > > 1. Create a md in linux sufficiently large enough to handle the data set > you are wanting to store. > 2. Create a HD based copy somewhere as your permanent storage mechanism. > 3. Start up your PostgreSQL instance with the MD as the data store > 4. Load your data to the MD instance. > 5. Figure out how you will change indexes _and_ ensure that your disk > storage is consistent with your MD instance. SNIP > Either way you do it, I can't think of an out of the box method to doing > it. Somehow one has to transfer data from permanent storage to the md > instance, and, likewise, back to permanent storage. dd could do that. Just have a third partition that holds the drive image. Start up the mirror set, dd the file system into place on the md device. When you're ready to shut the machine down or back it up, shut down the postmaster, sync the md drive, dd the filesystem back off to the image backup drive. But I'd really just recommend getting a LOT of RAM and letting the kernel do all the caching. If you've got a 2 gig database and 4 gigs of ram, you should be gold.