Re: In memory Database for postgres

Поиск
Список
Период
Сортировка
От Jeff Davis
Тема Re: In memory Database for postgres
Дата
Msg-id 1239655931.28193.10.camel@monkey-cat.sm.truviso.com
обсуждение исходный текст
Ответ на Re: In memory Database for postgres  (Emanuel Calvo Franco <postgres.arg@gmail.com>)
Список 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


В списке pgsql-general по дате отправления:

Предыдущее
От: Scott Marlowe
Дата:
Сообщение: Re: In memory Database for postgres
Следующее
От: Scott Marlowe
Дата:
Сообщение: Re: 'no pg_hba.conf entry for host "[local]", user "postgres", database "postgres"'...