Re: In memory Database for postgres

From: aravind chandu <avin_friends(at)yahoo(dot)com>
To: Blazej <bl(dot)oleszkiewicz(at)gmail(dot)com>, postgresql Forums <pgsql-general(at)postgresql(dot)org>
Subject: Re: In memory Database for postgres
Date: 2009-04-13 01:01:17
Message-ID: 618056.37116.qm@web31408.mail.mud.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hello,

I created in-memory database but the problem is all the data will be accessed from main memory .when ever the system is restarted the entire data that is in the tables will lost.Is there any way to dump all the data in to local hard disk before restarting the system or any similar method to save the data in to a permanent storage.

Thanks,
Avin.

________________________________
From: Blazej <bl(dot)oleszkiewicz(at)gmail(dot)com>
To: avin_friends(at)yahoo(dot)com
Cc: postgresql Forums <pgsql-general(at)postgresql(dot)org>
Sent: Monday, November 17, 2008 4:26:46 PM
Subject: Re: [GENERAL] In memory Database for postgres

Sorry I forgot about create tablespace script - this is the SQL script:

CREATE TABLESPACE ram_space LOCATION '/mnt/ram0/pgspace';

And then:

CREATE TABLE (...) TABLESPACE ram_space;

and table is in memory.

Regards,
Blazej

2008/11/17 Blazej <bl(dot)oleszkiewicz(at)gmail(dot)com>:
> In my opinion very nice solution is building part of PostgreSQL
> database in memory - below it is instruction how to build PostgreSQL
> schema in memory in Linux. I tested this with my ROLAP solution for
> recalculation MOLAP cubes in memory and then join with master cube
> (this speeds up proces about 10 times!!! - but in other solution may
> be different).
>
> In grub (or other bootloader) you must declare ramdisk and then in OS:
>
> mke2fs /dev/ram0
> mkdir /mnt/ram0
> mount /dev/ram0 /mnt/ram0
> mkdir /mnt/ram0/pgspace
>
> chown postgres:postgres /mnt/ram0/pgsapce
>
> The "/mnt/ram0/pgsapce" folder must be empty (ERROR: directory
> "/mnt/ram0" is not empty)
>
> And then you may create tables (in this schema of course) and write to them.
>
> Of course you must delete schema before shutdown PostgreSQL and OS - I
> dont't now how resolve problem with error when the schema was not
> deleted? - I have no time to think about it maybe anybody know how to
> restore db when the in memory schema was damaged?
>
> Regards,
> Blazej
>
> 2008/11/17 aravind chandu <avin_friends(at)yahoo(dot)com>:
>> Hello,
>>
>> I guess most of you guys heard about In Memory Database.I have
>> a small question regarding it.I need to create an In Memory Database for
>> postgresql through which I have to perform various operations on postgresql
>> database(queries,procedures,programs using pqxx API etc...).I didn't have
>> any idea of how to start and where to start this issue.Please comment on
>> this issue,so that it will be really helpful to me .
>>
>> Thanks,
>> Avin.
>>
>>
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message John R Pierce 2009-04-13 01:59:57 Re: In memory Database for postgres
Previous Message Scott Marlowe 2009-04-12 23:50:50 Re: psql 8.1.9 autovacuum safe?