Re: In memory Database for postgres

From: Jeff Davis <pgsql(at)j-davis(dot)com>
To: Emanuel Calvo Franco <postgres(dot)arg(at)gmail(dot)com>
Cc: aravind chandu <avin_friends(at)yahoo(dot)com>, postgresql Forums <pgsql-general(at)postgresql(dot)org>
Subject: Re: In memory Database for postgres
Date: 2009-04-13 20:52:11
Message-ID: 1239655931.28193.10.camel@monkey-cat.sm.truviso.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, 2009-04-13 at 17:36 -0300, Emanuel Calvo Franco wrote:
> > Thanks for your reply,but what I am actually looking for is
> > database should be an in-memory database and at the same i want to store
> > that data into disk so that data won't be lost when the system restarts or
> > in case of power failure. Can you guys tell me the procedure how to do this?
> > your help will he greatly appreciated.
> >

If you want the writes to be preserved across shutdown, the writes must
go to disk. If that's too expensive, and you are only concerned about
preserving the writes after a clean shutdown, you can turn off fsync
(but then your data will be corrupt after a crash).

The reads will usually come from memory anyway (as long as you have
enough memory), even if the tables are stored on disk. So what's wrong
with just using normal tables?

> So you can make the tables on memory and with a trigger update on disk...
> you can call this inverted materialized views (because in general you
> update the views on memory but not in the disk).

How does that help? Don't you have the same number of disk writes that
way?

> But there is a problem... if you update on memory and a shutdown
> occurs and the trigger didn't start... you lost this record :( I must
> say that you
>

Triggers are transactional. Either they all fire, and all the updates
happen, or none do.

Aravind, Scott asked the most important question: what problem are you
trying to solve?

Regards,
Jeff Davis

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Scott Marlowe 2009-04-13 20:54:41 Re: 'no pg_hba.conf entry for host "[local]", user "postgres", database "postgres"'...
Previous Message Scott Marlowe 2009-04-13 20:51:48 Re: In memory Database for postgres