pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Matt Davies | Postgresql List <matt-postgresql@mattdavies.net>
To: Charles A. Landemaine <landemaine@gmail.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: Loading the entire DB into RAM
Date: Fri, 07 Apr 2006 08:54:26 -0600
Message-ID: <44367D22.9060007@mattdavies.net> (raw)
In-Reply-To: <e6575a30604070737n20b2d7a4l33ba51dcbf4527a@mail.gmail.com>
References: <e6575a30604070737n20b2d7a4l33ba51dcbf4527a@mail.gmail.com>

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
>
>
>   




view thread (7+ messages)  latest in thread

Message-ID: <44367D22.9060007@mattdavies.net>
Permalink:  ../44367D22.9060007@mattdavies.net/
Also on:    postgresql.org/message-id/44367D22.9060007@mattdavies.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: matt-postgresql@mattdavies.net, landemaine@gmail.com
  Subject: Re: Loading the entire DB into RAM
  In-Reply-To: <44367D22.9060007@mattdavies.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox