Re: Loading the entire DB into RAM - Mailing list pgsql-performance

From Matt Davies | Postgresql List
Subject Re: Loading the entire DB into RAM
Date
Msg-id 44367D22.9060007@mattdavies.net
Whole thread Raw
In response to Loading the entire DB into RAM  ("Charles A. Landemaine" <landemaine@gmail.com>)
Responses Re: Loading the entire DB into RAM
Re: Loading the entire DB into RAM
List pgsql-performance
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.

I haven't done so, but it would be interesting to have a secondary
database somewhere that is your primary storage. It needn't be
especially powerful, or even available. It serves as the place to
generate your indexing data. You could then use SLONY to propogate the
data to the MD production system.

Of course, if you are updating your system that resides in ram, you
should be thinking the other way. Have SLONY replicate changes to the
other, permanent storage, system.

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.

Out of curiosity, what are you using as the search engine?


Charles A. Landemaine wrote:
> I have a web server with PostgreSQL and RHEL. It hosts a search
> engine, and each time some one makes a query, it uses the HDD Raid
> array. The DB is not very big, it is less than a GB. I plan to add
> more RAM anyway.
>
> What I'd like to do is find out how to keep the whole DB in RAM so
> that each time some one does a query, it doesn't use the HDD. Is it
> possible, if so, how?
> Thanks,
>
> Charles.
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: explain analyze is your friend
>
>
>


pgsql-performance by date:

Previous
From: "Charles A. Landemaine"
Date:
Subject: Re: Loading the entire DB into RAM
Next
From: Richard Huxton
Date:
Subject: Spotting planner errors (was Re: Query planner is using wrong index.)