Re: Loading the entire DB into RAM

From: Matt Davies | Postgresql List <matt-postgresql(at)mattdavies(dot)net>
To: "Charles A(dot) Landemaine" <landemaine(at)gmail(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org
Subject: Re: Loading the entire DB into RAM
Date: 2006-04-07 14:54:26
Message-ID: 44367D22.9060007@mattdavies.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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
>
>
>

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Charles A. Landemaine 2006-04-07 15:00:59 Re: Loading the entire DB into RAM
Previous Message Rafael Martinez 2006-04-07 14:53:40 Re: Same SQL, 104296ms of difference between 7.4.12 and