Search Postgresql Archives

Re: In memory Database for postgres

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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


-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux